@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.
Files changed (97) hide show
  1. package/dist/module/actions/JobActions.js +4 -4
  2. package/dist/module/actions/JobActions.js.map +1 -1
  3. package/dist/module/actions/index.js +1 -1
  4. package/dist/module/actions/index.js.map +1 -1
  5. package/dist/module/actions/types.js +1 -1
  6. package/dist/module/actions/types.js.map +1 -1
  7. package/dist/module/apis/index.js +3 -3
  8. package/dist/module/apis/index.js.map +1 -1
  9. package/dist/module/apis/maintenanceActions.js +36 -36
  10. package/dist/module/apis/maintenanceActions.js.map +1 -1
  11. package/dist/module/apis/userActions.js +5 -5
  12. package/dist/module/apis/userActions.js.map +1 -1
  13. package/dist/module/components/FilterPopupMenu.js +49 -49
  14. package/dist/module/components/FilterPopupMenu.js.map +1 -1
  15. package/dist/module/components/MaintenanceList.js +38 -38
  16. package/dist/module/components/MaintenanceList.js.map +1 -1
  17. package/dist/module/components/MaintenanceListItem.js +62 -62
  18. package/dist/module/components/MaintenanceListItem.js.map +1 -1
  19. package/dist/module/components/MaintenanceWidgetItem.js +27 -27
  20. package/dist/module/components/MaintenanceWidgetItem.js.map +1 -1
  21. package/dist/module/components/PrioritySelectorPopup.js +15 -15
  22. package/dist/module/components/PrioritySelectorPopup.js.map +1 -1
  23. package/dist/module/components/StatusSelectorPopup.js +16 -16
  24. package/dist/module/components/StatusSelectorPopup.js.map +1 -1
  25. package/dist/module/components/WidgetLarge.js +2 -2
  26. package/dist/module/components/WidgetLarge.js.map +1 -1
  27. package/dist/module/components/WidgetSmall.js +19 -19
  28. package/dist/module/components/WidgetSmall.js.map +1 -1
  29. package/dist/module/core.config.js +1 -1
  30. package/dist/module/core.config.js.map +1 -1
  31. package/dist/module/feature.config.js +17 -17
  32. package/dist/module/feature.config.js.map +1 -1
  33. package/dist/module/helper.js +10 -10
  34. package/dist/module/helper.js.map +1 -1
  35. package/dist/module/index.js +11 -11
  36. package/dist/module/index.js.map +1 -1
  37. package/dist/module/reducers/JobsReducer.js +13 -13
  38. package/dist/module/reducers/JobsReducer.js.map +1 -1
  39. package/dist/module/screens/JobTypePicker.js +17 -17
  40. package/dist/module/screens/JobTypePicker.js.map +1 -1
  41. package/dist/module/screens/MaintenancePage.js +10 -10
  42. package/dist/module/screens/MaintenancePage.js.map +1 -1
  43. package/dist/module/screens/MaintenanceUserPicker.js +22 -129
  44. package/dist/module/screens/MaintenanceUserPicker.js.map +1 -1
  45. package/dist/module/screens/RequestDetail.js +145 -145
  46. package/dist/module/screens/RequestDetail.js.map +1 -1
  47. package/dist/module/screens/RequestNotes.js +59 -59
  48. package/dist/module/screens/RequestNotes.js.map +1 -1
  49. package/dist/module/screens/ServiceRequest.js +189 -189
  50. package/dist/module/screens/ServiceRequest.js.map +1 -1
  51. package/dist/module/values.config.a.js +31 -31
  52. package/dist/module/values.config.a.js.map +1 -1
  53. package/dist/module/values.config.default.js +35 -35
  54. package/dist/module/values.config.default.js.map +1 -1
  55. package/dist/module/values.config.enquiry.js +35 -35
  56. package/dist/module/values.config.enquiry.js.map +1 -1
  57. package/dist/module/values.config.feedback.js +35 -35
  58. package/dist/module/values.config.feedback.js.map +1 -1
  59. package/dist/module/values.config.food.js +35 -35
  60. package/dist/module/values.config.food.js.map +1 -1
  61. package/dist/module/values.config.forms.js +34 -34
  62. package/dist/module/values.config.forms.js.map +1 -1
  63. package/dist/module/values.config.js +34 -34
  64. package/dist/module/values.config.js.map +1 -1
  65. package/package.json +52 -52
  66. package/src/actions/JobActions.js +60 -67
  67. package/src/actions/index.js +1 -1
  68. package/src/actions/types.js +2 -1
  69. package/src/apis/index.js +3 -3
  70. package/src/apis/maintenanceActions.js +178 -189
  71. package/src/apis/userActions.js +17 -17
  72. package/src/components/FilterPopupMenu.js +256 -313
  73. package/src/components/MaintenanceList.js +317 -396
  74. package/src/components/MaintenanceListItem.js +288 -347
  75. package/src/components/MaintenanceWidgetItem.js +124 -145
  76. package/src/components/PrioritySelectorPopup.js +68 -81
  77. package/src/components/StatusSelectorPopup.js +70 -81
  78. package/src/components/WidgetLarge.js +5 -5
  79. package/src/components/WidgetSmall.js +133 -153
  80. package/src/core.config.js +3 -27
  81. package/src/feature.config.js +62 -62
  82. package/src/helper.js +53 -58
  83. package/src/index.js +22 -22
  84. package/src/reducers/JobsReducer.js +66 -85
  85. package/src/screens/JobTypePicker.js +92 -115
  86. package/src/screens/MaintenancePage.js +80 -89
  87. package/src/screens/MaintenanceUserPicker.js +99 -262
  88. package/src/screens/RequestDetail.js +1125 -1345
  89. package/src/screens/RequestNotes.js +805 -946
  90. package/src/screens/ServiceRequest.js +1557 -1773
  91. package/src/values.config.a.js +34 -34
  92. package/src/values.config.default.js +40 -40
  93. package/src/values.config.enquiry.js +40 -40
  94. package/src/values.config.feedback.js +40 -40
  95. package/src/values.config.food.js +40 -40
  96. package/src/values.config.forms.js +39 -39
  97. package/src/values.config.js +39 -39
