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