@plusscommunities/pluss-maintenance-web 1.0.23 → 1.0.27-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/index.cjs.js +1851 -1876
- package/dist/index.esm.js +1851 -1876
- package/dist/index.umd.js +1854 -1879
- package/package.json +6 -5
- package/src/apis/reactionActions.js +2 -1
- package/src/components/JobList.js +2 -21
- package/src/{screens → components}/JobTypes.js +5 -11
- package/src/index.js +1 -2
- package/src/screens/RequestsHub.js +51 -41
package/package.json
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plusscommunities/pluss-maintenance-web",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.27-beta.0",
|
|
4
4
|
"description": "Extension package to enable maintenance on Pluss Communities Platform",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "npm i && rollup -c",
|
|
8
|
-
"
|
|
8
|
+
"betapatch": "npm version prepatch --preid=beta",
|
|
9
9
|
"patch": "npm version patch",
|
|
10
|
+
"betaupload": "npm run build && npm publish --access public --tag beta && rm -rf node_modules",
|
|
11
|
+
"betaupload:p": "npm run betapatch && npm run betaupload",
|
|
10
12
|
"upload": "npm run build && npm publish --access public && rm -rf node_modules",
|
|
11
|
-
"upload:p": "npm run patch && npm run upload"
|
|
12
|
-
"upload:cp": "npm run core && npm run patch && npm run upload"
|
|
13
|
+
"upload:p": "npm run patch && npm run upload"
|
|
13
14
|
},
|
|
14
15
|
"author": "Phillip Suh",
|
|
15
16
|
"license": "ISC",
|
|
@@ -29,7 +30,7 @@
|
|
|
29
30
|
},
|
|
30
31
|
"dependencies": {
|
|
31
32
|
"@babel/runtime": "^7.14.0",
|
|
32
|
-
"@plusscommunities/pluss-core-web": "^1.2.
|
|
33
|
+
"@plusscommunities/pluss-core-web": "^1.2.13-beta.0",
|
|
33
34
|
"js-cookie": "^2.2.0",
|
|
34
35
|
"lodash": "^4.17.4",
|
|
35
36
|
"moment": "^2.18.1",
|
|
@@ -3,13 +3,14 @@ import { PlussCore } from '../feature.config';
|
|
|
3
3
|
const { Helper, Session } = PlussCore;
|
|
4
4
|
|
|
5
5
|
export const reactionActions = {
|
|
6
|
-
addComment: (entityId, entityType, entityName, site, comment, image) => {
|
|
6
|
+
addComment: (entityId, entityType, entityName, site, comment, image, parentId) => {
|
|
7
7
|
const data = {
|
|
8
8
|
entityId,
|
|
9
9
|
entityType,
|
|
10
10
|
entityName,
|
|
11
11
|
site,
|
|
12
12
|
comment,
|
|
13
|
+
parentId,
|
|
13
14
|
};
|
|
14
15
|
if (!_.isEmpty(image)) {
|
|
15
16
|
data.image = image;
|
|
@@ -11,7 +11,7 @@ import { PlussCore } from '../feature.config';
|
|
|
11
11
|
import { maintenanceActions } from '../apis';
|
|
12
12
|
import StatusTypes from '../maintenanceStatus.json';
|
|
13
13
|
|
|
14
|
-
const { Session
|
|
14
|
+
const { Session } = PlussCore;
|
|
15
15
|
|
|
16
16
|
class JobList extends Component {
|
|
17
17
|
constructor(props) {
|
|
@@ -66,10 +66,6 @@ class JobList extends Component {
|
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
68
|
|
|
69
|
-
onOpenJobTypes = () => {
|
|
70
|
-
this.props.history.push('/requestTypes');
|
|
71
|
-
};
|
|
72
|
-
|
|
73
69
|
renderRequests() {
|
|
74
70
|
let source = _.sortBy(this.props.source, (event) => {
|
|
75
71
|
if (this.state.sortColumn !== 'createdUnix') return event[this.state.sortColumn];
|
|
@@ -155,21 +151,6 @@ class JobList extends Component {
|
|
|
155
151
|
);
|
|
156
152
|
}
|
|
157
153
|
|
|
158
|
-
renderButtons() {
|
|
159
|
-
if (!Session.validateAccess(this.props.auth.site, 'maintenanceTypes', this.props.auth)) return null;
|
|
160
|
-
|
|
161
|
-
return (
|
|
162
|
-
<div className="flex-reverse">
|
|
163
|
-
<Components.Button inline buttonType="primaryAction" onClick={this.onOpenJobTypes} isActive>
|
|
164
|
-
<div className="flex flex-row flex-center">
|
|
165
|
-
<Components.SVGIcon colour={'#fff'} icon="maintenance2" height="17px" />
|
|
166
|
-
<div className="marginLeft-10">Request Types</div>
|
|
167
|
-
</div>
|
|
168
|
-
</Components.Button>
|
|
169
|
-
</div>
|
|
170
|
-
);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
154
|
renderContent() {
|
|
174
155
|
if (_.isEmpty(this.props.source)) return this.renderEmpty();
|
|
175
156
|
|
|
@@ -226,8 +207,8 @@ class JobList extends Component {
|
|
|
226
207
|
render() {
|
|
227
208
|
return (
|
|
228
209
|
<div style={{ minWidth: '100%' }}>
|
|
229
|
-
{this.renderButtons()}
|
|
230
210
|
{this.renderContent()}
|
|
211
|
+
<div className="hub_tidioPadding"></div>
|
|
231
212
|
</div>
|
|
232
213
|
);
|
|
233
214
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import { Table } from 'react-bootstrap';
|
|
3
3
|
import { connect } from 'react-redux';
|
|
4
|
-
import { Link } from 'react-router-dom';
|
|
5
4
|
import _ from 'lodash';
|
|
6
5
|
import FontAwesome from 'react-fontawesome';
|
|
7
6
|
import { withRouter } from 'react-router';
|
|
@@ -256,8 +255,7 @@ class JobTypes extends Component {
|
|
|
256
255
|
}
|
|
257
256
|
return (
|
|
258
257
|
<div style={{ minWidth: '100%' }}>
|
|
259
|
-
<div className="
|
|
260
|
-
<Components.PageTitle>Request Types</Components.PageTitle>
|
|
258
|
+
<div className="marginBottom-32">
|
|
261
259
|
<Components.AddButton onClick={() => this.onShowJobType()} text="NEW REQUEST TYPE" />
|
|
262
260
|
</div>
|
|
263
261
|
{this.renderContent()}
|
|
@@ -336,14 +334,10 @@ class JobTypes extends Component {
|
|
|
336
334
|
|
|
337
335
|
render() {
|
|
338
336
|
return (
|
|
339
|
-
<div
|
|
340
|
-
<div
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
{this.renderJobTypes()}
|
|
344
|
-
</div>
|
|
345
|
-
{this.renderNewUserTypePopup()}
|
|
346
|
-
</div>
|
|
337
|
+
<div style={{ minWidth: '100%' }}>
|
|
338
|
+
<div>{this.renderJobTypes()}</div>
|
|
339
|
+
{this.renderNewUserTypePopup()}
|
|
340
|
+
<div className="hub_tidioPadding"></div>
|
|
347
341
|
</div>
|
|
348
342
|
);
|
|
349
343
|
}
|
package/src/index.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import RequestsHub from './screens/RequestsHub';
|
|
2
2
|
import Job from './screens/Job';
|
|
3
3
|
import AddJob from './screens/AddJob';
|
|
4
|
-
import JobTypes from './screens/JobTypes';
|
|
5
4
|
import MaintenanceReducer from './reducers/MaintenanceReducer';
|
|
6
5
|
|
|
7
6
|
export const Reducers = { maintenance: MaintenanceReducer };
|
|
8
|
-
export const Screens = { RequestsHub, Job, AddJob
|
|
7
|
+
export const Screens = { RequestsHub, Job, AddJob };
|
|
9
8
|
export { default as Config } from './feature.config';
|
|
10
9
|
export { default as ActivityText } from './components/ActivityText';
|
|
11
10
|
export { default as ViewWidget } from './components/ViewWidget';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import { connect } from 'react-redux';
|
|
3
|
+
import { withRouter } from 'react-router';
|
|
3
4
|
import _ from 'lodash';
|
|
4
5
|
import moment from 'moment';
|
|
5
6
|
import FontAwesome from 'react-fontawesome';
|
|
@@ -7,6 +8,7 @@ import Config, { PlussCore } from '../feature.config';
|
|
|
7
8
|
import { jobsLoaded } from '../actions';
|
|
8
9
|
import { maintenanceActions } from '../apis';
|
|
9
10
|
import JobList from '../components/JobList';
|
|
11
|
+
import JobTypes from '../components/JobTypes';
|
|
10
12
|
|
|
11
13
|
const { Components, Session } = PlussCore;
|
|
12
14
|
|
|
@@ -14,7 +16,7 @@ class RequestsHub extends Component {
|
|
|
14
16
|
constructor(props) {
|
|
15
17
|
super(props);
|
|
16
18
|
this.state = {
|
|
17
|
-
selectedSection: '
|
|
19
|
+
selectedSection: 'all',
|
|
18
20
|
location: '',
|
|
19
21
|
loadingAll: false,
|
|
20
22
|
loadingSubmissions: false,
|
|
@@ -102,49 +104,57 @@ class RequestsHub extends Component {
|
|
|
102
104
|
renderStats = (stat, loading) => (loading ? <FontAwesome style={styles.spinner} name="spinner fa-pulse fa-fw" /> : stat);
|
|
103
105
|
|
|
104
106
|
renderLeftBar() {
|
|
107
|
+
const sectionItems = [];
|
|
108
|
+
|
|
109
|
+
if (this.canAddNew()) {
|
|
110
|
+
sectionItems.push({
|
|
111
|
+
type: 'newButton',
|
|
112
|
+
text: 'New Request',
|
|
113
|
+
onClick: this.onAddNew,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
sectionItems.push({
|
|
118
|
+
type: 'navItem',
|
|
119
|
+
text: 'View Requests',
|
|
120
|
+
icon: 'eye',
|
|
121
|
+
isFontAwesome: true,
|
|
122
|
+
selected: this.state.selectedSection === 'all',
|
|
123
|
+
onClick: () => {
|
|
124
|
+
this.setState({ selectedSection: 'all' });
|
|
125
|
+
},
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
if (Session.validateAccess(this.props.auth.site, 'maintenanceTypes', this.props.auth)) {
|
|
129
|
+
sectionItems.push({
|
|
130
|
+
type: 'navItem',
|
|
131
|
+
text: 'Request Types',
|
|
132
|
+
// icon: 'maintenance2',
|
|
133
|
+
// isSVG: true,
|
|
134
|
+
selected: this.state.selectedSection === 'requestTypes',
|
|
135
|
+
onClick: () => {
|
|
136
|
+
this.setState({ selectedSection: 'requestTypes' });
|
|
137
|
+
},
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
|
|
105
141
|
return (
|
|
106
|
-
<
|
|
107
|
-
{
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
{/* Content */}
|
|
115
|
-
{/* All Articles */}
|
|
116
|
-
<div
|
|
117
|
-
onClick={() => {
|
|
118
|
-
this.setState({ selectedSection: 'completed' });
|
|
119
|
-
}}
|
|
120
|
-
className="sideBarSection"
|
|
121
|
-
style={this.getSideBarSectionColour('completed')}
|
|
122
|
-
>
|
|
123
|
-
<div className="fontMedium fontSize-36 text-dark" style={{ lineHeight: '50px' }}>
|
|
124
|
-
{this.renderStats(this.state.completed.length, this.state.loadingAll)}
|
|
125
|
-
</div>
|
|
126
|
-
<div className="fontRegular fontSize-16 text-light lineHeight-22">Complete</div>
|
|
127
|
-
</div>
|
|
128
|
-
{/* Upcoming */}
|
|
129
|
-
<div
|
|
130
|
-
onClick={() => {
|
|
131
|
-
this.setState({ selectedSection: 'upcoming' });
|
|
132
|
-
}}
|
|
133
|
-
className="sideBarSection"
|
|
134
|
-
style={this.getSideBarSectionColour('upcoming')}
|
|
135
|
-
>
|
|
136
|
-
<div className="fontMedium fontSize-36 text-dark" style={{ lineHeight: '50px' }}>
|
|
137
|
-
{this.renderStats(this.state.upcoming.length, this.state.loadingAll)}
|
|
138
|
-
</div>
|
|
139
|
-
<div className="fontRegular fontSize-16 text-light lineHeight-22">Incomplete</div>
|
|
140
|
-
</div>
|
|
141
|
-
</div>
|
|
142
|
-
</div>
|
|
142
|
+
<Components.HubSidebar
|
|
143
|
+
sections={[
|
|
144
|
+
{
|
|
145
|
+
title: 'Requests',
|
|
146
|
+
items: sectionItems,
|
|
147
|
+
},
|
|
148
|
+
]}
|
|
149
|
+
/>
|
|
143
150
|
);
|
|
144
151
|
}
|
|
145
152
|
|
|
146
153
|
renderRight() {
|
|
147
|
-
|
|
154
|
+
if (this.state.selectedSection === 'requestTypes') {
|
|
155
|
+
return <JobTypes />;
|
|
156
|
+
}
|
|
157
|
+
return <JobList source={this.state.allList} />;
|
|
148
158
|
}
|
|
149
159
|
|
|
150
160
|
render() {
|
|
@@ -152,7 +162,7 @@ class RequestsHub extends Component {
|
|
|
152
162
|
<div className="hub-wrapperContainer">
|
|
153
163
|
{this.renderLeftBar()}
|
|
154
164
|
<div className="hub-headerContentWrapper">
|
|
155
|
-
<Components.Header
|
|
165
|
+
<Components.Header />
|
|
156
166
|
<div className="hub-contentWrapper">{this.renderRight()}</div>
|
|
157
167
|
</div>
|
|
158
168
|
</div>
|
|
@@ -193,4 +203,4 @@ const mapStateToProps = (state) => {
|
|
|
193
203
|
};
|
|
194
204
|
};
|
|
195
205
|
|
|
196
|
-
export default connect(mapStateToProps, { jobsLoaded })(RequestsHub);
|
|
206
|
+
export default connect(mapStateToProps, { jobsLoaded })(withRouter(RequestsHub));
|