@plusscommunities/pluss-maintenance-web 1.1.15 → 1.2.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +214 -132
- package/dist/index.esm.js +214 -132
- package/dist/index.umd.js +214 -132
- package/package.json +7 -2
- package/src/actions/types.js +6 -4
- package/src/apis/maintenanceActions.js +18 -17
- package/src/components/ActivityText.js +12 -11
- package/src/components/AnalyticsHub.js +21 -12
- package/src/components/JobList.js +12 -9
- package/src/components/JobTypes.js +4 -5
- package/src/components/PreviewGrid.js +20 -7
- package/src/feature.config.js +37 -31
- package/src/index.js +13 -2
- package/src/screens/AddJob.js +8 -5
- package/src/screens/Job.js +16 -14
- package/src/screens/RequestsHub.js +8 -7
- package/src/values.config.a.js +53 -0
- package/src/values.config.b.js +53 -0
- package/src/values.config.c.js +53 -0
- package/src/values.config.d.js +53 -0
- package/src/values.config.default.js +53 -0
- package/src/values.config.js +53 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plusscommunities/pluss-maintenance-web",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.2.1-beta.0",
|
|
4
4
|
"description": "Extension package to enable maintenance on Pluss Communities Platform",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"scripts": {
|
|
@@ -10,7 +10,12 @@
|
|
|
10
10
|
"betaupload": "npm run build && npm publish --access public --tag beta && rm -rf node_modules",
|
|
11
11
|
"betaupload:p": "npm run betapatch && npm run betaupload",
|
|
12
12
|
"upload": "npm run build && npm publish --access public && rm -rf node_modules",
|
|
13
|
-
"upload:p": "npm run patch && npm run upload"
|
|
13
|
+
"upload:p": "npm run patch && npm run upload",
|
|
14
|
+
"copy:add": "run(){ ext=${1:-default}; test -f src/values.config.$ext.js || cp src/values.config.default.js src/values.config.$ext.js; }; run",
|
|
15
|
+
"copy:get": "echo $npm_package_name",
|
|
16
|
+
"copy:set": "run(){ target='\\@plusscommunities\\/pluss-maintenance-web'; ext=${1:-default}; [ $ext == 'default' ] && replace=$target || replace=$target'-'$ext; echo 'Setting target to '$replace; test -f src/values.config.$ext.js && cp -f src/values.config.$ext.js src/values.config.js; sed -i '' -e 's/'$target'.*\"/'$replace'\"/g' package.json; }; run",
|
|
17
|
+
"copy:betaupload": "npm run betapatch; for file in `ls ./src/values.config.*.js`; do dup=`echo $file | sed 's/.*values\\.config\\.\\(.*\\)\\.js/\\1/'`; npm run copy:set $dup; npm run betaupload; done; npm run copy:set;",
|
|
18
|
+
"copy:upload": "npm run patch; for file in `ls ./src/values.config.*.js`; do dup=`echo $file | sed 's/.*values\\.config\\.\\(.*\\)\\.js/\\1/'`; npm run copy:set $dup; npm run upload; done; npm run copy:set;"
|
|
14
19
|
},
|
|
15
20
|
"author": "Phillip Suh",
|
|
16
21
|
"license": "ISC",
|
package/src/actions/types.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export const
|
|
4
|
-
export const
|
|
1
|
+
import { values } from '../values.config';
|
|
2
|
+
|
|
3
|
+
export const JOBS_LOADED = values.actionJobsLoaded;
|
|
4
|
+
export const JOBS_REMOVED = values.actionJobsRemoved;
|
|
5
|
+
export const JOBS_TYPES_LOADED = values.actionJobsTypesLoaded;
|
|
6
|
+
export const JOBS_LOADING = values.actionJobsLoading;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { PlussCore } from '../feature.config';
|
|
2
|
+
import { values } from '../values.config';
|
|
2
3
|
const { Helper, Session } = PlussCore;
|
|
3
4
|
|
|
4
5
|
export const maintenanceActions = {
|
|
5
6
|
getJobTypes: (site) => {
|
|
6
|
-
let url = Helper.getUrl(
|
|
7
|
+
let url = Helper.getUrl(values.serviceKey, 'getjobtypes');
|
|
7
8
|
return Session.authedFunction({
|
|
8
9
|
method: 'POST',
|
|
9
10
|
url,
|
|
@@ -11,7 +12,7 @@ export const maintenanceActions = {
|
|
|
11
12
|
});
|
|
12
13
|
},
|
|
13
14
|
getJob: (site, id) => {
|
|
14
|
-
let url = Helper.getUrl(
|
|
15
|
+
let url = Helper.getUrl(values.serviceKey, 'getJob');
|
|
15
16
|
return Session.authedFunction({
|
|
16
17
|
method: 'POST',
|
|
17
18
|
url,
|
|
@@ -19,7 +20,7 @@ export const maintenanceActions = {
|
|
|
19
20
|
});
|
|
20
21
|
},
|
|
21
22
|
getJobByJobId: (site, jobId) => {
|
|
22
|
-
let url = Helper.getUrl(
|
|
23
|
+
let url = Helper.getUrl(values.serviceKey, 'getJob');
|
|
23
24
|
return Session.authedFunction({
|
|
24
25
|
method: 'POST',
|
|
25
26
|
url,
|
|
@@ -29,7 +30,7 @@ export const maintenanceActions = {
|
|
|
29
30
|
getJobs: (site, status = '', type = '') => {
|
|
30
31
|
return Session.authedFunction({
|
|
31
32
|
method: 'POST',
|
|
32
|
-
url: Helper.getUrl(
|
|
33
|
+
url: Helper.getUrl(values.serviceKey, 'getJobs'),
|
|
33
34
|
data: { site, status, type },
|
|
34
35
|
});
|
|
35
36
|
},
|
|
@@ -46,7 +47,7 @@ export const maintenanceActions = {
|
|
|
46
47
|
}
|
|
47
48
|
return Session.authedFunction({
|
|
48
49
|
method: 'GET',
|
|
49
|
-
url: Helper.getUrl(
|
|
50
|
+
url: Helper.getUrl(values.serviceKey, 'get/requests', query),
|
|
50
51
|
});
|
|
51
52
|
},
|
|
52
53
|
getJobsRecursive: (site, status, type, lastKey, jobs = []) => {
|
|
@@ -63,7 +64,7 @@ export const maintenanceActions = {
|
|
|
63
64
|
createJob: (job) => {
|
|
64
65
|
return Session.authedFunction({
|
|
65
66
|
method: 'POST',
|
|
66
|
-
url: Helper.getUrl(
|
|
67
|
+
url: Helper.getUrl(values.serviceKey, 'sendMaintenance'),
|
|
67
68
|
data: {
|
|
68
69
|
...job,
|
|
69
70
|
},
|
|
@@ -72,28 +73,28 @@ export const maintenanceActions = {
|
|
|
72
73
|
editJob: (job, site) => {
|
|
73
74
|
return Session.authedFunction({
|
|
74
75
|
method: 'POST',
|
|
75
|
-
url: Helper.getUrl(
|
|
76
|
+
url: Helper.getUrl(values.serviceKey, 'editJob'),
|
|
76
77
|
data: { job, site },
|
|
77
78
|
});
|
|
78
79
|
},
|
|
79
80
|
deleteJob: (site, id) => {
|
|
80
81
|
return Session.authedFunction({
|
|
81
82
|
method: 'POST',
|
|
82
|
-
url: Helper.getUrl(
|
|
83
|
+
url: Helper.getUrl(values.serviceKey, 'requests/remove'),
|
|
83
84
|
data: { site, id },
|
|
84
85
|
});
|
|
85
86
|
},
|
|
86
87
|
editJobStatus: (id, status) => {
|
|
87
88
|
return Session.authedFunction({
|
|
88
89
|
method: 'POST',
|
|
89
|
-
url: Helper.getUrl(
|
|
90
|
+
url: Helper.getUrl(values.serviceKey, 'editJobStatus'),
|
|
90
91
|
data: { id, status },
|
|
91
92
|
});
|
|
92
93
|
},
|
|
93
94
|
assignJob: (jobId, userId) => {
|
|
94
95
|
return Session.authedFunction({
|
|
95
96
|
method: 'POST',
|
|
96
|
-
url: Helper.getUrl(
|
|
97
|
+
url: Helper.getUrl(values.serviceKey, 'update/assign'),
|
|
97
98
|
data: {
|
|
98
99
|
id: jobId,
|
|
99
100
|
userId,
|
|
@@ -103,13 +104,13 @@ export const maintenanceActions = {
|
|
|
103
104
|
getAssignees: (site) => {
|
|
104
105
|
return Session.authedFunction({
|
|
105
106
|
method: 'GET',
|
|
106
|
-
url: Helper.getUrl(
|
|
107
|
+
url: Helper.getUrl(values.serviceKey, 'get/assignees', { site }),
|
|
107
108
|
});
|
|
108
109
|
},
|
|
109
110
|
addNote: (jobId, note, attachments) => {
|
|
110
111
|
return Session.authedFunction({
|
|
111
112
|
method: 'POST',
|
|
112
|
-
url: Helper.getUrl(
|
|
113
|
+
url: Helper.getUrl(values.serviceKey, 'requests/note'),
|
|
113
114
|
data: {
|
|
114
115
|
id: jobId,
|
|
115
116
|
note,
|
|
@@ -121,7 +122,7 @@ export const maintenanceActions = {
|
|
|
121
122
|
editNote: (jobId, noteId, note, attachments) => {
|
|
122
123
|
return Session.authedFunction({
|
|
123
124
|
method: 'POST',
|
|
124
|
-
url: Helper.getUrl(
|
|
125
|
+
url: Helper.getUrl(values.serviceKey, 'requests/note'),
|
|
125
126
|
data: {
|
|
126
127
|
id: jobId,
|
|
127
128
|
note,
|
|
@@ -134,7 +135,7 @@ export const maintenanceActions = {
|
|
|
134
135
|
deleteNote: (jobId, noteId) => {
|
|
135
136
|
return Session.authedFunction({
|
|
136
137
|
method: 'POST',
|
|
137
|
-
url: Helper.getUrl(
|
|
138
|
+
url: Helper.getUrl(values.serviceKey, 'requests/note'),
|
|
138
139
|
data: {
|
|
139
140
|
id: jobId,
|
|
140
141
|
noteId,
|
|
@@ -145,7 +146,7 @@ export const maintenanceActions = {
|
|
|
145
146
|
addJobType: (site, name, email, description, level) => {
|
|
146
147
|
return Session.authedFunction({
|
|
147
148
|
method: 'POST',
|
|
148
|
-
url: Helper.getUrl(
|
|
149
|
+
url: Helper.getUrl(values.serviceKey, 'createJobType'),
|
|
149
150
|
data: {
|
|
150
151
|
site,
|
|
151
152
|
name,
|
|
@@ -158,7 +159,7 @@ export const maintenanceActions = {
|
|
|
158
159
|
editJobType: (site, id, name, email, description, level) => {
|
|
159
160
|
return Session.authedFunction({
|
|
160
161
|
method: 'POST',
|
|
161
|
-
url: Helper.getUrl(
|
|
162
|
+
url: Helper.getUrl(values.serviceKey, 'editJobType'),
|
|
162
163
|
data: {
|
|
163
164
|
site,
|
|
164
165
|
id,
|
|
@@ -172,7 +173,7 @@ export const maintenanceActions = {
|
|
|
172
173
|
deleteJobType: (site, id) => {
|
|
173
174
|
return Session.authedFunction({
|
|
174
175
|
method: 'POST',
|
|
175
|
-
url: Helper.getUrl(
|
|
176
|
+
url: Helper.getUrl(values.serviceKey, 'deleteJobType'),
|
|
176
177
|
data: {
|
|
177
178
|
site,
|
|
178
179
|
id,
|
|
@@ -1,47 +1,48 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import _ from 'lodash';
|
|
3
3
|
import { Link } from 'react-router-dom';
|
|
4
|
+
import { values } from '../values.config';
|
|
4
5
|
|
|
5
6
|
class ActivityText extends Component {
|
|
6
7
|
render() {
|
|
7
8
|
const { data, classes, clickableClasses, highlightedClasses } = this.props;
|
|
8
9
|
|
|
9
10
|
switch (data.Type) {
|
|
10
|
-
case
|
|
11
|
+
case values.activityMaintenanceJobStatusChanged:
|
|
11
12
|
return (
|
|
12
13
|
<p className={classes}>
|
|
13
14
|
<span className={highlightedClasses}>{data.User.displayName}</span>
|
|
14
|
-
|
|
15
|
-
<Link to={
|
|
15
|
+
{values.textChangedRequestStatus}
|
|
16
|
+
<Link to={`${values.routeRequestDetails}/${data.Id}`} className={clickableClasses}>
|
|
16
17
|
{_.truncate(data.Data.title || data.Data.description, { length: 30, separator: '...' })}
|
|
17
18
|
</Link>
|
|
18
19
|
</p>
|
|
19
20
|
);
|
|
20
|
-
case
|
|
21
|
+
case values.activityAddMaintenanceJob:
|
|
21
22
|
return (
|
|
22
23
|
<p className={classes}>
|
|
23
24
|
<span className={highlightedClasses}>{data.User.displayName}</span>
|
|
24
|
-
|
|
25
|
-
<Link to={
|
|
25
|
+
{values.textAddedRequest}
|
|
26
|
+
<Link to={`${values.routeRequestDetails}/${data.Id}`} className={clickableClasses}>
|
|
26
27
|
{_.truncate(data.Data.title || data.Data.description, { length: 30, separator: '...' })}
|
|
27
28
|
</Link>
|
|
28
29
|
</p>
|
|
29
30
|
);
|
|
30
|
-
case
|
|
31
|
+
case values.activityEditMaintenanceJob:
|
|
31
32
|
return (
|
|
32
33
|
<p className={classes}>
|
|
33
34
|
<span className={highlightedClasses}>{data.User.displayName}</span>
|
|
34
|
-
|
|
35
|
-
<Link to={
|
|
35
|
+
{values.textEditedRequest}
|
|
36
|
+
<Link to={`${values.routeRequestDetails}/${data.Id}`} className={clickableClasses}>
|
|
36
37
|
{_.truncate(data.Data.title || data.Data.description, { length: 30, separator: '...' })}
|
|
37
38
|
</Link>
|
|
38
39
|
</p>
|
|
39
40
|
);
|
|
40
|
-
case
|
|
41
|
+
case values.activityDeleteMaintenanceJob:
|
|
41
42
|
return (
|
|
42
43
|
<p className={classes}>
|
|
43
44
|
<span className={highlightedClasses}>{data.User.displayName}</span>
|
|
44
|
-
|
|
45
|
+
{values.textRemovedRequest}
|
|
45
46
|
<span className={highlightedClasses}>
|
|
46
47
|
{_.truncate(data.Data.title || data.Data.description, { length: 30, separator: '...' })}
|
|
47
48
|
</span>
|
|
@@ -4,6 +4,7 @@ import { faCircleCheck, faComment, faWrench } from '@fortawesome/free-solid-svg-
|
|
|
4
4
|
import { connect } from 'react-redux';
|
|
5
5
|
import { analyticsActions } from '../apis';
|
|
6
6
|
import { PlussCore } from '../feature.config';
|
|
7
|
+
import { values } from '../values.config';
|
|
7
8
|
|
|
8
9
|
const { Analytics, Session, Components } = PlussCore;
|
|
9
10
|
|
|
@@ -18,15 +19,22 @@ const getInitialState = () => ({
|
|
|
18
19
|
});
|
|
19
20
|
|
|
20
21
|
// AnalyticsHub Component
|
|
21
|
-
const AnalyticsHub = ({ startTime, endTime, auth, prevText, dayCount }) => {
|
|
22
|
+
const AnalyticsHub = ({ startTime, endTime, auth, prevText, dayCount, strings }) => {
|
|
22
23
|
const [analyticsData, setAnalyticsData] = useState(getInitialState());
|
|
23
24
|
const [isExportOpen, setIsExportOpen] = useState(false);
|
|
24
25
|
|
|
25
|
-
const hasAccess = Session.validateAccess(auth.site,
|
|
26
|
+
const hasAccess = Session.validateAccess(auth.site, values.permissionMaintenanceTracking, auth);
|
|
26
27
|
if (!hasAccess) {
|
|
27
28
|
return null;
|
|
28
29
|
}
|
|
29
30
|
|
|
31
|
+
const featureTitle = ((key) => {
|
|
32
|
+
if (!strings || !strings.sideNav || !strings.sideNav[key]) {
|
|
33
|
+
return values.textMenuTitle;
|
|
34
|
+
}
|
|
35
|
+
return strings.sideNav[key];
|
|
36
|
+
})();
|
|
37
|
+
|
|
30
38
|
const exportColumns = [
|
|
31
39
|
{ label: 'Select All', key: '' },
|
|
32
40
|
{ label: 'Start Date', key: 'startDate' },
|
|
@@ -45,8 +53,8 @@ const AnalyticsHub = ({ startTime, endTime, auth, prevText, dayCount }) => {
|
|
|
45
53
|
// Load analytics data here using startTime and endTime
|
|
46
54
|
const timeDifference = endTime - startTime;
|
|
47
55
|
const [currentStatsResponse, prevStatsResponse] = await Promise.all([
|
|
48
|
-
analyticsActions.getAggregateEntityStats(auth.site,
|
|
49
|
-
analyticsActions.getAggregateEntityStats(auth.site,
|
|
56
|
+
analyticsActions.getAggregateEntityStats(auth.site, values.analyticsKey, startTime, endTime, true),
|
|
57
|
+
analyticsActions.getAggregateEntityStats(auth.site, values.analyticsKey, startTime - timeDifference, startTime, true),
|
|
50
58
|
]);
|
|
51
59
|
|
|
52
60
|
const data = {
|
|
@@ -89,7 +97,7 @@ const AnalyticsHub = ({ startTime, endTime, auth, prevText, dayCount }) => {
|
|
|
89
97
|
}}
|
|
90
98
|
columns={exportColumns}
|
|
91
99
|
source={source}
|
|
92
|
-
filename={
|
|
100
|
+
filename={`${values.analyticsKey}analytics_${source[0].startDate}_${source[0].endDate}.csv`}
|
|
93
101
|
/>
|
|
94
102
|
);
|
|
95
103
|
};
|
|
@@ -99,7 +107,7 @@ const AnalyticsHub = ({ startTime, endTime, auth, prevText, dayCount }) => {
|
|
|
99
107
|
{csvPopup()}
|
|
100
108
|
<div>
|
|
101
109
|
<Components.Text type="h4" className="inlineBlock marginRight-40">
|
|
102
|
-
|
|
110
|
+
{featureTitle}
|
|
103
111
|
</Components.Text>
|
|
104
112
|
<Components.Button
|
|
105
113
|
inline
|
|
@@ -116,30 +124,30 @@ const AnalyticsHub = ({ startTime, endTime, auth, prevText, dayCount }) => {
|
|
|
116
124
|
</div>
|
|
117
125
|
<div className="analyticsSection dashboardSection_content">
|
|
118
126
|
<Components.StatBox
|
|
119
|
-
title=
|
|
127
|
+
title={`${featureTitle} Requests`}
|
|
120
128
|
icon={faWrench}
|
|
121
129
|
value={analyticsData.requests}
|
|
122
130
|
previousValue={analyticsData.prevRequests}
|
|
123
131
|
prevText={prevText}
|
|
124
|
-
viewGraphLink={`/chart?entity
|
|
132
|
+
viewGraphLink={`/chart?entity=${values.analyticsKey}&startTime=${startTime}&endTime=${endTime}&key=Request&countType=total&dayCount=${dayCount}`}
|
|
125
133
|
isLoading={analyticsData.isLoading}
|
|
126
134
|
/>
|
|
127
135
|
<Components.StatBox
|
|
128
|
-
title=
|
|
136
|
+
title={`Completed ${featureTitle} Requests`}
|
|
129
137
|
icon={faCircleCheck}
|
|
130
138
|
value={analyticsData.completedRequests}
|
|
131
139
|
previousValue={analyticsData.prevCompletedRequests}
|
|
132
140
|
prevText={prevText}
|
|
133
|
-
viewGraphLink={`/chart?entity
|
|
141
|
+
viewGraphLink={`/chart?entity=${values.analyticsKey}&startTime=${startTime}&endTime=${endTime}&key=RequestCompleted&countType=unique&dayCount=${dayCount}`}
|
|
134
142
|
isLoading={analyticsData.isLoading}
|
|
135
143
|
/>
|
|
136
144
|
<Components.StatBox
|
|
137
|
-
title=
|
|
145
|
+
title={`${featureTitle} Comments`}
|
|
138
146
|
icon={faComment}
|
|
139
147
|
value={analyticsData.comments}
|
|
140
148
|
previousValue={analyticsData.prevComments}
|
|
141
149
|
prevText={prevText}
|
|
142
|
-
viewGraphLink={`/chart?entity
|
|
150
|
+
viewGraphLink={`/chart?entity=${values.analyticsKey}&startTime=${startTime}&endTime=${endTime}&key=Comment&countType=total&dayCount=${dayCount}`}
|
|
143
151
|
isLoading={analyticsData.isLoading}
|
|
144
152
|
/>
|
|
145
153
|
</div>
|
|
@@ -151,6 +159,7 @@ const mapStateToProps = (state) => {
|
|
|
151
159
|
const { auth } = state;
|
|
152
160
|
return {
|
|
153
161
|
auth,
|
|
162
|
+
strings: (state.strings && state.strings.config) || {},
|
|
154
163
|
};
|
|
155
164
|
};
|
|
156
165
|
|
|
@@ -11,6 +11,7 @@ import { PlussCore } from '../feature.config';
|
|
|
11
11
|
import { maintenanceActions } from '../apis';
|
|
12
12
|
import StatusTypes from '../maintenanceStatus.json';
|
|
13
13
|
import { Colours } from '@plusscommunities/pluss-core-web';
|
|
14
|
+
import { values } from '../values.config';
|
|
14
15
|
|
|
15
16
|
const { Session, Components, Analytics } = PlussCore;
|
|
16
17
|
|
|
@@ -85,7 +86,7 @@ class JobList extends Component {
|
|
|
85
86
|
};
|
|
86
87
|
|
|
87
88
|
onRemoveRequest = async (request) => {
|
|
88
|
-
if (window.confirm(
|
|
89
|
+
if (window.confirm(values.textAreYouSureYouWantToDelete)) {
|
|
89
90
|
this.props.removeJob(request.id);
|
|
90
91
|
try {
|
|
91
92
|
await maintenanceActions.deleteJob(this.props.auth.site, request.id);
|
|
@@ -476,7 +477,7 @@ class JobList extends Component {
|
|
|
476
477
|
<tr key={index}>
|
|
477
478
|
<td>{ev.jobId}</td>
|
|
478
479
|
<td className="table-TitleColumn">
|
|
479
|
-
<Link to={
|
|
480
|
+
<Link to={`${values.routeRequestDetails}/${ev.id}`}>
|
|
480
481
|
<span>{ev.title}</span>
|
|
481
482
|
</Link>
|
|
482
483
|
</td>
|
|
@@ -504,10 +505,10 @@ class JobList extends Component {
|
|
|
504
505
|
</td>
|
|
505
506
|
<td className="table-options">
|
|
506
507
|
<div style={{ display: 'flex', alignItems: 'center' }}>
|
|
507
|
-
<Link to={
|
|
508
|
+
<Link to={`${values.routeRequestDetails}/${ev.id}`}>
|
|
508
509
|
<FontAwesome style={{ fontSize: 20, padding: 5, cursor: 'pointer' }} name="pencil" />
|
|
509
510
|
</Link>
|
|
510
|
-
{Session.validateAccess(this.props.auth.site,
|
|
511
|
+
{Session.validateAccess(this.props.auth.site, values.permissionMaintenanceTracking, this.props.auth) && (
|
|
511
512
|
<a onClick={() => this.onRemoveRequest(ev)}>
|
|
512
513
|
<FontAwesome style={{ fontSize: 20, padding: 5, marginLeft: 8, cursor: 'pointer' }} name="minus-circle" />
|
|
513
514
|
</a>
|
|
@@ -531,17 +532,19 @@ class JobList extends Component {
|
|
|
531
532
|
}
|
|
532
533
|
|
|
533
534
|
renderEmpty() {
|
|
535
|
+
const title = this.props.strings[`${values.featureKey}_textTitleRequests`] || values.textTitleRequests;
|
|
536
|
+
|
|
534
537
|
return (
|
|
535
538
|
<div style={{ display: 'flex', flexDirection: 'column', flex: 1, justifyContent: 'center', alignItems: 'center', marginTop: 32 }}>
|
|
536
539
|
<div className="emptyState" />
|
|
537
540
|
<div className="marginTop-32" style={{ maxWidth: 500, textAlign: 'center' }}>
|
|
538
541
|
<span className="fontRegular fontSize-13">
|
|
539
|
-
<span className="fontHeavy text-brandingColour">
|
|
540
|
-
|
|
542
|
+
<span className="fontHeavy text-brandingColour">{title} </span>
|
|
543
|
+
{values.textEmptyDescription}
|
|
541
544
|
</span>
|
|
542
545
|
</div>
|
|
543
546
|
<div className="marginTop-8 fontRegular fontSize-13" style={{ maxWidth: 500, textAlign: 'center' }}>
|
|
544
|
-
|
|
547
|
+
{values.textEmptyExample}
|
|
545
548
|
</div>
|
|
546
549
|
</div>
|
|
547
550
|
);
|
|
@@ -783,11 +786,11 @@ class JobList extends Component {
|
|
|
783
786
|
}
|
|
784
787
|
|
|
785
788
|
const mapStateToProps = (state) => {
|
|
786
|
-
const { jobs } = state.maintenance;
|
|
787
789
|
const { auth } = state;
|
|
788
790
|
return {
|
|
789
|
-
jobs,
|
|
791
|
+
jobs: state[values.reducerKey].jobs,
|
|
790
792
|
auth,
|
|
793
|
+
strings: (state.strings && state.strings.config) || {},
|
|
791
794
|
};
|
|
792
795
|
};
|
|
793
796
|
|
|
@@ -6,8 +6,8 @@ import FontAwesome from 'react-fontawesome';
|
|
|
6
6
|
import { withRouter } from 'react-router';
|
|
7
7
|
import { jobTypesLoaded, jobTypesUpdate } from '../actions';
|
|
8
8
|
import { maintenanceActions } from '../apis';
|
|
9
|
-
|
|
10
9
|
import Config, { PlussCore } from '../feature.config';
|
|
10
|
+
import { values } from '../values.config';
|
|
11
11
|
|
|
12
12
|
const { Session, Components, Helper } = PlussCore;
|
|
13
13
|
|
|
@@ -179,12 +179,12 @@ class JobTypes extends Component {
|
|
|
179
179
|
<td>{ev.email}</td>
|
|
180
180
|
<td className="table-options">
|
|
181
181
|
<div style={{ display: 'flex', alignItems: 'center' }}>
|
|
182
|
-
{Session.validateAccess(this.props.auth.site,
|
|
182
|
+
{Session.validateAccess(this.props.auth.site, values.permissionMaintenanceTypes, this.props.auth) && (
|
|
183
183
|
<a onClick={() => this.onShowJobType(ev)}>
|
|
184
184
|
<FontAwesome style={{ fontSize: 20, padding: 5, marginLeft: 12, cursor: 'pointer' }} name="pencil" />
|
|
185
185
|
</a>
|
|
186
186
|
)}
|
|
187
|
-
{Session.validateAccess(this.props.auth.site,
|
|
187
|
+
{Session.validateAccess(this.props.auth.site, values.permissionMaintenanceTypes, this.props.auth) && (
|
|
188
188
|
<a onClick={() => this.onRemoveJobType(ev)}>
|
|
189
189
|
<FontAwesome style={{ fontSize: 20, padding: 5, marginLeft: 8, cursor: 'pointer' }} name="minus-circle" />
|
|
190
190
|
</a>
|
|
@@ -344,9 +344,8 @@ class JobTypes extends Component {
|
|
|
344
344
|
}
|
|
345
345
|
|
|
346
346
|
const mapStateToProps = (state) => {
|
|
347
|
-
const { jobtypes } = state.maintenance;
|
|
348
347
|
const { auth } = state;
|
|
349
|
-
return { jobtypes, auth };
|
|
348
|
+
return { jobtypes: state[values.reducerKey].jobtypes, auth };
|
|
350
349
|
};
|
|
351
350
|
|
|
352
351
|
export default connect(mapStateToProps, { jobTypesLoaded, jobTypesUpdate })(withRouter(JobTypes));
|
|
@@ -1,15 +1,28 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
|
+
import { values } from '../values.config';
|
|
3
|
+
|
|
4
|
+
const SVG_PATH = values.svgPathGridIcon;
|
|
5
|
+
const SVG_VIEWBOX = values.svgPathGridIconViewBox || '0 0 30 30';
|
|
2
6
|
|
|
3
7
|
class PreviewGrid extends Component {
|
|
4
8
|
render() {
|
|
5
9
|
const { colour } = this.props;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
|
|
11
|
+
if (Array.isArray(SVG_PATH)) {
|
|
12
|
+
return (
|
|
13
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox={SVG_VIEWBOX}>
|
|
14
|
+
{SVG_PATH.map((p) => {
|
|
15
|
+
return <path key={p.substring(0, 20)} d={p} fill={colour} />;
|
|
16
|
+
})}
|
|
17
|
+
</svg>
|
|
18
|
+
);
|
|
19
|
+
} else {
|
|
20
|
+
return (
|
|
21
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox={SVG_VIEWBOX}>
|
|
22
|
+
<path key={SVG_PATH.substring(0, 20)} d={SVG_PATH} fill={colour} />
|
|
23
|
+
</svg>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
13
26
|
}
|
|
14
27
|
}
|
|
15
28
|
|
package/src/feature.config.js
CHANGED
|
@@ -1,80 +1,86 @@
|
|
|
1
1
|
// import * as PlussCore from '../../pluss-core/src';
|
|
2
2
|
import * as PlussCore from '@plusscommunities/pluss-core-web';
|
|
3
|
+
import { values } from './values.config';
|
|
3
4
|
|
|
4
5
|
export { PlussCore };
|
|
5
6
|
|
|
6
7
|
const FeatureConfig = {
|
|
7
|
-
key:
|
|
8
|
-
aliases:
|
|
9
|
-
singularName:
|
|
8
|
+
key: values.featureKey,
|
|
9
|
+
aliases: values.aliases,
|
|
10
|
+
singularName: values.textSingularName,
|
|
10
11
|
description: 'Submit maintenance requests and track the progress.',
|
|
11
|
-
emptyText:
|
|
12
|
+
emptyText: values.textYourRequestHere,
|
|
12
13
|
widgetOptions: [],
|
|
13
14
|
menu: {
|
|
14
|
-
order:
|
|
15
|
-
text:
|
|
15
|
+
order: values.menuOrder,
|
|
16
|
+
text: values.textMenuTitle,
|
|
16
17
|
icon: 'maintenance',
|
|
17
18
|
isFontAwesome: false,
|
|
18
|
-
url:
|
|
19
|
+
url: values.routeRequestsHub,
|
|
19
20
|
countProps: null,
|
|
20
21
|
visibleExps: {
|
|
21
22
|
type: 'and',
|
|
22
23
|
exps: [
|
|
23
|
-
{ type: 'feature', value:
|
|
24
|
+
{ type: 'feature', value: values.featureKey },
|
|
24
25
|
{
|
|
25
26
|
type: 'or',
|
|
26
27
|
exps: [
|
|
27
|
-
{ type: 'permission', value:
|
|
28
|
-
{ type: 'permission', value:
|
|
29
|
-
{ type: 'permission', value:
|
|
28
|
+
{ type: 'permission', value: values.permissionMaintenanceTracking },
|
|
29
|
+
{ type: 'permission', value: values.permissionMaintenanceTypes },
|
|
30
|
+
{ type: 'permission', value: values.permissionMaintenanceAssignment },
|
|
30
31
|
],
|
|
31
32
|
},
|
|
32
33
|
],
|
|
33
34
|
},
|
|
34
35
|
},
|
|
35
|
-
addUrl:
|
|
36
|
-
addPermission:
|
|
37
|
-
activities: [
|
|
36
|
+
addUrl: values.routeAddRequest,
|
|
37
|
+
addPermission: values.permissionMaintenanceTracking,
|
|
38
|
+
activities: [
|
|
39
|
+
values.activityMaintenanceJobStatusChanged,
|
|
40
|
+
values.activityAddMaintenanceJob,
|
|
41
|
+
values.activityEditMaintenanceJob,
|
|
42
|
+
values.activityDeleteMaintenanceJob,
|
|
43
|
+
],
|
|
38
44
|
permissions: [
|
|
39
45
|
{
|
|
40
|
-
displayName:
|
|
41
|
-
key:
|
|
46
|
+
displayName: values.textPermissionMaintenanceTracking,
|
|
47
|
+
key: values.permissionMaintenanceTracking,
|
|
42
48
|
hq: false,
|
|
43
49
|
},
|
|
44
50
|
{
|
|
45
|
-
displayName:
|
|
46
|
-
key:
|
|
51
|
+
displayName: values.textPermissionManageMaintenanceTypes,
|
|
52
|
+
key: values.permissionMaintenanceTypes,
|
|
47
53
|
hq: false,
|
|
48
54
|
},
|
|
49
55
|
{
|
|
50
|
-
displayName:
|
|
51
|
-
key:
|
|
56
|
+
displayName: values.textPermissionManageAssignedMaintenance,
|
|
57
|
+
key: values.permissionMaintenanceAssignment,
|
|
52
58
|
hq: false,
|
|
53
59
|
},
|
|
54
60
|
],
|
|
55
61
|
hiddenSections: [
|
|
56
62
|
{
|
|
57
|
-
displayName:
|
|
58
|
-
key:
|
|
63
|
+
displayName: values.textHiddenSectionMaintenanceRequests,
|
|
64
|
+
key: values.keyHiddenSectionMaintenanceRequests,
|
|
59
65
|
defaultNew: false,
|
|
60
66
|
default: false,
|
|
61
67
|
},
|
|
62
68
|
],
|
|
63
69
|
moreSections: [
|
|
64
70
|
{
|
|
65
|
-
displayName:
|
|
66
|
-
featureKey:
|
|
67
|
-
optionKey:
|
|
68
|
-
hiddenKey:
|
|
71
|
+
displayName: values.textMoreSectionMaintenance,
|
|
72
|
+
featureKey: values.featureKeyMoreSectionMaintenance,
|
|
73
|
+
optionKey: values.optionKeyMoreSectionMaintenance,
|
|
74
|
+
hiddenKey: values.hiddenKeyMoreSectionMaintenance,
|
|
69
75
|
inverseOption: true,
|
|
70
76
|
},
|
|
71
77
|
],
|
|
72
78
|
routes: [
|
|
73
|
-
{ path:
|
|
74
|
-
{ path:
|
|
75
|
-
{ path:
|
|
76
|
-
{ path:
|
|
77
|
-
{ path:
|
|
79
|
+
{ path: values.routeRequestsHub, component: values.screenRequestsHub, exact: false },
|
|
80
|
+
{ path: values.routeAddRequest, component: values.screenAddJob, exact: true },
|
|
81
|
+
{ path: `${values.routeAddRequest}/:jobId`, component: values.screenAddJob, exact: true },
|
|
82
|
+
{ path: `${values.routeRequestDetails}/:jobId`, component: values.screenJob, exact: true },
|
|
83
|
+
{ path: values.routeRequestTypes, component: values.screenJobTypes, exact: false },
|
|
78
84
|
],
|
|
79
85
|
env: {
|
|
80
86
|
baseStage: '',
|
package/src/index.js
CHANGED
|
@@ -3,9 +3,20 @@ import Job from './screens/Job';
|
|
|
3
3
|
import AddJob from './screens/AddJob';
|
|
4
4
|
import { AnalyticsHub } from './components/AnalyticsHub.js';
|
|
5
5
|
import MaintenanceReducer from './reducers/MaintenanceReducer';
|
|
6
|
+
import { values } from './values.config';
|
|
6
7
|
|
|
7
|
-
export const Reducers =
|
|
8
|
-
|
|
8
|
+
export const Reducers = (() => {
|
|
9
|
+
const reducers = {};
|
|
10
|
+
reducers[values.reducerKey] = MaintenanceReducer;
|
|
11
|
+
return reducers;
|
|
12
|
+
})();
|
|
13
|
+
export const Screens = (() => {
|
|
14
|
+
const screens = {};
|
|
15
|
+
screens[values.screenRequestsHub] = RequestsHub;
|
|
16
|
+
screens[values.screenJob] = Job;
|
|
17
|
+
screens[values.screenAddJob] = AddJob;
|
|
18
|
+
return screens;
|
|
19
|
+
})();
|
|
9
20
|
export { default as Config } from './feature.config';
|
|
10
21
|
export { default as ActivityText } from './components/ActivityText';
|
|
11
22
|
export { default as ViewWidget } from './components/ViewWidget';
|