@plusscommunities/pluss-maintenance-app 6.0.6-auth.0 → 6.0.6-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/JobActions.js.map +1 -1
- package/dist/module/actions/index.js.map +1 -1
- package/dist/module/actions/types.js +4 -3
- package/dist/module/actions/types.js.map +1 -1
- package/dist/module/apis/index.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/FilterPopupMenu.js +2 -2
- package/dist/module/components/FilterPopupMenu.js.map +1 -1
- package/dist/module/components/MaintenanceList.js +6 -5
- package/dist/module/components/MaintenanceList.js.map +1 -1
- package/dist/module/components/MaintenanceListItem.js +5 -4
- package/dist/module/components/MaintenanceListItem.js.map +1 -1
- package/dist/module/components/MaintenanceWidgetItem.js +4 -3
- package/dist/module/components/MaintenanceWidgetItem.js.map +1 -1
- package/dist/module/components/StatusSelectorPopup.js.map +1 -1
- package/dist/module/components/WidgetLarge.js.map +1 -1
- package/dist/module/components/WidgetSmall.js +8 -5
- package/dist/module/components/WidgetSmall.js.map +1 -1
- package/dist/module/core.config.js.map +1 -1
- package/dist/module/feature.config.js +18 -33
- package/dist/module/feature.config.js.map +1 -1
- package/dist/module/helper.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.map +1 -1
- package/dist/module/screens/JobTypePicker.js +2 -2
- package/dist/module/screens/JobTypePicker.js.map +1 -1
- package/dist/module/screens/MaintenancePage.js +9 -5
- package/dist/module/screens/MaintenancePage.js.map +1 -1
- package/dist/module/screens/RequestDetail.js +121 -41
- package/dist/module/screens/RequestDetail.js.map +1 -1
- package/dist/module/screens/RequestNotes.js +7 -4
- package/dist/module/screens/RequestNotes.js.map +1 -1
- package/dist/module/screens/ServiceRequest.js +554 -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 +30 -0
- package/dist/module/values.config.default.js.map +1 -0
- package/dist/module/values.config.js +30 -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 +5 -3
- package/src/components/MaintenanceListItem.js +7 -2
- package/src/components/MaintenanceWidgetItem.js +2 -1
- package/src/components/WidgetSmall.js +6 -3
- package/src/feature.config.js +18 -30
- package/src/index.js +15 -8
- package/src/screens/MaintenancePage.js +5 -4
- package/src/screens/RequestDetail.js +113 -42
- package/src/screens/RequestNotes.js +5 -2
- package/src/screens/ServiceRequest.js +591 -149
- 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 +30 -0
- package/src/values.config.js +30 -0
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) {
|
@@ -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,7 +28,7 @@ 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 = () => {
|
@@ -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,25 +11,25 @@ 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
|
+
icon: values.iconGridMenu,
|
18
19
|
viewBox: '0 0 30 30',
|
19
|
-
navigate:
|
20
|
+
navigate: values.screenMaintenance,
|
20
21
|
},
|
21
22
|
addMenu: {
|
22
|
-
order:
|
23
|
-
icon:
|
24
|
-
title:
|
25
|
-
navigate:
|
26
|
-
visibleExps: { type: 'feature', value:
|
23
|
+
order: values.orderAddMenu,
|
24
|
+
icon: values.iconAddMenu,
|
25
|
+
title: values.textAddMenuTitle,
|
26
|
+
navigate: values.screenServiceRequest,
|
27
|
+
visibleExps: { type: 'feature', value: values.featureKey },
|
27
28
|
},
|
28
29
|
moreMenu: {
|
29
|
-
order:
|
30
|
-
title:
|
31
|
-
navigate:
|
30
|
+
order: values.orderMoreMenu,
|
31
|
+
title: values.textMoreMenuTitle,
|
32
|
+
navigate: values.screenMaintenance,
|
32
33
|
visibleExps: {
|
33
34
|
type: 'and',
|
34
35
|
exps: [
|
@@ -38,10 +39,10 @@ const FeatureConfig = {
|
|
38
39
|
},
|
39
40
|
},
|
40
41
|
kioskAction: {
|
41
|
-
order:
|
42
|
-
icon:
|
43
|
-
title:
|
44
|
-
navigate:
|
42
|
+
order: values.orderKioskAction,
|
43
|
+
icon: values.iconKioskAction,
|
44
|
+
title: values.textKioskActionTitle,
|
45
|
+
navigate: values.screenServiceRequest,
|
45
46
|
},
|
46
47
|
hideTabBar: [],
|
47
48
|
env: {
|
@@ -65,19 +66,6 @@ const FeatureConfig = {
|
|
65
66
|
Services.navigation = navigation;
|
66
67
|
BaseComponents.NotificationBell = notificationBell;
|
67
68
|
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
69
|
},
|
82
70
|
};
|
83
71
|
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';
|
@@ -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
|
|