@plusscommunities/pluss-maintenance-app 4.0.4 → 4.1.5-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/generalActions.js +12 -11
- package/dist/module/apis/generalActions.js.map +1 -1
- package/dist/module/apis/index.js.map +1 -1
- package/dist/module/components/FilterPopupMenu.js.map +1 -1
- package/dist/module/components/MaintenanceList.js +4 -3
- package/dist/module/components/MaintenanceList.js.map +1 -1
- package/dist/module/components/MaintenanceListItem.js +2 -1
- 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/StatusSelectorPopup.js.map +1 -1
- package/dist/module/components/WidgetLarge.js.map +1 -1
- package/dist/module/components/WidgetSmall.js +6 -3
- 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 +2 -2
- package/dist/module/reducers/JobsReducer.js.map +1 -1
- package/dist/module/screens/JobTypePicker.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 +8 -7
- 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 +6 -3
- package/dist/module/screens/ServiceRequest.js.map +1 -1
- package/dist/module/values.config.a.js +28 -0
- package/dist/module/values.config.a.js.map +1 -0
- package/dist/module/values.config.b.js +28 -0
- package/dist/module/values.config.b.js.map +1 -0
- package/dist/module/values.config.c.js +28 -0
- package/dist/module/values.config.c.js.map +1 -0
- package/dist/module/values.config.d.js +28 -0
- package/dist/module/values.config.d.js.map +1 -0
- package/dist/module/values.config.default.js +28 -0
- package/dist/module/values.config.default.js.map +1 -0
- package/dist/module/values.config.js +28 -0
- package/dist/module/values.config.js.map +1 -0
- package/package.json +11 -5
- package/src/actions/types.js +5 -3
- package/src/apis/generalActions.js +12 -11
- package/src/components/MaintenanceList.js +5 -3
- package/src/components/MaintenanceListItem.js +2 -1
- package/src/components/MaintenanceWidgetItem.js +2 -1
- package/src/components/WidgetSmall.js +5 -2
- 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 +8 -7
- package/src/screens/RequestNotes.js +2 -1
- package/src/screens/ServiceRequest.js +4 -2
- package/src/values.config.a.js +28 -0
- package/src/values.config.b.js +28 -0
- package/src/values.config.c.js +28 -0
- package/src/values.config.d.js +28 -0
- package/src/values.config.default.js +28 -0
- package/src/values.config.js +28 -0
@@ -2,26 +2,27 @@
|
|
2
2
|
// import { getUrl } from './helper';
|
3
3
|
// import { authedFunction } from '../js';
|
4
4
|
import { Helper, Session } from '../core.config';
|
5
|
+
import { values } from '../values.config';
|
5
6
|
|
6
7
|
export const generalActions = {
|
7
8
|
getJob: (site, id) => {
|
8
9
|
return Session.authedFunction({
|
9
10
|
method: 'POST',
|
10
|
-
url: Helper.getUrl(
|
11
|
+
url: Helper.getUrl(values.serviceKey, 'getJob'),
|
11
12
|
data: { site, id },
|
12
13
|
});
|
13
14
|
},
|
14
15
|
getJobByJobId: (site, jobId) => {
|
15
16
|
return Session.authedFunction({
|
16
17
|
method: 'POST',
|
17
|
-
url: Helper.getUrl(
|
18
|
+
url: Helper.getUrl(values.serviceKey, 'getJob'),
|
18
19
|
data: { site, jobId },
|
19
20
|
});
|
20
21
|
},
|
21
22
|
getJobs: (site, status = '', type = '') => {
|
22
23
|
return Session.authedFunction({
|
23
24
|
method: 'POST',
|
24
|
-
url: Helper.getUrl(
|
25
|
+
url: Helper.getUrl(values.serviceKey, 'getJobs'),
|
25
26
|
data: { site, status, type },
|
26
27
|
});
|
27
28
|
},
|
@@ -38,7 +39,7 @@ export const generalActions = {
|
|
38
39
|
}
|
39
40
|
return Session.authedFunction({
|
40
41
|
method: 'GET',
|
41
|
-
url: Helper.getUrl(
|
42
|
+
url: Helper.getUrl(values.serviceKey, 'get/requests', query),
|
42
43
|
});
|
43
44
|
},
|
44
45
|
getJobsRecursive: (site, status, type, lastKey, jobs = []) => {
|
@@ -55,7 +56,7 @@ export const generalActions = {
|
|
55
56
|
sendMaintenanceRequest: (userID, userName, phone, room, title, description, date, type, images, location, isHome, homeText) => {
|
56
57
|
const request = {
|
57
58
|
method: 'POST',
|
58
|
-
url: Helper.getUrl(
|
59
|
+
url: Helper.getUrl(values.serviceKey, 'sendMaintenance'),
|
59
60
|
data: {
|
60
61
|
userID,
|
61
62
|
userName,
|
@@ -76,21 +77,21 @@ export const generalActions = {
|
|
76
77
|
editJob: (job, site) => {
|
77
78
|
return Session.authedFunction({
|
78
79
|
method: 'POST',
|
79
|
-
url: Helper.getUrl(
|
80
|
+
url: Helper.getUrl(values.serviceKey, 'editJob'),
|
80
81
|
data: { job, site },
|
81
82
|
});
|
82
83
|
},
|
83
84
|
editJobStatus: (id, status) => {
|
84
85
|
return Session.authedFunction({
|
85
86
|
method: 'POST',
|
86
|
-
url: Helper.getUrl(
|
87
|
+
url: Helper.getUrl(values.serviceKey, 'editJobStatus'),
|
87
88
|
data: { id, status },
|
88
89
|
});
|
89
90
|
},
|
90
91
|
addNote: (jobId, note, attachments) => {
|
91
92
|
return Session.authedFunction({
|
92
93
|
method: 'POST',
|
93
|
-
url: Helper.getUrl(
|
94
|
+
url: Helper.getUrl(values.serviceKey, 'requests/note'),
|
94
95
|
data: {
|
95
96
|
id: jobId,
|
96
97
|
note,
|
@@ -102,7 +103,7 @@ export const generalActions = {
|
|
102
103
|
editNote: (jobId, noteId, note, attachments) => {
|
103
104
|
return Session.authedFunction({
|
104
105
|
method: 'POST',
|
105
|
-
url: Helper.getUrl(
|
106
|
+
url: Helper.getUrl(values.serviceKey, 'requests/note'),
|
106
107
|
data: {
|
107
108
|
id: jobId,
|
108
109
|
note,
|
@@ -115,7 +116,7 @@ export const generalActions = {
|
|
115
116
|
deleteNote: (jobId, noteId) => {
|
116
117
|
return Session.authedFunction({
|
117
118
|
method: 'POST',
|
118
|
-
url: Helper.getUrl(
|
119
|
+
url: Helper.getUrl(values.serviceKey, 'requests/note'),
|
119
120
|
data: {
|
120
121
|
id: jobId,
|
121
122
|
noteId,
|
@@ -128,7 +129,7 @@ export const generalActions = {
|
|
128
129
|
// return null;
|
129
130
|
// },
|
130
131
|
getJobTypes: async site => {
|
131
|
-
const url = Helper.getUrl(
|
132
|
+
const url = Helper.getUrl(values.serviceKey, 'getjobtypes');
|
132
133
|
return Session.authedFunction({
|
133
134
|
method: 'POST',
|
134
135
|
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) {
|
@@ -43,7 +44,7 @@ class MaintenanceList extends Component {
|
|
43
44
|
const { selectedStatus, selectedType } = this.state;
|
44
45
|
// console.log('filters', { selectedStatus, selectedType });
|
45
46
|
const res = await generalActions.getJobsRecursive(this.props.site, selectedStatus, selectedType);
|
46
|
-
// console.log('refresh', res
|
47
|
+
// console.log('refresh', JSON.stringify(res, null, 2));
|
47
48
|
if (selectedStatus !== this.initialStatus || !_.isEmpty(selectedType)) {
|
48
49
|
this.props.jobsAdded(res);
|
49
50
|
} else {
|
@@ -276,7 +277,8 @@ const styles = StyleSheet.create({
|
|
276
277
|
});
|
277
278
|
|
278
279
|
const mapStateToProps = state => {
|
279
|
-
const { user,
|
280
|
+
const { user, notifications } = state;
|
281
|
+
const jobs = state[values.reducerKey];
|
280
282
|
const jobsOrdered = _.orderBy(jobs.jobs, ['createdUnix'], ['desc']);
|
281
283
|
const hasPermission = _.includes(user.permissions, 'maintenanceTracking');
|
282
284
|
|
@@ -286,7 +288,7 @@ const mapStateToProps = state => {
|
|
286
288
|
site: user.site,
|
287
289
|
userCategory: user.category,
|
288
290
|
colourBrandingMain: Colours.getMainBrandingColourFromState(state),
|
289
|
-
dataUpdated: notifications.dataUpdated[
|
291
|
+
dataUpdated: notifications.dataUpdated[values.updateKey],
|
290
292
|
};
|
291
293
|
};
|
292
294
|
|
@@ -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() {
|
@@ -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
147
|
dataUpdated: notifications.dataUpdated.jobs,
|
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
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React, { Component } from 'react';
|
2
|
-
import { ScrollView, View, StyleSheet, Text, KeyboardAvoidingView, TouchableOpacity, ImageBackground } from 'react-native';
|
2
|
+
import { ScrollView, View, StyleSheet, Text, KeyboardAvoidingView, TouchableOpacity, ImageBackground, Platform } from 'react-native';
|
3
3
|
import DateTimePicker from 'react-native-modal-datetime-picker';
|
4
4
|
import { Icon } from 'react-native-elements';
|
5
5
|
import _ from 'lodash';
|
@@ -11,6 +11,7 @@ import StatusSelectorPopup from '../components/StatusSelectorPopup';
|
|
11
11
|
import { jobStatusOptions, getJobStatusProps } from '../helper';
|
12
12
|
import { Services } from '../feature.config';
|
13
13
|
import { Colours, Helper, Components, Config } from '../core.config';
|
14
|
+
import { values } from '../values.config';
|
14
15
|
|
15
16
|
class RequestDetail extends Component {
|
16
17
|
constructor(props) {
|
@@ -137,7 +138,7 @@ class RequestDetail extends Component {
|
|
137
138
|
};
|
138
139
|
|
139
140
|
openStaffNotes = () => {
|
140
|
-
Services.navigation.navigate(
|
141
|
+
Services.navigation.navigate(values.screenRequestNotes, { job: this.state.job });
|
141
142
|
};
|
142
143
|
|
143
144
|
onOpenDatePicker = () => {
|
@@ -194,7 +195,7 @@ class RequestDetail extends Component {
|
|
194
195
|
|
195
196
|
hasPermission = () => {
|
196
197
|
const { permissions } = this.props.user;
|
197
|
-
return _.includes(permissions,
|
198
|
+
return _.includes(permissions, values.permissionMaintenanceTracking);
|
198
199
|
};
|
199
200
|
|
200
201
|
toggleFullscreenVideo = url => {
|
@@ -398,8 +399,8 @@ class RequestDetail extends Component {
|
|
398
399
|
ref={this.commentSection}
|
399
400
|
commentReply={this.commentReply}
|
400
401
|
scrollView={this.scrollView}
|
401
|
-
adminPermission=
|
402
|
-
entityType=
|
402
|
+
adminPermission={values.permissionMaintenanceTracking}
|
403
|
+
entityType={values.featureKey}
|
403
404
|
entityId={this.props.job.id}
|
404
405
|
entityName={this.props.job.title}
|
405
406
|
site={this.state.job.site || this.state.job.location}
|
@@ -436,7 +437,7 @@ class RequestDetail extends Component {
|
|
436
437
|
ref={this.commentReply}
|
437
438
|
commentSection={this.commentSection}
|
438
439
|
scrollView={this.scrollView}
|
439
|
-
entityType=
|
440
|
+
entityType={values.featureKey}
|
440
441
|
entityId={this.props.job.id}
|
441
442
|
entityName={this.props.job.title}
|
442
443
|
site={this.state.job.site || this.state.job.location}
|
@@ -720,7 +721,7 @@ const mapStateToProps = state => {
|
|
720
721
|
return {
|
721
722
|
user: state.user,
|
722
723
|
colourBrandingMain: Colours.getMainBrandingColourFromState(state),
|
723
|
-
jobs: state.
|
724
|
+
jobs: state[values.reducerKey].jobs,
|
724
725
|
};
|
725
726
|
};
|
726
727
|
|
@@ -9,6 +9,7 @@ import { generalActions } from '../apis';
|
|
9
9
|
import { getBottomSpace } from 'react-native-iphone-x-helper';
|
10
10
|
import { Services } from '../feature.config';
|
11
11
|
import { Components, Colours, Helper } from '../core.config';
|
12
|
+
import { values } from '../values.config';
|
12
13
|
|
13
14
|
class RequestNotes extends Component {
|
14
15
|
constructor(props) {
|
@@ -408,7 +409,7 @@ const mapStateToProps = state => {
|
|
408
409
|
user: state.user,
|
409
410
|
colourBrandingMain: Colours.getMainBrandingColourFromState(state),
|
410
411
|
colourBrandingLight: Colours.getLightBrandingColourFromState(state),
|
411
|
-
jobs: state.
|
412
|
+
jobs: state[values.reducerKey].jobs,
|
412
413
|
};
|
413
414
|
};
|
414
415
|
|
@@ -19,6 +19,7 @@ import { jobAdded } from '../actions';
|
|
19
19
|
import { generalActions } from '../apis';
|
20
20
|
import { Services } from '../feature.config';
|
21
21
|
import { Components, Colours, Helper, Config } from '../core.config';
|
22
|
+
import { values } from '../values.config';
|
22
23
|
|
23
24
|
const PHOTO_SIZE = (Dimensions.get('window').width - 64) / 3;
|
24
25
|
|
@@ -143,7 +144,7 @@ class MaintenanceRequest extends Component {
|
|
143
144
|
}
|
144
145
|
|
145
146
|
onPressType() {
|
146
|
-
Services.navigation.navigate(
|
147
|
+
Services.navigation.navigate(values.screenJobTypePicker, {
|
147
148
|
currentType: this.state.type,
|
148
149
|
types: this.state.types,
|
149
150
|
onSelectType: this.pickType.bind(this),
|
@@ -614,7 +615,7 @@ class MaintenanceRequest extends Component {
|
|
614
615
|
<Components.Header
|
615
616
|
leftIcon="angle-left"
|
616
617
|
onPressLeft={this.onPressBack.bind(this)}
|
617
|
-
text={
|
618
|
+
text={this.props.strings[`${values.featureKey}_textFeatureTitle`] || values.textFeatureTitle}
|
618
619
|
rightText={this.state.submitting || this.state.success ? null : 'Done'}
|
619
620
|
onPressRight={this.submitRequest.bind(this)}
|
620
621
|
absoluteRight
|
@@ -740,6 +741,7 @@ const mapStateToProps = state => {
|
|
740
741
|
unit,
|
741
742
|
phoneNumber,
|
742
743
|
colourBrandingMain: Colours.getMainBrandingColourFromState(state),
|
744
|
+
strings: state.strings?.config || {},
|
743
745
|
};
|
744
746
|
};
|
745
747
|
|
@@ -0,0 +1,28 @@
|
|
1
|
+
const values = {
|
2
|
+
featureKey: 'maintenanceA',
|
3
|
+
aliases: ['maintenanceRequestA'],
|
4
|
+
reducerKey: 'jobsA',
|
5
|
+
serviceKey: 'maintenanceA',
|
6
|
+
updateKey: 'jobsA',
|
7
|
+
actionJobsLoaded: 'JOBS_LOADEDA',
|
8
|
+
actionJobAdded: 'JOB_ADDEDA',
|
9
|
+
actionJobsAdded: 'JOBS_ADDEDA',
|
10
|
+
screenMaintenance: 'maintenanceA',
|
11
|
+
screenRequestDetail: 'requestDetailA',
|
12
|
+
screenServiceRequest: 'serviceRequestA',
|
13
|
+
screenJobTypePicker: 'jobTypePickerA',
|
14
|
+
screenRequestNotes: 'requestNotesA',
|
15
|
+
permissionMaintenanceTracking: 'maintenanceTrackingA',
|
16
|
+
iconGridMenu: 'maintenance',
|
17
|
+
iconAddMenu: 'request',
|
18
|
+
iconKioskAction: 'wrench',
|
19
|
+
orderAddMenu: 5,
|
20
|
+
orderMoreMenu: 4,
|
21
|
+
orderKioskAction: 1,
|
22
|
+
textFeatureTitle: 'Request A',
|
23
|
+
textAddMenuTitle: 'Request A',
|
24
|
+
textMoreMenuTitle: 'Request A',
|
25
|
+
textKioskActionTitle: 'Request A',
|
26
|
+
};
|
27
|
+
|
28
|
+
export { values };
|
@@ -0,0 +1,28 @@
|
|
1
|
+
const values = {
|
2
|
+
featureKey: 'maintenanceB',
|
3
|
+
aliases: ['maintenanceRequestB'],
|
4
|
+
reducerKey: 'jobsB',
|
5
|
+
serviceKey: 'maintenanceB',
|
6
|
+
updateKey: 'jobsB',
|
7
|
+
actionJobsLoaded: 'JOBS_LOADEDB',
|
8
|
+
actionJobAdded: 'JOB_ADDEDB',
|
9
|
+
actionJobsAdded: 'JOBS_ADDEDB',
|
10
|
+
screenMaintenance: 'maintenanceB',
|
11
|
+
screenRequestDetail: 'requestDetailB',
|
12
|
+
screenServiceRequest: 'serviceRequestB',
|
13
|
+
screenJobTypePicker: 'jobTypePickerB',
|
14
|
+
screenRequestNotes: 'requestNotesB',
|
15
|
+
permissionMaintenanceTracking: 'maintenanceTrackingB',
|
16
|
+
iconGridMenu: 'maintenance',
|
17
|
+
iconAddMenu: 'request',
|
18
|
+
iconKioskAction: 'wrench',
|
19
|
+
orderAddMenu: 5,
|
20
|
+
orderMoreMenu: 4,
|
21
|
+
orderKioskAction: 1,
|
22
|
+
textFeatureTitle: 'Request B',
|
23
|
+
textAddMenuTitle: 'Request B',
|
24
|
+
textMoreMenuTitle: 'Request B',
|
25
|
+
textKioskActionTitle: 'Request B',
|
26
|
+
};
|
27
|
+
|
28
|
+
export { values };
|
@@ -0,0 +1,28 @@
|
|
1
|
+
const values = {
|
2
|
+
featureKey: 'maintenanceC',
|
3
|
+
aliases: ['maintenanceRequestC'],
|
4
|
+
reducerKey: 'jobsC',
|
5
|
+
serviceKey: 'maintenanceC',
|
6
|
+
updateKey: 'jobsC',
|
7
|
+
actionJobsLoaded: 'JOBS_LOADEDC',
|
8
|
+
actionJobAdded: 'JOB_ADDEDC',
|
9
|
+
actionJobsAdded: 'JOBS_ADDEDC',
|
10
|
+
screenMaintenance: 'maintenanceC',
|
11
|
+
screenRequestDetail: 'requestDetailC',
|
12
|
+
screenServiceRequest: 'serviceRequestC',
|
13
|
+
screenJobTypePicker: 'jobTypePickerC',
|
14
|
+
screenRequestNotes: 'requestNotesC',
|
15
|
+
permissionMaintenanceTracking: 'maintenanceTrackingC',
|
16
|
+
iconGridMenu: 'maintenance',
|
17
|
+
iconAddMenu: 'request',
|
18
|
+
iconKioskAction: 'wrench',
|
19
|
+
orderAddMenu: 5,
|
20
|
+
orderMoreMenu: 4,
|
21
|
+
orderKioskAction: 1,
|
22
|
+
textFeatureTitle: 'Request C',
|
23
|
+
textAddMenuTitle: 'Request C',
|
24
|
+
textMoreMenuTitle: 'Request C',
|
25
|
+
textKioskActionTitle: 'Request C',
|
26
|
+
};
|
27
|
+
|
28
|
+
export { values };
|
@@ -0,0 +1,28 @@
|
|
1
|
+
const values = {
|
2
|
+
featureKey: 'maintenanceD',
|
3
|
+
aliases: ['maintenanceRequestD'],
|
4
|
+
reducerKey: 'jobsD',
|
5
|
+
serviceKey: 'maintenanceD',
|
6
|
+
updateKey: 'jobsD',
|
7
|
+
actionJobsLoaded: 'JOBS_LOADEDD',
|
8
|
+
actionJobAdded: 'JOB_ADDEDD',
|
9
|
+
actionJobsAdded: 'JOBS_ADDEDD',
|
10
|
+
screenMaintenance: 'maintenanceD',
|
11
|
+
screenRequestDetail: 'requestDetailD',
|
12
|
+
screenServiceRequest: 'serviceRequestD',
|
13
|
+
screenJobTypePicker: 'jobTypePickerD',
|
14
|
+
screenRequestNotes: 'requestNotesD',
|
15
|
+
permissionMaintenanceTracking: 'maintenanceTrackingD',
|
16
|
+
iconGridMenu: 'maintenance',
|
17
|
+
iconAddMenu: 'request',
|
18
|
+
iconKioskAction: 'wrench',
|
19
|
+
orderAddMenu: 5,
|
20
|
+
orderMoreMenu: 4,
|
21
|
+
orderKioskAction: 1,
|
22
|
+
textFeatureTitle: 'Request D',
|
23
|
+
textAddMenuTitle: 'Request D',
|
24
|
+
textMoreMenuTitle: 'Request D',
|
25
|
+
textKioskActionTitle: 'Request D',
|
26
|
+
};
|
27
|
+
|
28
|
+
export { values };
|
@@ -0,0 +1,28 @@
|
|
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
|
+
iconGridMenu: 'maintenance',
|
17
|
+
iconAddMenu: 'request',
|
18
|
+
iconKioskAction: 'wrench',
|
19
|
+
orderAddMenu: 5,
|
20
|
+
orderMoreMenu: 4,
|
21
|
+
orderKioskAction: 1,
|
22
|
+
textFeatureTitle: 'Request',
|
23
|
+
textAddMenuTitle: 'Request',
|
24
|
+
textMoreMenuTitle: 'Request',
|
25
|
+
textKioskActionTitle: 'Request',
|
26
|
+
};
|
27
|
+
|
28
|
+
export { values };
|
@@ -0,0 +1,28 @@
|
|
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
|
+
iconGridMenu: 'maintenance',
|
17
|
+
iconAddMenu: 'request',
|
18
|
+
iconKioskAction: 'wrench',
|
19
|
+
orderAddMenu: 5,
|
20
|
+
orderMoreMenu: 4,
|
21
|
+
orderKioskAction: 1,
|
22
|
+
textFeatureTitle: 'Request',
|
23
|
+
textAddMenuTitle: 'Request',
|
24
|
+
textMoreMenuTitle: 'Request',
|
25
|
+
textKioskActionTitle: 'Request',
|
26
|
+
};
|
27
|
+
|
28
|
+
export { values };
|