@plusscommunities/pluss-maintenance-app 6.0.7-auth.0 → 6.0.8-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/module/actions/types.js +4 -3
- package/dist/module/actions/types.js.map +1 -1
- package/dist/module/apis/maintenanceActions.js +17 -15
- package/dist/module/apis/maintenanceActions.js.map +1 -1
- package/dist/module/components/MaintenanceList.js +5 -4
- package/dist/module/components/MaintenanceList.js.map +1 -1
- package/dist/module/components/MaintenanceListItem.js +3 -2
- package/dist/module/components/MaintenanceListItem.js.map +1 -1
- package/dist/module/components/MaintenanceWidgetItem.js +2 -1
- package/dist/module/components/MaintenanceWidgetItem.js.map +1 -1
- package/dist/module/components/WidgetSmall.js +8 -5
- package/dist/module/components/WidgetSmall.js.map +1 -1
- package/dist/module/feature.config.js +21 -36
- package/dist/module/feature.config.js.map +1 -1
- package/dist/module/index.js +15 -10
- package/dist/module/index.js.map +1 -1
- package/dist/module/reducers/JobsReducer.js +2 -1
- package/dist/module/reducers/JobsReducer.js.map +1 -1
- package/dist/module/screens/MaintenancePage.js +7 -3
- package/dist/module/screens/MaintenancePage.js.map +1 -1
- package/dist/module/screens/RequestDetail.js +106 -31
- package/dist/module/screens/RequestDetail.js.map +1 -1
- package/dist/module/screens/RequestNotes.js +2 -1
- package/dist/module/screens/RequestNotes.js.map +1 -1
- package/dist/module/screens/ServiceRequest.js +581 -86
- package/dist/module/screens/ServiceRequest.js.map +1 -1
- package/dist/module/values.config.a.js +30 -0
- package/dist/module/values.config.a.js.map +1 -0
- package/dist/module/values.config.b.js +30 -0
- package/dist/module/values.config.b.js.map +1 -0
- package/dist/module/values.config.c.js +30 -0
- package/dist/module/values.config.c.js.map +1 -0
- package/dist/module/values.config.d.js +30 -0
- package/dist/module/values.config.d.js.map +1 -0
- package/dist/module/values.config.default.js +35 -0
- package/dist/module/values.config.default.js.map +1 -0
- package/dist/module/values.config.forms.js +35 -0
- package/dist/module/values.config.forms.js.map +1 -0
- package/dist/module/values.config.js +35 -0
- package/dist/module/values.config.js.map +1 -0
- package/package.json +9 -6
- package/src/actions/types.js +5 -3
- package/src/apis/maintenanceActions.js +30 -14
- package/src/components/MaintenanceList.js +6 -4
- package/src/components/MaintenanceListItem.js +7 -2
- package/src/components/MaintenanceWidgetItem.js +2 -1
- package/src/components/WidgetSmall.js +8 -5
- package/src/feature.config.js +30 -40
- package/src/index.js +15 -8
- package/src/reducers/JobsReducer.js +2 -1
- package/src/screens/MaintenancePage.js +5 -4
- package/src/screens/RequestDetail.js +101 -33
- package/src/screens/RequestNotes.js +2 -1
- package/src/screens/ServiceRequest.js +625 -152
- package/src/values.config.a.js +30 -0
- package/src/values.config.b.js +30 -0
- package/src/values.config.c.js +30 -0
- package/src/values.config.d.js +30 -0
- package/src/values.config.default.js +35 -0
- package/src/values.config.forms.js +35 -0
- package/src/values.config.js +35 -0
@@ -0,0 +1,35 @@
|
|
1
|
+
const values = {
|
2
|
+
featureKey: 'maintenance',
|
3
|
+
aliases: ['maintenanceRequest'],
|
4
|
+
reducerKey: 'jobs',
|
5
|
+
serviceKey: 'maintenance',
|
6
|
+
updateKey: 'jobs',
|
7
|
+
actionJobsLoaded: 'JOBS_LOADED',
|
8
|
+
actionJobAdded: 'JOB_ADDED',
|
9
|
+
actionJobsAdded: 'JOBS_ADDED',
|
10
|
+
screenMaintenance: 'maintenance',
|
11
|
+
screenRequestDetail: 'requestDetail',
|
12
|
+
screenServiceRequest: 'serviceRequest',
|
13
|
+
screenJobTypePicker: 'jobTypePicker',
|
14
|
+
screenRequestNotes: 'requestNotes',
|
15
|
+
permissionMaintenanceTracking: 'maintenanceTracking',
|
16
|
+
permissionMaintenanceAssignment: 'maintenanceAssignment',
|
17
|
+
iconGridMenu: 'maintenance',
|
18
|
+
gridViewBox: '0 0 30 30',
|
19
|
+
iconAddMenu: 'request',
|
20
|
+
iconKioskAction: 'wrench',
|
21
|
+
hasMoreOption: true,
|
22
|
+
orderAddMenu: 5,
|
23
|
+
orderMoreMenu: 4,
|
24
|
+
orderKioskAction: 1,
|
25
|
+
textFeatureTitle: 'Request',
|
26
|
+
textAddMenuTitle: 'Request',
|
27
|
+
textMoreMenuTitle: 'Request',
|
28
|
+
textKioskActionTitle: 'Request',
|
29
|
+
textEntityName: 'Job',
|
30
|
+
emptyRequestsStaff: 'No active Requests',
|
31
|
+
emptyRequestsUser: 'Your Requests will show here',
|
32
|
+
forceCustomFields: false
|
33
|
+
};
|
34
|
+
export { values };
|
35
|
+
//# sourceMappingURL=values.config.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["values","featureKey","aliases","reducerKey","serviceKey","updateKey","actionJobsLoaded","actionJobAdded","actionJobsAdded","screenMaintenance","screenRequestDetail","screenServiceRequest","screenJobTypePicker","screenRequestNotes","permissionMaintenanceTracking","permissionMaintenanceAssignment","iconGridMenu","gridViewBox","iconAddMenu","iconKioskAction","hasMoreOption","orderAddMenu","orderMoreMenu","orderKioskAction","textFeatureTitle","textAddMenuTitle","textMoreMenuTitle","textKioskActionTitle","textEntityName","emptyRequestsStaff","emptyRequestsUser","forceCustomFields"],"sources":["values.config.js"],"sourcesContent":["const values = {\n featureKey: 'maintenance',\n aliases: ['maintenanceRequest'],\n reducerKey: 'jobs',\n serviceKey: 'maintenance',\n updateKey: 'jobs',\n actionJobsLoaded: 'JOBS_LOADED',\n actionJobAdded: 'JOB_ADDED',\n actionJobsAdded: 'JOBS_ADDED',\n screenMaintenance: 'maintenance',\n screenRequestDetail: 'requestDetail',\n screenServiceRequest: 'serviceRequest',\n screenJobTypePicker: 'jobTypePicker',\n screenRequestNotes: 'requestNotes',\n permissionMaintenanceTracking: 'maintenanceTracking',\n permissionMaintenanceAssignment: 'maintenanceAssignment',\n iconGridMenu: 'maintenance',\n gridViewBox: '0 0 30 30',\n iconAddMenu: 'request',\n iconKioskAction: 'wrench',\n hasMoreOption: true,\n orderAddMenu: 5,\n orderMoreMenu: 4,\n orderKioskAction: 1,\n textFeatureTitle: 'Request',\n textAddMenuTitle: 'Request',\n textMoreMenuTitle: 'Request',\n textKioskActionTitle: 'Request',\n textEntityName: 'Job',\n emptyRequestsStaff: 'No active Requests',\n emptyRequestsUser: 'Your Requests will show here',\n forceCustomFields: false,\n};\n\nexport { values };\n"],"mappings":"AAAA,MAAMA,MAAM,GAAG;EACbC,UAAU,EAAE,aAAa;EACzBC,OAAO,EAAE,CAAC,oBAAoB,CAAC;EAC/BC,UAAU,EAAE,MAAM;EAClBC,UAAU,EAAE,aAAa;EACzBC,SAAS,EAAE,MAAM;EACjBC,gBAAgB,EAAE,aAAa;EAC/BC,cAAc,EAAE,WAAW;EAC3BC,eAAe,EAAE,YAAY;EAC7BC,iBAAiB,EAAE,aAAa;EAChCC,mBAAmB,EAAE,eAAe;EACpCC,oBAAoB,EAAE,gBAAgB;EACtCC,mBAAmB,EAAE,eAAe;EACpCC,kBAAkB,EAAE,cAAc;EAClCC,6BAA6B,EAAE,qBAAqB;EACpDC,+BAA+B,EAAE,uBAAuB;EACxDC,YAAY,EAAE,aAAa;EAC3BC,WAAW,EAAE,WAAW;EACxBC,WAAW,EAAE,SAAS;EACtBC,eAAe,EAAE,QAAQ;EACzBC,aAAa,EAAE,IAAI;EACnBC,YAAY,EAAE,CAAC;EACfC,aAAa,EAAE,CAAC;EAChBC,gBAAgB,EAAE,CAAC;EACnBC,gBAAgB,EAAE,SAAS;EAC3BC,gBAAgB,EAAE,SAAS;EAC3BC,iBAAiB,EAAE,SAAS;EAC5BC,oBAAoB,EAAE,SAAS;EAC/BC,cAAc,EAAE,KAAK;EACrBC,kBAAkB,EAAE,oBAAoB;EACxCC,iBAAiB,EAAE,8BAA8B;EACjDC,iBAAiB,EAAE;AACrB,CAAC;AAED,SAAS/B,MAAM","ignoreList":[]}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@plusscommunities/pluss-maintenance-app",
|
3
|
-
"version": "6.0.
|
3
|
+
"version": "6.0.8-beta.0",
|
4
4
|
"description": "Extension package to enable maintenance on Pluss Communities Platform",
|
5
5
|
"main": "dist/module/index.js",
|
6
6
|
"module": "dist/module/index.js",
|
@@ -15,17 +15,20 @@
|
|
15
15
|
"patch": "npm version patch",
|
16
16
|
"betaupload": "npm run build && npm publish --access public --tag beta",
|
17
17
|
"betaupload:p": "npm run betapatch && npm run betaupload",
|
18
|
-
"authpatch": "npm version prepatch --preid=auth",
|
19
|
-
"authupload": "npm run build && npm publish --access public --tag auth",
|
20
|
-
"authupload:p": "npm run authpatch && npm run authupload",
|
21
18
|
"upload": "npm run build && npm publish --access public",
|
22
|
-
"upload:p": "npm run patch && npm run upload"
|
19
|
+
"upload:p": "npm run patch && npm run upload",
|
20
|
+
"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",
|
21
|
+
"copy:get": "echo $npm_package_name",
|
22
|
+
"copy:set": "run(){ target='\\@plusscommunities\\/pluss-maintenance-app'; 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",
|
23
|
+
"copy:uploadnopatch": "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;",
|
24
|
+
"copy:upload": "npm run patch; npm run copy:uploadnopatch;",
|
25
|
+
"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;"
|
23
26
|
},
|
24
27
|
"author": "Thorbjorn Kappel Davis",
|
25
28
|
"license": "ISC",
|
26
29
|
"dependencies": {},
|
27
30
|
"peerDependencies": {
|
28
|
-
"@plusscommunities/pluss-core-app": "
|
31
|
+
"@plusscommunities/pluss-core-app": "6.1.1-beta.0",
|
29
32
|
"axios": "^1.6.8",
|
30
33
|
"lodash": "^4.17.4",
|
31
34
|
"moment": "^2.30.1",
|
package/src/actions/types.js
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
export const
|
1
|
+
import { values } from '../values.config';
|
2
|
+
|
3
|
+
export const JOBS_LOADED = values.actionJobsLoaded;
|
4
|
+
export const JOB_ADDED = values.actionJobAdded;
|
5
|
+
export const JOBS_ADDED = values.actionJobsAdded;
|
@@ -1,24 +1,25 @@
|
|
1
1
|
import { Helper, Session } from '../core.config';
|
2
|
+
import { values } from '../values.config';
|
2
3
|
|
3
4
|
export const maintenanceActions = {
|
4
5
|
getJob: (site, id) => {
|
5
6
|
return Session.authedFunction({
|
6
7
|
method: 'POST',
|
7
|
-
url: Helper.getUrl(
|
8
|
+
url: Helper.getUrl(values.serviceKey, 'getJob'),
|
8
9
|
data: { site, id },
|
9
10
|
});
|
10
11
|
},
|
11
12
|
getJobByJobId: (site, jobId) => {
|
12
13
|
return Session.authedFunction({
|
13
14
|
method: 'POST',
|
14
|
-
url: Helper.getUrl(
|
15
|
+
url: Helper.getUrl(values.serviceKey, 'getJob'),
|
15
16
|
data: { site, jobId },
|
16
17
|
});
|
17
18
|
},
|
18
19
|
getJobs: (site, status = '', type = '') => {
|
19
20
|
return Session.authedFunction({
|
20
21
|
method: 'POST',
|
21
|
-
url: Helper.getUrl(
|
22
|
+
url: Helper.getUrl(values.serviceKey, 'getJobs'),
|
22
23
|
data: { site, status, type },
|
23
24
|
});
|
24
25
|
},
|
@@ -35,7 +36,7 @@ export const maintenanceActions = {
|
|
35
36
|
}
|
36
37
|
return Session.authedFunction({
|
37
38
|
method: 'GET',
|
38
|
-
url: Helper.getUrl(
|
39
|
+
url: Helper.getUrl(values.serviceKey, 'get/requests', query),
|
39
40
|
});
|
40
41
|
},
|
41
42
|
getJobsRecursive: (site, status, type, lastKey, jobs = []) => {
|
@@ -49,10 +50,24 @@ export const maintenanceActions = {
|
|
49
50
|
});
|
50
51
|
});
|
51
52
|
},
|
52
|
-
sendMaintenanceRequest: (
|
53
|
+
sendMaintenanceRequest: (
|
54
|
+
userID,
|
55
|
+
userName,
|
56
|
+
phone,
|
57
|
+
room,
|
58
|
+
title,
|
59
|
+
description,
|
60
|
+
date,
|
61
|
+
type,
|
62
|
+
images,
|
63
|
+
location,
|
64
|
+
isHome,
|
65
|
+
homeText,
|
66
|
+
customFields,
|
67
|
+
) => {
|
53
68
|
const request = {
|
54
69
|
method: 'POST',
|
55
|
-
url: Helper.getUrl(
|
70
|
+
url: Helper.getUrl(values.serviceKey, 'sendMaintenance'),
|
56
71
|
data: {
|
57
72
|
userID,
|
58
73
|
userName,
|
@@ -66,6 +81,7 @@ export const maintenanceActions = {
|
|
66
81
|
location,
|
67
82
|
isHome,
|
68
83
|
homeText,
|
84
|
+
customFields,
|
69
85
|
},
|
70
86
|
};
|
71
87
|
return Session.authedFunction(request);
|
@@ -73,21 +89,21 @@ export const maintenanceActions = {
|
|
73
89
|
editJob: (job, site) => {
|
74
90
|
return Session.authedFunction({
|
75
91
|
method: 'POST',
|
76
|
-
url: Helper.getUrl(
|
92
|
+
url: Helper.getUrl(values.serviceKey, 'editJob'),
|
77
93
|
data: { job, site },
|
78
94
|
});
|
79
95
|
},
|
80
96
|
editJobStatus: (id, status) => {
|
81
97
|
return Session.authedFunction({
|
82
98
|
method: 'POST',
|
83
|
-
url: Helper.getUrl(
|
99
|
+
url: Helper.getUrl(values.serviceKey, 'editJobStatus'),
|
84
100
|
data: { id, status },
|
85
101
|
});
|
86
102
|
},
|
87
103
|
assignJob: (jobId, userId) => {
|
88
104
|
return Session.authedFunction({
|
89
105
|
method: 'POST',
|
90
|
-
url: Helper.getUrl(
|
106
|
+
url: Helper.getUrl(values.serviceKey, 'update/assign'),
|
91
107
|
data: {
|
92
108
|
id: jobId,
|
93
109
|
userId,
|
@@ -97,13 +113,13 @@ export const maintenanceActions = {
|
|
97
113
|
getAssignees: site => {
|
98
114
|
return Session.authedFunction({
|
99
115
|
method: 'GET',
|
100
|
-
url: Helper.getUrl(
|
116
|
+
url: Helper.getUrl(values.serviceKey, 'get/assignees', { site }),
|
101
117
|
});
|
102
118
|
},
|
103
119
|
addNote: (jobId, note, attachments) => {
|
104
120
|
return Session.authedFunction({
|
105
121
|
method: 'POST',
|
106
|
-
url: Helper.getUrl(
|
122
|
+
url: Helper.getUrl(values.serviceKey, 'requests/note'),
|
107
123
|
data: {
|
108
124
|
id: jobId,
|
109
125
|
note,
|
@@ -115,7 +131,7 @@ export const maintenanceActions = {
|
|
115
131
|
editNote: (jobId, noteId, note, attachments) => {
|
116
132
|
return Session.authedFunction({
|
117
133
|
method: 'POST',
|
118
|
-
url: Helper.getUrl(
|
134
|
+
url: Helper.getUrl(values.serviceKey, 'requests/note'),
|
119
135
|
data: {
|
120
136
|
id: jobId,
|
121
137
|
note,
|
@@ -128,7 +144,7 @@ export const maintenanceActions = {
|
|
128
144
|
deleteNote: (jobId, noteId) => {
|
129
145
|
return Session.authedFunction({
|
130
146
|
method: 'POST',
|
131
|
-
url: Helper.getUrl(
|
147
|
+
url: Helper.getUrl(values.serviceKey, 'requests/note'),
|
132
148
|
data: {
|
133
149
|
id: jobId,
|
134
150
|
noteId,
|
@@ -137,7 +153,7 @@ export const maintenanceActions = {
|
|
137
153
|
});
|
138
154
|
},
|
139
155
|
getJobTypes: async site => {
|
140
|
-
const url = Helper.getUrl(
|
156
|
+
const url = Helper.getUrl(values.serviceKey, 'getjobtypes');
|
141
157
|
return Session.authedFunction({
|
142
158
|
method: 'POST',
|
143
159
|
url,
|
@@ -7,6 +7,7 @@ import { jobsLoaded, jobAdded, jobsAdded } from '../actions';
|
|
7
7
|
import MaintenanceListItem from '../components/MaintenanceListItem';
|
8
8
|
import FilterPopupMenu from './FilterPopupMenu';
|
9
9
|
import { Components, Colours, Config, Helper } from '../core.config';
|
10
|
+
import { values } from '../values.config';
|
10
11
|
|
11
12
|
class MaintenanceList extends Component {
|
12
13
|
constructor(props) {
|
@@ -91,7 +92,7 @@ class MaintenanceList extends Component {
|
|
91
92
|
if (this.props.options && !_.isEmpty(this.props.options.EmptyText)) {
|
92
93
|
return this.props.options.EmptyText;
|
93
94
|
}
|
94
|
-
return this.props.userCategory === 'staff' ?
|
95
|
+
return this.props.userCategory === 'staff' ? values.emptyRequestsStaff : values.emptyRequestsUser;
|
95
96
|
}
|
96
97
|
|
97
98
|
resetDataSource = (source = '') => {
|
@@ -201,7 +202,7 @@ class MaintenanceList extends Component {
|
|
201
202
|
return (
|
202
203
|
<View style={styles.searchContainer}>
|
203
204
|
<Components.GenericInput
|
204
|
-
placeholder=
|
205
|
+
placeholder={`Search by ${values.textEntityName} ID or Address`}
|
205
206
|
value={this.state.searchText}
|
206
207
|
onChangeText={this.onSearchText}
|
207
208
|
onSubmitEditing={this.onSearchSubmit}
|
@@ -316,7 +317,8 @@ const styles = StyleSheet.create({
|
|
316
317
|
});
|
317
318
|
|
318
319
|
const mapStateToProps = state => {
|
319
|
-
const { user,
|
320
|
+
const { user, notifications } = state;
|
321
|
+
const jobs = state[values.reducerKey];
|
320
322
|
const jobsOrdered = _.orderBy(jobs.jobs, ['createdUnix'], ['desc']);
|
321
323
|
const hasPermission = _.includes(user.permissions, 'maintenanceTracking');
|
322
324
|
|
@@ -326,7 +328,7 @@ const mapStateToProps = state => {
|
|
326
328
|
site: user.site,
|
327
329
|
userCategory: user.category,
|
328
330
|
colourBrandingMain: Colours.getMainBrandingColourFromState(state),
|
329
|
-
dataUpdated: notifications.dataUpdated[
|
331
|
+
dataUpdated: notifications.dataUpdated[values.updateKey],
|
330
332
|
};
|
331
333
|
};
|
332
334
|
|
@@ -19,10 +19,11 @@ import moment from 'moment';
|
|
19
19
|
import { getJobStatusProps, jobStatusOptions } from '../helper';
|
20
20
|
import { Services } from '../feature.config';
|
21
21
|
import { Helper, Colours } from '../core.config';
|
22
|
+
import { values } from '../values.config';
|
22
23
|
|
23
24
|
class MaintenanceListItem extends Component {
|
24
25
|
onPressJob = () => {
|
25
|
-
Services.navigation.navigate(
|
26
|
+
Services.navigation.navigate(values.screenRequestDetail, { job: this.props.job });
|
26
27
|
};
|
27
28
|
|
28
29
|
renderCommentCount() {
|
@@ -72,7 +73,11 @@ class MaintenanceListItem extends Component {
|
|
72
73
|
<View style={styles.jobInnerContainer}>
|
73
74
|
<View style={styles.jobTopSection}>
|
74
75
|
<View style={styles.jobTopLeft}>
|
75
|
-
{job.jobId ?
|
76
|
+
{job.jobId ? (
|
77
|
+
<Text
|
78
|
+
style={[styles.jobIdText, { color: this.props.colourBrandingMain }]}
|
79
|
+
>{`${values.textEntityName} #${job.jobId}`}</Text>
|
80
|
+
) : null}
|
76
81
|
<Text style={styles.jobTitleText}>{job.title}</Text>
|
77
82
|
{job.room ? <Text style={styles.jobLocationText}>{job.room}</Text> : null}
|
78
83
|
<View style={styles.jobTypeSeenContainer}>
|
@@ -7,10 +7,11 @@ import _ from 'lodash';
|
|
7
7
|
import { getJobStatusProps, jobStatusOptions } from '../helper';
|
8
8
|
import { Services } from '../feature.config';
|
9
9
|
import { Colours, Helper } from '../core.config';
|
10
|
+
import { values } from '../values.config';
|
10
11
|
|
11
12
|
class MaintenanceWidgetItem extends Component {
|
12
13
|
onPressJob = () => {
|
13
|
-
Services.navigation.navigate(
|
14
|
+
Services.navigation.navigate(values.screenRequestDetail, { job: this.props.job });
|
14
15
|
};
|
15
16
|
|
16
17
|
render() {
|
@@ -7,6 +7,7 @@ import { jobsLoaded } from '../actions';
|
|
7
7
|
import MaintenanceWidgetItem from './MaintenanceWidgetItem';
|
8
8
|
import { Services } from '../feature.config';
|
9
9
|
import { Colours, Components, Config } from '../core.config';
|
10
|
+
import { values } from '../values.config';
|
10
11
|
|
11
12
|
const MAX_ITEMS = 10;
|
12
13
|
|
@@ -27,13 +28,13 @@ class WidgetSmall extends Component {
|
|
27
28
|
getTitle = () => {
|
28
29
|
const { options } = this.props;
|
29
30
|
if (options && !_.isEmpty(options.Title)) return options.Title;
|
30
|
-
return
|
31
|
+
return this.props.strings[`${values.featureKey}_textFeatureTitle`] || values.textFeatureTitle;
|
31
32
|
};
|
32
33
|
|
33
34
|
getEmptyStateText = () => {
|
34
35
|
const { options, userCategory } = this.props;
|
35
36
|
if (options && !_.isEmpty(options.EmptyText)) return options.EmptyText;
|
36
|
-
return userCategory === 'staff' ?
|
37
|
+
return userCategory === 'staff' ? values.emptyRequestsStaff : values.emptyRequestsUser;
|
37
38
|
};
|
38
39
|
|
39
40
|
refresh = () => {
|
@@ -58,7 +59,7 @@ class WidgetSmall extends Component {
|
|
58
59
|
};
|
59
60
|
|
60
61
|
onPressAll = () => {
|
61
|
-
Services.navigation.navigate(
|
62
|
+
Services.navigation.navigate(values.screenMaintenance, { options: this.props.options });
|
62
63
|
};
|
63
64
|
|
64
65
|
renderContent() {
|
@@ -136,13 +137,15 @@ const styles = StyleSheet.create({
|
|
136
137
|
});
|
137
138
|
|
138
139
|
const mapStateToProps = state => {
|
139
|
-
const { user,
|
140
|
+
const { user, notifications } = state;
|
141
|
+
const jobs = state[values.reducerKey];
|
140
142
|
return {
|
141
143
|
colourBrandingMain: Colours.getMainBrandingColourFromState(state),
|
142
144
|
jobs: _.orderBy(jobs.jobs, ['createdUnix'], ['desc']),
|
143
145
|
site: user.site,
|
144
146
|
userCategory: user.category,
|
145
|
-
dataUpdated: notifications.dataUpdated.
|
147
|
+
dataUpdated: notifications.dataUpdated[values.updateKey],
|
148
|
+
strings: state.strings?.config || {},
|
146
149
|
};
|
147
150
|
};
|
148
151
|
|
package/src/feature.config.js
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
// import * as PlussCore from '../../pluss-core/src';
|
2
2
|
import * as PlussCore from '@plusscommunities/pluss-core-app';
|
3
|
+
import { values } from './values.config';
|
3
4
|
|
4
5
|
export const Services = {
|
5
6
|
navigation: null,
|
@@ -10,38 +11,40 @@ export const BaseComponents = {
|
|
10
11
|
};
|
11
12
|
|
12
13
|
const FeatureConfig = {
|
13
|
-
key:
|
14
|
-
aliases:
|
15
|
-
title:
|
14
|
+
key: values.featureKey,
|
15
|
+
aliases: values.aliases,
|
16
|
+
title: values.textFeatureTitle,
|
16
17
|
gridMenu: {
|
17
|
-
icon:
|
18
|
-
viewBox:
|
19
|
-
navigate:
|
18
|
+
icon: values.iconGridMenu,
|
19
|
+
viewBox: values.gridViewBox,
|
20
|
+
navigate: values.screenMaintenance,
|
20
21
|
},
|
21
22
|
addMenu: {
|
22
|
-
order:
|
23
|
-
icon:
|
24
|
-
title:
|
25
|
-
navigate:
|
26
|
-
visibleExps: { type: 'feature', value:
|
27
|
-
},
|
28
|
-
moreMenu: {
|
29
|
-
order: 4,
|
30
|
-
title: 'Request',
|
31
|
-
navigate: 'maintenance',
|
32
|
-
visibleExps: {
|
33
|
-
type: 'and',
|
34
|
-
exps: [
|
35
|
-
{ type: 'notHidden', value: 'maintenanceRequest' },
|
36
|
-
{ type: 'notUserType', value: 'KIOSK' },
|
37
|
-
],
|
38
|
-
},
|
23
|
+
order: values.orderAddMenu,
|
24
|
+
icon: values.iconAddMenu,
|
25
|
+
title: values.textAddMenuTitle,
|
26
|
+
navigate: values.screenServiceRequest,
|
27
|
+
visibleExps: { type: 'feature', value: values.featureKey },
|
39
28
|
},
|
29
|
+
moreMenu: values.hasMoreOption
|
30
|
+
? {
|
31
|
+
order: values.orderMoreMenu,
|
32
|
+
title: values.textMoreMenuTitle,
|
33
|
+
navigate: values.screenMaintenance,
|
34
|
+
visibleExps: {
|
35
|
+
type: 'and',
|
36
|
+
exps: [
|
37
|
+
{ type: 'notHidden', value: 'maintenanceRequest' },
|
38
|
+
{ type: 'notUserType', value: 'KIOSK' },
|
39
|
+
],
|
40
|
+
},
|
41
|
+
}
|
42
|
+
: undefined,
|
40
43
|
kioskAction: {
|
41
|
-
order:
|
42
|
-
icon:
|
43
|
-
title:
|
44
|
-
navigate:
|
44
|
+
order: values.orderKioskAction,
|
45
|
+
icon: values.iconKioskAction,
|
46
|
+
title: values.textKioskActionTitle,
|
47
|
+
navigate: values.screenServiceRequest,
|
45
48
|
},
|
46
49
|
hideTabBar: [],
|
47
50
|
env: {
|
@@ -65,19 +68,6 @@ const FeatureConfig = {
|
|
65
68
|
Services.navigation = navigation;
|
66
69
|
BaseComponents.NotificationBell = notificationBell;
|
67
70
|
PlussCore.Config.init(environment, navigation);
|
68
|
-
|
69
|
-
// Override strings
|
70
|
-
if (environment && environment.strings) {
|
71
|
-
const { MAINTENANCE, MAINTENANCE_REQUEST } = environment.strings;
|
72
|
-
if (MAINTENANCE) {
|
73
|
-
FeatureConfig.addMenu.title = MAINTENANCE;
|
74
|
-
}
|
75
|
-
if (MAINTENANCE_REQUEST) {
|
76
|
-
FeatureConfig.title = MAINTENANCE_REQUEST;
|
77
|
-
FeatureConfig.moreMenu.title = MAINTENANCE_REQUEST;
|
78
|
-
FeatureConfig.kioskAction.title = MAINTENANCE_REQUEST;
|
79
|
-
}
|
80
|
-
}
|
81
71
|
},
|
82
72
|
};
|
83
73
|
export default FeatureConfig;
|
package/src/index.js
CHANGED
@@ -4,15 +4,22 @@ import ServiceRequest from './screens/ServiceRequest';
|
|
4
4
|
import JobTypePicker from './screens/JobTypePicker';
|
5
5
|
import RequestNotes from './screens/RequestNotes';
|
6
6
|
import JobsReducer from './reducers/JobsReducer';
|
7
|
+
import { values } from './values.config';
|
7
8
|
|
8
|
-
export const Reducers =
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
9
|
+
export const Reducers = (() => {
|
10
|
+
const reducers = {};
|
11
|
+
reducers[values.reducerKey] = JobsReducer;
|
12
|
+
return reducers;
|
13
|
+
})();
|
14
|
+
export const Screens = (() => {
|
15
|
+
const screens = {};
|
16
|
+
screens[values.screenMaintenance] = MaintenancePage;
|
17
|
+
screens[values.screenRequestDetail] = RequestDetail;
|
18
|
+
screens[values.screenServiceRequest] = ServiceRequest;
|
19
|
+
screens[values.screenJobTypePicker] = JobTypePicker;
|
20
|
+
screens[values.screenRequestNotes] = RequestNotes;
|
21
|
+
return screens;
|
22
|
+
})();
|
16
23
|
export { default as Config } from './feature.config';
|
17
24
|
export { default as WidgetSmall } from './components/WidgetSmall';
|
18
25
|
export { default as WidgetLarge } from './components/WidgetLarge';
|
@@ -3,8 +3,9 @@ import _ from 'lodash';
|
|
3
3
|
import { REHYDRATE } from 'redux-persist';
|
4
4
|
import { JOBS_LOADED, JOB_ADDED, JOBS_ADDED } from '../actions/types';
|
5
5
|
import { ActionTypes } from '../core.config';
|
6
|
+
import { values } from '../values.config';
|
6
7
|
|
7
|
-
const REDUCER_KEY =
|
8
|
+
const REDUCER_KEY = values.reducerKey;
|
8
9
|
|
9
10
|
const INITIAL_STATE = {
|
10
11
|
jobs: [],
|
@@ -5,6 +5,7 @@ import _ from 'lodash';
|
|
5
5
|
import MaintenanceList from '../components/MaintenanceList';
|
6
6
|
import { Services, BaseComponents } from '../feature.config';
|
7
7
|
import { Components, Helper, Styles, Config } from '../core.config';
|
8
|
+
import { values } from '../values.config';
|
8
9
|
|
9
10
|
class MaintenancePage extends Component {
|
10
11
|
constructor(props) {
|
@@ -29,10 +30,11 @@ class MaintenancePage extends Component {
|
|
29
30
|
};
|
30
31
|
|
31
32
|
renderHeader() {
|
33
|
+
const title = this.props.title || this.props.strings[`${values.featureKey}_textFeatureTitle`] || values.textFeatureTitle;
|
32
34
|
if (this.state.isHomeTab) {
|
33
35
|
return (
|
34
36
|
<Components.Header
|
35
|
-
text={
|
37
|
+
text={title}
|
36
38
|
rightContent={
|
37
39
|
_.includes(this.props.user.hidden, 'notifications') ? null : (
|
38
40
|
<View style={styles.notificationContainer}>
|
@@ -46,9 +48,7 @@ class MaintenancePage extends Component {
|
|
46
48
|
/>
|
47
49
|
);
|
48
50
|
}
|
49
|
-
return
|
50
|
-
<Components.Header leftIcon="angle-left" onPressLeft={this.onPressBack} text={this.props.title || Config.env.strings.MAINTENANCE} />
|
51
|
-
);
|
51
|
+
return <Components.Header leftIcon="angle-left" onPressLeft={this.onPressBack} text={values.textFeatureTitle} />;
|
52
52
|
}
|
53
53
|
|
54
54
|
render() {
|
@@ -89,6 +89,7 @@ const styles = StyleSheet.create({
|
|
89
89
|
const mapStateToProps = state => {
|
90
90
|
return {
|
91
91
|
user: state.user,
|
92
|
+
strings: state.strings?.config || {},
|
92
93
|
};
|
93
94
|
};
|
94
95
|
|