Commit 5b9a944b by Jeong Gilmo

- redmineのチャットについて

 #36126, #36129, #36130, #36146 に対応しました。
parent 5016151a
...@@ -174,19 +174,30 @@ socket.on('refreshRoomList', function(rooms, activeRoomId = null){ ...@@ -174,19 +174,30 @@ socket.on('refreshRoomList', function(rooms, activeRoomId = null){
// チャットルームリストを削除する // チャットルームリストを削除する
jQuery('#room_list').html(''); jQuery('#room_list').html('');
if (rooms.length === 0) { // #36146に対応
let emptyListString = getLocalizedString("roomListEmptyString") let roomListTitle = getLocalizedString("roomListTitle")
$('.titleRoomName').text(roomListTitle)
jQuery('#room_list').append(`<center class="text-secondary">${emptyListString}</center>`);
}
// チャットルームの様式を読み込む
const template = jQuery('#room-template').html();
let keywordSearchMode = false; let keywordSearchMode = false;
if(jQuery('#roomKeyword').val().length > 0) { if(jQuery('#roomKeyword').val().length > 0) {
keywordSearchMode = true; keywordSearchMode = true;
} }
if (rooms.length === 0) {
// #36146に対応
// 検索結果がない場合のメッセージを追加
if (!keywordSearchMode) {
let emptyListString = getLocalizedString("roomListEmptyString")
jQuery('#room_list').append(`<center class="text-secondary">${emptyListString}</center>`);
} else {
let emptyListString = getLocalizedString("searchRoomListEmptyString")
jQuery('#room_list').append(`<center class="text-secondary">${emptyListString}</center>`);
}
}
// チャットルームの様式を読み込む
const template = jQuery('#room-template').html();
rooms.forEach( function(room) { rooms.forEach( function(room) {
room.profileImagePath = './images/user-profile.png' room.profileImagePath = './images/user-profile.png'
...@@ -232,11 +243,24 @@ socket.on('refreshRoomList', function(rooms, activeRoomId = null){ ...@@ -232,11 +243,24 @@ socket.on('refreshRoomList', function(rooms, activeRoomId = null){
jQuery('#room_list').append(obj); jQuery('#room_list').append(obj);
}); });
if(rooms.length > 0){ // #36146に対応
jQuery('.roomListIcon').show() if(rooms.length > 0) {
if(!keywordSearchMode) {
$(".roomListIcon").show()
$('#roomDeleteButton, #arrangeRooms').show()
} else {
$(".roomListIcon").show()
$('#roomDeleteButton, #arrangeRooms').hide()
}
} else { } else {
jQuery('.roomListIcon').hide() if(!keywordSearchMode) {
$(".roomListIcon").hide()
} else {
$(".roomListIcon").show()
$('#roomDeleteButton, #arrangeRooms').hide()
}
} }
jQuery('#createChatRoom').show() jQuery('#createChatRoom').show()
// Rotate // Rotate
...@@ -294,12 +318,12 @@ jQuery('#roomDeleteButton').on('click', function(e){ ...@@ -294,12 +318,12 @@ jQuery('#roomDeleteButton').on('click', function(e){
} else { } else {
// チャットルーム削除アイコンが表示されていない場合、表示する // チャットルーム削除アイコンが表示されていない場合、表示する
jQuery('.deleteBox').finish().hide().fadeTo('slow',1).show(); jQuery('.deleteBox').finish().hide().fadeTo('slow',1).show();
// #36129に対応
let deleteRoomTitle = getLocalizedString("deleteRoomTitle")
$('.titleRoomName').text(deleteRoomTitle)
// 重複処理を防ぐためにチャットリストのクリックイベントを消す // 重複処理を防ぐためにチャットリストのクリックイベントを消す
jQuery('.chat_list').off('click'); jQuery('.chat_list').off('click');
let roomListTitle = getLocalizedString("deleteRoomTitle")
$('.titleRoomName').text(roomListTitle)
// チャットルームの削除アイコンにクリックイベントを与える // チャットルームの削除アイコンにクリックイベントを与える
jQuery('.deleteBox').off('click'); jQuery('.deleteBox').off('click');
jQuery('.deleteBox').on('click', function(e){ jQuery('.deleteBox').on('click', function(e){
...@@ -313,6 +337,10 @@ jQuery('#roomDeleteButton').on('click', function(e){ ...@@ -313,6 +337,10 @@ jQuery('#roomDeleteButton').on('click', function(e){
} }
// チャットルームから退場する // チャットルームから退場する
socket.emit('exitRoom', jQuery(this).data('roomId')); socket.emit('exitRoom', jQuery(this).data('roomId'));
// #36129に対応
let roomListTitle = getLocalizedString("roomListTitle")
$('.titleRoomName').text(roomListTitle)
} }
}); });
} }
...@@ -1204,7 +1232,13 @@ function showConfirmView(isInvite){ ...@@ -1204,7 +1232,13 @@ function showConfirmView(isInvite){
} }
} else { } else {
if (jQuery('#select_user_list .user_list').find('.userCheckBox').length > 0) { if (jQuery('#select_user_list .user_list').find('.userCheckBox').length > 0) {
if (jQuery('#newRoomName').val().length > 0) { // #36130に対応
const trimmedRoomName = jQuery('#newRoomName').val().trim()
if(trimmedRoomName.length == 0) {
//ルーム名を入力しなかったら、ルーム名textFieldにfocusを置く
jQuery('#newRoomName').focus();
alert("Input RoomName");
} else {
//loadingIndicatorを表示 //loadingIndicatorを表示
showLoadingIndicator(); showLoadingIndicator();
let userIdList = jQuery.makeArray(jQuery('#select_user_list .user_list').find('.userCheckBox')).map(function (e) { let userIdList = jQuery.makeArray(jQuery('#select_user_list .user_list').find('.userCheckBox')).map(function (e) {
...@@ -1222,9 +1256,6 @@ function showConfirmView(isInvite){ ...@@ -1222,9 +1256,6 @@ function showConfirmView(isInvite){
jQuery('#pills-chat-tab').tab('show'); jQuery('#pills-chat-tab').tab('show');
}); });
}); });
} else {
//ルーム名を入力しなかったら、ルーム名textFieldにfocusを置く
jQuery('#newRoomName').focus();
} }
} }
} }
......
...@@ -30,5 +30,6 @@ $.lang.en = { ...@@ -30,5 +30,6 @@ $.lang.en = {
"newRoomName":"Enter Roomname", "newRoomName":"Enter Roomname",
"everyoneIsHere":"Everyone is in the chat.", "everyoneIsHere":"Everyone is in the chat.",
"people":"people", "people":"people",
"searchResult":"Results" "searchResult":"Results",
"searchRoomListEmptyString":"No search results."
} }
...@@ -3,7 +3,7 @@ $.lang.ja = { ...@@ -3,7 +3,7 @@ $.lang.ja = {
"participants":"メンバーリスト", "participants":"メンバーリスト",
"exitRoom":"退出 ", "exitRoom":"退出 ",
"roomListTitle":"ルーム一覧", "roomListTitle":"ルーム一覧",
"deleteRoomTitle":"ルーム削除", "deleteRoomTitle":"ルーム削除",
"inviteUsersButton":"招待", "inviteUsersButton":"招待",
"inviteUsersTitle":"メンバー追加", "inviteUsersTitle":"メンバー追加",
"createRoomSubtitle":"ルーム生成", "createRoomSubtitle":"ルーム生成",
...@@ -30,5 +30,6 @@ $.lang.ja = { ...@@ -30,5 +30,6 @@ $.lang.ja = {
"newRoomName":"ルーム名を入力", "newRoomName":"ルーム名を入力",
"everyoneIsHere":"招待可能なメンバーがいません。", "everyoneIsHere":"招待可能なメンバーがいません。",
"people":"人", "people":"人",
"searchResult":"件のトーク" "searchResult":"件のトーク",
"searchRoomListEmptyString":"検索結果がありません。"
} }
...@@ -2,7 +2,7 @@ $.lang.ko = { ...@@ -2,7 +2,7 @@ $.lang.ko = {
"chat_placeholder":"메시지를 입력하세요.", "chat_placeholder":"메시지를 입력하세요.",
"participants":"대화상대", "participants":"대화상대",
"exitRoom":"나가기 ", "exitRoom":"나가기 ",
"roomListTitle":"채팅", "roomListTitle":"채팅 리스트",
"deleteRoomTitle":"채팅방 삭제", "deleteRoomTitle":"채팅방 삭제",
"inviteUsersButton":"유저 초대", "inviteUsersButton":"유저 초대",
"inviteUsersTitle":"대화상대 추가", "inviteUsersTitle":"대화상대 추가",
...@@ -30,5 +30,6 @@ $.lang.ko = { ...@@ -30,5 +30,6 @@ $.lang.ko = {
"newRoomName":"방제목 입력", "newRoomName":"방제목 입력",
"everyoneIsHere":"초대가능한 유저가 없습니다.", "everyoneIsHere":"초대가능한 유저가 없습니다.",
"people":"명", "people":"명",
"searchResult":"건의 결과" "searchResult":"건의 결과",
"searchRoomListEmptyString":"검색 결과가 없습니다."
} }
...@@ -1429,4 +1429,5 @@ ...@@ -1429,4 +1429,5 @@
<string name="msg_error_chat_500">チャットサーバーでシステムエラーが発生しました。</string> <string name="msg_error_chat_500">チャットサーバーでシステムエラーが発生しました。</string>
<string name="msg_error_chat_join">チャットサーバーと接続に失敗しました。\n再度操作してください。</string> <string name="msg_error_chat_join">チャットサーバーと接続に失敗しました。\n再度操作してください。</string>
<string name="msg_error_chat_text_length">メッセージの長さは0です。1文字以上を入力してください。</string> <string name="msg_error_chat_text_length">メッセージの長さは0です。1文字以上を入力してください。</string>
<string name="msg_error_chat_input_roomname">ルーム名を入力してください。</string>
</resources> </resources>
...@@ -1437,4 +1437,5 @@ ...@@ -1437,4 +1437,5 @@
<string name="msg_error_chat_500">채팅 서버에서 시스템 오류가 발생했습니다.</string> <string name="msg_error_chat_500">채팅 서버에서 시스템 오류가 발생했습니다.</string>
<string name="msg_error_chat_join">채팅서버 접속에 실패했습니다.\n다시 접속을 시도해보시기 바랍니다.</string> <string name="msg_error_chat_join">채팅서버 접속에 실패했습니다.\n다시 접속을 시도해보시기 바랍니다.</string>
<string name="msg_error_chat_text_length">메시지 길이가 0입니다. 한글자 이상의 문자를 입력하십시오.</string> <string name="msg_error_chat_text_length">메시지 길이가 0입니다. 한글자 이상의 문자를 입력하십시오.</string>
<string name="msg_error_chat_input_roomname">방 제목을 입력해 주십시오.</string>
</resources> </resources>
\ No newline at end of file
...@@ -1435,4 +1435,5 @@ ...@@ -1435,4 +1435,5 @@
<string name="msg_error_chat_500">System error occurred on the chat server.</string> <string name="msg_error_chat_500">System error occurred on the chat server.</string>
<string name="msg_error_chat_join">Failed to connect to chat server.\nplease try again.</string> <string name="msg_error_chat_join">Failed to connect to chat server.\nplease try again.</string>
<string name="msg_error_chat_text_length">Message length is 0. please type 1 or more character.</string> <string name="msg_error_chat_text_length">Message length is 0. please type 1 or more character.</string>
<string name="msg_error_chat_input_roomname">Please enter a room name.</string>
</resources> </resources>
\ No newline at end of file
...@@ -175,6 +175,10 @@ public class ChatWebviewActivity extends ParentWebViewActivity { ...@@ -175,6 +175,10 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
message = getString(R.string.msg_error_chat_join); message = getString(R.string.msg_error_chat_join);
} else if (message.equals("Message length error")) { } else if (message.equals("Message length error")) {
message = getString(R.string.msg_error_chat_text_length); message = getString(R.string.msg_error_chat_text_length);
// #36130 start
} else if (message.equals("Input RoomName")) {
message = getString(R.string.msg_error_chat_input_roomname);
// #36130 end
} else { } else {
message = message; message = message;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment