@plusscommunities/pluss-maintenance-web 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.
Files changed (48) hide show
  1. package/dist/{index.esm.js → index.js} +3176 -2644
  2. package/dist/index.js.map +1 -0
  3. package/package.json +13 -20
  4. package/.babelrc +0 -3
  5. package/dist/index.cjs.js +0 -6234
  6. package/dist/index.umd.js +0 -6227
  7. package/rollup.config.js +0 -59
  8. package/src/actions/JobsActions.js +0 -150
  9. package/src/actions/index.js +0 -1
  10. package/src/actions/types.js +0 -8
  11. package/src/apis/index.js +0 -10
  12. package/src/apis/maintenanceActions.js +0 -203
  13. package/src/apis/reactionActions.js +0 -46
  14. package/src/components/ActivityText.js +0 -57
  15. package/src/components/AnalyticsHub.js +0 -167
  16. package/src/components/Configuration.js +0 -392
  17. package/src/components/JobList.js +0 -1108
  18. package/src/components/JobTypes.js +0 -198
  19. package/src/components/PreviewFull.js +0 -33
  20. package/src/components/PreviewGrid.js +0 -29
  21. package/src/components/PreviewWidget.js +0 -35
  22. package/src/components/ViewFull.js +0 -25
  23. package/src/components/ViewWidget.js +0 -23
  24. package/src/feature.config.js +0 -127
  25. package/src/helper/index.js +0 -26
  26. package/src/images/forms/full.png +0 -0
  27. package/src/images/forms/fullNoTitle.png +0 -0
  28. package/src/images/forms/previewWidget.png +0 -0
  29. package/src/images/forms/widget.png +0 -0
  30. package/src/images/full.png +0 -0
  31. package/src/images/fullNoTitle.png +0 -0
  32. package/src/images/previewWidget.png +0 -0
  33. package/src/images/widget.png +0 -0
  34. package/src/index.js +0 -29
  35. package/src/maintenancePriority.json +0 -5
  36. package/src/maintenanceStatus.json +0 -20
  37. package/src/reducers/MaintenanceReducer.js +0 -49
  38. package/src/screens/AddJob.js +0 -1138
  39. package/src/screens/AddJobType.js +0 -865
  40. package/src/screens/Job.js +0 -1531
  41. package/src/screens/RequestsHub.js +0 -237
  42. package/src/values.config.a.js +0 -63
  43. package/src/values.config.default.js +0 -75
  44. package/src/values.config.enquiry.js +0 -76
  45. package/src/values.config.feedback.js +0 -74
  46. package/src/values.config.food.js +0 -74
  47. package/src/values.config.forms.js +0 -74
  48. package/src/values.config.js +0 -75
