@plusscommunities/pluss-maintenance-web-forms 1.2.4-beta.0 → 1.2.4-beta.2
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/{index.esm.js → index.js} +3161 -2629
- package/dist/index.js.map +1 -0
- package/package.json +13 -20
- package/.babelrc +0 -3
- package/dist/index.cjs.js +0 -6232
- package/dist/index.umd.js +0 -6225
- package/rollup.config.js +0 -59
- package/src/actions/JobsActions.js +0 -150
- package/src/actions/index.js +0 -1
- package/src/actions/types.js +0 -8
- package/src/apis/index.js +0 -10
- package/src/apis/maintenanceActions.js +0 -203
- package/src/apis/reactionActions.js +0 -46
- package/src/components/ActivityText.js +0 -57
- package/src/components/AnalyticsHub.js +0 -167
- package/src/components/Configuration.js +0 -392
- package/src/components/JobList.js +0 -1108
- package/src/components/JobTypes.js +0 -198
- package/src/components/PreviewFull.js +0 -33
- package/src/components/PreviewGrid.js +0 -29
- package/src/components/PreviewWidget.js +0 -35
- package/src/components/ViewFull.js +0 -25
- package/src/components/ViewWidget.js +0 -23
- package/src/feature.config.js +0 -127
- package/src/helper/index.js +0 -26
- package/src/images/forms/full.png +0 -0
- package/src/images/forms/fullNoTitle.png +0 -0
- package/src/images/forms/previewWidget.png +0 -0
- package/src/images/forms/widget.png +0 -0
- package/src/images/full.png +0 -0
- package/src/images/fullNoTitle.png +0 -0
- package/src/images/previewWidget.png +0 -0
- package/src/images/widget.png +0 -0
- package/src/index.js +0 -29
- package/src/maintenancePriority.json +0 -5
- package/src/maintenanceStatus.json +0 -20
- package/src/reducers/MaintenanceReducer.js +0 -49
- package/src/screens/AddJob.js +0 -1138
- package/src/screens/AddJobType.js +0 -865
- package/src/screens/Job.js +0 -1531
- package/src/screens/RequestsHub.js +0 -237
- package/src/values.config.a.js +0 -63
- package/src/values.config.default.js +0 -75
- package/src/values.config.enquiry.js +0 -76
- package/src/values.config.feedback.js +0 -74
- package/src/values.config.food.js +0 -74
- package/src/values.config.forms.js +0 -74
- package/src/values.config.js +0 -74
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
import React, { Component } from 'react';
|
|
2
|
-
import { Table } from 'react-bootstrap';
|
|
3
|
-
import { connect } from 'react-redux';
|
|
4
|
-
import _ from 'lodash';
|
|
5
|
-
import FontAwesome from 'react-fontawesome';
|
|
6
|
-
import { withRouter } from 'react-router';
|
|
7
|
-
import { Link } from 'react-router-dom';
|
|
8
|
-
import { jobTypesLoaded, jobTypesUpdate } from '../actions';
|
|
9
|
-
import { maintenanceActions } from '../apis';
|
|
10
|
-
import Config, { PlussCore } from '../feature.config';
|
|
11
|
-
import { values } from '../values.config';
|
|
12
|
-
|
|
13
|
-
const { Session, Components } = PlussCore;
|
|
14
|
-
|
|
15
|
-
class JobTypes extends Component {
|
|
16
|
-
constructor(props) {
|
|
17
|
-
super(props);
|
|
18
|
-
this.state = {
|
|
19
|
-
jobList: [],
|
|
20
|
-
sortColumn: 'name',
|
|
21
|
-
sortDesc: false,
|
|
22
|
-
loading: true,
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
componentWillMount() {
|
|
27
|
-
this.updateProps(this.props);
|
|
28
|
-
Session.checkLoggedIn(this, this.props.auth);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
componentDidMount() {
|
|
32
|
-
this.getJobTypes();
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
componentWillReceiveProps(nextProps) {
|
|
36
|
-
this.updateProps(nextProps);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
updateProps(props) {
|
|
40
|
-
this.setState({ jobList: props.jobtypes });
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
getJobTypes = async () => {
|
|
44
|
-
try {
|
|
45
|
-
const res = await maintenanceActions.getJobTypes(this.props.auth.site);
|
|
46
|
-
if (res.data != null) this.props.jobTypesLoaded(res.data);
|
|
47
|
-
} catch (error) {
|
|
48
|
-
console.error('getJobTypes', error);
|
|
49
|
-
} finally {
|
|
50
|
-
this.setState({ loading: false });
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
sortByCol = (col) => {
|
|
55
|
-
if (this.state.sortColumn === col) {
|
|
56
|
-
this.setState({ sortDesc: !this.state.sortDesc });
|
|
57
|
-
} else {
|
|
58
|
-
this.setState({ sortColumn: col, sortDesc: false });
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
onRemoveJobType = async (ev) => {
|
|
63
|
-
if (!window.confirm(`Are you sure you want to delete ${ev.typeName}?`)) return;
|
|
64
|
-
|
|
65
|
-
try {
|
|
66
|
-
await maintenanceActions.deleteJobType(this.props.auth.site, ev.id);
|
|
67
|
-
const index = _.findIndex(this.state.jobList, (job) => {
|
|
68
|
-
return job != null && job.id === ev.id;
|
|
69
|
-
});
|
|
70
|
-
if (index > -1) {
|
|
71
|
-
const newJobTypes = [...this.state.jobList];
|
|
72
|
-
newJobTypes[index].Deleted = true;
|
|
73
|
-
this.props.jobTypesLoaded(newJobTypes);
|
|
74
|
-
}
|
|
75
|
-
} catch (error) {
|
|
76
|
-
console.error('onRemoveJobType', error);
|
|
77
|
-
alert('Something went wrong with the request. Please try again.');
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
renderList() {
|
|
82
|
-
let source = _.sortBy(this.state.jobList, this.state.sortColumn);
|
|
83
|
-
if (this.state.sortDesc) source.reverse();
|
|
84
|
-
source = _.filter(source, (ev) => {
|
|
85
|
-
if (!ev) return false;
|
|
86
|
-
if (ev.Deleted) return false;
|
|
87
|
-
return true;
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
return source.map((ev, index) => {
|
|
91
|
-
if (ev != null) {
|
|
92
|
-
return (
|
|
93
|
-
<tr key={index}>
|
|
94
|
-
<td className="table-TitleColumn">
|
|
95
|
-
<Link to={`${values.routeAddRequestType}/${ev.id}`}>{ev.typeName}</Link>
|
|
96
|
-
</td>
|
|
97
|
-
<td>{ev.description}</td>
|
|
98
|
-
<td>{ev.email}</td>
|
|
99
|
-
<td className="table-options">
|
|
100
|
-
<div style={{ display: 'flex', alignItems: 'center' }}>
|
|
101
|
-
{Session.validateAccess(this.props.auth.site, values.permissionMaintenanceTypes, this.props.auth) && (
|
|
102
|
-
<Link to={`${values.routeAddRequestType}/${ev.id}`}>
|
|
103
|
-
<FontAwesome style={{ fontSize: 20, padding: 5, marginLeft: 12, cursor: 'pointer' }} name="pencil" />
|
|
104
|
-
</Link>
|
|
105
|
-
)}
|
|
106
|
-
{Session.validateAccess(this.props.auth.site, values.permissionMaintenanceTypes, this.props.auth) && (
|
|
107
|
-
<a onClick={() => this.onRemoveJobType(ev)}>
|
|
108
|
-
<FontAwesome style={{ fontSize: 20, padding: 5, marginLeft: 8, cursor: 'pointer' }} name="minus-circle" />
|
|
109
|
-
</a>
|
|
110
|
-
)}
|
|
111
|
-
</div>
|
|
112
|
-
</td>
|
|
113
|
-
</tr>
|
|
114
|
-
);
|
|
115
|
-
}
|
|
116
|
-
return null;
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
renderView() {
|
|
121
|
-
return (
|
|
122
|
-
<Table className="plussTable" striped bordered condensed hover style={{ minWidth: '100%' }}>
|
|
123
|
-
<thead>
|
|
124
|
-
<tr>
|
|
125
|
-
<th style={{ cursor: 'pointer' }} onClick={() => this.sortByCol('name')}>
|
|
126
|
-
{values.textSingularName} type
|
|
127
|
-
</th>
|
|
128
|
-
<th style={{ cursor: 'pointer' }} onClick={() => this.sortByCol('name')}>
|
|
129
|
-
Type Description
|
|
130
|
-
</th>
|
|
131
|
-
<th style={{ cursor: 'pointer' }} onClick={() => this.sortByCol('email')}>
|
|
132
|
-
Email
|
|
133
|
-
</th>
|
|
134
|
-
<th style={{ width: 70 }} />
|
|
135
|
-
</tr>
|
|
136
|
-
</thead>
|
|
137
|
-
<tbody>{this.renderList()}</tbody>
|
|
138
|
-
</Table>
|
|
139
|
-
);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
renderEmpty() {
|
|
143
|
-
return (
|
|
144
|
-
<div style={{ display: 'flex', flexDirection: 'column', flex: 1, justifyContent: 'center', alignItems: 'center', marginTop: 32 }}>
|
|
145
|
-
<div className="emptyState" />
|
|
146
|
-
<div className="marginTop-32" style={{ maxWidth: 500, textAlign: 'center' }}>
|
|
147
|
-
<span className="fontRegular fontSize-13">{values.textEmptyJobTypes}</span>
|
|
148
|
-
</div>
|
|
149
|
-
<div className="marginTop-8 fontRegular fontSize-13" style={{ maxWidth: 500, textAlign: 'center' }}>
|
|
150
|
-
{values.textEmptyJobTypesExample}
|
|
151
|
-
</div>
|
|
152
|
-
</div>
|
|
153
|
-
);
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
renderContent() {
|
|
157
|
-
if (_.isEmpty(this.state.jobList)) return this.renderEmpty();
|
|
158
|
-
return this.renderView();
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
renderJobTypes() {
|
|
162
|
-
const { jobList, loading } = this.state;
|
|
163
|
-
|
|
164
|
-
if (jobList.length === 0 && loading) {
|
|
165
|
-
return (
|
|
166
|
-
<div style={{ minWidth: '100%' }}>
|
|
167
|
-
<div className="padding-60 paddingVertical-40" style={{ textAlign: 'center' }}>
|
|
168
|
-
<FontAwesome style={{ fontSize: 30, color: Config.env.colourBrandingOff }} name="spinner fa-pulse fa-fw" />
|
|
169
|
-
</div>
|
|
170
|
-
</div>
|
|
171
|
-
);
|
|
172
|
-
}
|
|
173
|
-
return (
|
|
174
|
-
<div style={{ minWidth: '100%' }}>
|
|
175
|
-
<div className="marginBottom-32">
|
|
176
|
-
<Components.AddButton onClick={this.props.onNew} text={values.textNewTypeButton} />
|
|
177
|
-
</div>
|
|
178
|
-
{this.renderContent()}
|
|
179
|
-
</div>
|
|
180
|
-
);
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
render() {
|
|
184
|
-
return (
|
|
185
|
-
<div style={{ minWidth: '100%' }}>
|
|
186
|
-
<div>{this.renderJobTypes()}</div>
|
|
187
|
-
<div className="hub_tidioPadding"></div>
|
|
188
|
-
</div>
|
|
189
|
-
);
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
const mapStateToProps = (state) => {
|
|
194
|
-
const { auth } = state;
|
|
195
|
-
return { jobtypes: state[values.reducerKey].jobtypes, auth };
|
|
196
|
-
};
|
|
197
|
-
|
|
198
|
-
export default connect(mapStateToProps, { jobTypesLoaded, jobTypesUpdate })(withRouter(JobTypes));
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import React, { Component } from 'react';
|
|
2
|
-
import fullNoTitle from '../images/fullNoTitle.png';
|
|
3
|
-
import fullNoTitleForms from '../images/forms/fullNoTitle.png';
|
|
4
|
-
import { values } from '../values.config';
|
|
5
|
-
|
|
6
|
-
class PreviewFull extends Component {
|
|
7
|
-
render() {
|
|
8
|
-
const { backgroundColor, widgetTitle, titleClassName } = this.props;
|
|
9
|
-
|
|
10
|
-
let src = fullNoTitle;
|
|
11
|
-
if (values.featureKey === 'maintenanceForms') {
|
|
12
|
-
src = fullNoTitleForms;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
return (
|
|
16
|
-
<div style={styles.container}>
|
|
17
|
-
<p className={titleClassName}>{widgetTitle}</p>
|
|
18
|
-
<img style={{ ...styles.image, backgroundColor }} src={src} alt="fullNoTitle" />
|
|
19
|
-
</div>
|
|
20
|
-
);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const styles = {
|
|
25
|
-
container: {
|
|
26
|
-
position: 'relative',
|
|
27
|
-
},
|
|
28
|
-
image: {
|
|
29
|
-
width: '100%',
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export default PreviewFull;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import React, { Component } from 'react';
|
|
2
|
-
import { values } from '../values.config';
|
|
3
|
-
|
|
4
|
-
const SVG_PATH = values.svgPathGridIcon;
|
|
5
|
-
const SVG_VIEWBOX = values.svgPathGridIconViewBox || '0 0 30 30';
|
|
6
|
-
|
|
7
|
-
class PreviewGrid extends Component {
|
|
8
|
-
render() {
|
|
9
|
-
const { colour } = this.props;
|
|
10
|
-
|
|
11
|
-
if (Array.isArray(SVG_PATH)) {
|
|
12
|
-
return (
|
|
13
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox={SVG_VIEWBOX}>
|
|
14
|
-
{SVG_PATH.map((p) => {
|
|
15
|
-
return <path key={p.substring(0, 20)} d={p} fill={colour} />;
|
|
16
|
-
})}
|
|
17
|
-
</svg>
|
|
18
|
-
);
|
|
19
|
-
} else {
|
|
20
|
-
return (
|
|
21
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox={SVG_VIEWBOX}>
|
|
22
|
-
<path key={SVG_PATH.substring(0, 20)} d={SVG_PATH} fill={colour} />
|
|
23
|
-
</svg>
|
|
24
|
-
);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export default PreviewGrid;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import React, { Component } from 'react';
|
|
2
|
-
import previewWidget from '../images/previewWidget.png';
|
|
3
|
-
import previewWidgetForms from '../images/forms/previewWidget.png';
|
|
4
|
-
import { values } from '../values.config';
|
|
5
|
-
|
|
6
|
-
class PreviewWidget extends Component {
|
|
7
|
-
render() {
|
|
8
|
-
const { backgroundColor, widgetTitle, titleClassName } = this.props;
|
|
9
|
-
|
|
10
|
-
let src = previewWidget;
|
|
11
|
-
if (values.featureKey === 'maintenanceForms') {
|
|
12
|
-
src = previewWidgetForms;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
return (
|
|
16
|
-
<div style={styles.container}>
|
|
17
|
-
<img style={{ ...styles.image, backgroundColor }} src={src} alt="previewWidget" />
|
|
18
|
-
<p className={titleClassName} style={styles.title}>
|
|
19
|
-
{widgetTitle}
|
|
20
|
-
</p>
|
|
21
|
-
</div>
|
|
22
|
-
);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const styles = {
|
|
27
|
-
container: {
|
|
28
|
-
position: 'relative',
|
|
29
|
-
},
|
|
30
|
-
image: {
|
|
31
|
-
width: '100%',
|
|
32
|
-
},
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export default PreviewWidget;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React, { Component } from 'react';
|
|
2
|
-
import full from '../images/full.png';
|
|
3
|
-
import fullForms from '../images/forms/full.png';
|
|
4
|
-
import { values } from '../values.config';
|
|
5
|
-
|
|
6
|
-
class ViewFull extends Component {
|
|
7
|
-
render() {
|
|
8
|
-
let src = full;
|
|
9
|
-
if (values.featureKey === 'maintenanceForms') {
|
|
10
|
-
src = fullForms;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
return <img style={styles.image} src={src} alt="full" />;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const styles = {
|
|
18
|
-
image: {
|
|
19
|
-
width: '100%',
|
|
20
|
-
height: '100%',
|
|
21
|
-
objectFit: 'contain',
|
|
22
|
-
},
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export default ViewFull;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React, { Component } from 'react';
|
|
2
|
-
import widget from '../images/widget.png';
|
|
3
|
-
import widgetForms from '../images/forms/widget.png';
|
|
4
|
-
import { values } from '../values.config';
|
|
5
|
-
|
|
6
|
-
class ViewWidget extends Component {
|
|
7
|
-
render() {
|
|
8
|
-
let src = widget;
|
|
9
|
-
if (values.featureKey === 'maintenanceForms') {
|
|
10
|
-
src = widgetForms;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
return <img style={styles.image} src={src} alt="widget" />;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const styles = {
|
|
18
|
-
image: {
|
|
19
|
-
width: 80,
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export default ViewWidget;
|
package/src/feature.config.js
DELETED
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
// import * as PlussCore from '../../pluss-core/src';
|
|
2
|
-
import * as PlussCore from '@plusscommunities/pluss-core-web';
|
|
3
|
-
import { values } from './values.config';
|
|
4
|
-
|
|
5
|
-
export { PlussCore };
|
|
6
|
-
|
|
7
|
-
const FeatureConfig = {
|
|
8
|
-
key: values.featureKey,
|
|
9
|
-
aliases: values.aliases,
|
|
10
|
-
singularName: values.textSingularName,
|
|
11
|
-
description: 'Submit maintenance requests and track the progress.',
|
|
12
|
-
emptyText: values.textYourRequestHere,
|
|
13
|
-
widgetOptions: [
|
|
14
|
-
{
|
|
15
|
-
key: values.featureKey,
|
|
16
|
-
widget: true,
|
|
17
|
-
main: true,
|
|
18
|
-
hideOnTabNumbers: [],
|
|
19
|
-
optionKey: values.optionOnlyForResidents,
|
|
20
|
-
type: 'toggle',
|
|
21
|
-
inverseOption: false,
|
|
22
|
-
title: 'Limit Admins to Only Submit on Behalf of Primary Users',
|
|
23
|
-
description:
|
|
24
|
-
'This will limit admins to only make a submission on behalf of a primary users in the site. Otherwise they can also submit on behalf of other admins/staff users.',
|
|
25
|
-
defaultNew: false,
|
|
26
|
-
default: false,
|
|
27
|
-
},
|
|
28
|
-
],
|
|
29
|
-
menu: {
|
|
30
|
-
order: values.menuOrder,
|
|
31
|
-
text: values.textMenuTitle,
|
|
32
|
-
icon: values.menuIcon,
|
|
33
|
-
isFontAwesome: values.isFontAwesomeIcon,
|
|
34
|
-
isSVGIcon: values.isSVGIcon,
|
|
35
|
-
url: values.routeRequestsHub,
|
|
36
|
-
countProps: null,
|
|
37
|
-
visibleExps: {
|
|
38
|
-
type: 'and',
|
|
39
|
-
exps: [
|
|
40
|
-
{ type: 'feature', value: values.featureKey },
|
|
41
|
-
{
|
|
42
|
-
type: 'or',
|
|
43
|
-
exps: [
|
|
44
|
-
{ type: 'permission', value: values.permissionMaintenanceTracking },
|
|
45
|
-
{ type: 'permission', value: values.permissionMaintenanceTypes },
|
|
46
|
-
{ type: 'permission', value: values.permissionMaintenanceAssignment },
|
|
47
|
-
],
|
|
48
|
-
},
|
|
49
|
-
],
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
addUrl: values.routeAddRequest,
|
|
53
|
-
addPermission: values.permissionMaintenanceTracking,
|
|
54
|
-
activities: [
|
|
55
|
-
values.activityMaintenanceJobStatusChanged,
|
|
56
|
-
values.activityAddMaintenanceJob,
|
|
57
|
-
values.activityEditMaintenanceJob,
|
|
58
|
-
values.activityDeleteMaintenanceJob,
|
|
59
|
-
],
|
|
60
|
-
permissions: [
|
|
61
|
-
{
|
|
62
|
-
displayName: values.textPermissionMaintenanceTracking,
|
|
63
|
-
key: values.permissionMaintenanceTracking,
|
|
64
|
-
hq: false,
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
displayName: values.textPermissionManageMaintenanceTypes,
|
|
68
|
-
key: values.permissionMaintenanceTypes,
|
|
69
|
-
hq: false,
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
displayName: values.textPermissionManageAssignedMaintenance,
|
|
73
|
-
key: values.permissionMaintenanceAssignment,
|
|
74
|
-
hq: false,
|
|
75
|
-
},
|
|
76
|
-
],
|
|
77
|
-
hiddenSections: [
|
|
78
|
-
{
|
|
79
|
-
displayName: values.textHiddenSectionMaintenanceRequests,
|
|
80
|
-
key: values.keyHiddenSectionMaintenanceRequests,
|
|
81
|
-
defaultNew: false,
|
|
82
|
-
default: false,
|
|
83
|
-
},
|
|
84
|
-
],
|
|
85
|
-
moreSections: values.hasMoreSection
|
|
86
|
-
? [
|
|
87
|
-
{
|
|
88
|
-
displayName: values.textMoreSectionMaintenance,
|
|
89
|
-
featureKey: values.featureKeyMoreSectionMaintenance,
|
|
90
|
-
optionKey: values.optionKeyMoreSectionMaintenance,
|
|
91
|
-
hiddenKey: values.hiddenKeyMoreSectionMaintenance,
|
|
92
|
-
inverseOption: true,
|
|
93
|
-
},
|
|
94
|
-
]
|
|
95
|
-
: [],
|
|
96
|
-
routes: [
|
|
97
|
-
{ path: values.routeRequestsHub, component: values.screenRequestsHub, exact: false },
|
|
98
|
-
{ path: values.routeAddRequest, component: values.screenAddJob, exact: true },
|
|
99
|
-
{ path: `${values.routeAddRequest}/:jobId`, component: values.screenAddJob, exact: true },
|
|
100
|
-
{ path: `${values.routeRequestDetails}/:jobId`, component: values.screenJob, exact: true },
|
|
101
|
-
{ path: values.routeRequestTypes, component: values.screenJobTypes, exact: false },
|
|
102
|
-
{ path: values.routeAddRequestType, component: values.screenAddJobType, exact: true },
|
|
103
|
-
{ path: `${values.routeAddRequestType}/:jobTypeId`, component: values.screenAddJobType, exact: true },
|
|
104
|
-
],
|
|
105
|
-
env: {
|
|
106
|
-
baseStage: '',
|
|
107
|
-
baseAPIUrl: '',
|
|
108
|
-
baseUploadsUrl: '',
|
|
109
|
-
uploadBucket: '',
|
|
110
|
-
colourBrandingMain: '',
|
|
111
|
-
colourBrandingOff: '',
|
|
112
|
-
colourBrandingApp: '',
|
|
113
|
-
defaultProfileImage: '',
|
|
114
|
-
utcOffset: '',
|
|
115
|
-
hasAvailableNews: false,
|
|
116
|
-
newsHaveTags: true,
|
|
117
|
-
defaultAllowComments: true,
|
|
118
|
-
makeApiKey: '',
|
|
119
|
-
logo: '',
|
|
120
|
-
clientName: '',
|
|
121
|
-
},
|
|
122
|
-
init: (environment) => {
|
|
123
|
-
FeatureConfig.env = environment;
|
|
124
|
-
PlussCore.Config.init(environment);
|
|
125
|
-
},
|
|
126
|
-
};
|
|
127
|
-
export default FeatureConfig;
|
package/src/helper/index.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import jobStatusOptions from '../maintenanceStatus.json';
|
|
2
|
-
import jobPriorityOptions from '../maintenancePriority.json';
|
|
3
|
-
|
|
4
|
-
const STATUS_IMCOMPLETE = 'All Incomplete';
|
|
5
|
-
const STATUS_NOT_ACTIONED = 'Not Actioned';
|
|
6
|
-
const STATUS_IN_PROGRESS = 'In Progress';
|
|
7
|
-
const STATUS_COMPLETED = 'Completed';
|
|
8
|
-
|
|
9
|
-
const getDefaultPriority = () => jobPriorityOptions.find((p) => p.default);
|
|
10
|
-
|
|
11
|
-
const getJobPriority = (priority) => {
|
|
12
|
-
let priorityOption = null;
|
|
13
|
-
if (priority) priorityOption = jobPriorityOptions.find((p) => p.name === priority);
|
|
14
|
-
return priorityOption || getDefaultPriority();
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export {
|
|
18
|
-
STATUS_IMCOMPLETE,
|
|
19
|
-
STATUS_NOT_ACTIONED,
|
|
20
|
-
STATUS_IN_PROGRESS,
|
|
21
|
-
STATUS_COMPLETED,
|
|
22
|
-
jobStatusOptions,
|
|
23
|
-
jobPriorityOptions,
|
|
24
|
-
getDefaultPriority,
|
|
25
|
-
getJobPriority,
|
|
26
|
-
};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/src/images/full.png
DELETED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/src/images/widget.png
DELETED
|
Binary file
|
package/src/index.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import RequestsHub from './screens/RequestsHub';
|
|
2
|
-
import Job from './screens/Job';
|
|
3
|
-
import AddJob from './screens/AddJob';
|
|
4
|
-
import AddJobType from './screens/AddJobType.js';
|
|
5
|
-
import { AnalyticsHub } from './components/AnalyticsHub.js';
|
|
6
|
-
import MaintenanceReducer from './reducers/MaintenanceReducer';
|
|
7
|
-
import { values } from './values.config';
|
|
8
|
-
|
|
9
|
-
export const Reducers = (() => {
|
|
10
|
-
const reducers = {};
|
|
11
|
-
reducers[values.reducerKey] = MaintenanceReducer;
|
|
12
|
-
return reducers;
|
|
13
|
-
})();
|
|
14
|
-
export const Screens = (() => {
|
|
15
|
-
const screens = {};
|
|
16
|
-
screens[values.screenRequestsHub] = RequestsHub;
|
|
17
|
-
screens[values.screenJob] = Job;
|
|
18
|
-
screens[values.screenAddJob] = AddJob;
|
|
19
|
-
screens[values.screenAddJobType] = AddJobType;
|
|
20
|
-
return screens;
|
|
21
|
-
})();
|
|
22
|
-
export { default as Config } from './feature.config';
|
|
23
|
-
export { default as ActivityText } from './components/ActivityText';
|
|
24
|
-
export { default as ViewWidget } from './components/ViewWidget';
|
|
25
|
-
export { default as ViewFull } from './components/ViewFull';
|
|
26
|
-
export { default as PreviewWidget } from './components/PreviewWidget';
|
|
27
|
-
export { default as PreviewFull } from './components/PreviewFull';
|
|
28
|
-
export { default as PreviewGrid } from './components/PreviewGrid';
|
|
29
|
-
export const Analytics = [AnalyticsHub];
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"text": "Open",
|
|
4
|
-
"order": 0,
|
|
5
|
-
"color": "#d5dde4",
|
|
6
|
-
"category": "Not Actioned"
|
|
7
|
-
},
|
|
8
|
-
{
|
|
9
|
-
"text": "In Progress",
|
|
10
|
-
"order": 1,
|
|
11
|
-
"color": "#82d6e5",
|
|
12
|
-
"category": "In Progress"
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
"text": "Completed",
|
|
16
|
-
"order": 2,
|
|
17
|
-
"color": "#58dba4",
|
|
18
|
-
"category": "Completed"
|
|
19
|
-
}
|
|
20
|
-
]
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import _ from 'lodash';
|
|
2
|
-
import { JOBS_LOADED, JOBS_REMOVED, JOBS_LOADING, JOBS_TYPES_LOADED, JOBS_STATUSES_LOADED, JOBS_HIDE_SEEN } from '../actions/types';
|
|
3
|
-
import { jobStatusOptions } from '../helper';
|
|
4
|
-
|
|
5
|
-
const INITIAL_STATE = {
|
|
6
|
-
jobs: [],
|
|
7
|
-
jobtypes: [],
|
|
8
|
-
jobstatuses: jobStatusOptions,
|
|
9
|
-
loading: false,
|
|
10
|
-
hideSeen: false,
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export default (state = INITIAL_STATE, action) => {
|
|
14
|
-
switch (action.type) {
|
|
15
|
-
case JOBS_LOADING:
|
|
16
|
-
return { ...state, loading: true };
|
|
17
|
-
case JOBS_LOADED:
|
|
18
|
-
const result = _.unionWith(action.payload, state.jobs, (v1, v2) => {
|
|
19
|
-
return v1 != null && v2 != null && v1.id === v2.id;
|
|
20
|
-
});
|
|
21
|
-
return {
|
|
22
|
-
...state,
|
|
23
|
-
jobs: result.map((job) => ({ title: job.title || job.description, ...job })),
|
|
24
|
-
loading: false,
|
|
25
|
-
};
|
|
26
|
-
case JOBS_REMOVED:
|
|
27
|
-
const index = _.findIndex(state.jobs, (event) => {
|
|
28
|
-
return event != null && event.id === action.payload;
|
|
29
|
-
});
|
|
30
|
-
if (index > -1) {
|
|
31
|
-
const newJobs = [...state.jobs];
|
|
32
|
-
newJobs.splice(index, 1);
|
|
33
|
-
return { ...state, jobs: newJobs };
|
|
34
|
-
}
|
|
35
|
-
return state;
|
|
36
|
-
case JOBS_TYPES_LOADED:
|
|
37
|
-
const jobtypes = _.unionWith(action.payload, state.jobtypes, (v1, v2) => {
|
|
38
|
-
return v1 != null && v2 != null && v1.id === v2.id;
|
|
39
|
-
});
|
|
40
|
-
return { ...state, jobtypes };
|
|
41
|
-
case JOBS_STATUSES_LOADED:
|
|
42
|
-
const jobstatuses = _.orderBy(action.payload, 'order', 'asc');
|
|
43
|
-
return { ...state, jobstatuses };
|
|
44
|
-
case JOBS_HIDE_SEEN:
|
|
45
|
-
return { ...state, hideSeen: action.payload };
|
|
46
|
-
default:
|
|
47
|
-
return state;
|
|
48
|
-
}
|
|
49
|
-
};
|