Commit dc754bc7 by Takumi Imai

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

Feature/1.0 check web dev 50265

See merge request !18
parents 3960692e 26fbd48e
......@@ -2,35 +2,35 @@
<nav class="navbar navbar-dark shadow-sm px-sm-auto px-0">
<div class="container">
<a href="dashboard.html" class="navbar-brand">
<img src="../common/img/logo.svg" alt="ロゴ" class="img-fluid">
<img src="../common/img/logo.svg" type="image" alt="" class="img-fluid lang" lang="logo">
</a>
<ul class="mr-sm-auto ml-sm-0 ml-auto mb-0 pl-0 d-flex">
<li class="active nav-link">
<a href="dashboard.html" class="d-block text-center text-decoration-none">
<img src="../common/img/nav_icon_dashboard.svg" alt="ダッシュボード" class="p-sm-1 p-0 img-fluid">
<img src="../common/img/nav_icon_dashboard.svg" type="image" alt="" class="p-sm-1 p-0 img-fluid lang" lang="dashboard">
<div class="fs-7 d-sm-block d-none lang" lang="dashboard"></div>
</a>
</li>
<li class="nav-link">
<a href="task-list.html" class="d-block text-center text-decoration-none">
<img src="../common/img/nav_icon_task.svg" alt="作業一覧" class="p-sm-1 p-0 img-fluid">
<img src="../common/img/nav_icon_task.svg" type="image" alt="" class="p-sm-1 p-0 img-fluid lang" lang="workList">
<div class="fs-7 d-sm-block d-none lang" lang="workList"></div>
</a>
</li>
</ul>
<div class="dropdown">
<a href="#" class="nav-link text-center" id="dropdown-profile" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<img src="../common/img/nav_icon_profile.svg" alt="プロフィール" class="p-sm-1 p-0 img-fluid profile-img">
<img src="../common/img/nav_icon_profile.svg" type="image" alt="" class="p-sm-1 p-0 img-fluid profile-img lang" lang="profile">
<div class="fs-7 d-sm-block d-none lang" lang="profile"></div>
</a>
<div class="dropdown-menu dropdown-menu-right" data-animation="true" aria-labelledby="dropdown-profile">
<h6 class="dropdown-header lang" lang="dspLogin" ></h6>
<a class="dropdown-item " href="account-setting.html" >
<img src="../common/img/menu_icon_account_setting.svg" alt="アカウント設定" class="navbar-dropdown-icon">
<img src="../common/img/menu_icon_account_setting.svg" type="image" alt="" class="navbar-dropdown-icon lang" lang="account_setting">
<span class="lang" style=" color: #6c757d;" lang="account_setting"></span>
</a>
<a class="dropdown-item " href="#" data-toggle="modal" data-target="#confirm-modal">
<img src="../common/img/menu_icon_logout.svg" alt="ログアウト" class="navbar-dropdown-icon">
<img src="../common/img/menu_icon_logout.svg" type="image" alt="" class="navbar-dropdown-icon lang" lang="dspLogout">
<span class="lang" style=" color: #6c757d;" lang="dspLogout"></span>
</a>
</div>
......
......@@ -123,12 +123,20 @@ I18N.replaceText = function(jsonLangData) {
if(tn == 'input') {
if(obj.attr('type') == 'button' || obj.attr('type') == 'submit') {
obj.val(langText);
} else {
}else {
obj.text(langText);
}
} else {
if (obj.attr('type') == 'image') {
obj.attr('alt', langText);
obj.attr('title', langText);
}
else
{
obj.text(langText);
}
}
}
}
}
......
......@@ -73,6 +73,9 @@
"sender":"Sender",
"content":"Content",
"operationSelection":"Operation select",
"selection":"Selection"
"selection":"Selection",
"logo":"logo",
"listDisplay":"List display",
"gridDisplay":"Grid display"
}
\ No newline at end of file
......@@ -73,5 +73,8 @@
"sender":"送信者",
"content":"内容",
"operationSelection":"作業選択",
"selection":"選択"
"selection":"選択",
"logo":"ロゴ",
"listDisplay":"リスト表示",
"gridDisplay":"グリッド表示"
}
\ No newline at end of file
......@@ -73,5 +73,8 @@
"sender":"Sender",
"content":"Content",
"operationSelection":"Operation select",
"selection":"Selection"
"selection":"Selection",
"logo":"logo",
"listDisplay":"list display",
"gridDisplay":"Grid display"
}
\ No newline at end of file
......@@ -24,7 +24,7 @@
</tr>
<tr>
<th class="fs-9 p-2 text-secondary lang" lang="workWithWarningsTitle"></th>
<td class="p-2"><div id="settingReportWarning" data-key="reportWarning" class="toggle ml-auto"><input type="checkbox" name="chk-alert"></div></td>
<td class="p-2"><div id="settingWarningReport" data-key="warningReport" class="toggle ml-auto"><input type="checkbox" name="chk-alert"></div></td>
</tr>
<tr>
<th class="fs-9 p-2 text-secondary lang" lang="makeDashboardAsHome"></th>
......
......@@ -26,9 +26,14 @@
<script type="text/javascript" src="../js/template/template.js"></script>
<script type="text/javascript" src="../js/dashboard/dashboard.js"></script>
<script type="text/javascript">
$(document).ready(function(){
DASHBOARD.init();
});
</script>
</head>
<body onload="DASHBOARD.init();">
<body>
<!-- header -->
<div id="includedHeader"></div>
......@@ -39,7 +44,7 @@
<div class="d-flex align-items-center">
<h1 class="fs-14 font-weight-bold pt-4 pb-3 mb-0 mr-auto lang" lang="dashboard"></h1>
<a href="#" data-toggle="modal" data-target="#dashboard-setting-modal" >
<img src="../common/img/icon_dashboard_setting.svg" alt="ダッシュボード設定" class="p-1 w-40px">
<img src="../common/img/icon_dashboard_setting.svg" type="image" alt="" class="p-1 w-40px lang" lang="dashboardSettings">
</a>
</div>
......
<!-- view display type menu -->
<div class="view">
<a href="#" class="text-decoration-none view-btn view-list-btn">
<img src="../common/img/icon_view_list.svg" alt="" class="list-block-icon mx-1 lang" lang="listDisplay" type="image" data-toggle="tooltip" data-placement="bottom" title="">
</a>
<a href="#" class="text-decoration-none view-btn view-block-btn active">
<img src="../common/img/icon_view_block.svg" alt="" class="list-block-icon mx-1 lang" lang="gridDisplay" type="image" data-toggle="tooltip" data-placement="bottom" title="">
</a>
</div>
\ No newline at end of file
......@@ -76,14 +76,7 @@
<nav aria-label="view" class="view-menu mt-2" id="viewMenuNewReport">
<div class="d-flex justify-content-between align-items-center">
<div class="fs-9" id="count-NewReport"></div>
<div class="view">
<a href="#" class="text-decoration-none view-btn view-list-btn">
<img src="../common/img/icon_view_list.svg" alt="リスト表示" class="list-block-icon mx-1" data-toggle="tooltip" data-placement="bottom" title="リスト表示">
</a>
<a href="#" class="text-decoration-none view-btn view-block-btn active">
<img src="../common/img/icon_view_block.svg" alt="グリッド表示" class="list-block-icon mx-1" data-toggle="tooltip" data-placement="bottom" title="グリッド表示">
</a>
</div>
<div id="includedNewReportMenuDisplay"></div>
</div>
</nav>
<!-- task list -->
......@@ -96,14 +89,7 @@
<nav aria-label="view" class="view-menu mt-2" id="viewMenuContinuousWork">
<div class="d-flex justify-content-between align-items-center">
<div class="fs-9" id="count-ContinuousWork"></div>
<div class="view">
<a href="#" class="text-decoration-none view-btn view-list-btn">
<img src="../common/img/icon_view_list.svg" alt="リスト表示" class="list-block-icon mx-1" data-toggle="tooltip" data-placement="bottom" title="リスト表示">
</a>
<a href="#" class="text-decoration-none view-btn view-block-btn active">
<img src="../common/img/icon_view_block.svg" alt="グリッド表示" class="list-block-icon mx-1" data-toggle="tooltip" data-placement="bottom" title="グリッド表示">
</a>
</div>
<div id="includedContinuousWorkMenuDisplay"></div>
</div>
</nav>
<!-- task list -->
......@@ -115,15 +101,8 @@
<!-- view menu -->
<nav aria-label="view" class="view-menu mt-2" id="viewMenuReportWithWarnings">
<div class="d-flex justify-content-between align-items-center">
<div class="fs-9" d="count-ReportWithWarnings"></div>
<div class="view">
<a href="#" class="text-decoration-none view-btn view-list-btn">
<img src="../common/img/icon_view_list.svg" alt="リスト表示" class="list-block-icon mx-1" data-toggle="tooltip" data-placement="bottom" title="リスト表示">
</a>
<a href="#" class="text-decoration-none view-btn view-block-btn active">
<img src="../common/img/icon_view_block.svg" alt="グリッド表示" class="list-block-icon mx-1" data-toggle="tooltip" data-placement="bottom" title="グリッド表示">
</a>
</div>
<div class="fs-9" id="count-ReportWithWarnings"></div>
<div id="includedReportWithWarningsMenuDisplay"></div>
</div>
</nav>
<!-- task list -->
......
......@@ -8,7 +8,7 @@ var DASHBOARD = {};
DASHBOARD.pickupItems = [
{id: 'newReport', href: "javascript:DASHBOARD.goPickup('newReport');", count: 0, enabled: true, img: {src: '../common/img/dahboard_icon_new.svg'}, msg: 'newRegistrationTitle'},
{id: 'continousWork', href: "javascript:DASHBOARD.goPickup('continousWork');", count: 0, enabled: true, img: {src: '../common/img/dahboard_icon_proccess.svg'}, msg: 'continousWorkTitle'},
{id: 'reportWarning', href: "javascript:DASHBOARD.goPickup('reportWarning');", count: 0, enabled: true, img: {src: '../common/img/dahboard_icon_alert.svg'}, msg: 'reportWarningTitle' },
{id: 'warningReport', href: "javascript:DASHBOARD.goPickup('reportWarning');", count: 0, enabled: true, img: {src: '../common/img/dahboard_icon_alert.svg'}, msg: 'reportWarningTitle' },
];
/** comunication dashboard configuration */
......@@ -23,7 +23,7 @@ DASHBOARD.communicationItems = [
DASHBOARD.defaultDashboard = {
newReport: 0,
continousWork: 0,
reportWarning: 0,
warningReport: 0,
pushMesage: 0,
}
......@@ -115,7 +115,7 @@ DASHBOARD.init = function() {
/** load common data */
DASHBOARD.loadCommon = function() {
TEMPLATE.loadHearder("#includedHeader");
TEMPLATE.loadDashboardSetting("#includedDashboardSetting");
TEMPLATE.loadDashboardSetting("#includedDashboardSetting", DASHBOARD.changeSettingCallback);
TEMPLATE.loadConfirmModal("#includedConfirmModal");
}
......@@ -152,5 +152,19 @@ DASHBOARD.goPickup = function(pickupId) {
/** Direct to Message list screen */
DASHBOARD.goMessageList = function() {
COMMON.goUrlWithCurrentParams('message-list.html', {});
COMMON.goUrlWithCurrentParams('push-message-list.html', {});
}
/**
* Direct to send message screen
*/
DASHBOARD.goSendMessage = function() {
COMMON.goUrlWithCurrentParams('send-message.html', {});
}
/**
* callback when setting changed
*/
DASHBOARD.changeSettingCallback = function() {
location.reload();
}
......@@ -5,46 +5,87 @@
*/
var DashboardSetting = {};
DashboardSetting.changeSettingCallback = function() {};
/**
* Html element array, map with json key from setting data API
*/
DashboardSetting.elementItems = {
newReport: { id: 'settingNewReport', name: 'chk-new', enabled: true },
continousWork: { id: 'settingContinousWork', name: 'chk-proccess', enabled: true },
reportWarning: { id: 'settingReportWarning', name: 'chk-alert', enabled: true },
warningReport: { id: 'settingWarningReport', name: 'chk-alert', enabled: true },
dashboardHome: { id: 'settingDashboardHome', name: 'chk-home', enabled: false },
};
DashboardSetting.baseApiUrl = CONSTANT.URL.CMS.BASE + ClientData.userInfo_accountPath() + CONSTANT.URL.CMS.API.BASE + 'dashboardSetting/';
/**
* default setting JSON
* default setting
*/
DashboardSetting.defaultSettingJson = {
DashboardSetting.defaultSetting = {
newReport: 1,
continousWork: 1,
reportWarning: 1,
warningReport: 1,
dashboardHome: 0,
}
/** dummy setting json reponse */
DashboardSetting.dummySettingJson = {
dashboardSettingList: [
{
"id": 1,
"settingName": "New Report",
"settingValue": 1
},
{
"id": 2,
"settingName": "Continous Work",
"settingValue": 1
},
{
"id": 3,
"settingName": "Warning Report",
"settingValue": 1
},
{
"id": 4,
"settingName": "Dashboard Home",
"settingValue": 0
}
],
}
/**
* get setting data from cms
* @param {function} callback
* @param {function} callback - callback with settings
*/
DashboardSetting.getSettingData = function (callback) {
let param = {
sid: COMMON.getSid(),
};
const url = DashboardSetting.baseApiUrl + 'getAllSettingData';
const url = DashboardSetting.baseApiUrl;
COMMON.cmsAjax(url, param, false, function (json) {
let settings = {};
//map id with key when save setting
const mapKeys = {
1: 'newReport',
2: 'continousWork',
3: 'warningReport',
4: 'dashboardHome'
};
if (json && json.dashboardSettingList) {
for (const item of json.dashboardSettingList) {
if (mapKeys.hasOwnProperty(item.id)) {
const settingKey = mapKeys[item.id];
settings[settingKey] = item.settingValue;
}
}
}
if (callback) {
callback(json);
callback(settings);
}
}, function() {
console.log('DashboardSetting.getSettingData error');
if (callback) {
callback(DashboardSetting.defaultSettingJson);
}
});
};
......@@ -79,11 +120,14 @@ DashboardSetting.saveSetting = function () {
param.sid = COMMON.getSid();
for (const key in DashboardSetting.elementItems) {
const element = DashboardSetting.elementItems[key];
param[key] = element.enabled;
param[key] = element.enabled ? 1 : 0;
}
const url = DashboardSetting.baseApiUrl + 'saveSetting';
const url = CONSTANT.URL.CMS.BASE + ClientData.userInfo_accountPath() + CONSTANT.URL.CMS.API.BASE + 'saveDashboardSetting/';
COMMON.cmsAjax(url, param, false, function (json) {
DashboardSetting.closeModal();
if (DashboardSetting.changeSettingCallback && typeof DashboardSetting.changeSettingCallback === 'function') {
DashboardSetting.changeSettingCallback();
}
}, function() {
console.log('DashboardSetting.saveSetting error');
DashboardSetting.closeModal();
......@@ -110,12 +154,14 @@ DashboardSetting.bindToggleClick = function () {
/**
* init data, action when screen onload
* @param {function} changeCallback - callback when settings changed
*/
DashboardSetting.init = function () {
DashboardSetting.init = function (changeCallback) {
DashboardSetting.getSettingData(function (settings) {
DashboardSetting.applySettings(settings);
});
DashboardSetting.bindToggleClick();
DashboardSetting.changeSettingCallback = changeCallback;
};
/**
......
......@@ -47,7 +47,7 @@ PICKUP.defaultPickupList = {
operationList:[]
}
PICKUP.baseApiUrl = CONSTANT.URL.CMS.BASE + ClientData.userInfo_accountPath() + CONSTANT.URL.CMS.API.BASE + 'pickup/';
PICKUP.baseApiUrl = CONSTANT.URL.CMS.BASE + ClientData.userInfo_accountPath() + CONSTANT.URL.CMS.API.BASE ;
PICKUP.getNewReportListApiUrl = PICKUP.baseApiUrl + 'newReport';
PICKUP.getContinuousWorkListApiUrl = PICKUP.baseApiUrl + 'workingFlow';
PICKUP.getReportWithWarningsListApiUrl = PICKUP.baseApiUrl + 'warningWithReport';
......@@ -116,6 +116,10 @@ PICKUP.init = function() {
console.log("PICKUP.init");
TEMPLATE.loadHearder("#includedHeader");
TEMPLATE.loadConfirmModal("#includedConfirmModal");
TEMPLATE.loadDisplaymenu("#includedNewReportMenuDisplay");
TEMPLATE.loadDisplaymenu("#includedContinuousWorkMenuDisplay");
TEMPLATE.loadDisplaymenu("#includedReportWithWarningsMenuDisplay");
PICKUP.initSettingActivePickup();
PICKUP.settingPickup();
}
......@@ -135,12 +139,12 @@ PICKUP.settingPickup = function() {
if(settings.continousWork)
{
$("#liTabContinousWork").removeClass('d-none');
PICKUP.initContinuosWorkTab();
//PICKUP.initContinuosWorkTab();
}
if(settings.reportWarning)
{
$("#liTabReportWithWarning").removeClass('d-none');
PICKUP.initReportWithWarningsTab();
//PICKUP.initReportWithWarningsTab();
}
});
}
......
......@@ -11,10 +11,14 @@ TEMPLATE.loadHearder = function(elmentId) {
});
}
/** template load dashboard setting */
TEMPLATE.loadDashboardSetting = function(elmentId) {
/**
* template load dashboard setting
* @param {string} elmentId - element to load setting html
* @param {*} changeCallback - callback when setting changed
*/
TEMPLATE.loadDashboardSetting = function(elmentId, changeCallback) {
$(elmentId).load("dashboard-setting.html", function() {
DashboardSetting.init();
DashboardSetting.init(changeCallback);
I18N.initi18n();
});
}
......@@ -34,6 +38,13 @@ TEMPLATE.loadOperationSelect = function(elmentId) {
});
}
/** Template load display menu */
TEMPLATE.loadDisplaymenu = function(elmentId) {
$(elmentId).load("display-menu.html", function() {
I18N.initi18n();
});
}
/**
* show confirm model
*/
......
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