Commit 99b9347d by Takumi Imai

Merge branch 'feature/1.0_check_web_dev_50270' into 'feature/1.0_check_web_dev'

Feature/1.0 check web dev 50270

See merge request !20
parents dc754bc7 b542ca08
......@@ -11038,7 +11038,7 @@ ul.card-list > li:not(.selected):not(.not-found):hover{
}
.select-card-list .arrow-icon {
background-image: url("../img/icon_arrow_down.svg");
background-image: url("/abvw/common/img/icon_arrow_down.svg");
background-size: contain;
background-repeat: no-repeat;
width: 14px;
......@@ -20590,7 +20590,7 @@ button {
list-style: none;
}
.list-menu button .arrow-icon{
background-image: url("../img/icon_arrow_right.svg");
background-image: url("/abvw/common/img/icon_arrow_right.svg");
background-size: contain;
width: 17px;
height: 17px;
......
......@@ -72,8 +72,19 @@
"sendDate":"Send Date",
"sender":"Sender",
"content":"Content",
"buttonOperationSelect":"Operation",
"labelSendTypeTitle":"Type",
"labelSendTypeGroup":"Group",
"labelSendTypeAll":"All",
"txtMessageContent":"Message",
"buttonTemplateSelection":"Template",
"buttonSend":"Send",
"msgContentRequired":"Content is required",
"msgOperationRequired":"Operation is required",
"msgSendTypeRequired":"Send type is required",
"operationSelection":"Operation select",
"selection":"Selection",
"templateSelection":"Template selection",
"logo":"logo",
"listDisplay":"List display",
"gridDisplay":"Grid display"
......
......@@ -72,8 +72,19 @@
"sendDate":"送信日時",
"sender":"送信者",
"content":"内容",
"buttonOperationSelect":"作業名",
"labelSendTypeTitle":"送信先",
"labelSendTypeGroup":"グループ内",
"labelSendTypeAll":"作業全体",
"txtMessageContent":"メッセージ",
"buttonTemplateSelection":"テンプレート選択",
"buttonSend":"送信",
"msgContentRequired":"Content is required",
"msgOperationRequired":"Operation is required",
"msgSendTypeRequired":"Send type is required",
"operationSelection":"作業選択",
"selection":"選択",
"templateSelection":"テンプレート選択",
"logo":"ロゴ",
"listDisplay":"リスト表示",
"gridDisplay":"グリッド表示"
......
......@@ -72,8 +72,19 @@
"sendDate":"Send Date",
"sender":"Sender",
"content":"Content",
"buttonOperationSelect":"Operation",
"labelSendTypeTitle":"Type",
"labelSendTypeGroup":"Group",
"labelSendTypeAll":"All",
"txtMessageContent":"Message",
"buttonTemplateSelection":"Template",
"buttonSend":"Send",
"msgContentRequired":"Content is required",
"msgOperationRequired":"Operation is required",
"msgSendTypeRequired":"Send type is required",
"operationSelection":"Operation select",
"selection":"Selection",
"templateSelection":"Template selection",
"logo":"logo",
"listDisplay":"list display",
"gridDisplay":"Grid display"
......
<!-- select template modal -->
<div class="modal fade" id="select-template-modal" tabindex="-1" role="dialog">
<div class="modal-dialog modal-dialog-centered modal-dialog-scrollable" role="document">
<div class="modal-content">
<div class="modal-header bg-dark10">
<h5 class="modal-title lang" lang="templateSelection"></h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<ul class="card-list select-card-list" id="notificationSelectList">
</ul>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary lang" lang="selection"></button>
<button type="button" class="btn btn-tertiary lang" lang="dspCancel" data-dismiss="modal"></button>
</div>
</div>
</div>
</div>
\ No newline at end of file
......@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<title>ダッシュボード</title>
<title class="lang" lang="messageDetail"></title>
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<!-- favicons -->
<link href="../common/img/favicon.ico" rel="icon">
......
......@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<title>ダッシュボード</title>
<title class="lang" lang="messageListTitle"></title>
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<!-- favicons -->
<link href="../common/img/favicon.ico" rel="icon">
......
<!DOCTYPE html>
<html lang="ja-JP">
<head>
<meta charset="utf-8">
<title class="lang" lang="sendMessageTitle"></title>
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<!-- favicons -->
<link href="../common/img/favicon.ico" rel="icon">
<link href="../common/img/apple-touch-icon.png" rel="apple-touch-icon">
<!-- main css -->
<link rel="stylesheet" type="text/css" href="../common/css/newdash/app.css">
<link rel="stylesheet" type="text/css" href="../common/css/newdash/header.css">
<link rel="stylesheet" type="text/css" href="../common/css/newdash/style.css">
<!-- vender css -->
<link rel="stylesheet" type="text/css" href="../common/css/newdash/fontawesome_relative_path.css">
<script type="text/javascript" src="/abvw/common/js/jquery/jquery-3.6.0.min.js?__UPDATEID__"></script>
<script type="text/javascript" src="/abvw/common/js/jquery/jquery-ui.min.js?__UPDATEID__"></script>
<script type="text/javascript" src="/abvw/common/js/web/i18n.js?__UPDATEID__"></script>
<script type="text/javascript" src="../common/js/newdash/app.js"></script>
<script type="text/javascript" src="../common/js/newdash/common.js"></script>
<script type="text/javascript" src="/abvw/common/js/validation.js?__UPDATEID__"></script>
<script src="../common/js/constant.js?__UPDATEID__"></script>
<script src="../common/js/common.js?__UPDATEID__"></script>
<script type="text/javascript" src="../js/operationSelect/operation-select.js"></script>
<script type="text/javascript" src="../js/notification-content/notification-content.js"></script>
<script type="text/javascript" src="../js/template/template.js"></script>
<script type="text/javascript" src="../js/sendMessage/send-message.js"></script>
<script type="text/javascript">
$(document).ready(function(){
SendMessage.init();
});
</script>
</head>
<body>
<!-- header -->
<div id="includedHeader"></div>
<!-- send message -->
<main>
<div class="container">
<!-- breadcrumb -->
<nav aria-label="breadcrumb">
<ol class="breadcrumb px-0 mb-0">
<li class="breadcrumb-item"><a href="dashboard.html" class="text-decoration-none text-underline lang" lang="dashboard"></a></li>
<li class="breadcrumb-item active lang" lang="sendMessageTitle" aria-current="page"><span></span></li>
</ol>
</nav>
<!-- title -->
<h1 class="fs-14 font-weight-bold pt-sm-4 pt-2 pb-3 mb-0 lang" lang="sendMessageTitle"></h1>
<!-- content -->
<div class="py-2">
<div class="row">
<div class="col-12">
<form action="#">
<div class="form-group form-row">
<div class="col-lg-1 col-md-2 col-3 control-label">
<button type="button" class="btn btn-sm btn-tertiary lang" lang="buttonOperationSelect" data-toggle="modal" data-target="#task-list-modal"></button>
</div>
<div class="col-lg-11 col-md-10 col-9">
<div id="operationSelected" data-operation-id=""></div>
</div>
</div>
<div class="form-group form-row">
<label for="address" class="col-lg-1 col-md-2 col-3 control-label lang" lang="labelSendTypeTitle"></label>
<div class="col-lg-11 col-md-10 col-9">
<div class="btn-group btn-group-toggle" data-toggle="buttons">
<label class="btn btn-sm btn-primary custom active" for="sendTypeGroup">
<input type="radio" name="sendType" id="sendTypeGroup" value="0" autocomplete="off" checked></label>
<label class="btn btn-sm btn-primary custom" for="sendTypeAll">
<input type="radio" name="sendType" id="sendTypeAll" value="1" autocomplete="off"></label>
</div>
</div>
</div>
<div class="form-group mb-4">
<div class="d-flex justify-content-between">
<label for="message-content" class="lang" lang="txtMessageContent"></label>
<a href="#" data-toggle="modal" data-target="#select-template-modal" class="lang" lang="buttonTemplateSelection"></a>
</div>
<textarea name="message-content" class="form-control" id="messageContent" cols="30" rows="10"></textarea>
</div>
</form>
</div>
</div>
<button type="submit" class="btn btn-primary lang" lang="buttonSend" onclick="SendMessage.onClickSend();"></button>
</div>
</div>
</main>
<!-- task list modal -->
<div id="includeOperationSelect"></div>
<!-- select template modal -->
<div id="includeTemplateModal"></div>
</body>
</html>
\ No newline at end of file
/**
* Operation Select js in operation-select.html
*
* @since 1.0 check web
*/
var NotificationSelect = {};
NotificationSelect.nameSelected="";
NotificationSelect.valueSelected="";
/**
* default operation select data JSON
*/
NotificationSelect.defaultNotificationSelectJson = [];
/**
* get operation select data from cms
* @param {function} callback
*/
NotificationSelect.getNotificationSelectData = function (callback) {
let param = {
sid: COMMON.getSid(),
};
const url = CONSTANT.URL.CMS.BASE + ClientData.userInfo_accountPath() + CONSTANT.URL.CMS.API.BASE + 'pushMessageTemplate/';
COMMON.cmsAjax(url, param, false, function (json) {
if (callback) {
callback(json);
}
}, function() {
console.log('NotificationSelect.getNotificationSelectData error');
if (callback) {
callback(NotificationSelect.defaultNotificationSelectJson);
}
});
};
/**
* handle click operation setting
*/
NotificationSelect.selectOperationClick = function () {
$('.select-card-list .card .select-label').on('click', function () {
$(this).closest('.select-card-list').find('.card').removeClass('selected');
$(this).closest('.card').addClass('selected');
NotificationSelect.nameSelected = $(this).text();
NotificationSelect.valueSelected = $(this).closest('.accordion').find('.card-body').text();
});
};
/**
* init data, action when screen onload
*/
NotificationSelect.init = function () {
NotificationSelect.getNotificationSelectData(function (data) {
NotificationSelect.createNotificationSelectList(data);
});
NotificationSelect.selectOperationClick();
};
/**
* Implement notification select html
* @returns
*/
NotificationSelect.createNotificationSelectList = function(data) {
$("#notificationSelectList").empty();
if (typeof data === 'undefined' || data.length < 1) return;
let classSelected = "selected";
for (let i = 0; i < data.length; i++) {
let divName = $("<div class='pl-5 py-3 h-100 w-100 align-self-center select-label'>" + data[i].name + "</div>");
let divIcon = $("<div class='flex-shrink-1 mx-3 align-self-center'>"
+ "<button class='btn btn-link border collapsed' type='button' data-toggle='collapse' data-target='#collapse" + i + "' aria-expanded='true' aria-controls='collapse" + i + "'>"
+ "<div class='arrow-icon'></div>"
+ "</button></div>");
let ahrefName = $("<a href='#' class='d-flex text-decoration-none'></a>");
let divParentName = $("<div class='card mb-2 " + classSelected + "' id='heading" + i + "'></div>");
classSelected = "";
let divValue = $("<div id='collapse" + i + "' class='collapse' aria-labelledby='heading" + i + "' data-parent='#accordion" + i + "'></div>");
let divBodyValue = $("<div class='card-body'>" + data[i].value + "</div>");
let messageli = $("<li class='accordion' id='accordion" + i + "'></li>");
ahrefName.append(divName);
ahrefName.append(divIcon);
divParentName.append(ahrefName);
divValue.append(divBodyValue);
messageli.append(divParentName);
messageli.append(divValue);
$("#notificationSelectList").append(messageli);
}
}
......@@ -50,11 +50,12 @@ OperationSelect.selectOperationClick = function () {
/**
* init data, action when screen onload
*/
OperationSelect.init = function () {
OperationSelect.init = function (selectedCallback) {
OperationSelect.getOperationSelectData(function (data) {
OperationSelect.createOperationSelectList(data);
});
OperationSelect.selectOperationClick();
OperationSelect.changeSelectCallback = selectedCallback;
};
/**
......
/**
* Send Message js in send-message.html
*
* @since 1.0 check web
*/
var SendMessage = {};
SendMessage.baseApiUrl = CONSTANT.URL.CMS.BASE + ClientData.userInfo_accountPath() + CONSTANT.URL.CMS.API.BASE + 'sendPushMessage/';
/**
* Get input content
* @returns string
*/
SendMessage.getCurrentMessageContent = function() {
return $('#messageContent').val();
}
/**
* Get operation id selected
* @returns string
*/
SendMessage.getCurrentOperationId = function() {
return $('#operationSelected').attr('data-operation-id');
}
/**
* Get send type selected
* @returns string
*/
SendMessage.getCurrentSendType = function() {
return $('input[name="sendType"]:checked').val();
}
/**
* Check data required when send message request to cms
* @returns boolean
*/
SendMessage.checkValidation = function() {
const message = SendMessage.getCurrentMessageContent();
if (!ValidationUtil.CheckRequiredForText(message)) {
alert(I18N.i18nText('msgContentRequired'));
return false;
}
const operationId = SendMessage.getCurrentOperationId();
if (!ValidationUtil.IsNumber(operationId)) {
alert(I18N.i18nText('msgOperationRequired'));
return false;
}
const sendType = SendMessage.getCurrentSendType();
if (!ValidationUtil.IsNumber(sendType)) {
alert(I18N.i18nText('msgSendTypeRequired'));
return false;
}
return true;
};
/**
* handle click event of send button
*/
SendMessage.onClickSend = function() {
if (!SendMessage.checkValidation()) {
return;
}
const message = SendMessage.getCurrentMessageContent();
const operationId = SendMessage.getCurrentOperationId();
const sendType = SendMessage.getCurrentSendType();
SendMessage.postMessage(message, operationId, sendType);
};
/**
* post message data to cms
* @param {string} message
* @param {long} operationId
* @param {int} sendType - 0: Group, 1: All
*/
SendMessage.postMessage = function(message, operationId, sendType) {
let param = {
sid: COMMON.getSid(),
message: message,
operationId: operationId,
sendType: sendType
};
COMMON.cmsAjax(SendMessage.baseApiUrl, param, false, function (json) {
}, function() {
console.log('SendMessage.postMessage error');
});
};
SendMessage.operationSelectedCallback = function(operationId, operationName) {
$('#operationSelected').attr('data-operation-id', operationId);
$('#operationSelected').text(operationName);
}
SendMessage.templateSelectedCallback = function(template) {
$('#messageContent').val(template);
}
/**
* init data, action when screen onload
*/
SendMessage.init = function () {
TEMPLATE.loadHearder("#includedHeader");
TEMPLATE.loadOperationSelect('#includeOperationSelect', SendMessage.operationSelectedCallback);
TEMPLATE.loadNotificationSelect('#includeTemplateModal', SendMessage.templateSelectedCallback);
//load lang for elements none class lang
I18N.initi18n();
$("label[for='sendTypeGroup']").append(I18N.i18nText('labelSendTypeGroup'));
$("label[for='sendTypeAll']").append(I18N.i18nText('labelSendTypeAll'));
};
\ No newline at end of file
......@@ -31,9 +31,9 @@ TEMPLATE.loadConfirmModal = function(elmentId) {
}
/** Template load operation select */
TEMPLATE.loadOperationSelect = function(elmentId) {
TEMPLATE.loadOperationSelect = function(elmentId, selectCallback) {
$(elmentId).load("operation-select.html", function() {
OperationSelect.init();
OperationSelect.init(selectCallback);
I18N.initi18n();
});
}
......@@ -53,3 +53,11 @@ TEMPLATE.loadDisplaymenu = function(elmentId) {
$("#confirm-modal").modal();
});
};
/** Template load notification content*/
TEMPLATE.loadNotificationSelect = function(elmentId, selectCallback) {
$(elmentId).load("notification-content.html", function() {
NotificationSelect.init(selectCallback);
I18N.initi18n();
});
}
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