@plusscommunities/pluss-maintenance-app-forms 7.0.21 → 7.0.23-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 +4 -4
- package/dist/module/actions/JobActions.js.map +1 -1
- package/dist/module/actions/index.js +1 -1
- package/dist/module/actions/index.js.map +1 -1
- package/dist/module/actions/types.js +1 -1
- package/dist/module/actions/types.js.map +1 -1
- package/dist/module/apis/index.js +3 -3
- package/dist/module/apis/index.js.map +1 -1
- package/dist/module/apis/maintenanceActions.js +36 -36
- package/dist/module/apis/maintenanceActions.js.map +1 -1
- package/dist/module/apis/userActions.js +5 -5
- package/dist/module/apis/userActions.js.map +1 -1
- package/dist/module/components/FilterPopupMenu.js +49 -49
- package/dist/module/components/FilterPopupMenu.js.map +1 -1
- package/dist/module/components/MaintenanceList.js +38 -38
- package/dist/module/components/MaintenanceList.js.map +1 -1
- package/dist/module/components/MaintenanceListItem.js +62 -62
- package/dist/module/components/MaintenanceListItem.js.map +1 -1
- package/dist/module/components/MaintenanceWidgetItem.js +27 -27
- package/dist/module/components/MaintenanceWidgetItem.js.map +1 -1
- package/dist/module/components/PrioritySelectorPopup.js +15 -15
- package/dist/module/components/PrioritySelectorPopup.js.map +1 -1
- package/dist/module/components/StatusSelectorPopup.js +16 -16
- package/dist/module/components/StatusSelectorPopup.js.map +1 -1
- package/dist/module/components/WidgetLarge.js +2 -2
- package/dist/module/components/WidgetLarge.js.map +1 -1
- package/dist/module/components/WidgetSmall.js +19 -19
- package/dist/module/components/WidgetSmall.js.map +1 -1
- package/dist/module/core.config.js +1 -1
- package/dist/module/core.config.js.map +1 -1
- package/dist/module/feature.config.js +17 -17
- package/dist/module/feature.config.js.map +1 -1
- package/dist/module/helper.js +10 -10
- package/dist/module/helper.js.map +1 -1
- package/dist/module/index.js +11 -11
- package/dist/module/index.js.map +1 -1
- package/dist/module/reducers/JobsReducer.js +13 -13
- package/dist/module/reducers/JobsReducer.js.map +1 -1
- package/dist/module/screens/JobTypePicker.js +17 -17
- package/dist/module/screens/JobTypePicker.js.map +1 -1
- package/dist/module/screens/MaintenancePage.js +10 -10
- package/dist/module/screens/MaintenancePage.js.map +1 -1
- package/dist/module/screens/MaintenanceUserPicker.js +22 -129
- package/dist/module/screens/MaintenanceUserPicker.js.map +1 -1
- package/dist/module/screens/RequestDetail.js +145 -145
- package/dist/module/screens/RequestDetail.js.map +1 -1
- package/dist/module/screens/RequestNotes.js +59 -59
- package/dist/module/screens/RequestNotes.js.map +1 -1
- package/dist/module/screens/ServiceRequest.js +189 -189
- package/dist/module/screens/ServiceRequest.js.map +1 -1
- package/dist/module/values.config.a.js +31 -31
- package/dist/module/values.config.a.js.map +1 -1
- package/dist/module/values.config.default.js +35 -35
- package/dist/module/values.config.default.js.map +1 -1
- package/dist/module/values.config.enquiry.js +35 -35
- package/dist/module/values.config.enquiry.js.map +1 -1
- package/dist/module/values.config.feedback.js +35 -35
- package/dist/module/values.config.feedback.js.map +1 -1
- package/dist/module/values.config.food.js +35 -35
- package/dist/module/values.config.food.js.map +1 -1
- package/dist/module/values.config.forms.js +34 -34
- package/dist/module/values.config.forms.js.map +1 -1
- package/dist/module/values.config.js +34 -34
- package/dist/module/values.config.js.map +1 -1
- package/package.json +52 -52
- package/src/actions/JobActions.js +60 -67
- package/src/actions/index.js +1 -1
- package/src/actions/types.js +2 -1
- package/src/apis/index.js +3 -3
- package/src/apis/maintenanceActions.js +178 -189
- package/src/apis/userActions.js +17 -17
- package/src/components/FilterPopupMenu.js +256 -313
- package/src/components/MaintenanceList.js +317 -396
- package/src/components/MaintenanceListItem.js +288 -347
- package/src/components/MaintenanceWidgetItem.js +124 -145
- package/src/components/PrioritySelectorPopup.js +68 -81
- package/src/components/StatusSelectorPopup.js +70 -81
- package/src/components/WidgetLarge.js +5 -5
- package/src/components/WidgetSmall.js +133 -153
- package/src/core.config.js +3 -27
- package/src/feature.config.js +62 -62
- package/src/helper.js +53 -58
- package/src/index.js +22 -22
- package/src/reducers/JobsReducer.js +66 -85
- package/src/screens/JobTypePicker.js +92 -115
- package/src/screens/MaintenancePage.js +80 -89
- package/src/screens/MaintenanceUserPicker.js +99 -262
- package/src/screens/RequestDetail.js +1125 -1345
- package/src/screens/RequestNotes.js +805 -946
- package/src/screens/ServiceRequest.js +1557 -1773
- package/src/values.config.a.js +34 -34
- package/src/values.config.default.js +40 -40
- package/src/values.config.enquiry.js +40 -40
- package/src/values.config.feedback.js +40 -40
- package/src/values.config.food.js +40 -40
- package/src/values.config.forms.js +39 -39
- package/src/values.config.js +39 -39
|
@@ -1,174 +1,154 @@
|
|
|
1
|
-
import React, { Component } from
|
|
2
|
-
import { Text, View, ScrollView, StyleSheet } from
|
|
3
|
-
import { connect } from
|
|
4
|
-
import _ from
|
|
5
|
-
import { maintenanceActions } from
|
|
6
|
-
import { jobsLoaded, jobStatusesUpdate, jobHideSeenUpdate } from
|
|
7
|
-
import MaintenanceWidgetItem from
|
|
8
|
-
import { Services } from
|
|
9
|
-
import { Colours, Components } from
|
|
10
|
-
import { values } from
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import { Text, View, ScrollView, StyleSheet } from 'react-native';
|
|
3
|
+
import { connect } from 'react-redux';
|
|
4
|
+
import _ from 'lodash';
|
|
5
|
+
import { maintenanceActions } from '../apis';
|
|
6
|
+
import { jobsLoaded, jobStatusesUpdate, jobHideSeenUpdate } from '../actions';
|
|
7
|
+
import MaintenanceWidgetItem from './MaintenanceWidgetItem';
|
|
8
|
+
import { Services } from '../feature.config';
|
|
9
|
+
import { Colours, Components } from '../core.config';
|
|
10
|
+
import { values } from '../values.config';
|
|
11
11
|
|
|
12
12
|
const MAX_ITEMS = 10;
|
|
13
13
|
|
|
14
14
|
class WidgetSmall extends Component {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
constructor(props) {
|
|
16
|
+
super(props);
|
|
17
|
+
this.state = { loading: false };
|
|
18
|
+
}
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
componentDidMount() {
|
|
21
|
+
this.props.jobStatusesUpdate(this.props.site);
|
|
22
|
+
this.props.jobHideSeenUpdate(this.props.site);
|
|
23
|
+
this.refresh();
|
|
24
|
+
}
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
componentDidUpdate(prevProps) {
|
|
27
|
+
if (!prevProps.dataUpdated && this.props.dataUpdated) this.refresh();
|
|
28
|
+
}
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
values.textFeatureTitle
|
|
36
|
-
);
|
|
37
|
-
};
|
|
30
|
+
getTitle = () => {
|
|
31
|
+
const { options } = this.props;
|
|
32
|
+
if (options && !_.isEmpty(options.Title)) return options.Title;
|
|
33
|
+
return this.props.strings[`${values.featureKey}_textFeatureTitle`] || values.textFeatureTitle;
|
|
34
|
+
};
|
|
38
35
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
: values.emptyRequestsUser;
|
|
45
|
-
};
|
|
36
|
+
getEmptyStateText = () => {
|
|
37
|
+
const { options, userCategory } = this.props;
|
|
38
|
+
if (options && !_.isEmpty(options.EmptyText)) return options.EmptyText;
|
|
39
|
+
return userCategory === 'staff' ? values.emptyRequestsStaff : values.emptyRequestsUser;
|
|
40
|
+
};
|
|
46
41
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
42
|
+
refresh = () => {
|
|
43
|
+
this.onLoadingChanged(true, async () => {
|
|
44
|
+
try {
|
|
45
|
+
const res = await maintenanceActions.getJobsRecursive(this.props.site);
|
|
46
|
+
// console.log('WidgetSmall - refresh', res.data);
|
|
47
|
+
this.props.jobsLoaded(res);
|
|
48
|
+
} catch (error) {
|
|
49
|
+
console.log('refresh error', error);
|
|
50
|
+
} finally {
|
|
51
|
+
this.onLoadingChanged(false);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
};
|
|
60
55
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
};
|
|
56
|
+
onLoadingChanged = (loading, callback) => {
|
|
57
|
+
this.setState({ loading }, () => {
|
|
58
|
+
if (this.props.onLoadingChanged) this.props.onLoadingChanged(this.state.loading);
|
|
59
|
+
if (callback) callback();
|
|
60
|
+
});
|
|
61
|
+
};
|
|
68
62
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
});
|
|
73
|
-
};
|
|
63
|
+
onPressAll = () => {
|
|
64
|
+
Services.navigation.navigate(values.screenMaintenance, { options: this.props.options });
|
|
65
|
+
};
|
|
74
66
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
>
|
|
100
|
-
{jobs.slice(0, MAX_ITEMS).map((job) => {
|
|
101
|
-
return <MaintenanceWidgetItem key={job.id} job={job} />;
|
|
102
|
-
})}
|
|
103
|
-
</ScrollView>
|
|
104
|
-
);
|
|
105
|
-
}
|
|
67
|
+
renderContent() {
|
|
68
|
+
const { jobs } = this.props;
|
|
69
|
+
if (_.isEmpty(jobs)) {
|
|
70
|
+
if (this.state.loading) {
|
|
71
|
+
return (
|
|
72
|
+
<View style={styles.loadingPadding}>
|
|
73
|
+
<Components.LoadingStateWidget height={180} />
|
|
74
|
+
</View>
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
return (
|
|
78
|
+
<View style={styles.loadingPadding}>
|
|
79
|
+
<Components.EmptyStateWidget title={this.getEmptyStateText()} height={180} />
|
|
80
|
+
</View>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
return (
|
|
84
|
+
<ScrollView horizontal contentContainerStyle={{ paddingLeft: 6, paddingRight: 8 }} showsHorizontalScrollIndicator={false}>
|
|
85
|
+
{jobs.slice(0, MAX_ITEMS).map(job => {
|
|
86
|
+
return <MaintenanceWidgetItem key={job.id} job={job} />;
|
|
87
|
+
})}
|
|
88
|
+
</ScrollView>
|
|
89
|
+
);
|
|
90
|
+
}
|
|
106
91
|
|
|
107
|
-
|
|
108
|
-
|
|
92
|
+
render() {
|
|
93
|
+
const { colourBrandingMain } = this.props;
|
|
109
94
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
95
|
+
return (
|
|
96
|
+
<View style={styles.sectionContainer}>
|
|
97
|
+
<View style={styles.sectionPadding}>
|
|
98
|
+
<View style={styles.sectionHeading}>
|
|
99
|
+
<Text style={styles.sectionTitle}>{this.getTitle()}</Text>
|
|
100
|
+
<Components.InlineButton
|
|
101
|
+
onPress={this.onPressAll}
|
|
102
|
+
color={colourBrandingMain}
|
|
103
|
+
touchableStyle={{ paddingTop: 6 }}
|
|
104
|
+
textStyle={{ color: '#fff' }}
|
|
105
|
+
>
|
|
106
|
+
View All
|
|
107
|
+
</Components.InlineButton>
|
|
108
|
+
</View>
|
|
109
|
+
</View>
|
|
110
|
+
{this.renderContent()}
|
|
111
|
+
</View>
|
|
112
|
+
);
|
|
113
|
+
}
|
|
129
114
|
}
|
|
130
115
|
|
|
131
116
|
const styles = StyleSheet.create({
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
117
|
+
sectionContainer: {
|
|
118
|
+
backgroundColor: '#fff',
|
|
119
|
+
paddingTop: 16,
|
|
120
|
+
},
|
|
121
|
+
sectionPadding: {
|
|
122
|
+
paddingHorizontal: 16,
|
|
123
|
+
paddingBottom: 6,
|
|
124
|
+
},
|
|
125
|
+
loadingPadding: {
|
|
126
|
+
paddingHorizontal: 16,
|
|
127
|
+
},
|
|
128
|
+
sectionHeading: {
|
|
129
|
+
marginBottom: 4,
|
|
130
|
+
flexDirection: 'row',
|
|
131
|
+
alignContent: 'flex-start',
|
|
132
|
+
justifyContent: 'space-between',
|
|
133
|
+
},
|
|
134
|
+
sectionTitle: {
|
|
135
|
+
fontFamily: 'sf-bold',
|
|
136
|
+
fontSize: 24,
|
|
137
|
+
color: Colours.TEXT_DARKEST,
|
|
138
|
+
},
|
|
154
139
|
});
|
|
155
140
|
|
|
156
|
-
const mapStateToProps =
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
141
|
+
const mapStateToProps = state => {
|
|
142
|
+
const { user, notifications } = state;
|
|
143
|
+
const jobs = state[values.reducerKey];
|
|
144
|
+
return {
|
|
145
|
+
colourBrandingMain: Colours.getMainBrandingColourFromState(state),
|
|
146
|
+
jobs: _.orderBy(jobs.jobs, ['createdUnix'], ['desc']),
|
|
147
|
+
site: user.site,
|
|
148
|
+
userCategory: user.category,
|
|
149
|
+
dataUpdated: notifications.dataUpdated[values.updateKey],
|
|
150
|
+
strings: state.strings?.config || {},
|
|
151
|
+
};
|
|
167
152
|
};
|
|
168
153
|
|
|
169
|
-
export default connect(
|
|
170
|
-
mapStateToProps,
|
|
171
|
-
{ jobsLoaded, jobStatusesUpdate, jobHideSeenUpdate },
|
|
172
|
-
null,
|
|
173
|
-
{ forwardRef: true },
|
|
174
|
-
)(WidgetSmall);
|
|
154
|
+
export default connect(mapStateToProps, { jobsLoaded, jobStatusesUpdate, jobHideSeenUpdate }, null, { forwardRef: true })(WidgetSmall);
|
package/src/core.config.js
CHANGED
|
@@ -1,29 +1,5 @@
|
|
|
1
1
|
// import * as PlussCore from '../../pluss-core/src';
|
|
2
|
-
import * as PlussCore from
|
|
2
|
+
import * as PlussCore from '@plusscommunities/pluss-core-app';
|
|
3
3
|
|
|
4
|
-
const {
|
|
5
|
-
|
|
6
|
-
Fonts,
|
|
7
|
-
Actions,
|
|
8
|
-
ActionTypes,
|
|
9
|
-
Config,
|
|
10
|
-
Components,
|
|
11
|
-
Styles,
|
|
12
|
-
Session,
|
|
13
|
-
Helper,
|
|
14
|
-
Constants,
|
|
15
|
-
Colours,
|
|
16
|
-
} = PlussCore;
|
|
17
|
-
export {
|
|
18
|
-
Apis,
|
|
19
|
-
Fonts,
|
|
20
|
-
Actions,
|
|
21
|
-
ActionTypes,
|
|
22
|
-
Config,
|
|
23
|
-
Components,
|
|
24
|
-
Styles,
|
|
25
|
-
Session,
|
|
26
|
-
Helper,
|
|
27
|
-
Constants,
|
|
28
|
-
Colours,
|
|
29
|
-
};
|
|
4
|
+
const { Apis, Fonts, Actions, ActionTypes, Config, Components, Styles, Session, Helper, Constants, Colours } = PlussCore;
|
|
5
|
+
export { Apis, Fonts, Actions, ActionTypes, Config, Components, Styles, Session, Helper, Constants, Colours };
|
package/src/feature.config.js
CHANGED
|
@@ -1,73 +1,73 @@
|
|
|
1
1
|
// import * as PlussCore from '../../pluss-core/src';
|
|
2
|
-
import * as PlussCore from
|
|
3
|
-
import { values } from
|
|
2
|
+
import * as PlussCore from '@plusscommunities/pluss-core-app';
|
|
3
|
+
import { values } from './values.config';
|
|
4
4
|
|
|
5
5
|
export const Services = {
|
|
6
|
-
|
|
6
|
+
navigation: null,
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
export const BaseComponents = {
|
|
10
|
-
|
|
10
|
+
NotificationBell: null,
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
const FeatureConfig = {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
14
|
+
key: values.featureKey,
|
|
15
|
+
aliases: values.aliases,
|
|
16
|
+
title: values.textFeatureTitle,
|
|
17
|
+
gridMenu: {
|
|
18
|
+
icon: values.iconGridMenu,
|
|
19
|
+
viewBox: values.gridViewBox,
|
|
20
|
+
navigate: values.screenMaintenance,
|
|
21
|
+
},
|
|
22
|
+
addMenu: {
|
|
23
|
+
order: values.orderAddMenu,
|
|
24
|
+
icon: values.iconAddMenu,
|
|
25
|
+
title: values.textAddMenuTitle,
|
|
26
|
+
navigate: values.screenServiceRequest,
|
|
27
|
+
visibleExps: { type: 'feature', value: values.featureKey },
|
|
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,
|
|
43
|
+
kioskAction: {
|
|
44
|
+
order: values.orderKioskAction,
|
|
45
|
+
icon: values.iconKioskAction,
|
|
46
|
+
title: values.textKioskActionTitle,
|
|
47
|
+
navigate: values.screenServiceRequest,
|
|
48
|
+
},
|
|
49
|
+
hideTabBar: [],
|
|
50
|
+
env: {
|
|
51
|
+
baseStage: '',
|
|
52
|
+
baseAPIUrl: '',
|
|
53
|
+
hasGradientHeader: false,
|
|
54
|
+
defaultProfileImage: '',
|
|
55
|
+
tinyChatDefault: '',
|
|
56
|
+
baseUploadsUrl: '',
|
|
57
|
+
allowMediaDownload: false,
|
|
58
|
+
allowMediaSharing: false,
|
|
59
|
+
awsUploadsBucket: '',
|
|
60
|
+
awsStorageBucket: '',
|
|
61
|
+
preferredSite: '',
|
|
62
|
+
strings: {},
|
|
63
|
+
newEventDefaults: '',
|
|
64
|
+
defaultAllowComments: true,
|
|
65
|
+
},
|
|
66
|
+
init: (environment, navigation, notificationBell) => {
|
|
67
|
+
FeatureConfig.env = environment;
|
|
68
|
+
Services.navigation = navigation;
|
|
69
|
+
BaseComponents.NotificationBell = notificationBell;
|
|
70
|
+
PlussCore.Config.init(environment, navigation);
|
|
71
|
+
},
|
|
72
72
|
};
|
|
73
73
|
export default FeatureConfig;
|
package/src/helper.js
CHANGED
|
@@ -1,76 +1,71 @@
|
|
|
1
|
-
import { Colours } from
|
|
1
|
+
import { Colours } from './core.config';
|
|
2
2
|
|
|
3
|
-
const STATUS_NOT_ACTIONED =
|
|
4
|
-
const STATUS_IN_PROGRESS =
|
|
5
|
-
const STATUS_COMPLETED =
|
|
3
|
+
const STATUS_NOT_ACTIONED = 'Not Actioned';
|
|
4
|
+
const STATUS_IN_PROGRESS = 'In Progress';
|
|
5
|
+
const STATUS_COMPLETED = 'Completed';
|
|
6
6
|
|
|
7
7
|
const jobStatusOptions = [
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
8
|
+
{
|
|
9
|
+
text: 'Open',
|
|
10
|
+
order: 0,
|
|
11
|
+
color: Colours.LINEGREY,
|
|
12
|
+
category: STATUS_NOT_ACTIONED,
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
text: 'In Progress',
|
|
16
|
+
order: 1,
|
|
17
|
+
color: Colours.COLOUR_TEAL,
|
|
18
|
+
category: STATUS_IN_PROGRESS,
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
text: 'Completed',
|
|
22
|
+
order: 2,
|
|
23
|
+
color: Colours.COLOUR_GREEN_LIGHT,
|
|
24
|
+
category: STATUS_COMPLETED,
|
|
25
|
+
},
|
|
26
26
|
];
|
|
27
27
|
|
|
28
28
|
const jobPriorityOptions = [
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
29
|
+
{
|
|
30
|
+
label: 'Low',
|
|
31
|
+
color: Colours.COLOUR_GREEN,
|
|
32
|
+
default: true,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
label: 'Medium',
|
|
36
|
+
color: Colours.COLOUR_TANGERINE,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
label: 'High',
|
|
40
|
+
color: Colours.COLOUR_RED,
|
|
41
|
+
},
|
|
42
42
|
];
|
|
43
43
|
|
|
44
|
-
const getJobStatusOptions = (props)
|
|
45
|
-
props?.statusTypes?.length ? props?.statusTypes : jobStatusOptions;
|
|
44
|
+
const getJobStatusOptions = props => (props?.statusTypes?.length ? props?.statusTypes : jobStatusOptions);
|
|
46
45
|
|
|
47
|
-
const getDefaultJobStatuses = (props) =>
|
|
48
|
-
getJobStatusOptions(props).filter((s) => s.category === STATUS_NOT_ACTIONED);
|
|
46
|
+
const getDefaultJobStatuses = props => getJobStatusOptions(props).filter(s => s.category === STATUS_NOT_ACTIONED);
|
|
49
47
|
|
|
50
|
-
const getIncompleteJobStatuses = (props) =>
|
|
51
|
-
getJobStatusOptions(props).filter((s) => s.category === STATUS_IN_PROGRESS);
|
|
48
|
+
const getIncompleteJobStatuses = props => getJobStatusOptions(props).filter(s => s.category === STATUS_IN_PROGRESS);
|
|
52
49
|
|
|
53
50
|
const getJobStatus = (status, props) => {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
51
|
+
const statusOptions = getJobStatusOptions(props);
|
|
52
|
+
// console.log('getJobStatus', JSON.stringify({ status, statusOptions }, null, 2));
|
|
53
|
+
let statusOption = null;
|
|
54
|
+
if (status) statusOption = statusOptions.find(s => s.text === status);
|
|
55
|
+
return statusOption || getDefaultJobStatuses(props)[0];
|
|
59
56
|
};
|
|
60
57
|
|
|
61
|
-
const getDefaultJobPriority = () => jobPriorityOptions.find(
|
|
58
|
+
const getDefaultJobPriority = () => jobPriorityOptions.find(p => p.default);
|
|
62
59
|
|
|
63
|
-
const getJobPriority = (priority)
|
|
64
|
-
jobPriorityOptions.find((p) => p.label === priority) ||
|
|
65
|
-
getDefaultJobPriority();
|
|
60
|
+
const getJobPriority = priority => jobPriorityOptions.find(p => p.label === priority) || getDefaultJobPriority();
|
|
66
61
|
|
|
67
62
|
export {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
63
|
+
jobStatusOptions,
|
|
64
|
+
jobPriorityOptions,
|
|
65
|
+
getJobStatusOptions,
|
|
66
|
+
getDefaultJobStatuses,
|
|
67
|
+
getIncompleteJobStatuses,
|
|
68
|
+
getJobStatus,
|
|
69
|
+
getJobPriority,
|
|
70
|
+
getDefaultJobPriority,
|
|
76
71
|
};
|
package/src/index.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import MaintenancePage from
|
|
2
|
-
import RequestDetail from
|
|
3
|
-
import ServiceRequest from
|
|
4
|
-
import JobTypePicker from
|
|
5
|
-
import RequestNotes from
|
|
6
|
-
import MaintenanceUserPicker from
|
|
7
|
-
import JobsReducer from
|
|
8
|
-
import { values } from
|
|
1
|
+
import MaintenancePage from './screens/MaintenancePage';
|
|
2
|
+
import RequestDetail from './screens/RequestDetail';
|
|
3
|
+
import ServiceRequest from './screens/ServiceRequest';
|
|
4
|
+
import JobTypePicker from './screens/JobTypePicker';
|
|
5
|
+
import RequestNotes from './screens/RequestNotes';
|
|
6
|
+
import MaintenanceUserPicker from './screens/MaintenanceUserPicker';
|
|
7
|
+
import JobsReducer from './reducers/JobsReducer';
|
|
8
|
+
import { values } from './values.config';
|
|
9
9
|
|
|
10
10
|
export const Reducers = (() => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
const reducers = {};
|
|
12
|
+
reducers[values.reducerKey] = JobsReducer;
|
|
13
|
+
return reducers;
|
|
14
14
|
})();
|
|
15
15
|
export const Screens = (() => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
const screens = {};
|
|
17
|
+
screens[values.screenMaintenance] = MaintenancePage;
|
|
18
|
+
screens[values.screenRequestDetail] = RequestDetail;
|
|
19
|
+
screens[values.screenServiceRequest] = ServiceRequest;
|
|
20
|
+
screens[values.screenJobTypePicker] = JobTypePicker;
|
|
21
|
+
screens[values.screenRequestNotes] = RequestNotes;
|
|
22
|
+
screens[values.screenUserPicker] = MaintenanceUserPicker;
|
|
23
|
+
return screens;
|
|
24
24
|
})();
|
|
25
|
-
export { default as Config } from
|
|
26
|
-
export { default as WidgetSmall } from
|
|
27
|
-
export { default as WidgetLarge } from
|
|
25
|
+
export { default as Config } from './feature.config';
|
|
26
|
+
export { default as WidgetSmall } from './components/WidgetSmall';
|
|
27
|
+
export { default as WidgetLarge } from './components/WidgetLarge';
|