Commit 991a9a5d by Kang Donghun

Merge branch 'feature/1.0_check_web_dev_kdh_2' of…

Merge branch 'feature/1.0_check_web_dev_kdh_2' of gitlab.agentec.jp:abook_web/check into feature/1.0_check_web_dev_kdh_2
parents df379163 fb05b42e
...@@ -98,7 +98,10 @@ COMMON.showConfirmModal = function (data, confirmCallback) { ...@@ -98,7 +98,10 @@ COMMON.showConfirmModal = function (data, confirmCallback) {
$('#confirm-modal #confirmYes').click(function() { $('#confirm-modal #confirmYes').click(function() {
$('#confirm-modal .close').click(); $('#confirm-modal .close').click();
if (confirmCallback) { if (confirmCallback) {
confirmCallback(); //timeout for animation modal close
setTimeout(function() {
confirmCallback();
}, 500);
} }
}); });
} else { } else {
...@@ -144,17 +147,21 @@ COMMON.showConfirm = function (messageCode, confirmCallback, options = {}) { ...@@ -144,17 +147,21 @@ COMMON.showConfirm = function (messageCode, confirmCallback, options = {}) {
/** /**
* show alert message by confirm modal html * show alert message by confirm modal html
* @param {String} messageCode * @param {String} messageCode
* @param {string} titleCode
* @param {Object} options - Data Options {message, titleCode, confirmNoCode} * @param {Object} options - Data Options {message, titleCode, confirmNoCode}
*/ */
COMMON.showAlert = function (messageCode, options = {}) { COMMON.showAlert = function (messageCode, titleCode = 'error', options = {}) {
const defaultParams = { const defaultParams = {
titleCode: 'error', titleCode: titleCode ? titleCode : 'error',
confirmNoCode: 'close' confirmNoCode: 'close'
} }
const params = Object.assign(options, defaultParams); const params = Object.assign(options, defaultParams);
let message = ''; let message = '';
if (messageCode) { if (messageCode) {
message = I18N.i18nText(messageCode); message = I18N.i18nText(messageCode);
if (typeof message === 'undefined') {
message = messageCode;
}
} else if (params.message) { } else if (params.message) {
message = params.message; message = params.message;
} }
......
...@@ -121,6 +121,7 @@ ...@@ -121,6 +121,7 @@
"error": "Error", "error": "Error",
"msgSendPushMessageConfirm": "Do you want to send message?", "msgSendPushMessageConfirm": "Do you want to send message?",
"close":"Close", "close":"Close",
"success":"Success",
"dateError": "Set the start date before the end date.", "dateError": "Set the start date before the end date.",
"errorGetToken": "Failed to get token value from server." "onlyRfid":"RFID or barcode is set.\nPlease scan the code."
} }
\ No newline at end of file
...@@ -119,6 +119,7 @@ ...@@ -119,6 +119,7 @@
"error": "エラー", "error": "エラー",
"msgSendPushMessageConfirm": "プッシュメッセージを送信しますか?", "msgSendPushMessageConfirm": "プッシュメッセージを送信しますか?",
"close":"閉じる", "close":"閉じる",
"success":"成功",
"dateError": "開始日は終了日の前に設定してください。", "dateError": "開始日は終了日の前に設定してください。",
"errorGetToken": "サーバからトークン値を取得できませんでした。" "onlyRfid":"RFID又はバーコードが設定されています。\n該当コードを読み込んでください。"
} }
\ No newline at end of file
...@@ -117,7 +117,8 @@ ...@@ -117,7 +117,8 @@
"msgSendPushMessageSuccess":"푸시메시지를 보냈습니다.", "msgSendPushMessageSuccess":"푸시메시지를 보냈습니다.",
"error": "에러", "error": "에러",
"msgSendPushMessageConfirm": "Do you want to send message?", "msgSendPushMessageConfirm": "Do you want to send message?",
"close":"닫기", "close":"Close",
"success":"Success",
"dateError": "시작일은 종료일 이전에 설정하십시오.", "dateError": "시작일은 종료일 이전에 설정하십시오.",
"errorGetToken": "서버에서 토큰 값을 가져오지 못했습니다." "onlyRfid":"RFID또는 바코드가 설정되어있습니다.\n해당코드를 스캔해주십시오."
} }
\ No newline at end of file
...@@ -26,20 +26,21 @@ PushMessageDetail.init = function () { ...@@ -26,20 +26,21 @@ PushMessageDetail.init = function () {
COMMON.checkAuth(false); COMMON.checkAuth(false);
//load common html //load common html
TEMPLATE.loadHeader('#includedHeader'); TEMPLATE.loadHeader('#includedHeader');
TEMPLATE.loadConfirmModal();
const navs = [ const navs = [
{ {
titleLang: 'dashboard', titleLang: 'dashboard',
href: 'dashboard.html', href: 'dashboard.html',
}, },
{ {
titleLang: 'messageListTitle', titleLang: 'pushMessageList',
href: 'pushMessageList.html', href: 'pushMessageList.html',
}, },
{ {
titleLang: 'messageDetail', titleLang: 'pushMessageDetail',
}, },
]; ];
TEMPLATE.loadMainNavsTitle('#includedMainTitle', 'messageDetail', navs, null); TEMPLATE.loadMainNavsTitle('#includedMainTitle', 'pushMessageDetail', navs, null);
//request message detail data //request message detail data
let urlParam = COMMON.getUrlParameter(); let urlParam = COMMON.getUrlParameter();
if (typeof urlParam !== 'object' || typeof urlParam.pushMessageId === 'undefined') { if (typeof urlParam !== 'object' || typeof urlParam.pushMessageId === 'undefined') {
......
...@@ -12,6 +12,7 @@ PushMessageList.init = function () { ...@@ -12,6 +12,7 @@ PushMessageList.init = function () {
//Check if user is logged in //Check if user is logged in
COMMON.checkAuth(false); COMMON.checkAuth(false);
TEMPLATE.loadHeader('#includedHeader'); TEMPLATE.loadHeader('#includedHeader');
TEMPLATE.loadConfirmModal();
const navs = [ const navs = [
{ {
titleLang: 'dashboard', titleLang: 'dashboard',
......
...@@ -43,7 +43,7 @@ SendMessage.checkValidation = function () { ...@@ -43,7 +43,7 @@ SendMessage.checkValidation = function () {
return false; return false;
} }
if (!ValidationUtil.CheckMaxLengthForByte(message, SendMessage.contentMaxLength)) { if (!ValidationUtil.CheckMaxLengthForByte(message, SendMessage.contentMaxLength)) {
COMMON.showAlert(null, {message: COMMON.format(I18N.i18nText('msgContentInvalidLength'), SendMessage.contentMaxLength)}); COMMON.showAlert(COMMON.format(I18N.i18nText('msgContentInvalidLength'), SendMessage.contentMaxLength));
return false; return false;
} }
const operationId = SendMessage.getCurrentOperationId(); const operationId = SendMessage.getCurrentOperationId();
...@@ -94,7 +94,7 @@ SendMessage.postMessage = function (message, operationId, sendType) { ...@@ -94,7 +94,7 @@ SendMessage.postMessage = function (message, operationId, sendType) {
false, false,
function (json) { function (json) {
COMMON.closeLoading(); COMMON.closeLoading();
COMMON.showAlert('msgSendPushMessageSuccess'); COMMON.showAlert('msgSendPushMessageSuccess', 'success');
}, },
function () { function () {
console.log('SendMessage.postMessage error'); console.log('SendMessage.postMessage error');
......
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