package/rollup.config.js DELETED
@@ -1,59 +0,0 @@
1
- import styles from 'rollup-plugin-styles';
2
- const autoprefixer = require('autoprefixer');
3
- import babel from '@rollup/plugin-babel';
4
- import json from '@rollup/plugin-json';
5
- import image from '@rollup/plugin-image';
6
- import localResolve from 'rollup-plugin-local-resolve';
7
-
8
- // the entry point for the library
9
- const input = 'src/index.js';
10
-
11
- var MODE = [
12
- {
13
- fomart: 'cjs',
14
- },
15
- {
16
- fomart: 'esm',
17
- },
18
- {
19
- fomart: 'umd',
20
- },
21
- ];
22
-
23
- var config = [];
24
-
25
- MODE.map((m) => {
26
- var conf = {
27
- input: input,
28
- output: {
29
- // then name of your package
30
- name: '@plusscommunities/pluss-maintenance-web',
31
- file: `dist/index.${m.fomart}.js`,
32
- format: m.fomart,
33
- exports: 'auto',
34
- },
35
- // this externelizes react to prevent rollup from compiling it
36
- external: ['react', /@babel\/runtime/],
37
- plugins: [
38
- // these are babel comfigurations
39
- babel({
40
- exclude: 'node_modules/**',
41
- presets: ['@babel/preset-react', '@babel/preset-env'],
42
- plugins: ['@babel/transform-runtime'],
43
- babelHelpers: 'runtime',
44
- }),
45
- // this adds support for styles
46
- styles({
47
- postcss: {
48
- plugins: [autoprefixer()],
49
- },
50
- }),
51
- json(),
52
- image(),
53
- localResolve(),
54
- ],
55
- };
56
- config.push(conf);
57
- });
58
-
59
- export default [...config];
@@ -1,150 +0,0 @@
1
- import _ from 'lodash';
2
- import { JOBS_LOADED, JOBS_REMOVED, JOBS_LOADING, JOBS_TYPES_LOADED, JOBS_STATUSES_LOADED, JOBS_HIDE_SEEN } from './types';
3
- import { maintenanceActions, stringActions } from '../apis';
4
- import DefaultStatusTypes from '../maintenanceStatus.json';
5
- import { PlussCore } from '../feature.config';
6
- import { values } from '../values.config';
7
-
8
- const { Helper } = PlussCore;
9
-
10
- export const jobsUpdate = (site, isdashboard) => {
11
- return (dispatch) => {
12
- if (isdashboard) dispatch({ type: JOBS_LOADING });
13
-
14
- maintenanceActions.getJobsRecursive(site).then((res) => {
15
- const currentSite = Helper.readStorageWithCookie('site');
16
- if (!_.isEmpty(res) && res[0].site === currentSite) {
17
- dispatch({
18
- type: JOBS_LOADED,
19
- payload: res,
20
- });
21
- } else {
22
- dispatch({
23
- type: JOBS_LOADED,
24
- payload: [],
25
- });
26
- }
27
- });
28
- };
29
- };
30
-
31
- export const jobsLoaded = (events) => {
32
- return {
33
- type: JOBS_LOADED,
34
- payload: events,
35
- };
36
- };
37
-
38
- export const removeJob = (id) => {
39
- return {
40
- type: JOBS_REMOVED,
41
- payload: id,
42
- };
43
- };
44
-
45
- export const jobTypesUpdate = (site) => {
46
- return (dispatch) => {
47
- maintenanceActions.getJobTypes(site).then((res) => {
48
- dispatch({
49
- type: JOBS_TYPES_LOADED,
50
- payload: res.data,
51
- });
52
- });
53
- };
54
- };
55
-
56
- export const jobTypesLoaded = (events) => {
57
- return {
58
- type: JOBS_TYPES_LOADED,
59
- payload: events,
60
- };
61
- };
62
-
63
- export const jobStatusesUpdate = (site, callback = null) => {
64
- return (dispatch) => {
65
- stringActions
66
- .getString(site, values.stringConfigJobStatus)
67
- .then((res) => {
68
- dispatch({
69
- type: JOBS_STATUSES_LOADED,
70
- payload: res.data,
71
- });
72
- if (callback) callback(res.data);
73
- })
74
- .catch((_error) => {
75
- dispatch({
76
- type: JOBS_STATUSES_LOADED,
77
- payload: DefaultStatusTypes,
78
- });
79
- if (callback) callback(DefaultStatusTypes);
80
- });
81
- };
82
- };
83
-
84
- export const jobStatusesLoaded = (statuses) => {
85
- return {
86
- type: JOBS_STATUSES_LOADED,
87
- payload: statuses,
88
- };
89
- };
90
-
91
- export const jobHideSeenUpdate = (site, callback = null) => {
92
- return (dispatch) => {
93
- stringActions
94
- .getString(site, values.stringConfigHideSeen)
95
- .then((res) => {
96
- dispatch({
97
- type: JOBS_HIDE_SEEN,
98
- payload: res.data,
99
- });
100
- if (callback) callback(res.data);
101
- })
102
- .catch((_error) => {
103
- dispatch({
104
- type: JOBS_HIDE_SEEN,
105
- payload: false,
106
- });
107
- if (callback) callback(false);
108
- });
109
- };
110
- };
111
-
112
- export const jobHideSeenLoaded = (hide) => {
113
- return {
114
- type: JOBS_HIDE_SEEN,
115
- payload: hide,
116
- };
117
- };
118
-
119
- // export const removeJobType = (id) => {
120
- // return {
121
- // type: JOBS_TYPES_REMOVED,
122
- // payload: id,
123
- // };
124
- // };
125
-
126
- // export const clearJobs = () => {
127
- // return {
128
- // type: JOBS_PURGE,
129
- // };
130
- // };
131
-
132
- // export const ticketsLoaded = (tickets) => {
133
- // return {
134
- // type: TICKETS_LOADED,
135
- // payload: tickets,
136
- // };
137
- // };
138
-
139
- // export const ticketsUpdate = (site) => {
140
- // return (dispatch) => {
141
- // maintenanceActions.getTickets(site).then((res) => {
142
- // if (res.data != null) {
143
- // dispatch({
144
- // type: TICKETS_LOADED,
145
- // payload: res.data,
146
- // });
147
- // }
148
- // });
149
- // };
150
- // };
@@ -1 +0,0 @@
1
- export * from './JobsActions';
@@ -1,8 +0,0 @@
1
- import { values } from '../values.config';
2
-
3
- export const JOBS_LOADED = values.actionJobsLoaded;
4
- export const JOBS_LOADING = values.actionJobsLoading;
5
- export const JOBS_REMOVED = values.actionJobsRemoved;
6
- export const JOBS_TYPES_LOADED = values.actionJobsTypesLoaded;
7
- export const JOBS_STATUSES_LOADED = values.actionJobsStatusesLoaded;
8
- export const JOBS_HIDE_SEEN = values.actionJobsHideSeen;
package/src/apis/index.js DELETED
@@ -1,10 +0,0 @@
1
- import { PlussCore } from '../feature.config';
2
-
3
- const { Apis } = PlussCore;
4
-
5
- export const analyticsActions = Apis.analyticsActions;
6
- export const userActions = Apis.userActions;
7
- export const stringActions = Apis.stringActions;
8
-
9
- export * from './maintenanceActions';
10
- export * from './reactionActions';
@@ -1,203 +0,0 @@
1
- import { PlussCore } from '../feature.config';
2
- import { values } from '../values.config';
3
- const { Helper, Session } = PlussCore;
4
-
5
- export const maintenanceActions = {
6
- getJobType: (site, typeId) => {
7
- let url = Helper.getUrl(values.serviceKey, 'getjobtype');
8
- return Session.authedFunction({
9
- method: 'POST',
10
- url,
11
- data: { site, typeId },
12
- });
13
- },
14
- getJobTypes: (site, id) => {
15
- let url = Helper.getUrl(values.serviceKey, 'getjobtypes');
16
- return Session.authedFunction({
17
- method: 'POST',
18
- url,
19
- data: { site },
20
- });
21
- },
22
- getJob: (site, id) => {
23
- let url = Helper.getUrl(values.serviceKey, 'getJob');
24
- return Session.authedFunction({
25
- method: 'POST',
26
- url,
27
- data: { site, id },
28
- });
29
- },
30
- getJobByJobId: (site, jobId) => {
31
- let url = Helper.getUrl(values.serviceKey, 'getJob');
32
- return Session.authedFunction({
33
- method: 'POST',
34
- url,
35
- data: { site, jobId },
36
- });
37
- },
38
- getJobs: (site, status = '', type = '') => {
39
- return Session.authedFunction({
40
- method: 'POST',
41
- url: Helper.getUrl(values.serviceKey, 'getJobs'),
42
- data: { site, status, type },
43
- });
44
- },
45
- getJobs2: (site, status, type, lastKey) => {
46
- const query = { site };
47
- if (status) {
48
- query.status = status;
49
- }
50
- if (type) {
51
- query.type = type;
52
- }
53
- if (lastKey) {
54
- query.lastKey = JSON.stringify(lastKey);
55
- }
56
- return Session.authedFunction({
57
- method: 'GET',
58
- url: Helper.getUrl(values.serviceKey, 'get/requests', query),
59
- });
60
- },
61
- getJobsRecursive: (site, status, type, lastKey, jobs = []) => {
62
- return new Promise((resolve) => {
63
- maintenanceActions.getJobs2(site, status, type, lastKey).then((jobRes) => {
64
- const newJobs = [...jobs, ...jobRes.data.Items];
65
- if (!jobRes.data.LastKey) {
66
- return resolve(newJobs);
67
- }
68
- return resolve(maintenanceActions.getJobsRecursive(site, status, type, jobRes.data.LastKey, newJobs));
69
- });
70
- });
71
- },
72
- createJob: (job) => {
73
- return Session.authedFunction({
74
- method: 'POST',
75
- url: Helper.getUrl(values.serviceKey, 'sendMaintenance'),
76
- data: {
77
- ...job,
78
- },
79
- });
80
- },
81
- editJob: (job, site) => {
82
- return Session.authedFunction({
83
- method: 'POST',
84
- url: Helper.getUrl(values.serviceKey, 'editJob'),
85
- data: { job, site },
86
- });
87
- },
88
- deleteJob: (site, id) => {
89
- return Session.authedFunction({
90
- method: 'POST',
91
- url: Helper.getUrl(values.serviceKey, 'requests/remove'),
92
- data: { site, id },
93
- });
94
- },
95
- editJobStatus: (id, status) => {
96
- return Session.authedFunction({
97
- method: 'POST',
98
- url: Helper.getUrl(values.serviceKey, 'editJobStatus'),
99
- data: { id, status },
100
- });
101
- },
102
- editJobPriority: (id, priority) => {
103
- return Session.authedFunction({
104
- method: 'POST',
105
- url: Helper.getUrl(values.serviceKey, 'update/priority'),
106
- data: { id, priority },
107
- });
108
- },
109
- assignJob: (jobId, userId) => {
110
- return Session.authedFunction({
111
- method: 'POST',
112
- url: Helper.getUrl(values.serviceKey, 'update/assign'),
113
- data: {
114
- id: jobId,
115
- userId,
116
- },
117
- });
118
- },
119
- getAssignees: (site) => {
120
- return Session.authedFunction({
121
- method: 'GET',
122
- url: Helper.getUrl(values.serviceKey, 'get/assignees', { site }),
123
- });
124
- },
125
- addNote: (jobId, note, attachments, images) => {
126
- return Session.authedFunction({
127
- method: 'POST',
128
- url: Helper.getUrl(values.serviceKey, 'requests/note'),
129
- data: {
130
- id: jobId,
131
- note,
132
- attachments,
133
- images,
134
- action: 'AddNote',
135
- },
136
- });
137
- },
138
- editNote: (jobId, noteId, note, attachments, images) => {
139
- return Session.authedFunction({
140
- method: 'POST',
141
- url: Helper.getUrl(values.serviceKey, 'requests/note'),
142
- data: {
143
- id: jobId,
144
- note,
145
- attachments,
146
- images,
147
- noteId,
148
- action: 'EditNote',
149
- },
150
- });
151
- },
152
- deleteNote: (jobId, noteId) => {
153
- return Session.authedFunction({
154
- method: 'POST',
155
- url: Helper.getUrl(values.serviceKey, 'requests/note'),
156
- data: {
157
- id: jobId,
158
- noteId,
159
- action: 'DeleteNote',
160
- },
161
- });
162
- },
163
- addJobType: (site, name, email, description, level, hasCustomFields, customFields) => {
164
- const data = { site, name, email, description, level, hasCustomFields, customFields: customFields || [] };
165
- return Session.authedFunction({
166
- method: 'POST',
167
- url: Helper.getUrl(values.serviceKey, 'createJobType'),
168
- data,
169
- });
170
- },
171
- editJobType: (site, id, name, email, description, level, hasCustomFields, customFields) => {
172
- const data = { site, id, name, email, description, level, hasCustomFields, customFields: customFields || [] };
173
- if (hasCustomFields && customFields) data.customFields = customFields;
174
- return Session.authedFunction({
175
- method: 'POST',
176
- url: Helper.getUrl(values.serviceKey, 'editJobType'),
177
- data,
178
- });
179
- },
180
- deleteJobType: (site, id) => {
181
- return Session.authedFunction({
182
- method: 'POST',
183
- url: Helper.getUrl(values.serviceKey, 'deleteJobType'),
184
- data: {
185
- site,
186
- id,
187
- },
188
- });
189
- },
190
- getExternalSync: (jobId) => {
191
- return Session.authedFunction({
192
- method: 'GET',
193
- url: Helper.getUrl(values.serviceKey, 'get/externalsync', { id: jobId }),
194
- });
195
- },
196
- retrySync: (jobId) => {
197
- return Session.authedFunction({
198
- method: 'POST',
199
- url: Helper.getUrl(values.serviceKey, 'update/retrysync'),
200
- data: { id: jobId },
201
- });
202
- },
203
- };
@@ -1,46 +0,0 @@
1
- import _ from 'lodash';
2
- import { PlussCore } from '../feature.config';
3
- const { Helper, Session } = PlussCore;
4
-
5
- export const reactionActions = {
6
- addComment: (entityId, entityType, entityName, site, comment, image, parentId) => {
7
- const data = {
8
- entityId,
9
- entityType,
10
- entityName,
11
- site,
12
- comment,
13
- parentId,
14
- };
15
- if (!_.isEmpty(image)) {
16
- data.image = image;
17
- }
18
- return Session.authedFunction({
19
- method: 'POST',
20
- url: Helper.getUrl('reactions', 'comments/add'),
21
- data,
22
- });
23
- },
24
- // removeComment: (id) => {
25
- // return Session.authedFunction({
26
- // method: 'POST',
27
- // url: Helper.getUrl('reactions', 'comments/remove'),
28
- // data: {
29
- // id,
30
- // },
31
- // });
32
- // },
33
- getComments: (entityId, entityType, minTime) => {
34
- const query = {
35
- entityId,
36
- entityType,
37
- };
38
- if (minTime) {
39
- query.minTime = minTime;
40
- }
41
- return Session.authedFunction({
42
- method: 'GET',
43
- url: Helper.getUrl('reactions', 'comments/get', query),
44
- });
45
- },
46
- };
@@ -1,57 +0,0 @@
1
- import React, { Component } from 'react';
2
- import _ from 'lodash';
3
- import { Link } from 'react-router-dom';
4
- import { values } from '../values.config';
5
-
6
- class ActivityText extends Component {
7
- render() {
8
- const { data, classes, clickableClasses, highlightedClasses } = this.props;
9
-
10
- switch (data.Type) {
11
- case values.activityMaintenanceJobStatusChanged:
12
- return (
13
- <p className={classes}>
14
- <span className={highlightedClasses}>{data.User.displayName}</span>
15
- &nbsp;{values.textChangedRequestStatus}&nbsp;
16
- <Link to={`${values.routeRequestDetails}/${data.Id}`} className={clickableClasses}>
17
- {_.truncate(data.Data.title || data.Data.description, { length: 30, separator: '...' })}
18
- </Link>
19
- </p>
20
- );
21
- case values.activityAddMaintenanceJob:
22
- return (
23
- <p className={classes}>
24
- <span className={highlightedClasses}>{data.User.displayName}</span>
25
- &nbsp;{values.textAddedRequest}&nbsp;
26
- <Link to={`${values.routeRequestDetails}/${data.Id}`} className={clickableClasses}>
27
- {_.truncate(data.Data.title || data.Data.description, { length: 30, separator: '...' })}
28
- </Link>
29
- </p>
30
- );
31
- case values.activityEditMaintenanceJob:
32
- return (
33
- <p className={classes}>
34
- <span className={highlightedClasses}>{data.User.displayName}</span>
35
- &nbsp;{values.textEditedRequest}&nbsp;
36
- <Link to={`${values.routeRequestDetails}/${data.Id}`} className={clickableClasses}>
37
- {_.truncate(data.Data.title || data.Data.description, { length: 30, separator: '...' })}
38
- </Link>
39
- </p>
40
- );
41
- case values.activityDeleteMaintenanceJob:
42
- return (
43
- <p className={classes}>
44
- <span className={highlightedClasses}>{data.User.displayName}</span>
45
- &nbsp;{values.textRemovedRequest}&nbsp;
46
- <span className={highlightedClasses}>
47
- {_.truncate(data.Data.title || data.Data.description, { length: 30, separator: '...' })}
48
- </span>
49
- </p>
50
- );
51
- default:
52
- return null;
53
- }
54
- }
55
- }
56
-
57
- export default ActivityText;
@@ -1,167 +0,0 @@
1
- import React, { useState, useEffect } from 'react';
2
- import moment from 'moment';
3
- import { faCircleCheck, faComment, faWrench } from '@fortawesome/free-solid-svg-icons';
4
- import { connect } from 'react-redux';
5
- import { analyticsActions } from '../apis';
6
- import { PlussCore } from '../feature.config';
7
- import { values } from '../values.config';
8
-
9
- const { Analytics, Session, Components } = PlussCore;
10
-
11
- const getInitialState = () => ({
12
- requests: 0,
13
- prevRequests: 0,
14
- completedRequests: 0,
15
- prevCompletedRequests: 0,
16
- comments: 0,
17
- prevComments: 0,
18
- isLoading: true,
19
- });
20
-
21
- // AnalyticsHub Component
22
- const AnalyticsHub = ({ startTime, endTime, auth, prevText, dayCount, strings }) => {
23
- const [analyticsData, setAnalyticsData] = useState(getInitialState());
24
- const [isExportOpen, setIsExportOpen] = useState(false);
25
-
26
- const hasAccess = Session.validateAccess(auth.site, values.permissionMaintenanceTracking, auth);
27
- if (!hasAccess) {
28
- return null;
29
- }
30
-
31
- const featureTitle = ((key) => {
32
- if (!strings || !strings.sideNav || !strings.sideNav[key]) {
33
- return values.textMenuTitle;
34
- }
35
- return strings.sideNav[key];
36
- })();
37
-
38
- const exportColumns = [
39
- { label: 'Select All', key: '' },
40
- { label: 'Start Date', key: 'startDate' },
41
- { label: 'End Date', key: 'endDate' },
42
- { label: `${values.textSingularName}s`, key: 'requests' },
43
- { label: `Completed ${values.textSingularName}s`, key: 'completedRequests' },
44
- { label: 'Comments', key: 'comments' },
45
- ];
46
-
47
- useEffect(() => {
48
- getData();
49
- }, [startTime, endTime]);
50
-
51
- const getData = async () => {
52
- setAnalyticsData(getInitialState());
53
- // Load analytics data here using startTime and endTime
54
- const timeDifference = endTime - startTime;
55
- const [currentStatsResponse, prevStatsResponse] = await Promise.all([
56
- analyticsActions.getAggregateEntityStats(auth.site, values.analyticsKey, startTime, endTime, true),
57
- analyticsActions.getAggregateEntityStats(auth.site, values.analyticsKey, startTime - timeDifference, startTime, true),
58
- ]);
59
-
60
- const data = {
61
- requests: Analytics.countActivities(currentStatsResponse.data, 'Request', 'total'),
62
- prevRequests: Analytics.countActivities(prevStatsResponse.data, 'Request', 'total'),
63
- completedRequests: Analytics.countActivities(currentStatsResponse.data, 'RequestCompleted', 'unique'),
64
- prevCompletedRequests: Analytics.countActivities(prevStatsResponse.data, 'RequestCompleted', 'unique'),
65
- comments: Analytics.countActivities(currentStatsResponse.data, 'Comment', 'total'),
66
- prevComments: Analytics.countActivities(prevStatsResponse.data, 'Comment', 'total'),
67
- isLoading: false,
68
- };
69
- setAnalyticsData(data);
70
- };
71
-
72
- const isReadyToOpenCSV = () => {
73
- return !analyticsData.isLoading;
74
- };
75
-
76
- const getExportSource = () => {
77
- return [
78
- {
79
- startDate: moment(startTime + 1).format('D-MM-YYYY'),
80
- endDate: moment(endTime).format('D-MM-YYYY'),
81
- requests: analyticsData.requests,
82
- completedRequests: analyticsData.completedRequests,
83
- comments: analyticsData.comments,
84
- },
85
- ];
86
- };
87
-
88
- const csvPopup = () => {
89
- if (!isExportOpen) {
90
- return null;
91
- }
92
- const source = getExportSource();
93
- return (
94
- <Components.ExportCsvPopup
95
- onClose={() => {
96
- setIsExportOpen(false);
97
- }}
98
- columns={exportColumns}
99
- source={source}
100
- filename={`${values.analyticsKey}analytics_${source[0].startDate}_${source[0].endDate}.csv`}
101
- />
102
- );
103
- };
104
-
105
- return (
106
- <div className="dashboardSection">
107
- {csvPopup()}
108
- <div>
109
- <Components.Text type="h4" className="inlineBlock marginRight-40">
110
- {featureTitle}
111
- </Components.Text>
112
- <Components.Button
113
- inline
114
- buttonType="primaryAction"
115
- onClick={() => {
116
- if (!isReadyToOpenCSV()) return;
117
- setIsExportOpen(true);
118
- }}
119
- isActive={isReadyToOpenCSV()}
120
- leftIcon="file-code-o"
121
- >
122
- Export CSV
123
- </Components.Button>
124
- </div>
125
- <div className="analyticsSection dashboardSection_content">
126
- <Components.StatBox
127
- title={`${featureTitle} Requests`}
128
- icon={faWrench}
129
- value={analyticsData.requests}
130
- previousValue={analyticsData.prevRequests}
131
- prevText={prevText}
132
- viewGraphLink={`/chart?entity=${values.analyticsKey}&startTime=${startTime}&endTime=${endTime}&key=Request&countType=total&dayCount=${dayCount}`}
133
- isLoading={analyticsData.isLoading}
134
- />
135
- <Components.StatBox
136
- title={`Completed ${featureTitle} Requests`}
137
- icon={faCircleCheck}
138
- value={analyticsData.completedRequests}
139
- previousValue={analyticsData.prevCompletedRequests}
140
- prevText={prevText}
141
- viewGraphLink={`/chart?entity=${values.analyticsKey}&startTime=${startTime}&endTime=${endTime}&key=RequestCompleted&countType=unique&dayCount=${dayCount}`}
142
- isLoading={analyticsData.isLoading}
143
- />
144
- <Components.StatBox
145
- title={`${featureTitle} Comments`}
146
- icon={faComment}
147
- value={analyticsData.comments}
148
- previousValue={analyticsData.prevComments}
149
- prevText={prevText}
150
- viewGraphLink={`/chart?entity=${values.analyticsKey}&startTime=${startTime}&endTime=${endTime}&key=Comment&countType=total&dayCount=${dayCount}`}
151
- isLoading={analyticsData.isLoading}
152
- />
153
- </div>
154
- </div>
155
- );
156
- };
157
-
158
- const mapStateToProps = (state) => {
159
- const { auth } = state;
160
- return {
161
- auth,
162
- strings: (state.strings && state.strings.config) || {},
163
- };
164
- };
165
-
166
- const toExport = connect(mapStateToProps, {})(AnalyticsHub);
167
- export { toExport as AnalyticsHub };