@@ -1,174 +1,154 @@
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";
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
- constructor(props) {
16
- super(props);
17
- this.state = { loading: false };
18
- }
15
+ constructor(props) {
16
+ super(props);
17
+ this.state = { loading: false };
18
+ }
19
19
 
20
- componentDidMount() {
21
- this.props.jobStatusesUpdate(this.props.site);
22
- this.props.jobHideSeenUpdate(this.props.site);
23
- this.refresh();
24
- }
20
+ componentDidMount() {
21
+ this.props.jobStatusesUpdate(this.props.site);
22
+ this.props.jobHideSeenUpdate(this.props.site);
23
+ this.refresh();
24
+ }
25
25
 
26
- componentDidUpdate(prevProps) {
27
- if (!prevProps.dataUpdated && this.props.dataUpdated) this.refresh();
28
- }
26
+ componentDidUpdate(prevProps) {
27
+ if (!prevProps.dataUpdated && this.props.dataUpdated) this.refresh();
28
+ }
29
29
 
30
- getTitle = () => {
31
- const { options } = this.props;
32
- if (options && !_.isEmpty(options.Title)) return options.Title;
33
- return (
34
- this.props.strings[`${values.featureKey}_textFeatureTitle`] ||
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
- getEmptyStateText = () => {
40
- const { options, userCategory } = this.props;
41
- if (options && !_.isEmpty(options.EmptyText)) return options.EmptyText;
42
- return userCategory === "staff"
43
- ? values.emptyRequestsStaff
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
- refresh = () => {
48
- this.onLoadingChanged(true, async () => {
49
- try {
50
- const res = await maintenanceActions.getJobsRecursive(this.props.site);
51
- // console.log('WidgetSmall - refresh', res.data);
52
- this.props.jobsLoaded(res);
53
- } catch (error) {
54
- console.log("refresh error", error);
55
- } finally {
56
- this.onLoadingChanged(false);
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
- onLoadingChanged = (loading, callback) => {
62
- this.setState({ loading }, () => {
63
- if (this.props.onLoadingChanged)
64
- this.props.onLoadingChanged(this.state.loading);
65
- if (callback) callback();
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
- onPressAll = () => {
70
- Services.navigation.navigate(values.screenMaintenance, {
71
- options: this.props.options,
72
- });
73
- };
63
+ onPressAll = () => {
64
+ Services.navigation.navigate(values.screenMaintenance, { options: this.props.options });
65
+ };
74
66
 
75
- renderContent() {
76
- const { jobs } = this.props;
77
- if (_.isEmpty(jobs)) {
78
- if (this.state.loading) {
79
- return (
80
- <View style={styles.loadingPadding}>
81
- <Components.LoadingStateWidget height={180} />
82
- </View>
83
- );
84
- }
85
- return (
86
- <View style={styles.loadingPadding}>
87
- <Components.EmptyStateWidget
88
- title={this.getEmptyStateText()}
89
- height={180}
90
- />
91
- </View>
92
- );
93
- }
94
- return (
95
- <ScrollView
96
- horizontal
97
- contentContainerStyle={{ paddingLeft: 6, paddingRight: 8 }}
98
- showsHorizontalScrollIndicator={false}
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
- render() {
108
- const { colourBrandingMain } = this.props;
92
+ render() {
93
+ const { colourBrandingMain } = this.props;
109
94
 
110
- return (
111
- <View style={styles.sectionContainer}>
112
- <View style={styles.sectionPadding}>
113
- <View style={styles.sectionHeading}>
114
- <Text style={styles.sectionTitle}>{this.getTitle()}</Text>
115
- <Components.InlineButton
116
- onPress={this.onPressAll}
117
- color={colourBrandingMain}
118
- touchableStyle={{ paddingTop: 6 }}
119
- textStyle={{ color: "#fff" }}
120
- >
121
- View All
122
- </Components.InlineButton>
123
- </View>
124
- </View>
125
- {this.renderContent()}
126
- </View>
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
- sectionContainer: {
133
- backgroundColor: "#fff",
134
- paddingTop: 16,
135
- },
136
- sectionPadding: {
137
- paddingHorizontal: 16,
138
- paddingBottom: 6,
139
- },
140
- loadingPadding: {
141
- paddingHorizontal: 16,
142
- },
143
- sectionHeading: {
144
- marginBottom: 4,
145
- flexDirection: "row",
146
- alignContent: "flex-start",
147
- justifyContent: "space-between",
148
- },
149
- sectionTitle: {
150
- fontFamily: "sf-bold",
151
- fontSize: 24,
152
- color: Colours.TEXT_DARKEST,
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 = (state) => {
157
- const { user, notifications } = state;
158
- const jobs = state[values.reducerKey];
159
- return {
160
- colourBrandingMain: Colours.getMainBrandingColourFromState(state),
161
- jobs: _.orderBy(jobs.jobs, ["createdUnix"], ["desc"]),
162
- site: user.site,
163
- userCategory: user.category,
164
- dataUpdated: notifications.dataUpdated[values.updateKey],
165
- strings: state.strings?.config || {},
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);
@@ -1,29 +1,5 @@
1
1
  // import * as PlussCore from '../../pluss-core/src';
2
- import * as PlussCore from "@plusscommunities/pluss-core-app";
2
+ import * as PlussCore from '@plusscommunities/pluss-core-app';
3
3
 
4
- const {
5
- Apis,
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 };
@@ -1,73 +1,73 @@
1
1
  // import * as PlussCore from '../../pluss-core/src';
2
- import * as PlussCore from "@plusscommunities/pluss-core-app";
3
- import { values } from "./values.config";
2
+ import * as PlussCore from '@plusscommunities/pluss-core-app';
3
+ import { values } from './values.config';
4
4
 
5
5
  export const Services = {
6
- navigation: null,
6
+ navigation: null,
7
7
  };
8
8
 
9
9
  export const BaseComponents = {
10
- NotificationBell: null,
10
+ NotificationBell: null,
11
11
  };
12
12
 
13
13
  const FeatureConfig = {
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
- },
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 "./core.config";
1
+ import { Colours } from './core.config';
2
2
 
3
- const STATUS_NOT_ACTIONED = "Not Actioned";
4
- const STATUS_IN_PROGRESS = "In Progress";
5
- const STATUS_COMPLETED = "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
- 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
- },
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
- 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
- },
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
- const statusOptions = getJobStatusOptions(props);
55
- // console.log('getJobStatus', JSON.stringify({ status, statusOptions }, null, 2));
56
- let statusOption = null;
57
- if (status) statusOption = statusOptions.find((s) => s.text === status);
58
- return statusOption || getDefaultJobStatuses(props)[0];
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((p) => p.default);
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
- jobStatusOptions,
69
- jobPriorityOptions,
70
- getJobStatusOptions,
71
- getDefaultJobStatuses,
72
- getIncompleteJobStatuses,
73
- getJobStatus,
74
- getJobPriority,
75
- getDefaultJobPriority,
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 "./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";
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
- const reducers = {};
12
- reducers[values.reducerKey] = JobsReducer;
13
- return reducers;
11
+ const reducers = {};
12
+ reducers[values.reducerKey] = JobsReducer;
13
+ return reducers;
14
14
  })();
15
15
  export const Screens = (() => {
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;
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 "./feature.config";
26
- export { default as WidgetSmall } from "./components/WidgetSmall";
27
- export { default as WidgetLarge } from "./components/WidgetLarge";
25
+ export { default as Config } from './feature.config';
26
+ export { default as WidgetSmall } from './components/WidgetSmall';
27
+ export { default as WidgetLarge } from './components/WidgetLarge';