@plusscommunities/pluss-maintenance-app 6.1.2-beta.0 → 7.0.0-auth.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 +44 -1
- package/dist/module/actions/JobActions.js.map +1 -1
- package/dist/module/actions/types.js +3 -0
- package/dist/module/actions/types.js.map +1 -1
- package/dist/module/apis/index.js +3 -1
- package/dist/module/apis/index.js.map +1 -1
- package/dist/module/apis/{generalActions.js → maintenanceActions.js} +44 -45
- package/dist/module/apis/maintenanceActions.js.map +1 -0
- package/dist/module/components/FilterPopupMenu.js +78 -26
- package/dist/module/components/FilterPopupMenu.js.map +1 -1
- package/dist/module/components/MaintenanceList.js +70 -45
- package/dist/module/components/MaintenanceList.js.map +1 -1
- package/dist/module/components/MaintenanceListItem.js +54 -42
- package/dist/module/components/MaintenanceListItem.js.map +1 -1
- package/dist/module/components/MaintenanceWidgetItem.js +16 -20
- package/dist/module/components/MaintenanceWidgetItem.js.map +1 -1
- package/dist/module/components/PrioritySelectorPopup.js +82 -0
- package/dist/module/components/PrioritySelectorPopup.js.map +1 -0
- package/dist/module/components/StatusSelectorPopup.js +9 -13
- package/dist/module/components/StatusSelectorPopup.js.map +1 -1
- package/dist/module/components/WidgetSmall.js +13 -9
- package/dist/module/components/WidgetSmall.js.map +1 -1
- package/dist/module/feature.config.js +3 -3
- package/dist/module/feature.config.js.map +1 -1
- package/dist/module/helper.js +39 -17
- package/dist/module/helper.js.map +1 -1
- package/dist/module/reducers/JobsReducer.js +33 -3
- package/dist/module/reducers/JobsReducer.js.map +1 -1
- package/dist/module/screens/JobTypePicker.js +3 -3
- package/dist/module/screens/JobTypePicker.js.map +1 -1
- package/dist/module/screens/MaintenancePage.js +2 -2
- package/dist/module/screens/RequestDetail.js +340 -88
- package/dist/module/screens/RequestDetail.js.map +1 -1
- package/dist/module/screens/RequestNotes.js +437 -26
- package/dist/module/screens/RequestNotes.js.map +1 -1
- package/dist/module/screens/ServiceRequest.js +596 -93
- package/dist/module/screens/ServiceRequest.js.map +1 -1
- package/dist/module/values.config.a.js +9 -1
- package/dist/module/values.config.a.js.map +1 -1
- package/dist/module/values.config.default.js +15 -1
- package/dist/module/values.config.default.js.map +1 -1
- package/dist/module/values.config.forms.js +42 -0
- package/dist/module/values.config.forms.js.map +1 -0
- package/dist/module/values.config.js +15 -1
- package/dist/module/values.config.js.map +1 -1
- package/package.json +16 -12
- package/src/actions/JobActions.js +53 -1
- package/src/actions/types.js +4 -0
- package/src/apis/index.js +5 -1
- package/src/apis/{generalActions.js → maintenanceActions.js} +51 -43
- package/src/components/FilterPopupMenu.js +75 -24
- package/src/components/MaintenanceList.js +64 -33
- package/src/components/MaintenanceListItem.js +53 -31
- package/src/components/MaintenanceWidgetItem.js +18 -14
- package/src/components/PrioritySelectorPopup.js +79 -0
- package/src/components/StatusSelectorPopup.js +8 -13
- package/src/components/WidgetSmall.js +9 -7
- package/src/feature.config.js +15 -13
- package/src/helper.js +51 -13
- package/src/reducers/JobsReducer.js +27 -2
- package/src/screens/JobTypePicker.js +1 -1
- package/src/screens/RequestDetail.js +324 -75
- package/src/screens/RequestNotes.js +434 -33
- package/src/screens/ServiceRequest.js +642 -157
- package/src/values.config.a.js +8 -0
- package/src/values.config.default.js +14 -0
- package/src/values.config.forms.js +42 -0
- package/src/values.config.js +14 -0
- package/dist/module/apis/generalActions.js.map +0 -1
- package/dist/module/values.config.b.js +0 -28
- package/dist/module/values.config.b.js.map +0 -1
- package/dist/module/values.config.c.js +0 -28
- package/dist/module/values.config.c.js.map +0 -1
- package/dist/module/values.config.d.js +0 -28
- package/dist/module/values.config.d.js.map +0 -1
- package/src/values.config.b.js +0 -28
- package/src/values.config.c.js +0 -28
- package/src/values.config.d.js +0 -28
package/src/helper.js
CHANGED
@@ -1,30 +1,68 @@
|
|
1
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';
|
6
|
+
|
3
7
|
const jobStatusOptions = [
|
4
8
|
{
|
5
|
-
|
9
|
+
text: 'Open',
|
10
|
+
order: 0,
|
6
11
|
color: Colours.LINEGREY,
|
12
|
+
category: STATUS_NOT_ACTIONED,
|
7
13
|
},
|
8
14
|
{
|
9
|
-
|
15
|
+
text: 'In Progress',
|
16
|
+
order: 1,
|
10
17
|
color: Colours.COLOUR_TEAL,
|
18
|
+
category: STATUS_IN_PROGRESS,
|
11
19
|
},
|
12
20
|
{
|
13
|
-
|
21
|
+
text: 'Completed',
|
22
|
+
order: 2,
|
14
23
|
color: Colours.COLOUR_GREEN_LIGHT,
|
24
|
+
category: STATUS_COMPLETED,
|
15
25
|
},
|
16
26
|
];
|
17
27
|
|
18
|
-
const
|
19
|
-
|
20
|
-
|
21
|
-
|
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
|
+
},
|
42
|
+
];
|
22
43
|
|
23
|
-
const
|
24
|
-
const statusText = status || jobStatusOptions[0].name;
|
25
|
-
const statusColor = getJobStatusColour(statusText);
|
44
|
+
const getJobStatusOptions = props => props?.statusTypes?.length ? props?.statusTypes : jobStatusOptions;
|
26
45
|
|
27
|
-
|
28
|
-
|
46
|
+
const getDefaultJobStatuses = props => getJobStatusOptions(props).filter(s => s.category === STATUS_NOT_ACTIONED);
|
47
|
+
|
48
|
+
const getIncompleteJobStatuses = props => getJobStatusOptions(props).filter(s => s.category === STATUS_IN_PROGRESS);
|
29
49
|
|
30
|
-
|
50
|
+
const getJobStatus = (status, props) => {
|
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];
|
56
|
+
}
|
57
|
+
|
58
|
+
const getJobPriority = priority => jobPriorityOptions.find(p => p.label === priority) || jobPriorityOptions.find(p => p.default);
|
59
|
+
|
60
|
+
export {
|
61
|
+
jobStatusOptions,
|
62
|
+
jobPriorityOptions,
|
63
|
+
getJobStatusOptions,
|
64
|
+
getDefaultJobStatuses,
|
65
|
+
getIncompleteJobStatuses,
|
66
|
+
getJobStatus,
|
67
|
+
getJobPriority,
|
68
|
+
};
|
@@ -1,18 +1,30 @@
|
|
1
1
|
/* eslint-disable no-param-reassign */
|
2
2
|
import _ from 'lodash';
|
3
3
|
import { REHYDRATE } from 'redux-persist';
|
4
|
-
import { JOBS_LOADED, JOB_ADDED, JOBS_ADDED } from '../actions/types';
|
4
|
+
import { JOBS_LOADED, JOB_ADDED, JOBS_ADDED, JOBS_STATUSES_LOADED, JOBS_HIDE_SEEN, JOB_FILTER_LOADED } from '../actions/types';
|
5
5
|
import { ActionTypes } from '../core.config';
|
6
|
+
import { values } from '../values.config';
|
6
7
|
|
7
|
-
const REDUCER_KEY =
|
8
|
+
const REDUCER_KEY = values.reducerKey;
|
8
9
|
|
9
10
|
const INITIAL_STATE = {
|
10
11
|
jobs: [],
|
12
|
+
jobstatuses: [],
|
13
|
+
hideSeen: false,
|
14
|
+
jobfilters: {
|
15
|
+
status: '',
|
16
|
+
statusText: '',
|
17
|
+
priority: '',
|
18
|
+
type: '',
|
19
|
+
assignee: '',
|
20
|
+
assigneeName: '',
|
21
|
+
},
|
11
22
|
};
|
12
23
|
|
13
24
|
export default (state = INITIAL_STATE, action) => {
|
14
25
|
let updateJobs = [];
|
15
26
|
let index = 0;
|
27
|
+
let jobstatuses = [];
|
16
28
|
|
17
29
|
switch (action.type) {
|
18
30
|
case ActionTypes.LOGOUT:
|
@@ -35,6 +47,19 @@ export default (state = INITIAL_STATE, action) => {
|
|
35
47
|
updateJobs.push(action.payload);
|
36
48
|
}
|
37
49
|
return { ...state, jobs: updateJobs };
|
50
|
+
case JOBS_STATUSES_LOADED:
|
51
|
+
jobstatuses = _.orderBy(
|
52
|
+
_.unionWith(action.payload, state.jobstatuses, (v1, v2) => {
|
53
|
+
return v1 != null && v2 != null && v1.text === v2.text;
|
54
|
+
}),
|
55
|
+
'order',
|
56
|
+
'asc',
|
57
|
+
);
|
58
|
+
return { ...state, jobstatuses };
|
59
|
+
case JOBS_HIDE_SEEN:
|
60
|
+
return { ...state, hideSeen: action.payload };
|
61
|
+
case JOB_FILTER_LOADED:
|
62
|
+
return { ...state, jobfilters: action.payload };
|
38
63
|
case REHYDRATE:
|
39
64
|
if (!action.payload) return state;
|
40
65
|
if (action.payload[REDUCER_KEY]) {
|
@@ -2,7 +2,7 @@ import React, { Component } from 'react';
|
|
2
2
|
import _ from 'lodash';
|
3
3
|
import { TouchableOpacity, View, ScrollView, Text } from 'react-native';
|
4
4
|
import { connect } from 'react-redux';
|
5
|
-
import { Icon } from '
|
5
|
+
import { Icon } from '@rneui/themed';
|
6
6
|
import { Services } from '../feature.config';
|
7
7
|
import { Components, Colours } from '../core.config';
|
8
8
|
|