@plusscommunities/pluss-feeds-web 1.0.7 → 1.1.0-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.
@@ -1,85 +1,87 @@
1
+ import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
1
2
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
- import React, { Component } from 'react';
3
+ import { Component } from 'react';
3
4
  import { connect } from 'react-redux';
4
5
  import { withRouter } from 'react-router';
5
6
  import _ from 'lodash';
6
- import FontAwesome from 'react-fontawesome';
7
+ import { Icon } from '@plusscommunities/pluss-icons';
7
8
  import * as PlussCore from '@plusscommunities/pluss-core-web';
8
- import { Colours as Colours$1 } from '@plusscommunities/pluss-core-web';
9
+ import { PERMISSION_CATEGORIES, IMPORTANCE_LEVELS, Colours as Colours$1 } from '@plusscommunities/pluss-core-web';
9
10
  import { Table } from 'react-bootstrap';
10
11
  import { Link } from 'react-router-dom';
11
12
  import moment from 'moment';
13
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
12
14
  import Textarea from 'react-textarea-autosize';
13
15
 
14
- const values = {
15
- featureKey: 'feeds',
16
+ var values = {
17
+ featureKey: "feeds",
16
18
  aliases: [],
17
- serviceKey: 'feeds',
18
- reducerKey: 'feeds',
19
- analyticsKey: 'feeds',
20
- actionFeedsLoading: 'FEEDS_LOADING',
21
- actionFeedsLoaded: 'FEEDS_LOADED',
22
- actionFeedRemoved: 'FEEDS_REMOVED',
23
- actionFeedsSubmissionsLoaded: 'FEEDS_SUBMISSIONS_LOADED',
24
- actionFeedsSubmissionsRemoved: 'FEEDS_SUBMISSIONS_REMOVED',
25
- actionFeedTypeLoaded: 'FEED_TYPES_LOADED',
26
- permissionFeedManagement: 'feedManagement',
27
- permissionFeedPost: 'feedPost',
28
- permissionFeedDraft: 'feedDraft',
29
- routeHub: '/feedHub',
30
- routeAddFeed: '/feedHub/feed',
31
- routeFeedDetails: '/feedHub/feedDetails',
32
- routeFeedTypes: '/feedTypes',
33
- screenFeedHub: 'FeedHub',
34
- screenAddFeed: 'AddFeed',
35
- screenFeed: 'Feed',
36
- screenFeedTypes: 'FeedTypes',
37
- svgPathGridIcon: 'M5 4.5C4.17157 4.5 3.5 5.17157 3.5 6C3.5 6.82843 4.17157 7.5 5 7.5H14C14.8284 7.5 15.5 6.82843 15.5 6C15.5 5.17157 14.8284 4.5 14 4.5H5ZM5 11.5C4.17157 11.5 3.5 12.1716 3.5 13C3.5 13.8284 4.17157 14.5 5 14.5H21C21.8284 14.5 22.5 13.8284 22.5 13C22.5 12.1716 21.8284 11.5 21 11.5H5ZM5 18.5C4.17157 18.5 3.5 19.1716 3.5 20C3.5 20.8284 4.17157 21.5 5 21.5H17C17.8284 21.5 18.5 20.8284 18.5 20C18.5 19.1716 17.8284 18.5 17 18.5H5Z',
38
- svgPathGridIconViewBox: '0 0 26 26',
19
+ serviceKey: "feeds",
20
+ reducerKey: "feeds",
21
+ analyticsKey: "feeds",
22
+ actionFeedsLoading: "FEEDS_LOADING",
23
+ actionFeedsLoaded: "FEEDS_LOADED",
24
+ actionFeedRemoved: "FEEDS_REMOVED",
25
+ actionFeedsSubmissionsLoaded: "FEEDS_SUBMISSIONS_LOADED",
26
+ actionFeedsSubmissionsRemoved: "FEEDS_SUBMISSIONS_REMOVED",
27
+ actionFeedTypeLoaded: "FEED_TYPES_LOADED",
28
+ permissionFeedManagement: "feedManagement",
29
+ permissionFeedPost: "feedPost",
30
+ permissionFeedDraft: "feedDraft",
31
+ routeHub: "/feedHub",
32
+ routeAddFeed: "/feedHub/feed",
33
+ routeFeedDetails: "/feedHub/feedDetails",
34
+ routeFeedTypes: "/feedTypes",
35
+ screenFeedHub: "FeedHub",
36
+ screenAddFeed: "AddFeed",
37
+ screenFeed: "Feed",
38
+ screenFeedTypes: "FeedTypes",
39
+ svgPathGridIcon: "M5 4.5C4.17157 4.5 3.5 5.17157 3.5 6C3.5 6.82843 4.17157 7.5 5 7.5H14C14.8284 7.5 15.5 6.82843 15.5 6C15.5 5.17157 14.8284 4.5 14 4.5H5ZM5 11.5C4.17157 11.5 3.5 12.1716 3.5 13C3.5 13.8284 4.17157 14.5 5 14.5H21C21.8284 14.5 22.5 13.8284 22.5 13C22.5 12.1716 21.8284 11.5 21 11.5H5ZM5 18.5C4.17157 18.5 3.5 19.1716 3.5 20C3.5 20.8284 4.17157 21.5 5 21.5H17C17.8284 21.5 18.5 20.8284 18.5 20C18.5 19.1716 17.8284 18.5 17 18.5H5Z",
40
+ svgPathGridIconViewBox: "0 0 26 26",
39
41
  menuOrder: 20,
40
- textEmptyDescription: 'allows your users to submit feed posts.',
41
- textEmptyExample: '',
42
- textAreYouSureYouWantToDelete: 'Are you sure you want to delete the post?',
43
- textAreYouSureYouWantToApprove: 'Are you sure you want to approve the post?',
44
- textAreYouSureYouWantToReject: 'Are you sure you want to reject the post?',
45
- textSingularName: 'Resident Activity',
46
- textEmptyState: 'Your Resident Activity will show here',
47
- textTitleFeeds: 'Resident Activity',
48
- textMenuTitle: 'Resident Activity',
49
- textPermissionFeedManagement: 'Resident Activity Feed Management',
50
- textPermissionFeedPost: 'Post to Resident Activity Feed',
51
- textPermissionFeedDraft: 'Resident Activity Feed Submission (Approval Required)'
42
+ textEmptyDescription: "allows your users to submit feed posts.",
43
+ textEmptyExample: "",
44
+ textAreYouSureYouWantToDelete: "Are you sure you want to delete the post?",
45
+ textAreYouSureYouWantToApprove: "Are you sure you want to approve the post?",
46
+ textAreYouSureYouWantToReject: "Are you sure you want to reject the post?",
47
+ textSingularName: "Resident Activity",
48
+ textEmptyState: "Your Resident Activity will show here",
49
+ textTitleFeeds: "Resident Activity",
50
+ textMenuTitle: "Resident Activity",
51
+ textPermissionFeedManagement: "Resident Activity Feed Management",
52
+ textPermissionFeedPost: "Post to Resident Activity Feed",
53
+ textPermissionFeedDraft: "Resident Activity Feed Submission (Approval Required)"
52
54
  };
53
55
 
54
56
  // import * as PlussCore from '../../pluss-core/src';
55
- const FeatureConfig = {
57
+ var FeatureConfig = {
56
58
  key: values.featureKey,
57
59
  aliases: values.aliases,
58
60
  singularName: values.textSingularName,
59
- description: 'Submit and track resident feed.',
61
+ description: "Submit and track resident feed.",
60
62
  emptyText: values.textEmptyState,
61
63
  widgetOptions: [],
62
64
  menu: {
63
65
  order: values.menuOrder,
64
66
  text: values.textMenuTitle,
65
- icon: 'list-burger',
67
+ icon: "list-burger",
66
68
  url: values.routeHub,
67
69
  countProps: null,
68
70
  visibleExps: {
69
- type: 'and',
71
+ type: "and",
70
72
  exps: [{
71
- type: 'feature',
73
+ type: "feature",
72
74
  value: values.featureKey
73
75
  }, {
74
- type: 'or',
76
+ type: "or",
75
77
  exps: [{
76
- type: 'permission',
78
+ type: "permission",
77
79
  value: values.permissionFeedManagement
78
80
  }, {
79
- type: 'permission',
81
+ type: "permission",
80
82
  value: values.permissionFeedPost
81
83
  }, {
82
- type: 'permission',
84
+ type: "permission",
83
85
  value: values.permissionFeedDraft
84
86
  }]
85
87
  }]
@@ -91,15 +93,24 @@ const FeatureConfig = {
91
93
  permissions: [{
92
94
  displayName: values.textPermissionFeedManagement,
93
95
  key: values.permissionFeedManagement,
94
- hq: false
96
+ hq: false,
97
+ category: PERMISSION_CATEGORIES.COMMUNICATION,
98
+ helperText: "Allows full control over resident feed posts including approving, editing, and deleting.",
99
+ importance: IMPORTANCE_LEVELS.IMPORTANT
95
100
  }, {
96
101
  displayName: values.textPermissionFeedPost,
97
102
  key: values.permissionFeedPost,
98
- hq: false
103
+ hq: false,
104
+ category: PERMISSION_CATEGORIES.COMMUNICATION,
105
+ helperText: "Allows posting directly to the resident feed without needing approval.",
106
+ importance: IMPORTANCE_LEVELS.IMPORTANT
99
107
  }, {
100
108
  displayName: values.textPermissionFeedDraft,
101
109
  key: values.permissionFeedDraft,
102
- hq: false
110
+ hq: false,
111
+ category: PERMISSION_CATEGORIES.COMMUNICATION,
112
+ helperText: "Allows submitting feed posts that require manager approval before publishing.",
113
+ importance: IMPORTANCE_LEVELS.IMPORTANT
103
114
  }],
104
115
  hiddenSections: [],
105
116
  moreSections: [],
@@ -125,21 +136,21 @@ const FeatureConfig = {
125
136
  exact: false
126
137
  }],
127
138
  env: {
128
- baseStage: '',
129
- baseAPIUrl: '',
130
- baseUploadsUrl: '',
131
- uploadBucket: '',
132
- colourBrandingMain: '',
133
- colourBrandingOff: '',
134
- colourBrandingApp: '',
135
- defaultProfileImage: '',
136
- utcOffset: '',
139
+ baseStage: "",
140
+ baseAPIUrl: "",
141
+ baseUploadsUrl: "",
142
+ uploadBucket: "",
143
+ colourBrandingMain: "",
144
+ colourBrandingOff: "",
145
+ colourBrandingApp: "",
146
+ defaultProfileImage: "",
147
+ utcOffset: "",
137
148
  hasAvailableNews: false,
138
149
  newsHaveTags: true,
139
150
  defaultAllowComments: true,
140
- makeApiKey: '',
141
- logo: '',
142
- clientName: ''
151
+ makeApiKey: "",
152
+ logo: "",
153
+ clientName: ""
143
154
  },
144
155
  init: environment => {
145
156
  FeatureConfig.env = environment;
@@ -147,33 +158,33 @@ const FeatureConfig = {
147
158
  }
148
159
  };
149
160
 
150
- const FEEDS_LOADED = values.actionFeedsLoaded;
151
- const FEED_TYPES_LOADED = values.actionFeedTypeLoaded;
152
- const FEEDS_REMOVED = values.actionFeedRemoved;
153
- const FEEDS_LOADING = values.actionFeedsLoading;
154
- const FEEDS_SUBMISSIONS_LOADED = values.actionFeedsSubmissionsLoaded;
155
- const FEEDS_SUBMISSIONS_REMOVED = values.actionFeedsSubmissionsRemoved;
161
+ var FEEDS_LOADED = values.actionFeedsLoaded;
162
+ var FEED_TYPES_LOADED = values.actionFeedTypeLoaded;
163
+ var FEEDS_REMOVED = values.actionFeedRemoved;
164
+ var FEEDS_LOADING = values.actionFeedsLoading;
165
+ var FEEDS_SUBMISSIONS_LOADED = values.actionFeedsSubmissionsLoaded;
166
+ var FEEDS_SUBMISSIONS_REMOVED = values.actionFeedsSubmissionsRemoved;
156
167
 
157
168
  function ownKeys$5(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
158
169
  function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$5(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
159
- const {
170
+ var {
160
171
  Helper: Helper$5,
161
172
  Session: Session$7
162
173
  } = PlussCore;
163
- const feedActions = {
174
+ var feedActions = {
164
175
  getFeedTypes: site => {
165
- let url = Helper$5.getUrl(values.serviceKey, 'getTypes', {
176
+ var url = Helper$5.getUrl(values.serviceKey, "getTypes", {
166
177
  site
167
178
  });
168
179
  return Session$7.authedFunction({
169
- method: 'GET',
180
+ method: "GET",
170
181
  url
171
182
  });
172
183
  },
173
184
  addFeedType: (site, label, colour) => {
174
185
  return Session$7.authedFunction({
175
- method: 'POST',
176
- url: Helper$5.getUrl(values.serviceKey, 'createType'),
186
+ method: "POST",
187
+ url: Helper$5.getUrl(values.serviceKey, "createType"),
177
188
  data: {
178
189
  site,
179
190
  label,
@@ -183,8 +194,8 @@ const feedActions = {
183
194
  },
184
195
  editFeedType: (site, id, label, colour) => {
185
196
  return Session$7.authedFunction({
186
- method: 'POST',
187
- url: Helper$5.getUrl(values.serviceKey, 'editType'),
197
+ method: "POST",
198
+ url: Helper$5.getUrl(values.serviceKey, "editType"),
188
199
  data: {
189
200
  site,
190
201
  id,
@@ -195,8 +206,8 @@ const feedActions = {
195
206
  },
196
207
  deleteFeedType: (site, id) => {
197
208
  return Session$7.authedFunction({
198
- method: 'POST',
199
- url: Helper$5.getUrl(values.serviceKey, 'deleteType'),
209
+ method: "POST",
210
+ url: Helper$5.getUrl(values.serviceKey, "deleteType"),
200
211
  data: {
201
212
  site,
202
213
  id
@@ -204,40 +215,40 @@ const feedActions = {
204
215
  });
205
216
  },
206
217
  getFeed: id => {
207
- const query = {
218
+ var query = {
208
219
  id
209
220
  };
210
221
  return Session$7.authedFunction({
211
- method: 'GET',
212
- url: Helper$5.getUrl(values.serviceKey, 'getPost', query)
222
+ method: "GET",
223
+ url: Helper$5.getUrl(values.serviceKey, "getPost", query)
213
224
  });
214
225
  },
215
226
  getFeedSubmissions: site => {
216
- const query = {
227
+ var query = {
217
228
  site
218
229
  };
219
230
  return Session$7.authedFunction({
220
- method: 'GET',
221
- url: Helper$5.getUrl(values.serviceKey, 'getPendingPosts', query)
231
+ method: "GET",
232
+ url: Helper$5.getUrl(values.serviceKey, "getPendingPosts", query)
222
233
  });
223
234
  },
224
235
  getFeeds: (site, userId, authorId, lastKey) => {
225
- const query = {
236
+ var query = {
226
237
  site
227
238
  };
228
239
  if (userId) query.userId = userId;
229
240
  if (authorId) query.authorId = authorId;
230
241
  if (lastKey) query.lastKey = JSON.stringify(lastKey);
231
242
  return Session$7.authedFunction({
232
- method: 'GET',
233
- url: Helper$5.getUrl(values.serviceKey, 'getPosts', query)
243
+ method: "GET",
244
+ url: Helper$5.getUrl(values.serviceKey, "getPosts", query)
234
245
  });
235
246
  },
236
- getFeedsRecursive: function (site, userId, authorId, lastKey) {
237
- let feeds = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
247
+ getFeedsRecursive: function getFeedsRecursive(site, userId, authorId, lastKey) {
248
+ var feeds = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
238
249
  return new Promise(resolve => {
239
250
  feedActions.getFeeds(site, userId, authorId, lastKey).then(res => {
240
- const newFeeds = [...feeds, ...res.data.Items];
251
+ var newFeeds = [...feeds, ...res.data.Items];
241
252
  if (!res.data.LastKey) {
242
253
  return resolve(newFeeds);
243
254
  }
@@ -247,22 +258,22 @@ const feedActions = {
247
258
  },
248
259
  createFeed: feed => {
249
260
  return Session$7.authedFunction({
250
- method: 'POST',
251
- url: Helper$5.getUrl(values.serviceKey, 'createPost'),
261
+ method: "POST",
262
+ url: Helper$5.getUrl(values.serviceKey, "createPost"),
252
263
  data: _objectSpread$5({}, feed)
253
264
  });
254
265
  },
255
266
  editFeed: feed => {
256
267
  return Session$7.authedFunction({
257
- method: 'POST',
258
- url: Helper$5.getUrl(values.serviceKey, 'editPost'),
268
+ method: "POST",
269
+ url: Helper$5.getUrl(values.serviceKey, "editPost"),
259
270
  data: _objectSpread$5({}, feed)
260
271
  });
261
272
  },
262
273
  deleteFeed: id => {
263
274
  return Session$7.authedFunction({
264
- method: 'POST',
265
- url: Helper$5.getUrl(values.serviceKey, 'deletePost'),
275
+ method: "POST",
276
+ url: Helper$5.getUrl(values.serviceKey, "deletePost"),
266
277
  data: {
267
278
  id
268
279
  }
@@ -270,8 +281,8 @@ const feedActions = {
270
281
  },
271
282
  reviewFeed: (id, approved) => {
272
283
  return Session$7.authedFunction({
273
- method: 'POST',
274
- url: Helper$5.getUrl(values.serviceKey, 'reviewPost'),
284
+ method: "POST",
285
+ url: Helper$5.getUrl(values.serviceKey, "reviewPost"),
275
286
  data: {
276
287
  id,
277
288
  approved
@@ -280,13 +291,13 @@ const feedActions = {
280
291
  }
281
292
  };
282
293
 
283
- const {
294
+ var {
284
295
  Helper: Helper$4,
285
296
  Session: Session$6
286
297
  } = PlussCore;
287
- const reactionActions = {
298
+ var reactionActions = {
288
299
  addComment: (entityId, entityType, entityName, site, comment, image, parentId) => {
289
- const data = {
300
+ var data = {
290
301
  entityId,
291
302
  entityType,
292
303
  entityName,
@@ -298,8 +309,8 @@ const reactionActions = {
298
309
  data.image = image;
299
310
  }
300
311
  return Session$6.authedFunction({
301
- method: 'POST',
302
- url: Helper$4.getUrl('reactions', 'comments/add'),
312
+ method: "POST",
313
+ url: Helper$4.getUrl("reactions", "comments/add"),
303
314
  data
304
315
  });
305
316
  },
@@ -313,7 +324,7 @@ const reactionActions = {
313
324
  // });
314
325
  // },
315
326
  getComments: (entityId, entityType, minTime) => {
316
- const query = {
327
+ var query = {
317
328
  entityId,
318
329
  entityType
319
330
  };
@@ -321,28 +332,28 @@ const reactionActions = {
321
332
  query.minTime = minTime;
322
333
  }
323
334
  return Session$6.authedFunction({
324
- method: 'GET',
325
- url: Helper$4.getUrl('reactions', 'comments/get', query)
335
+ method: "GET",
336
+ url: Helper$4.getUrl("reactions", "comments/get", query)
326
337
  });
327
338
  }
328
339
  };
329
340
 
330
- const {
341
+ var {
331
342
  Apis
332
343
  } = PlussCore;
333
344
  Apis.analyticsActions;
334
- const userActions = Apis.userActions;
345
+ var userActions = Apis.userActions;
335
346
 
336
- const {
347
+ var {
337
348
  Helper: Helper$3
338
349
  } = PlussCore;
339
- const feedsUpdate = (site, isdashboard) => {
350
+ var feedsUpdate = (site, isdashboard) => {
340
351
  return dispatch => {
341
352
  if (isdashboard) dispatch({
342
353
  type: FEEDS_LOADING
343
354
  });
344
355
  feedActions.getFeedsRecursive(site).then(res => {
345
- const currentSite = Helper$3.readStorageWithCookie('site');
356
+ var currentSite = Helper$3.readStorageWithCookie("site");
346
357
  if (!_.isEmpty(res) && res[0].site === currentSite) {
347
358
  dispatch({
348
359
  type: FEEDS_LOADED,
@@ -357,31 +368,31 @@ const feedsUpdate = (site, isdashboard) => {
357
368
  });
358
369
  };
359
370
  };
360
- const feedsLoaded = feeds => {
371
+ var feedsLoaded = feeds => {
361
372
  return {
362
373
  type: FEEDS_LOADED,
363
374
  payload: feeds
364
375
  };
365
376
  };
366
- const removeFeed = id => {
377
+ var removeFeed = id => {
367
378
  return {
368
379
  type: FEEDS_REMOVED,
369
380
  payload: id
370
381
  };
371
382
  };
372
- const feedsSubmissionsLoaded = submissions => {
383
+ var feedsSubmissionsLoaded = submissions => {
373
384
  return {
374
385
  type: FEEDS_SUBMISSIONS_LOADED,
375
386
  payload: submissions
376
387
  };
377
388
  };
378
- const removeFeedSubmission = id => {
389
+ var removeFeedSubmission = id => {
379
390
  return {
380
391
  type: FEEDS_SUBMISSIONS_REMOVED,
381
392
  payload: id
382
393
  };
383
394
  };
384
- const feedTypesUpdate = site => {
395
+ var feedTypesUpdate = site => {
385
396
  return dispatch => {
386
397
  feedActions.getFeedTypes(site).then(res => {
387
398
  dispatch({
@@ -391,21 +402,21 @@ const feedTypesUpdate = site => {
391
402
  });
392
403
  };
393
404
  };
394
- const feedTypesLoaded = feedTypes => {
405
+ var feedTypesLoaded = feedTypes => {
395
406
  return {
396
407
  type: FEED_TYPES_LOADED,
397
408
  payload: feedTypes
398
409
  };
399
410
  };
400
411
 
401
- const {
412
+ var {
402
413
  Actions
403
414
  } = PlussCore;
404
- const usersLoaded = Actions.usersLoaded;
415
+ var usersLoaded = Actions.usersLoaded;
405
416
 
406
417
  function ownKeys$4(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
407
418
  function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
408
- const {
419
+ var {
409
420
  Session: Session$5,
410
421
  Components: Components$4,
411
422
  Analytics
@@ -415,34 +426,34 @@ class FeedList extends Component {
415
426
  var _this;
416
427
  super(props);
417
428
  _this = this;
418
- _defineProperty(this, "getUsers", async () => {
419
- const {
429
+ _defineProperty(this, "getUsers", /*#__PURE__*/_asyncToGenerator(function* () {
430
+ var {
420
431
  auth
421
- } = this.props;
432
+ } = _this.props;
422
433
  try {
423
- const res = await userActions.fetchUsers(auth.site);
434
+ var res = yield userActions.fetchUsers(auth.site);
424
435
  if (res.data != null && !_.isEmpty(res.data.results.Items) && res.data.results.Items[0].site === auth.site) {
425
- this.props.usersLoaded(res.data.results.Items);
436
+ _this.props.usersLoaded(res.data.results.Items);
426
437
  }
427
438
  } catch (error) {
428
- console.error('getUsers', error);
439
+ console.error("getUsers", error);
429
440
  }
430
- });
431
- _defineProperty(this, "getFeeds", async () => {
432
- const {
441
+ }));
442
+ _defineProperty(this, "getFeeds", /*#__PURE__*/_asyncToGenerator(function* () {
443
+ var {
433
444
  auth
434
- } = this.props;
445
+ } = _this.props;
435
446
  try {
436
- const res = await feedActions.getFeedsRecursive(auth.site);
447
+ var res = yield feedActions.getFeedsRecursive(auth.site);
437
448
  if (!_.isEmpty(res) && res[0].site === auth.site) {
438
- this.props.feedsLoaded(res);
449
+ _this.props.feedsLoaded(res);
439
450
  }
440
451
  } catch (error) {
441
- console.error('getFeeds', error);
452
+ console.error("getFeeds", error);
442
453
  }
443
- });
454
+ }));
444
455
  _defineProperty(this, "sortByCol", col => {
445
- const {
456
+ var {
446
457
  sortColumn,
447
458
  sortDesc
448
459
  } = this.state;
@@ -457,18 +468,23 @@ class FeedList extends Component {
457
468
  });
458
469
  }
459
470
  });
460
- _defineProperty(this, "onRemoveFeed", async feed => {
461
- if (window.confirm(values.textAreYouSureYouWantToDelete)) {
462
- this.props.removeFeed(feed.id);
463
- try {
464
- await feedActions.deleteFeed(feed.id);
465
- this.getFeeds();
466
- } catch (error) {
467
- console.log('onRemoveFeed', error);
468
- alert('Something went wrong with the request. Please try again.');
471
+ _defineProperty(this, "onRemoveFeed", /*#__PURE__*/function () {
472
+ var _ref3 = _asyncToGenerator(function* (feed) {
473
+ if (window.confirm(values.textAreYouSureYouWantToDelete)) {
474
+ _this.props.removeFeed(feed.id);
475
+ try {
476
+ yield feedActions.deleteFeed(feed.id);
477
+ _this.getFeeds();
478
+ } catch (error) {
479
+ console.log("onRemoveFeed", error);
480
+ alert("Something went wrong with the request. Please try again.");
481
+ }
469
482
  }
470
- }
471
- });
483
+ });
484
+ return function (_x) {
485
+ return _ref3.apply(this, arguments);
486
+ };
487
+ }());
472
488
  _defineProperty(this, "openFilter", filter => {
473
489
  this.setState({
474
490
  filterOpen: filter
@@ -499,22 +515,22 @@ class FeedList extends Component {
499
515
  _defineProperty(this, "isValidTimeFilter", () => {
500
516
  if (!this.state.selectedTimeFilter) return false;
501
517
  if (this.state.selectedTimeFilter.dayCount > 0) return true;
502
- return moment(this.state.timeFilterStart).startOf('d').valueOf() < moment(this.state.timeFilterEnd).endOf('d').valueOf();
518
+ return moment(this.state.timeFilterStart).startOf("d").valueOf() < moment(this.state.timeFilterEnd).endOf("d").valueOf();
503
519
  });
504
520
  _defineProperty(this, "saveTimeFilter", () => {
505
521
  if (!this.isValidTimeFilter()) return;
506
- let startTime = 0;
507
- let endTime = moment().endOf('d').valueOf();
508
- let text = '';
522
+ var startTime = 0;
523
+ var endTime = moment().endOf("d").valueOf();
524
+ var text = "";
509
525
  if (this.state.selectedTimeFilter.dayCount > 0) {
510
- startTime = moment().add(-this.state.selectedTimeFilter.dayCount, 'd').startOf('d').valueOf();
526
+ startTime = moment().add(-this.state.selectedTimeFilter.dayCount, "d").startOf("d").valueOf();
511
527
  text = this.state.selectedTimeFilter.text;
512
528
  } else {
513
- const startDate = moment(this.state.timeFilterStart).startOf('d');
514
- const endDate = moment(this.state.timeFilterEnd).endOf('d');
529
+ var startDate = moment(this.state.timeFilterStart).startOf("d");
530
+ var endDate = moment(this.state.timeFilterEnd).endOf("d");
515
531
  startTime = startDate.valueOf();
516
532
  endTime = endDate.valueOf();
517
- text = "".concat(startDate.format('DD/MM/YYYY'), " to ").concat(endDate.format('DD/MM/YYYY'));
533
+ text = "".concat(startDate.format("DD/MM/YYYY"), " to ").concat(endDate.format("DD/MM/YYYY"));
518
534
  }
519
535
  this.setState({
520
536
  selectedTimeFilterStart: startTime,
@@ -532,11 +548,11 @@ class FeedList extends Component {
532
548
  });
533
549
  _defineProperty(this, "onHandleChange", event => {
534
550
  var stateChange = {};
535
- stateChange[event.target.getAttribute('id')] = event.target.value;
551
+ stateChange[event.target.getAttribute("id")] = event.target.value;
536
552
  this.setState(stateChange);
537
553
  });
538
554
  _defineProperty(this, "onSelectUser", function (userKey) {
539
- let user = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
555
+ var user = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
540
556
  _this.setState({
541
557
  [userKey]: user
542
558
  });
@@ -547,11 +563,11 @@ class FeedList extends Component {
547
563
  ["".concat(userKey, "FilterText")]: null
548
564
  });
549
565
  // Notifiy user filter reset (for preselecting user in add)
550
- if (userKey === 'selectedUser' && this.props.onUserSelected) this.props.onUserSelected('');
566
+ if (userKey === "selectedUser" && this.props.onUserSelected) this.props.onUserSelected("");
551
567
  });
552
568
  _defineProperty(this, "saveUserFilter", userKey => {
553
- const selected = this.state[userKey];
554
- let userId = '';
569
+ var selected = this.state[userKey];
570
+ var userId = "";
555
571
  if (!selected) {
556
572
  this.removeUserFilter(userKey);
557
573
  } else {
@@ -562,19 +578,19 @@ class FeedList extends Component {
562
578
  [userKey]: null
563
579
  });
564
580
  // Notifiy user filter set (for preselecting user in add)
565
- if (userKey === 'selectedUser' && this.props.onUserSelected) this.props.onUserSelected(userId);
581
+ if (userKey === "selectedUser" && this.props.onUserSelected) this.props.onUserSelected(userId);
566
582
  }
567
583
  this.closeFilter();
568
584
  });
569
585
  _defineProperty(this, "getSource", () => {
570
- const {
586
+ var {
571
587
  selectedTimeFilterStart,
572
588
  selectedTimeFilterEnd,
573
589
  selectedTypeFilter,
574
590
  selectedUserFilter,
575
591
  selectedAuthorFilter
576
592
  } = this.state;
577
- let source = this.props.source;
593
+ var source = this.props.source;
578
594
 
579
595
  // filter by time
580
596
  if (selectedTimeFilterStart && selectedTimeFilterEnd) {
@@ -625,9 +641,9 @@ class FeedList extends Component {
625
641
  });
626
642
  }
627
643
  source = _.sortBy(source, event => {
628
- if (this.state.sortColumn === 'userName') return event.user.displayName;
629
- if (this.state.sortColumn === 'authorName') return event.author.displayName;
630
- if (this.state.sortColumn !== 'created') return event[this.state.sortColumn];
644
+ if (this.state.sortColumn === "userName") return event.user.displayName;
645
+ if (this.state.sortColumn === "authorName") return event.author.displayName;
646
+ if (this.state.sortColumn !== "created") return event[this.state.sortColumn];
631
647
  return event.created;
632
648
  });
633
649
  if (this.state.sortDesc) source.reverse();
@@ -635,11 +651,11 @@ class FeedList extends Component {
635
651
  });
636
652
  _defineProperty(this, "getExportSource", () => {
637
653
  return this.getSource().map(r => {
638
- const userName = r.user.displayName;
639
- const userId = r.user.id;
640
- const authorName = r.author.displayName;
641
- const authorId = r.author.id;
642
- const created = moment.utc(r.created).format();
654
+ var userName = r.user.displayName;
655
+ var userId = r.user.id;
656
+ var authorName = r.author.displayName;
657
+ var authorId = r.author.id;
658
+ var created = moment.utc(r.created).format();
643
659
  return _objectSpread$4(_objectSpread$4({}, r), {}, {
644
660
  userName,
645
661
  userId,
@@ -664,7 +680,7 @@ class FeedList extends Component {
664
680
  });
665
681
  });
666
682
  this.state = {
667
- sortColumn: 'created',
683
+ sortColumn: "created",
668
684
  sortDesc: true,
669
685
  selectedTimeFilter: Analytics.getAnalyticsFilterOptions()[1],
670
686
  selectedTimeFilterStart: null,
@@ -679,35 +695,35 @@ class FeedList extends Component {
679
695
  selectedTypeFilter: null
680
696
  };
681
697
  this.exportColumns = [{
682
- label: 'Select All',
683
- key: ''
698
+ label: "Select All",
699
+ key: ""
684
700
  }, {
685
- label: 'System Id',
686
- key: 'id'
701
+ label: "System Id",
702
+ key: "id"
687
703
  }, {
688
- label: 'Type',
689
- key: 'type'
704
+ label: "Type",
705
+ key: "type"
690
706
  }, {
691
- label: 'Title',
692
- key: 'title'
707
+ label: "Title",
708
+ key: "title"
693
709
  }, {
694
- label: 'Text',
695
- key: 'text'
710
+ label: "Text",
711
+ key: "text"
696
712
  }, {
697
- label: 'User Name',
698
- key: 'userName'
713
+ label: "User Name",
714
+ key: "userName"
699
715
  }, {
700
- label: 'User ID',
701
- key: 'userId'
716
+ label: "User ID",
717
+ key: "userId"
702
718
  }, {
703
- label: 'Author Name',
704
- key: 'authorName'
719
+ label: "Author Name",
720
+ key: "authorName"
705
721
  }, {
706
- label: 'Author ID',
707
- key: 'authorId'
722
+ label: "Author ID",
723
+ key: "authorId"
708
724
  }, {
709
- label: 'Post Time',
710
- key: 'created'
725
+ label: "Post Time",
726
+ key: "created"
711
727
  }];
712
728
  }
713
729
  UNSAFE_componentWillMount() {
@@ -718,10 +734,10 @@ class FeedList extends Component {
718
734
  this.getFeeds();
719
735
  }
720
736
  renderTimePopup() {
721
- const {
737
+ var {
722
738
  selectedTimeFilter
723
739
  } = this.state;
724
- return /*#__PURE__*/React.createElement(Components$4.Popup, {
740
+ return /*#__PURE__*/jsx(Components$4.Popup, {
725
741
  title: "Select Time",
726
742
  maxWidth: 600,
727
743
  minWidth: 400,
@@ -729,251 +745,286 @@ class FeedList extends Component {
729
745
  hasPadding: true,
730
746
  onClose: this.closeFilter,
731
747
  buttons: [{
732
- type: 'primaryAction',
748
+ type: "primaryAction",
733
749
  onClick: this.saveTimeFilter,
734
- text: 'Select',
750
+ text: "Select",
735
751
  isActive: this.isValidTimeFilter()
736
- }]
737
- }, /*#__PURE__*/React.createElement("div", {
738
- style: {
739
- minHeight: 150
740
- }
741
- }, /*#__PURE__*/React.createElement(Components$4.AnalyticsFilter, {
742
- defaultFilter: selectedTimeFilter,
743
- filterChanged: this.timeFilterChanged,
744
- filterDateRangeChanged: this.timeFilterDateRangeChanged
745
- })));
752
+ }],
753
+ children: /*#__PURE__*/jsx("div", {
754
+ style: {
755
+ minHeight: 150
756
+ },
757
+ children: /*#__PURE__*/jsx(Components$4.AnalyticsFilter, {
758
+ defaultFilter: selectedTimeFilter,
759
+ filterChanged: this.timeFilterChanged,
760
+ filterDateRangeChanged: this.timeFilterDateRangeChanged
761
+ })
762
+ })
763
+ });
746
764
  }
747
765
  renderUserPopup(userKey, label) {
748
- const {
766
+ var {
749
767
  userSearch
750
768
  } = this.state;
751
- const selected = this.state[userKey];
752
- let userContent = null;
769
+ var selected = this.state[userKey];
770
+ var userContent = null;
753
771
  if (selected) {
754
- userContent = /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Components$4.UserListing, {
755
- key: selected.id || selected.Id,
756
- user: selected,
757
- rightContent: /*#__PURE__*/React.createElement(Components$4.SVGIcon, {
758
- className: "removeIcon",
759
- icon: "close",
760
- onClick: () => this.onSelectUser(userKey),
761
- colour: Colours$1.COLOUR_DUSK
762
- })
763
- }));
772
+ userContent = /*#__PURE__*/jsx("div", {
773
+ children: /*#__PURE__*/jsx(Components$4.UserListing, {
774
+ user: selected,
775
+ rightContent: /*#__PURE__*/jsx(Icon, {
776
+ className: "removeIcon",
777
+ icon: "xmark",
778
+ onClick: () => this.onSelectUser(userKey),
779
+ colour: Colours$1.COLOUR_DUSK
780
+ })
781
+ }, selected.id || selected.Id)
782
+ });
764
783
  } else {
765
- userContent = /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Components$4.GenericInput, {
766
- id: "userSearch",
767
- type: "text"
768
- // label="Search"
769
- ,
770
- placeholder: "Search name",
771
- value: userSearch,
772
- onChange: e => this.onHandleChange(e),
773
- alwaysShowLabel: true
774
- }), _.sortBy(this.props.users, u => u.displayName.toUpperCase()).filter(u => {
775
- if (_.isEmpty(userSearch)) return true;
776
- return u.displayName.toUpperCase().indexOf(userSearch.toUpperCase()) > -1;
777
- }).map(user => {
778
- return /*#__PURE__*/React.createElement(Components$4.UserListing, {
779
- key: user.Id,
780
- user: user,
781
- onClick: () => this.onSelectUser(userKey, user)
782
- });
783
- }));
784
+ userContent = /*#__PURE__*/jsxs("div", {
785
+ children: [/*#__PURE__*/jsx(Components$4.GenericInput, {
786
+ id: "userSearch",
787
+ type: "text"
788
+ // label="Search"
789
+ ,
790
+ placeholder: "Search name",
791
+ value: userSearch,
792
+ onChange: e => this.onHandleChange(e),
793
+ alwaysShowLabel: true
794
+ }), _.sortBy(this.props.users, u => u.displayName.toUpperCase()).filter(u => {
795
+ if (_.isEmpty(userSearch)) return true;
796
+ return u.displayName.toUpperCase().indexOf(userSearch.toUpperCase()) > -1;
797
+ }).map(user => {
798
+ return /*#__PURE__*/jsx(Components$4.UserListing, {
799
+ user: user,
800
+ onClick: () => this.onSelectUser(userKey, user)
801
+ }, user.Id);
802
+ })]
803
+ });
784
804
  }
785
- return /*#__PURE__*/React.createElement(Components$4.Popup, {
805
+ return /*#__PURE__*/jsx(Components$4.Popup, {
786
806
  title: "Select ".concat(label),
787
807
  maxWidth: 600,
788
808
  minWidth: 400,
789
809
  hasPadding: true,
790
810
  onClose: this.closeFilter,
791
811
  buttons: [{
792
- type: 'primaryAction',
812
+ type: "primaryAction",
793
813
  onClick: () => this.saveUserFilter(userKey),
794
- text: 'Select',
814
+ text: "Select",
795
815
  isActive: true
796
- }]
797
- }, userContent);
816
+ }],
817
+ children: userContent
818
+ });
798
819
  }
799
820
  renderTypePopup() {
800
- const validTypes = _.uniq(this.props.source.map(r => r.type)).filter(t => t);
801
- const orderedTypes = _.sortBy(validTypes, t => t.toLowerCase());
802
- return /*#__PURE__*/React.createElement(Components$4.Popup, {
821
+ var validTypes = _.uniq(this.props.source.map(r => r.type)).filter(t => t);
822
+ var orderedTypes = _.sortBy(validTypes, t => t.toLowerCase());
823
+ return /*#__PURE__*/jsx(Components$4.Popup, {
803
824
  title: "Select Type",
804
825
  maxWidth: 600,
805
826
  minWidth: 400,
806
827
  hasPadding: true,
807
- onClose: this.closeFilter
808
- }, orderedTypes.map(type => {
809
- return /*#__PURE__*/React.createElement(Components$4.Tag, {
810
- key: type,
811
- onClick: () => this.selectTypeFilter(type),
812
- text: type,
813
- className: "marginRight-10 marginBottom-8"
814
- });
815
- }));
828
+ onClose: this.closeFilter,
829
+ children: orderedTypes.map(type => {
830
+ return /*#__PURE__*/jsx(Components$4.Tag, {
831
+ onClick: () => this.selectTypeFilter(type),
832
+ text: type,
833
+ className: "marginRight-10 marginBottom-8"
834
+ }, type);
835
+ })
836
+ });
816
837
  }
817
838
  renderFilterPopup() {
818
839
  if (!this.state.filterOpen) return null;
819
- if (this.state.filterOpen === 'time') return this.renderTimePopup();
820
- if (this.state.filterOpen === 'user') return this.renderUserPopup('selectedUser', 'User');
821
- if (this.state.filterOpen === 'author') return this.renderUserPopup('selectedAuthor', 'Author');
822
- if (this.state.filterOpen === 'type') return this.renderTypePopup();
840
+ if (this.state.filterOpen === "time") return this.renderTimePopup();
841
+ if (this.state.filterOpen === "user") return this.renderUserPopup("selectedUser", "User");
842
+ if (this.state.filterOpen === "author") return this.renderUserPopup("selectedAuthor", "Author");
843
+ if (this.state.filterOpen === "type") return this.renderTypePopup();
823
844
  return null;
824
845
  }
825
846
  renderFeeds() {
826
847
  // Posts can only be edited or deleted by those with full admin privileges
827
- const canEdit = Session$5.validateAccess(this.props.auth.site, values.permissionFeedManagement, this.props.auth);
848
+ var canEdit = Session$5.validateAccess(this.props.auth.site, values.permissionFeedManagement, this.props.auth);
828
849
  return this.getSource().map((feed, index) => {
829
850
  if (!feed) {
830
851
  return null;
831
852
  }
832
- return /*#__PURE__*/React.createElement("tr", {
833
- key: index
834
- }, /*#__PURE__*/React.createElement("td", {
835
- className: "table-TitleColumn"
836
- }, /*#__PURE__*/React.createElement(Link, {
837
- to: "".concat(values.routeFeedDetails, "/").concat(feed.id)
838
- }, /*#__PURE__*/React.createElement("span", null, feed.title))), /*#__PURE__*/React.createElement("td", null, moment.utc(feed.created).local().format('ddd D MMM YYYY h:mma')), /*#__PURE__*/React.createElement("td", null, feed.user && feed.user.displayName), /*#__PURE__*/React.createElement("td", null, feed.author && feed.author.displayName), /*#__PURE__*/React.createElement("td", {
839
- className: "table-options"
840
- }, canEdit ? /*#__PURE__*/React.createElement("div", {
841
- style: {
842
- display: 'flex',
843
- alignItems: 'center'
844
- }
845
- }, /*#__PURE__*/React.createElement(Link, {
846
- to: "".concat(values.routeFeedDetails, "/").concat(feed.id)
847
- }, /*#__PURE__*/React.createElement(FontAwesome, {
848
- style: {
849
- fontSize: 20,
850
- padding: 5,
851
- cursor: 'pointer'
852
- },
853
- name: "pencil"
854
- })), /*#__PURE__*/React.createElement("a", {
855
- onClick: () => this.onRemoveFeed(feed)
856
- }, /*#__PURE__*/React.createElement(FontAwesome, {
857
- style: {
858
- fontSize: 20,
859
- padding: 5,
860
- marginLeft: 8,
861
- cursor: 'pointer'
862
- },
863
- name: "minus-circle"
864
- }))) : null));
853
+ return /*#__PURE__*/jsxs("tr", {
854
+ children: [/*#__PURE__*/jsx("td", {
855
+ className: "table-TitleColumn",
856
+ children: /*#__PURE__*/jsx(Link, {
857
+ to: "".concat(values.routeFeedDetails, "/").concat(feed.id),
858
+ children: /*#__PURE__*/jsx("span", {
859
+ children: feed.title
860
+ })
861
+ })
862
+ }), /*#__PURE__*/jsx("td", {
863
+ children: moment.utc(feed.created).local().format("ddd D MMM YYYY h:mma")
864
+ }), /*#__PURE__*/jsx("td", {
865
+ children: feed.user && feed.user.displayName
866
+ }), /*#__PURE__*/jsx("td", {
867
+ children: feed.author && feed.author.displayName
868
+ }), /*#__PURE__*/jsx("td", {
869
+ className: "table-options",
870
+ children: canEdit ? /*#__PURE__*/jsxs("div", {
871
+ style: {
872
+ display: "flex",
873
+ alignItems: "center"
874
+ },
875
+ children: [/*#__PURE__*/jsx(Link, {
876
+ to: "".concat(values.routeFeedDetails, "/").concat(feed.id),
877
+ children: /*#__PURE__*/jsx(Icon, {
878
+ style: {
879
+ fontSize: 20,
880
+ padding: 5,
881
+ cursor: "pointer"
882
+ },
883
+ icon: "pencil"
884
+ })
885
+ }), /*#__PURE__*/jsx("a", {
886
+ onClick: () => this.onRemoveFeed(feed),
887
+ children: /*#__PURE__*/jsx(Icon, {
888
+ style: {
889
+ fontSize: 20,
890
+ padding: 5,
891
+ marginLeft: 8,
892
+ cursor: "pointer"
893
+ },
894
+ icon: "circle-minus"
895
+ })
896
+ })]
897
+ }) : null
898
+ })]
899
+ }, index);
865
900
  });
866
901
  }
867
902
  renderSort(col) {
868
- const {
903
+ var {
869
904
  sortColumn,
870
905
  sortDesc
871
906
  } = this.state;
872
907
  if (col !== sortColumn) return null;
873
- return /*#__PURE__*/React.createElement(FontAwesome, {
908
+ return /*#__PURE__*/jsx(Icon, {
874
909
  style: {
875
910
  marginLeft: 5
876
911
  },
877
- name: sortDesc ? 'chevron-up' : 'chevron-down'
912
+ icon: sortDesc ? "fa-".concat("chevron-up") : "fa-".concat("chevron-down")
878
913
  });
879
914
  }
880
915
  sortIsActive(col) {
881
- if (col !== this.state.sortColumn) return '';
882
- return ' table--columnActive';
916
+ if (col !== this.state.sortColumn) return "";
917
+ return " table--columnActive";
883
918
  }
884
919
  renderEmpty() {
885
- const title = this.props.strings["".concat(values.featureKey, "_textTitleRequests")] || values.textTitleRequests;
886
- return /*#__PURE__*/React.createElement("div", {
920
+ var title = this.props.strings["".concat(values.featureKey, "_textTitleRequests")] || values.textTitleRequests;
921
+ return /*#__PURE__*/jsxs("div", {
887
922
  style: {
888
- display: 'flex',
889
- flexDirection: 'column',
923
+ display: "flex",
924
+ flexDirection: "column",
890
925
  flex: 1,
891
- justifyContent: 'center',
892
- alignItems: 'center',
926
+ justifyContent: "center",
927
+ alignItems: "center",
893
928
  marginTop: 32
894
- }
895
- }, /*#__PURE__*/React.createElement("div", {
896
- className: "emptyState"
897
- }), /*#__PURE__*/React.createElement("div", {
898
- className: "marginTop-32",
899
- style: {
900
- maxWidth: 500,
901
- textAlign: 'center'
902
- }
903
- }, /*#__PURE__*/React.createElement("span", {
904
- className: "fontRegular fontSize-13"
905
- }, /*#__PURE__*/React.createElement("span", {
906
- className: "fontHeavy text-brandingColour"
907
- }, title, " "), values.textEmptyDescription)), /*#__PURE__*/React.createElement("div", {
908
- className: "marginTop-8 fontRegular fontSize-13",
909
- style: {
910
- maxWidth: 500,
911
- textAlign: 'center'
912
- }
913
- }, values.textEmptyExample));
929
+ },
930
+ children: [/*#__PURE__*/jsx("div", {
931
+ className: "emptyState"
932
+ }), /*#__PURE__*/jsx("div", {
933
+ className: "marginTop-32",
934
+ style: {
935
+ maxWidth: 500,
936
+ textAlign: "center"
937
+ },
938
+ children: /*#__PURE__*/jsxs("span", {
939
+ className: "fontRegular fontSize-13",
940
+ children: [/*#__PURE__*/jsxs("span", {
941
+ className: "fontHeavy text-brandingColour",
942
+ children: [title, " "]
943
+ }), values.textEmptyDescription]
944
+ })
945
+ }), /*#__PURE__*/jsx("div", {
946
+ className: "marginTop-8 fontRegular fontSize-13",
947
+ style: {
948
+ maxWidth: 500,
949
+ textAlign: "center"
950
+ },
951
+ children: values.textEmptyExample
952
+ })]
953
+ });
914
954
  }
915
955
  renderContent() {
916
956
  if (_.isEmpty(this.props.source)) return this.renderEmpty();
917
- return /*#__PURE__*/React.createElement(Table, {
957
+ return /*#__PURE__*/jsxs(Table, {
918
958
  className: "plussTable",
919
959
  striped: true,
920
960
  bordered: true,
921
961
  condensed: true,
922
962
  hover: true,
923
963
  style: {
924
- minWidth: '100%',
964
+ minWidth: "100%",
925
965
  marginTop: 32
926
- }
927
- }, /*#__PURE__*/React.createElement("thead", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("th", {
928
- className: "".concat(this.sortIsActive('title')),
929
- style: {
930
- cursor: 'pointer',
931
- minWidth: 200
932
- },
933
- onClick: () => {
934
- this.sortByCol('title');
935
- }
936
- }, "Title", this.renderSort('title')), /*#__PURE__*/React.createElement("th", {
937
- className: "".concat(this.sortIsActive('created')),
938
- style: {
939
- cursor: 'pointer'
940
- },
941
- onClick: () => {
942
- this.sortByCol('created');
943
- }
944
- }, "Time", this.renderSort('created')), /*#__PURE__*/React.createElement("th", {
945
- className: "".concat(this.sortIsActive('userName')),
946
- style: {
947
- cursor: 'pointer'
948
966
  },
949
- onClick: () => {
950
- this.sortByCol('userName');
951
- }
952
- }, "Posted To", this.renderSort('userName')), /*#__PURE__*/React.createElement("th", {
953
- className: "".concat(this.sortIsActive('authorName')),
954
- style: {
955
- cursor: 'pointer'
956
- },
957
- onClick: () => {
958
- this.sortByCol('authorName');
959
- }
960
- }, "Author", this.renderSort('authorName')), /*#__PURE__*/React.createElement("th", {
961
- style: {
962
- width: 50
963
- }
964
- }))), /*#__PURE__*/React.createElement("tbody", null, this.renderFeeds()));
967
+ children: [/*#__PURE__*/jsx("thead", {
968
+ children: /*#__PURE__*/jsxs("tr", {
969
+ children: [/*#__PURE__*/jsxs("th", {
970
+ className: "".concat(this.sortIsActive("title")),
971
+ style: {
972
+ cursor: "pointer",
973
+ minWidth: 200
974
+ },
975
+ onClick: () => {
976
+ this.sortByCol("title");
977
+ },
978
+ children: ["Title", this.renderSort("title")]
979
+ }), /*#__PURE__*/jsxs("th", {
980
+ className: "".concat(this.sortIsActive("created")),
981
+ style: {
982
+ cursor: "pointer"
983
+ },
984
+ onClick: () => {
985
+ this.sortByCol("created");
986
+ },
987
+ children: ["Time", this.renderSort("created")]
988
+ }), /*#__PURE__*/jsxs("th", {
989
+ className: "".concat(this.sortIsActive("userName")),
990
+ style: {
991
+ cursor: "pointer"
992
+ },
993
+ onClick: () => {
994
+ this.sortByCol("userName");
995
+ },
996
+ children: ["Posted To", this.renderSort("userName")]
997
+ }), /*#__PURE__*/jsxs("th", {
998
+ className: "".concat(this.sortIsActive("authorName")),
999
+ style: {
1000
+ cursor: "pointer"
1001
+ },
1002
+ onClick: () => {
1003
+ this.sortByCol("authorName");
1004
+ },
1005
+ children: ["Author", this.renderSort("authorName")]
1006
+ }), /*#__PURE__*/jsx("th", {
1007
+ style: {
1008
+ width: 50
1009
+ }
1010
+ })]
1011
+ })
1012
+ }), /*#__PURE__*/jsx("tbody", {
1013
+ children: this.renderFeeds()
1014
+ })]
1015
+ });
965
1016
  }
966
1017
  renderFilters() {
967
- let typeFilter = /*#__PURE__*/React.createElement(Components$4.Tag, {
1018
+ var typeFilter = /*#__PURE__*/jsx(Components$4.Tag, {
968
1019
  className: "marginRight-10",
969
- onClick: () => this.openFilter('type'),
1020
+ onClick: () => this.openFilter("type"),
970
1021
  text: "Type"
971
1022
  });
972
1023
  if (this.state.selectedTypeFilter) {
973
- typeFilter = /*#__PURE__*/React.createElement(Components$4.Tag, {
1024
+ typeFilter = /*#__PURE__*/jsx(Components$4.Tag, {
974
1025
  className: "marginRight-10",
975
1026
  onClick: () => {
976
- this.openFilter('type');
1027
+ this.openFilter("type");
977
1028
  },
978
1029
  rightIcon: "close",
979
1030
  rightClick: e => {
@@ -983,18 +1034,18 @@ class FeedList extends Component {
983
1034
  text: this.state.selectedTypeFilter
984
1035
  });
985
1036
  }
986
- let timeFilter = /*#__PURE__*/React.createElement(Components$4.Tag, {
1037
+ var timeFilter = /*#__PURE__*/jsx(Components$4.Tag, {
987
1038
  className: "marginRight-10",
988
1039
  onClick: () => {
989
- this.openFilter('time');
1040
+ this.openFilter("time");
990
1041
  },
991
1042
  text: "Time"
992
1043
  });
993
1044
  if (this.state.selectedTimeFilterText) {
994
- timeFilter = /*#__PURE__*/React.createElement(Components$4.Tag, {
1045
+ timeFilter = /*#__PURE__*/jsx(Components$4.Tag, {
995
1046
  className: "marginRight-10",
996
1047
  onClick: () => {
997
- this.openFilter('time');
1048
+ this.openFilter("time");
998
1049
  },
999
1050
  rightIcon: "close",
1000
1051
  rightClick: e => {
@@ -1004,68 +1055,74 @@ class FeedList extends Component {
1004
1055
  text: this.state.selectedTimeFilterText
1005
1056
  });
1006
1057
  }
1007
- let userFilter = /*#__PURE__*/React.createElement(Components$4.Tag, {
1058
+ var userFilter = /*#__PURE__*/jsx(Components$4.Tag, {
1008
1059
  className: "marginRight-10",
1009
1060
  onClick: () => {
1010
- this.openFilter('user');
1061
+ this.openFilter("user");
1011
1062
  },
1012
1063
  text: "User"
1013
1064
  });
1014
1065
  if (this.state.selectedUserFilter) {
1015
- userFilter = /*#__PURE__*/React.createElement(Components$4.Tag, {
1066
+ userFilter = /*#__PURE__*/jsx(Components$4.Tag, {
1016
1067
  className: "marginRight-10",
1017
1068
  onClick: () => {
1018
- this.openFilter('user');
1069
+ this.openFilter("user");
1019
1070
  },
1020
1071
  rightIcon: "close",
1021
1072
  rightClick: e => {
1022
1073
  e.stopPropagation();
1023
- this.removeUserFilter('selectedUser');
1074
+ this.removeUserFilter("selectedUser");
1024
1075
  },
1025
1076
  text: this.state.selectedUserFilterText
1026
1077
  });
1027
1078
  }
1028
- let authorFilter = /*#__PURE__*/React.createElement(Components$4.Tag, {
1079
+ var authorFilter = /*#__PURE__*/jsx(Components$4.Tag, {
1029
1080
  className: "marginRight-10",
1030
1081
  onClick: () => {
1031
- this.openFilter('author');
1082
+ this.openFilter("author");
1032
1083
  },
1033
1084
  text: "Author"
1034
1085
  });
1035
1086
  if (this.state.selectedAuthorFilter) {
1036
- authorFilter = /*#__PURE__*/React.createElement(Components$4.Tag, {
1087
+ authorFilter = /*#__PURE__*/jsx(Components$4.Tag, {
1037
1088
  className: "marginRight-10",
1038
1089
  onClick: () => {
1039
- this.openFilter('author');
1090
+ this.openFilter("author");
1040
1091
  },
1041
1092
  rightIcon: "close",
1042
1093
  rightClick: e => {
1043
1094
  e.stopPropagation();
1044
- this.removeUserFilter('selectedAuthor');
1095
+ this.removeUserFilter("selectedAuthor");
1045
1096
  },
1046
1097
  text: this.state.selectedAuthorFilterText
1047
1098
  });
1048
1099
  }
1049
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
1050
- className: "marginTop-20 flex flex-between flex-center"
1051
- }, /*#__PURE__*/React.createElement("div", {
1052
- className: "flex flex-center"
1053
- }, /*#__PURE__*/React.createElement(Components$4.Text, {
1054
- type: "h5",
1055
- className: "marginRight-20"
1056
- }, "Filter by"), timeFilter, userFilter, authorFilter, typeFilter), /*#__PURE__*/React.createElement(Components$4.Button, {
1057
- inline: true,
1058
- buttonType: "primaryAction",
1059
- leftIcon: "file-code-o",
1060
- onClick: this.onOpenExportCsv,
1061
- isActive: !_.isEmpty(this.getSource())
1062
- }, "Export CSV")));
1100
+ return /*#__PURE__*/jsx("div", {
1101
+ children: /*#__PURE__*/jsxs("div", {
1102
+ className: "marginTop-20 flex flex-between flex-center",
1103
+ children: [/*#__PURE__*/jsxs("div", {
1104
+ className: "flex flex-center",
1105
+ children: [/*#__PURE__*/jsx(Components$4.Text, {
1106
+ type: "h5",
1107
+ className: "marginRight-20",
1108
+ children: "Filter by"
1109
+ }), timeFilter, userFilter, authorFilter, typeFilter]
1110
+ }), /*#__PURE__*/jsx(Components$4.Button, {
1111
+ inline: true,
1112
+ buttonType: "primaryAction",
1113
+ leftIcon: "file-code",
1114
+ onClick: this.onOpenExportCsv,
1115
+ isActive: !_.isEmpty(this.getSource()),
1116
+ children: "Export CSV"
1117
+ })]
1118
+ })
1119
+ });
1063
1120
  }
1064
1121
  renderCSVPopup() {
1065
1122
  if (!this.state.exportCsvOpen) {
1066
1123
  return null;
1067
1124
  }
1068
- return /*#__PURE__*/React.createElement(Components$4.ExportCsvPopup, {
1125
+ return /*#__PURE__*/jsx(Components$4.ExportCsvPopup, {
1069
1126
  onClose: this.onCloseExportCsv,
1070
1127
  columns: this.exportColumns,
1071
1128
  source: this.getExportSource(),
@@ -1073,18 +1130,19 @@ class FeedList extends Component {
1073
1130
  });
1074
1131
  }
1075
1132
  render() {
1076
- return /*#__PURE__*/React.createElement("div", {
1133
+ return /*#__PURE__*/jsxs("div", {
1077
1134
  style: {
1078
- minWidth: '100%'
1079
- }
1080
- }, this.renderFilterPopup(), this.renderCSVPopup(), this.renderFilters(), this.renderContent());
1135
+ minWidth: "100%"
1136
+ },
1137
+ children: [this.renderFilterPopup(), this.renderCSVPopup(), this.renderFilters(), this.renderContent()]
1138
+ });
1081
1139
  }
1082
1140
  }
1083
- const mapStateToProps$5 = state => {
1084
- const {
1141
+ var mapStateToProps$5 = state => {
1142
+ var {
1085
1143
  users
1086
1144
  } = state.users;
1087
- const {
1145
+ var {
1088
1146
  auth
1089
1147
  } = state;
1090
1148
  return {
@@ -1100,33 +1158,35 @@ var FeedList$1 = connect(mapStateToProps$5, {
1100
1158
  usersLoaded
1101
1159
  })(withRouter(FeedList));
1102
1160
 
1103
- const {
1161
+ var {
1104
1162
  Session: Session$4
1105
1163
  } = PlussCore;
1106
1164
  class FeedSubmissions extends Component {
1107
1165
  constructor() {
1166
+ var _this;
1108
1167
  super(...arguments);
1168
+ _this = this;
1109
1169
  _defineProperty(this, "state", {
1110
1170
  feedSubmissions: [],
1111
- sortColumn: 'created',
1171
+ sortColumn: "created",
1112
1172
  // column to sort by
1113
1173
  sortDesc: false // if true, sort descending rather than ascending
1114
1174
  });
1115
- _defineProperty(this, "getData", async () => {
1116
- const {
1175
+ _defineProperty(this, "getData", /*#__PURE__*/_asyncToGenerator(function* () {
1176
+ var {
1117
1177
  auth
1118
- } = this.props;
1178
+ } = _this.props;
1119
1179
  try {
1120
- const res = await feedActions.getFeedSubmissions(auth.site);
1121
- const submissions = res.data.Items;
1180
+ var res = yield feedActions.getFeedSubmissions(auth.site);
1181
+ var submissions = res.data.Items;
1122
1182
  // console.log('getSubmissions', submissions && submissions[0]);
1123
1183
  if (!_.isEmpty(submissions) && submissions[0].site === auth.site) {
1124
- this.props.feedsSubmissionsLoaded(submissions);
1184
+ _this.props.feedsSubmissionsLoaded(submissions);
1125
1185
  }
1126
1186
  } catch (error) {
1127
- console.log('getData error', error);
1187
+ console.log("getData error", error);
1128
1188
  }
1129
- });
1189
+ }));
1130
1190
  }
1131
1191
  UNSAFE_componentWillMount() {
1132
1192
  Session$4.checkLoggedIn(this, this.props.auth);
@@ -1156,23 +1216,33 @@ class FeedSubmissions extends Component {
1156
1216
  }
1157
1217
  }
1158
1218
  renderSubmissions() {
1159
- let source = _.sortBy(this.props.source, feed => {
1160
- if (this.state.sortColumn === 'userName') return feed.user.displayName;
1161
- if (this.state.sortColumn === 'authorName') return feed.author.displayName;
1162
- if (this.state.sortColumn !== 'created') return feed[this.state.sortColumn];
1219
+ var source = _.sortBy(this.props.source, feed => {
1220
+ if (this.state.sortColumn === "userName") return feed.user.displayName;
1221
+ if (this.state.sortColumn === "authorName") return feed.author.displayName;
1222
+ if (this.state.sortColumn !== "created") return feed[this.state.sortColumn];
1163
1223
  return feed.created;
1164
1224
  });
1165
1225
  if (this.state.sortDesc) source.reverse();
1166
1226
  source = _.filter(source, feed => feed);
1167
1227
  return source.map(feed => {
1168
1228
  if (feed != null) {
1169
- return /*#__PURE__*/React.createElement("tr", {
1170
- key: feed.id
1171
- }, /*#__PURE__*/React.createElement("td", {
1172
- className: "table-TitleColumn"
1173
- }, /*#__PURE__*/React.createElement(Link, {
1174
- to: "".concat(values.routeFeedDetails, "/").concat(feed.id)
1175
- }, /*#__PURE__*/React.createElement("span", null, feed.title))), /*#__PURE__*/React.createElement("td", null, moment.utc(feed.createdTime).local().format('ddd D MMM YYYY h:mma')), /*#__PURE__*/React.createElement("td", null, feed.user && feed.user.displayName), /*#__PURE__*/React.createElement("td", null, feed.author && feed.author.displayName));
1229
+ return /*#__PURE__*/jsxs("tr", {
1230
+ children: [/*#__PURE__*/jsx("td", {
1231
+ className: "table-TitleColumn",
1232
+ children: /*#__PURE__*/jsx(Link, {
1233
+ to: "".concat(values.routeFeedDetails, "/").concat(feed.id),
1234
+ children: /*#__PURE__*/jsx("span", {
1235
+ children: feed.title
1236
+ })
1237
+ })
1238
+ }), /*#__PURE__*/jsx("td", {
1239
+ children: moment.utc(feed.createdTime).local().format("ddd D MMM YYYY h:mma")
1240
+ }), /*#__PURE__*/jsx("td", {
1241
+ children: feed.user && feed.user.displayName
1242
+ }), /*#__PURE__*/jsx("td", {
1243
+ children: feed.author && feed.author.displayName
1244
+ })]
1245
+ }, feed.id);
1176
1246
  }
1177
1247
  return null;
1178
1248
  });
@@ -1181,72 +1251,84 @@ class FeedSubmissions extends Component {
1181
1251
  if (col !== this.state.sortColumn) {
1182
1252
  return null;
1183
1253
  }
1184
- return /*#__PURE__*/React.createElement(FontAwesome, {
1254
+ return /*#__PURE__*/jsx(Icon, {
1185
1255
  style: {
1186
1256
  marginLeft: 5
1187
1257
  },
1188
- name: this.state.sortDesc ? 'chevron-up' : 'chevron-down'
1258
+ icon: this.state.sortDesc ? "fa-".concat("chevron-up") : "fa-".concat("chevron-down")
1189
1259
  });
1190
1260
  }
1191
1261
  sortIsActive(col) {
1192
1262
  if (col !== this.state.sortColumn) {
1193
- return '';
1263
+ return "";
1194
1264
  }
1195
- return ' table--columnActive';
1265
+ return " table--columnActive";
1196
1266
  }
1197
1267
  render() {
1198
- return /*#__PURE__*/React.createElement("div", {
1268
+ return /*#__PURE__*/jsx("div", {
1199
1269
  style: {
1200
- minWidth: '100%'
1201
- }
1202
- }, /*#__PURE__*/React.createElement(Table, {
1203
- className: "plussTable",
1204
- striped: true,
1205
- bordered: true,
1206
- condensed: true,
1207
- hover: true
1208
- }, /*#__PURE__*/React.createElement("thead", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("th", {
1209
- className: "".concat(this.sortIsActive('title')),
1210
- style: {
1211
- cursor: 'pointer',
1212
- minWidth: 200
1270
+ minWidth: "100%"
1213
1271
  },
1214
- onClick: () => {
1215
- this.sortByCol('title');
1216
- }
1217
- }, "Title", this.renderSort('title')), /*#__PURE__*/React.createElement("th", {
1218
- className: "".concat(this.sortIsActive('created')),
1219
- style: {
1220
- cursor: 'pointer'
1221
- },
1222
- onClick: () => {
1223
- this.sortByCol('created');
1224
- }
1225
- }, "Time", this.renderSort('created')), /*#__PURE__*/React.createElement("th", {
1226
- className: "".concat(this.sortIsActive('userName')),
1227
- style: {
1228
- cursor: 'pointer'
1229
- },
1230
- onClick: () => {
1231
- this.sortByCol('userName');
1232
- }
1233
- }, "Posted To", this.renderSort('userName')), /*#__PURE__*/React.createElement("th", {
1234
- className: "".concat(this.sortIsActive('authorName')),
1235
- style: {
1236
- cursor: 'pointer'
1237
- },
1238
- onClick: () => {
1239
- this.sortByCol('authorName');
1240
- }
1241
- }, "Author", this.renderSort('authorName')), /*#__PURE__*/React.createElement("th", {
1242
- style: {
1243
- width: 50
1244
- }
1245
- }))), /*#__PURE__*/React.createElement("tbody", null, this.renderSubmissions())));
1272
+ children: /*#__PURE__*/jsxs(Table, {
1273
+ className: "plussTable",
1274
+ striped: true,
1275
+ bordered: true,
1276
+ condensed: true,
1277
+ hover: true,
1278
+ children: [/*#__PURE__*/jsx("thead", {
1279
+ children: /*#__PURE__*/jsxs("tr", {
1280
+ children: [/*#__PURE__*/jsxs("th", {
1281
+ className: "".concat(this.sortIsActive("title")),
1282
+ style: {
1283
+ cursor: "pointer",
1284
+ minWidth: 200
1285
+ },
1286
+ onClick: () => {
1287
+ this.sortByCol("title");
1288
+ },
1289
+ children: ["Title", this.renderSort("title")]
1290
+ }), /*#__PURE__*/jsxs("th", {
1291
+ className: "".concat(this.sortIsActive("created")),
1292
+ style: {
1293
+ cursor: "pointer"
1294
+ },
1295
+ onClick: () => {
1296
+ this.sortByCol("created");
1297
+ },
1298
+ children: ["Time", this.renderSort("created")]
1299
+ }), /*#__PURE__*/jsxs("th", {
1300
+ className: "".concat(this.sortIsActive("userName")),
1301
+ style: {
1302
+ cursor: "pointer"
1303
+ },
1304
+ onClick: () => {
1305
+ this.sortByCol("userName");
1306
+ },
1307
+ children: ["Posted To", this.renderSort("userName")]
1308
+ }), /*#__PURE__*/jsxs("th", {
1309
+ className: "".concat(this.sortIsActive("authorName")),
1310
+ style: {
1311
+ cursor: "pointer"
1312
+ },
1313
+ onClick: () => {
1314
+ this.sortByCol("authorName");
1315
+ },
1316
+ children: ["Author", this.renderSort("authorName")]
1317
+ }), /*#__PURE__*/jsx("th", {
1318
+ style: {
1319
+ width: 50
1320
+ }
1321
+ })]
1322
+ })
1323
+ }), /*#__PURE__*/jsx("tbody", {
1324
+ children: this.renderSubmissions()
1325
+ })]
1326
+ })
1327
+ });
1246
1328
  }
1247
1329
  }
1248
- const mapStateToProps$4 = state => {
1249
- const {
1330
+ var mapStateToProps$4 = state => {
1331
+ var {
1250
1332
  auth
1251
1333
  } = state;
1252
1334
  return {
@@ -1258,7 +1340,7 @@ var FeedSubmissions$1 = connect(mapStateToProps$4, {
1258
1340
  feedsSubmissionsLoaded
1259
1341
  })(FeedSubmissions);
1260
1342
 
1261
- const {
1343
+ var {
1262
1344
  Session: Session$3,
1263
1345
  Components: Components$3
1264
1346
  } = PlussCore;
@@ -1267,18 +1349,18 @@ class FeedTypes extends Component {
1267
1349
  var _this;
1268
1350
  super(props);
1269
1351
  _this = this;
1270
- _defineProperty(this, "getFeedTypes", async () => {
1352
+ _defineProperty(this, "getFeedTypes", /*#__PURE__*/_asyncToGenerator(function* () {
1271
1353
  try {
1272
- const res = await feedActions.getFeedTypes(this.props.auth.site);
1273
- if (res.data != null) this.props.feedTypesLoaded(res.data);
1354
+ var res = yield feedActions.getFeedTypes(_this.props.auth.site);
1355
+ if (res.data != null) _this.props.feedTypesLoaded(res.data);
1274
1356
  } catch (error) {
1275
- console.error('getFeedTypes', error);
1357
+ console.error("getFeedTypes", error);
1276
1358
  } finally {
1277
- this.setState({
1359
+ _this.setState({
1278
1360
  loading: false
1279
1361
  });
1280
1362
  }
1281
- });
1363
+ }));
1282
1364
  _defineProperty(this, "sortByCol", col => {
1283
1365
  if (this.state.sortColumn === col) {
1284
1366
  this.setState({
@@ -1292,7 +1374,7 @@ class FeedTypes extends Component {
1292
1374
  }
1293
1375
  });
1294
1376
  _defineProperty(this, "isFeedTypeValid", () => {
1295
- const {
1377
+ var {
1296
1378
  feedTypeLabel,
1297
1379
  feedTypeColour
1298
1380
  } = this.state;
@@ -1300,29 +1382,34 @@ class FeedTypes extends Component {
1300
1382
  if (_.isEmpty(feedTypeColour)) return false;
1301
1383
  return true;
1302
1384
  });
1303
- _defineProperty(this, "onRemoveFeedType", async ev => {
1304
- if (!window.confirm("Are you sure you want to delete ".concat(ev.label, "?"))) return;
1305
- try {
1306
- await feedActions.deleteFeedType(this.props.auth.site, ev.id);
1307
- const index = _.findIndex(this.state.feedTypeList, feedType => {
1308
- return feedType != null && feedType.id === ev.id;
1309
- });
1310
- if (index > -1) {
1311
- const newFeedTypes = [...this.state.feedTypeList];
1312
- newFeedTypes[index].Deleted = true;
1313
- this.props.feedTypesLoaded(newFeedTypes);
1385
+ _defineProperty(this, "onRemoveFeedType", /*#__PURE__*/function () {
1386
+ var _ref2 = _asyncToGenerator(function* (ev) {
1387
+ if (!window.confirm("Are you sure you want to delete ".concat(ev.label, "?"))) return;
1388
+ try {
1389
+ yield feedActions.deleteFeedType(_this.props.auth.site, ev.id);
1390
+ var index = _.findIndex(_this.state.feedTypeList, feedType => {
1391
+ return feedType != null && feedType.id === ev.id;
1392
+ });
1393
+ if (index > -1) {
1394
+ var newFeedTypes = [..._this.state.feedTypeList];
1395
+ newFeedTypes[index].Deleted = true;
1396
+ _this.props.feedTypesLoaded(newFeedTypes);
1397
+ }
1398
+ } catch (error) {
1399
+ console.error("onRemoveFeedType", error);
1400
+ alert("Something went wrong with the request. Please try again.");
1314
1401
  }
1315
- } catch (error) {
1316
- console.error('onRemoveFeedType', error);
1317
- alert('Something went wrong with the request. Please try again.');
1318
- }
1319
- });
1402
+ });
1403
+ return function (_x) {
1404
+ return _ref2.apply(this, arguments);
1405
+ };
1406
+ }());
1320
1407
  _defineProperty(this, "onShowFeedType", function () {
1321
- let feedType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
1408
+ var feedType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
1322
1409
  _this.setState({
1323
1410
  showFeedType: true,
1324
1411
  feedTypeId: feedType ? feedType.id : null,
1325
- feedTypeLabel: feedType ? feedType.label : '',
1412
+ feedTypeLabel: feedType ? feedType.label : "",
1326
1413
  feedTypeColour: feedType ? feedType.colour : FeatureConfig.env.colourBrandingMain
1327
1414
  });
1328
1415
  });
@@ -1332,20 +1419,20 @@ class FeedTypes extends Component {
1332
1419
  showWarnings: false,
1333
1420
  showFeedType: false,
1334
1421
  feedTypeId: null,
1335
- feedTypeLabel: '',
1336
- feedTypeColour: ''
1422
+ feedTypeLabel: "",
1423
+ feedTypeColour: ""
1337
1424
  });
1338
1425
  });
1339
1426
  _defineProperty(this, "onHandleChange", event => {
1340
1427
  var stateChange = {};
1341
- stateChange[event.target.getAttribute('id')] = event.target.value;
1428
+ stateChange[event.target.getAttribute("id")] = event.target.value;
1342
1429
  this.setState(stateChange);
1343
1430
  });
1344
1431
  _defineProperty(this, "onSave", () => {
1345
- const {
1432
+ var {
1346
1433
  site
1347
1434
  } = this.props.auth;
1348
- const {
1435
+ var {
1349
1436
  submitting,
1350
1437
  feedTypeId,
1351
1438
  feedTypeLabel,
@@ -1360,35 +1447,35 @@ class FeedTypes extends Component {
1360
1447
  }
1361
1448
  this.setState({
1362
1449
  submitting: true
1363
- }, async () => {
1450
+ }, /*#__PURE__*/_asyncToGenerator(function* () {
1364
1451
  try {
1365
1452
  if (feedTypeId) {
1366
- await feedActions.editFeedType(site, feedTypeId, feedTypeLabel, feedTypeColour);
1453
+ yield feedActions.editFeedType(site, feedTypeId, feedTypeLabel, feedTypeColour);
1367
1454
  } else {
1368
- await feedActions.addFeedType(site, feedTypeLabel, feedTypeColour);
1455
+ yield feedActions.addFeedType(site, feedTypeLabel, feedTypeColour);
1369
1456
  }
1370
- this.props.feedTypesUpdate(site);
1371
- this.setState({
1457
+ _this.props.feedTypesUpdate(site);
1458
+ _this.setState({
1372
1459
  submitting: false
1373
- }, this.onHideFeedType);
1460
+ }, _this.onHideFeedType);
1374
1461
  } catch (error) {
1375
- console.error('onSave', error);
1376
- this.setState({
1462
+ console.error("onSave", error);
1463
+ _this.setState({
1377
1464
  submitting: false
1378
1465
  });
1379
- alert('Something went wrong with the request. Please try again.');
1466
+ alert("Something went wrong with the request. Please try again.");
1380
1467
  }
1381
- });
1468
+ }));
1382
1469
  });
1383
1470
  this.state = {
1384
1471
  feedTypeList: [],
1385
- sortColumn: 'name',
1472
+ sortColumn: "name",
1386
1473
  sortDesc: false,
1387
1474
  loading: true,
1388
1475
  showFeedType: false,
1389
1476
  feedTypeId: null,
1390
- feedTypeLabel: '',
1391
- feedTypeColour: '',
1477
+ feedTypeLabel: "",
1478
+ feedTypeColour: "",
1392
1479
  showWarnings: false,
1393
1480
  submitting: false
1394
1481
  };
@@ -1409,8 +1496,8 @@ class FeedTypes extends Component {
1409
1496
  });
1410
1497
  }
1411
1498
  renderList() {
1412
- const canEdit = Session$3.validateAccess(this.props.auth.site, values.permissionFeedManagement, this.props.auth);
1413
- let source = _.sortBy(this.state.feedTypeList, this.state.sortColumn);
1499
+ var canEdit = Session$3.validateAccess(this.props.auth.site, values.permissionFeedManagement, this.props.auth);
1500
+ var source = _.sortBy(this.state.feedTypeList, this.state.sortColumn);
1414
1501
  if (this.state.sortDesc) source.reverse();
1415
1502
  source = _.filter(source, ev => {
1416
1503
  if (!ev) return false;
@@ -1419,151 +1506,180 @@ class FeedTypes extends Component {
1419
1506
  });
1420
1507
  return source.map((ev, index) => {
1421
1508
  if (ev != null) {
1422
- return /*#__PURE__*/React.createElement("tr", {
1423
- key: index
1424
- }, /*#__PURE__*/React.createElement("td", {
1425
- className: "table-TitleColumn"
1426
- }, /*#__PURE__*/React.createElement("a", {
1427
- onClick: () => this.onShowFeedType(ev)
1428
- }, ev.label)), /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("div", {
1429
- className: "flex flex-row flex-center"
1430
- }, /*#__PURE__*/React.createElement("div", {
1431
- className: "colourPicker_button",
1432
- style: {
1433
- width: 80,
1434
- height: 30,
1435
- marginBottom: 'unset',
1436
- backgroundColor: ev.colour
1437
- }
1438
- }), /*#__PURE__*/React.createElement("div", {
1439
- className: "marginLeft-10"
1440
- }, ev.colour && ev.colour.toUpperCase()))), /*#__PURE__*/React.createElement("td", {
1441
- className: "table-options"
1442
- }, canEdit ? /*#__PURE__*/React.createElement("div", {
1443
- style: {
1444
- display: 'flex',
1445
- alignItems: 'center'
1446
- }
1447
- }, /*#__PURE__*/React.createElement("a", {
1448
- onClick: () => this.onShowFeedType(ev)
1449
- }, /*#__PURE__*/React.createElement(FontAwesome, {
1450
- style: {
1451
- fontSize: 20,
1452
- padding: 5,
1453
- marginLeft: 12,
1454
- cursor: 'pointer'
1455
- },
1456
- name: "pencil"
1457
- })), /*#__PURE__*/React.createElement("a", {
1458
- onClick: () => this.onRemoveFeedType(ev)
1459
- }, /*#__PURE__*/React.createElement(FontAwesome, {
1460
- style: {
1461
- fontSize: 20,
1462
- padding: 5,
1463
- marginLeft: 8,
1464
- cursor: 'pointer'
1465
- },
1466
- name: "minus-circle"
1467
- }))) : null));
1509
+ return /*#__PURE__*/jsxs("tr", {
1510
+ children: [/*#__PURE__*/jsx("td", {
1511
+ className: "table-TitleColumn",
1512
+ children: /*#__PURE__*/jsx("a", {
1513
+ onClick: () => this.onShowFeedType(ev),
1514
+ children: ev.label
1515
+ })
1516
+ }), /*#__PURE__*/jsx("td", {
1517
+ children: /*#__PURE__*/jsxs("div", {
1518
+ className: "flex flex-row flex-center",
1519
+ children: [/*#__PURE__*/jsx("div", {
1520
+ className: "colourPicker_button",
1521
+ style: {
1522
+ width: 80,
1523
+ height: 30,
1524
+ marginBottom: "unset",
1525
+ backgroundColor: ev.colour
1526
+ }
1527
+ }), /*#__PURE__*/jsx("div", {
1528
+ className: "marginLeft-10",
1529
+ children: ev.colour && ev.colour.toUpperCase()
1530
+ })]
1531
+ })
1532
+ }), /*#__PURE__*/jsx("td", {
1533
+ className: "table-options",
1534
+ children: canEdit ? /*#__PURE__*/jsxs("div", {
1535
+ style: {
1536
+ display: "flex",
1537
+ alignItems: "center"
1538
+ },
1539
+ children: [/*#__PURE__*/jsx("a", {
1540
+ onClick: () => this.onShowFeedType(ev),
1541
+ children: /*#__PURE__*/jsx(Icon, {
1542
+ style: {
1543
+ fontSize: 20,
1544
+ padding: 5,
1545
+ marginLeft: 12,
1546
+ cursor: "pointer"
1547
+ },
1548
+ icon: "pencil"
1549
+ })
1550
+ }), /*#__PURE__*/jsx("a", {
1551
+ onClick: () => this.onRemoveFeedType(ev),
1552
+ children: /*#__PURE__*/jsx(Icon, {
1553
+ style: {
1554
+ fontSize: 20,
1555
+ padding: 5,
1556
+ marginLeft: 8,
1557
+ cursor: "pointer"
1558
+ },
1559
+ icon: "circle-minus"
1560
+ })
1561
+ })]
1562
+ }) : null
1563
+ })]
1564
+ }, index);
1468
1565
  }
1469
1566
  return null;
1470
1567
  });
1471
1568
  }
1472
1569
  renderView() {
1473
- return /*#__PURE__*/React.createElement(Table, {
1570
+ return /*#__PURE__*/jsxs(Table, {
1474
1571
  className: "plussTable",
1475
1572
  striped: true,
1476
1573
  bordered: true,
1477
1574
  condensed: true,
1478
1575
  hover: true,
1479
1576
  style: {
1480
- minWidth: '100%'
1481
- }
1482
- }, /*#__PURE__*/React.createElement("thead", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("th", {
1483
- style: {
1484
- cursor: 'pointer'
1577
+ minWidth: "100%"
1485
1578
  },
1486
- onClick: () => this.sortByCol('label')
1487
- }, "Feed type"), /*#__PURE__*/React.createElement("th", {
1488
- style: {
1489
- cursor: 'pointer'
1490
- },
1491
- onClick: () => this.sortByCol('colour')
1492
- }, "Type colour"), /*#__PURE__*/React.createElement("th", {
1493
- style: {
1494
- width: 70
1495
- }
1496
- }))), /*#__PURE__*/React.createElement("tbody", null, this.renderList()));
1579
+ children: [/*#__PURE__*/jsx("thead", {
1580
+ children: /*#__PURE__*/jsxs("tr", {
1581
+ children: [/*#__PURE__*/jsx("th", {
1582
+ style: {
1583
+ cursor: "pointer"
1584
+ },
1585
+ onClick: () => this.sortByCol("label"),
1586
+ children: "Feed type"
1587
+ }), /*#__PURE__*/jsx("th", {
1588
+ style: {
1589
+ cursor: "pointer"
1590
+ },
1591
+ onClick: () => this.sortByCol("colour"),
1592
+ children: "Type colour"
1593
+ }), /*#__PURE__*/jsx("th", {
1594
+ style: {
1595
+ width: 70
1596
+ }
1597
+ })]
1598
+ })
1599
+ }), /*#__PURE__*/jsx("tbody", {
1600
+ children: this.renderList()
1601
+ })]
1602
+ });
1497
1603
  }
1498
1604
  renderEmpty() {
1499
- return /*#__PURE__*/React.createElement("div", {
1605
+ return /*#__PURE__*/jsxs("div", {
1500
1606
  style: {
1501
- display: 'flex',
1502
- flexDirection: 'column',
1607
+ display: "flex",
1608
+ flexDirection: "column",
1503
1609
  flex: 1,
1504
- justifyContent: 'center',
1505
- alignItems: 'center',
1610
+ justifyContent: "center",
1611
+ alignItems: "center",
1506
1612
  marginTop: 32
1507
- }
1508
- }, /*#__PURE__*/React.createElement("div", {
1509
- className: "emptyState"
1510
- }), /*#__PURE__*/React.createElement("div", {
1511
- className: "marginTop-32",
1512
- style: {
1513
- maxWidth: 600,
1514
- textAlign: 'center'
1515
- }
1516
- }, /*#__PURE__*/React.createElement("span", {
1517
- className: "fontRegular fontSize-13"
1518
- }, "Please add the feed types that exist in your village which work alongside the Care Feeds area.")), /*#__PURE__*/React.createElement("div", {
1519
- className: "marginTop-8 fontRegular fontSize-13",
1520
- style: {
1521
- maxWidth: 600,
1522
- textAlign: 'center'
1523
- }
1524
- }, "Examples might be; Lifestyle."));
1613
+ },
1614
+ children: [/*#__PURE__*/jsx("div", {
1615
+ className: "emptyState"
1616
+ }), /*#__PURE__*/jsx("div", {
1617
+ className: "marginTop-32",
1618
+ style: {
1619
+ maxWidth: 600,
1620
+ textAlign: "center"
1621
+ },
1622
+ children: /*#__PURE__*/jsx("span", {
1623
+ className: "fontRegular fontSize-13",
1624
+ children: "Please add the feed types that exist in your village which work alongside the Care Feeds area."
1625
+ })
1626
+ }), /*#__PURE__*/jsx("div", {
1627
+ className: "marginTop-8 fontRegular fontSize-13",
1628
+ style: {
1629
+ maxWidth: 600,
1630
+ textAlign: "center"
1631
+ },
1632
+ children: "Examples might be; Lifestyle."
1633
+ })]
1634
+ });
1525
1635
  }
1526
1636
  renderContent() {
1527
1637
  if (_.isEmpty(this.state.feedTypeList)) return this.renderEmpty();
1528
1638
  return this.renderView();
1529
1639
  }
1530
1640
  renderFeedTypes() {
1531
- const {
1641
+ var {
1532
1642
  feedTypeList,
1533
1643
  loading
1534
1644
  } = this.state;
1535
- const canAdd = Session$3.validateAccess(this.props.auth.site, values.permissionFeedManagement, this.props.auth);
1645
+ var canAdd = Session$3.validateAccess(this.props.auth.site, values.permissionFeedManagement, this.props.auth);
1536
1646
  if (feedTypeList.length === 0 && loading) {
1537
- return /*#__PURE__*/React.createElement("div", {
1647
+ return /*#__PURE__*/jsx("div", {
1538
1648
  style: {
1539
- minWidth: '100%'
1540
- }
1541
- }, /*#__PURE__*/React.createElement("div", {
1542
- className: "padding-60 paddingVertical-40",
1543
- style: {
1544
- textAlign: 'center'
1545
- }
1546
- }, /*#__PURE__*/React.createElement(FontAwesome, {
1547
- style: {
1548
- fontSize: 30,
1549
- color: FeatureConfig.env.colourBrandingOff
1649
+ minWidth: "100%"
1550
1650
  },
1551
- name: "spinner fa-pulse fa-fw"
1552
- })));
1651
+ children: /*#__PURE__*/jsx("div", {
1652
+ className: "padding-60 paddingVertical-40",
1653
+ style: {
1654
+ textAlign: "center"
1655
+ },
1656
+ children: /*#__PURE__*/jsx(Icon, {
1657
+ style: {
1658
+ fontSize: 30,
1659
+ color: FeatureConfig.env.colourBrandingOff
1660
+ },
1661
+ icon: "spinner",
1662
+ pulse: true,
1663
+ fixedWidth: true
1664
+ })
1665
+ })
1666
+ });
1553
1667
  }
1554
- return /*#__PURE__*/React.createElement("div", {
1668
+ return /*#__PURE__*/jsxs("div", {
1555
1669
  style: {
1556
- minWidth: '100%'
1557
- }
1558
- }, canAdd ? /*#__PURE__*/React.createElement("div", {
1559
- className: "marginBottom-32"
1560
- }, /*#__PURE__*/React.createElement(Components$3.AddButton, {
1561
- onClick: () => this.onShowFeedType(),
1562
- text: "NEW FEED TYPE"
1563
- })) : null, this.renderContent());
1670
+ minWidth: "100%"
1671
+ },
1672
+ children: [canAdd ? /*#__PURE__*/jsx("div", {
1673
+ className: "marginBottom-32",
1674
+ children: /*#__PURE__*/jsx(Components$3.AddButton, {
1675
+ onClick: () => this.onShowFeedType(),
1676
+ text: "NEW FEED TYPE"
1677
+ })
1678
+ }) : null, this.renderContent()]
1679
+ });
1564
1680
  }
1565
1681
  renderNewFeedTypePopup() {
1566
- const {
1682
+ var {
1567
1683
  submitting,
1568
1684
  showFeedType,
1569
1685
  feedTypeId,
@@ -1572,67 +1688,73 @@ class FeedTypes extends Component {
1572
1688
  feedTypeColour
1573
1689
  } = this.state;
1574
1690
  if (!showFeedType) return null;
1575
- return /*#__PURE__*/React.createElement(Components$3.Popup, {
1691
+ return /*#__PURE__*/jsxs(Components$3.Popup, {
1576
1692
  maxWidth: 800,
1577
1693
  minWidth: 450,
1578
1694
  hasPadding: true,
1579
1695
  buttons: [{
1580
- type: 'primaryAction',
1696
+ type: "primaryAction",
1581
1697
  onClick: this.onSave,
1582
1698
  isActive: !submitting && this.isFeedTypeValid(),
1583
- text: submitting ? 'Saving...' : 'Save',
1584
- className: 'popupButton'
1699
+ text: submitting ? "Saving..." : "Save",
1700
+ className: "popupButton"
1585
1701
  }, {
1586
- type: 'outlinedAction',
1702
+ type: "outlinedAction",
1587
1703
  onClick: this.onHideFeedType,
1588
1704
  isActive: !submitting,
1589
- text: 'Cancel',
1590
- className: 'popupButton'
1705
+ text: "Cancel",
1706
+ className: "popupButton"
1591
1707
  }],
1592
1708
  onClose: this.onHideFeedType,
1593
- title: feedTypeId ? 'Edit Type' : 'New Type'
1594
- }, /*#__PURE__*/React.createElement(Components$3.GenericInput, {
1595
- id: "feedTypeLabel",
1596
- type: "text",
1597
- label: "Label",
1598
- placeholder: "Feed type label",
1599
- value: feedTypeLabel,
1600
- onChange: this.onHandleChange,
1601
- isRequired: true,
1602
- isValid: () => !_.isEmpty(feedTypeLabel),
1603
- showError: () => showWarnings && _.isEmpty(feedTypeLabel),
1604
- alwaysShowLabel: true
1605
- }), /*#__PURE__*/React.createElement(Components$3.ColourOptions, {
1606
- options: ['vibrant', 'picker'],
1607
- defaultTab: "vibrant",
1608
- value: feedTypeColour,
1609
- onColourSelected: feedTypeColour => this.setState({
1610
- feedTypeColour
1611
- })
1612
- }), /*#__PURE__*/React.createElement("div", {
1613
- className: "marginTop-24"
1614
- }, /*#__PURE__*/React.createElement("div", {
1615
- className: "fieldLabel marginBottom-4"
1616
- }, "Preview"), /*#__PURE__*/React.createElement(Components$3.Tag, {
1617
- text: this.state.feedTypeLabel,
1618
- style: {
1619
- backgroundColor: feedTypeColour,
1620
- borderColor: feedTypeColour
1621
- }
1622
- })));
1709
+ title: feedTypeId ? "Edit Type" : "New Type",
1710
+ children: [/*#__PURE__*/jsx(Components$3.GenericInput, {
1711
+ id: "feedTypeLabel",
1712
+ type: "text",
1713
+ label: "Label",
1714
+ placeholder: "Feed type label",
1715
+ value: feedTypeLabel,
1716
+ onChange: this.onHandleChange,
1717
+ isRequired: true,
1718
+ isValid: () => !_.isEmpty(feedTypeLabel),
1719
+ showError: () => showWarnings && _.isEmpty(feedTypeLabel),
1720
+ alwaysShowLabel: true
1721
+ }), /*#__PURE__*/jsx(Components$3.ColourOptions, {
1722
+ options: ["vibrant", "picker"],
1723
+ defaultTab: "vibrant",
1724
+ value: feedTypeColour,
1725
+ onColourSelected: feedTypeColour => this.setState({
1726
+ feedTypeColour
1727
+ })
1728
+ }), /*#__PURE__*/jsxs("div", {
1729
+ className: "marginTop-24",
1730
+ children: [/*#__PURE__*/jsx("div", {
1731
+ className: "fieldLabel marginBottom-4",
1732
+ children: "Preview"
1733
+ }), /*#__PURE__*/jsx(Components$3.Tag, {
1734
+ text: this.state.feedTypeLabel,
1735
+ style: {
1736
+ backgroundColor: feedTypeColour,
1737
+ borderColor: feedTypeColour
1738
+ }
1739
+ })]
1740
+ })]
1741
+ });
1623
1742
  }
1624
1743
  render() {
1625
- return /*#__PURE__*/React.createElement("div", {
1744
+ return /*#__PURE__*/jsxs("div", {
1626
1745
  style: {
1627
- minWidth: '100%'
1628
- }
1629
- }, /*#__PURE__*/React.createElement("div", null, this.renderFeedTypes()), this.renderNewFeedTypePopup(), /*#__PURE__*/React.createElement("div", {
1630
- className: "hub_tidioPadding"
1631
- }));
1746
+ minWidth: "100%"
1747
+ },
1748
+ children: [/*#__PURE__*/jsx("div", {
1749
+ children: this.renderFeedTypes()
1750
+ }), this.renderNewFeedTypePopup(), /*#__PURE__*/jsx("div", {
1751
+ className: "hub_tidioPadding"
1752
+ })]
1753
+ });
1632
1754
  }
1633
1755
  }
1634
- const mapStateToProps$3 = state => {
1635
- const {
1756
+ var mapStateToProps$3 = state => {
1757
+ var {
1636
1758
  auth
1637
1759
  } = state;
1638
1760
  return {
@@ -1645,17 +1767,19 @@ var FeedTypes$1 = connect(mapStateToProps$3, {
1645
1767
  feedTypesUpdate
1646
1768
  })(withRouter(FeedTypes));
1647
1769
 
1648
- const {
1770
+ var {
1649
1771
  Components: Components$2,
1650
1772
  Session: Session$2,
1651
1773
  Helper: Helper$2
1652
1774
  } = PlussCore;
1653
1775
  class FeedHub extends Component {
1654
1776
  constructor(props) {
1777
+ var _this;
1655
1778
  super(props);
1779
+ _this = this;
1656
1780
  _defineProperty(this, "setData", () => {
1657
- const feeds = [];
1658
- const feedSubmissions = [];
1781
+ var feeds = [];
1782
+ var feedSubmissions = [];
1659
1783
  this.state.feeds.forEach(ev => {
1660
1784
  if (ev != null && !ev.deleted) feeds.push(ev);
1661
1785
  });
@@ -1668,79 +1792,81 @@ class FeedHub extends Component {
1668
1792
  });
1669
1793
  });
1670
1794
  _defineProperty(this, "getFeeds", () => {
1671
- const {
1795
+ var {
1672
1796
  auth
1673
1797
  } = this.props;
1674
1798
  this.setState({
1675
1799
  loadingFeeds: true
1676
- }, async () => {
1800
+ }, /*#__PURE__*/_asyncToGenerator(function* () {
1677
1801
  try {
1678
- const res = await feedActions.getFeedsRecursive(auth.site);
1802
+ var res = yield feedActions.getFeedsRecursive(auth.site);
1679
1803
  if (!_.isEmpty(res) && res[0].site === auth.site) {
1680
- this.props.feedsLoaded(res);
1804
+ _this.props.feedsLoaded(res);
1681
1805
  }
1682
1806
  } catch (error) {
1683
- console.error('getFeeds', error);
1807
+ console.error("getFeeds", error);
1684
1808
  } finally {
1685
- this.setState({
1809
+ _this.setState({
1686
1810
  loadingFeeds: false
1687
1811
  });
1688
1812
  }
1689
- });
1813
+ }));
1690
1814
  });
1691
1815
  _defineProperty(this, "getSubmissions", () => {
1692
- const {
1816
+ var {
1693
1817
  auth
1694
1818
  } = this.props;
1695
1819
  if (!Session$2.validateAccess(auth.site, values.permissionFeedManagement, auth)) return;
1696
1820
  this.setState({
1697
1821
  loadingSubmissions: true
1698
- }, async () => {
1822
+ }, /*#__PURE__*/_asyncToGenerator(function* () {
1699
1823
  try {
1700
- const res = await feedActions.getFeedSubmissions(auth.site);
1701
- const submissions = res.data.Items;
1824
+ var res = yield feedActions.getFeedSubmissions(auth.site);
1825
+ var submissions = res.data.Items;
1702
1826
  // console.log('getSubmissions', submissions && submissions[0]);
1703
1827
  if (!_.isEmpty(submissions) && submissions[0].site === auth.site) {
1704
- this.props.feedsSubmissionsLoaded(submissions);
1828
+ _this.props.feedsSubmissionsLoaded(submissions);
1705
1829
  }
1706
1830
  } catch (error) {
1707
- console.log('getSubmissions error', error);
1831
+ console.log("getSubmissions error", error);
1708
1832
  } finally {
1709
- this.setState({
1833
+ _this.setState({
1710
1834
  loadingSubmissions: false
1711
1835
  });
1712
1836
  }
1713
- });
1837
+ }));
1714
1838
  });
1715
1839
  _defineProperty(this, "canAddNew", isClass => {
1716
- const {
1840
+ var {
1717
1841
  auth
1718
1842
  } = this.props;
1719
- if (Session$2.validateAccess(auth.site, values.permissionFeedPost, auth) || Session$2.validateAccess(auth.site, values.permissionFeedDraft, auth)) return isClass ? '' : true;
1720
- return isClass ? ' hub-sideContent-topButton--hide' : false;
1843
+ if (Session$2.validateAccess(auth.site, values.permissionFeedPost, auth) || Session$2.validateAccess(auth.site, values.permissionFeedDraft, auth)) return isClass ? "" : true;
1844
+ return isClass ? " hub-sideContent-topButton--hide" : false;
1721
1845
  });
1722
1846
  _defineProperty(this, "onAddNew", () => {
1723
- const {
1847
+ var {
1724
1848
  selectedUserId
1725
1849
  } = this.state;
1726
1850
  if (this.canAddNew()) {
1727
1851
  // Preselect user if filter set
1728
- this.props.history.push("".concat(values.routeAddFeed).concat(selectedUserId ? "?userId=".concat(selectedUserId) : ''));
1852
+ this.props.history.push("".concat(values.routeAddFeed).concat(selectedUserId ? "?userId=".concat(selectedUserId) : ""));
1729
1853
  }
1730
1854
  });
1731
1855
  _defineProperty(this, "getSideBarSectionColour", id => this.state.selectedSection === id ? {
1732
- backgroundColor: '#fff'
1856
+ backgroundColor: "#fff"
1733
1857
  } : {});
1734
- _defineProperty(this, "renderStats", (stat, loading) => loading ? /*#__PURE__*/React.createElement(FontAwesome, {
1858
+ _defineProperty(this, "renderStats", (stat, loading) => loading ? /*#__PURE__*/jsx(Icon, {
1735
1859
  style: styles$4.spinner,
1736
- name: "spinner fa-pulse fa-fw"
1860
+ icon: "spinner",
1861
+ pulse: true,
1862
+ fixedWidth: true
1737
1863
  }) : stat);
1738
1864
  this.state = {
1739
- selectedSection: 'all',
1865
+ selectedSection: "all",
1740
1866
  loadingFeeds: false,
1741
1867
  feeds: [],
1742
1868
  feedSubmissions: [],
1743
- selectedUserId: ''
1869
+ selectedUserId: ""
1744
1870
  };
1745
1871
  }
1746
1872
  UNSAFE_componentWillMount() {
@@ -1760,84 +1886,84 @@ class FeedHub extends Component {
1760
1886
  }, this.setData);
1761
1887
  }
1762
1888
  renderLeftBar() {
1763
- const sectionItems = [];
1889
+ var sectionItems = [];
1764
1890
  if (this.canAddNew()) {
1765
1891
  sectionItems.push({
1766
- type: 'newButton',
1767
- text: 'New Post',
1892
+ type: "newButton",
1893
+ text: "New Post",
1768
1894
  onClick: this.onAddNew
1769
1895
  });
1770
1896
  }
1771
1897
  sectionItems.push({
1772
- type: 'navItem',
1773
- text: 'View Posts',
1774
- icon: 'eye',
1898
+ type: "navItem",
1899
+ text: "View Posts",
1900
+ icon: "eye",
1775
1901
  isFontAwesome: true,
1776
- selected: this.state.selectedSection === 'all',
1902
+ selected: this.state.selectedSection === "all",
1777
1903
  onClick: () => {
1778
1904
  this.setState({
1779
- selectedSection: 'all'
1905
+ selectedSection: "all"
1780
1906
  });
1781
1907
  }
1782
1908
  });
1783
1909
  if (Session$2.validateAccess(this.props.auth.site, values.permissionFeedManagement, this.props.auth)) {
1784
- let submissionText = 'View Submissions';
1910
+ var submissionText = "View Submissions";
1785
1911
  if (!this.state.loadingSubmissions) {
1786
1912
  submissionText = "View Submission".concat(Helper$2.getPluralS(this.state.feedSubmissions.length), " (").concat(this.state.feedSubmissions.length, ")");
1787
1913
  }
1788
1914
  sectionItems.push({
1789
- type: 'navItem',
1915
+ type: "navItem",
1790
1916
  text: submissionText,
1791
- // icon: 'question-circle-o',
1917
+ // icon: 'circle-question',
1792
1918
  // isFontAwesome: true,
1793
- selected: this.state.selectedSection === 'submissions',
1919
+ selected: this.state.selectedSection === "submissions",
1794
1920
  onClick: () => {
1795
1921
  this.setState({
1796
- selectedSection: 'submissions'
1922
+ selectedSection: "submissions"
1797
1923
  });
1798
1924
  }
1799
1925
  });
1800
1926
  }
1801
1927
  if (Session$2.validateAccess(this.props.auth.site, values.permissionFeedManagement, this.props.auth)) {
1802
1928
  sectionItems.push({
1803
- type: 'navItem',
1804
- text: 'Post Types',
1929
+ type: "navItem",
1930
+ text: "Post Types",
1805
1931
  // icon: 'maintenance2',
1806
1932
  // isSVG: true,
1807
- selected: this.state.selectedSection === 'feedTypes',
1933
+ selected: this.state.selectedSection === "feedTypes",
1808
1934
  onClick: () => {
1809
1935
  this.setState({
1810
- selectedSection: 'feedTypes'
1936
+ selectedSection: "feedTypes"
1811
1937
  });
1812
1938
  }
1813
1939
  });
1814
1940
  }
1815
- return /*#__PURE__*/React.createElement(Components$2.HubSidebar, {
1941
+ return /*#__PURE__*/jsx(Components$2.HubSidebar, {
1816
1942
  sections: [{
1817
1943
  title: this.props.strings["".concat(values.featureKey, "_textTitleRequests")] || values.textTitleFeeds,
1818
1944
  items: sectionItems
1819
1945
  }],
1820
1946
  helpGuide: {
1821
1947
  text: "Help with Resident Activity",
1822
- url: 'https://www.plusscommunities.com/resident-activity-feed-feature'
1948
+ url: "https://www.plusscommunities.com/resident-activity-feed-feature"
1823
1949
  }
1824
1950
  });
1825
1951
  }
1826
1952
  renderRight() {
1827
- const {
1953
+ var {
1828
1954
  selectedSection,
1829
1955
  feeds,
1830
1956
  feedSubmissions
1831
1957
  } = this.state;
1832
- if (selectedSection === 'submissions') {
1833
- return /*#__PURE__*/React.createElement(FeedSubmissions$1, {
1958
+ if (selectedSection === "submissions") {
1959
+ return /*#__PURE__*/jsx(FeedSubmissions$1, {
1834
1960
  source: feedSubmissions
1835
1961
  });
1836
1962
  }
1837
- if (selectedSection === 'feedTypes') {
1838
- return /*#__PURE__*/React.createElement(FeedTypes$1, null);
1963
+ if (selectedSection === "feedTypes") {
1964
+ return /*#__PURE__*/jsx(FeedTypes$1, {});
1839
1965
  }
1840
- return /*#__PURE__*/React.createElement(FeedList$1, {
1966
+ return /*#__PURE__*/jsx(FeedList$1, {
1841
1967
  source: feeds,
1842
1968
  onUserSelected: userId => this.setState({
1843
1969
  selectedUserId: userId
@@ -1845,40 +1971,43 @@ class FeedHub extends Component {
1845
1971
  });
1846
1972
  }
1847
1973
  render() {
1848
- return /*#__PURE__*/React.createElement("div", {
1849
- className: "hub-wrapperContainer"
1850
- }, this.renderLeftBar(), /*#__PURE__*/React.createElement("div", {
1851
- className: "hub-headerContentWrapper"
1852
- }, /*#__PURE__*/React.createElement(Components$2.Header, null), /*#__PURE__*/React.createElement("div", {
1853
- className: "hub-contentWrapper"
1854
- }, this.renderRight())));
1974
+ return /*#__PURE__*/jsxs("div", {
1975
+ className: "hub-wrapperContainer",
1976
+ children: [this.renderLeftBar(), /*#__PURE__*/jsxs("div", {
1977
+ className: "hub-headerContentWrapper",
1978
+ children: [/*#__PURE__*/jsx(Components$2.Header, {}), /*#__PURE__*/jsx("div", {
1979
+ className: "hub-contentWrapper",
1980
+ children: this.renderRight()
1981
+ })]
1982
+ })]
1983
+ });
1855
1984
  }
1856
1985
  }
1857
- const styles$4 = {
1986
+ var styles$4 = {
1858
1987
  sideBarTitleSection: {
1859
- lineHeight: '40px',
1988
+ lineHeight: "40px",
1860
1989
  marginTop: 30,
1861
1990
  marginBottom: 30,
1862
1991
  paddingLeft: 24,
1863
1992
  paddingRight: 24
1864
1993
  },
1865
1994
  sideBarSection: {
1866
- weight: '100%',
1995
+ weight: "100%",
1867
1996
  minWidth: 200,
1868
1997
  padding: 32,
1869
1998
  paddingLeft: 24,
1870
- cursor: 'pointer',
1871
- display: 'flex',
1872
- flexDirection: 'column',
1873
- justifyContent: 'center'
1999
+ cursor: "pointer",
2000
+ display: "flex",
2001
+ flexDirection: "column",
2002
+ justifyContent: "center"
1874
2003
  },
1875
2004
  spinner: {
1876
2005
  fontSize: 32,
1877
2006
  color: FeatureConfig.env.colourBrandingOff
1878
2007
  }
1879
2008
  };
1880
- const mapStateToProps$2 = state => {
1881
- const {
2009
+ var mapStateToProps$2 = state => {
2010
+ var {
1882
2011
  auth
1883
2012
  } = state;
1884
2013
  return {
@@ -1893,7 +2022,7 @@ var FeedHub$1 = connect(mapStateToProps$2, {
1893
2022
  feedsSubmissionsLoaded
1894
2023
  })(withRouter(FeedHub));
1895
2024
 
1896
- const {
2025
+ var {
1897
2026
  Helper: Helper$1,
1898
2027
  Session: Session$1,
1899
2028
  Colours,
@@ -1904,33 +2033,33 @@ class Feed extends Component {
1904
2033
  var _this;
1905
2034
  super(props);
1906
2035
  _this = this;
1907
- _defineProperty(this, "getFeed", async () => {
2036
+ _defineProperty(this, "getFeed", /*#__PURE__*/_asyncToGenerator(function* () {
1908
2037
  try {
1909
- const res = await feedActions.getFeed(this.state.feedId);
2038
+ var res = yield feedActions.getFeed(_this.state.feedId);
1910
2039
  // console.log('getFeed:', res.data);
1911
- this.setState({
2040
+ _this.setState({
1912
2041
  feed: res.data
1913
2042
  });
1914
- this.props.feedsLoaded([res.data]);
2043
+ _this.props.feedsLoaded([res.data]);
1915
2044
  } catch (error) {
1916
- console.error('getFeed', error);
2045
+ console.error("getFeed", error);
1917
2046
  }
1918
- });
1919
- _defineProperty(this, "getFeedTypes", async () => {
2047
+ }));
2048
+ _defineProperty(this, "getFeedTypes", /*#__PURE__*/_asyncToGenerator(function* () {
1920
2049
  try {
1921
- const res = await feedActions.getFeedTypes(this.props.auth.site);
1922
- this.setState({
2050
+ var res = yield feedActions.getFeedTypes(_this.props.auth.site);
2051
+ _this.setState({
1923
2052
  types: res.data
1924
2053
  });
1925
2054
  } catch (error) {
1926
- console.error('getFeedTypes', error);
2055
+ console.error("getFeedTypes", error);
1927
2056
  }
1928
- });
2057
+ }));
1929
2058
  _defineProperty(this, "canEdit", () => {
1930
2059
  return Session$1.validateAccess(this.props.auth.site, values.permissionFeedManagement, this.props.auth);
1931
2060
  });
1932
2061
  _defineProperty(this, "canApprove", () => {
1933
- const {
2062
+ var {
1934
2063
  feed
1935
2064
  } = this.state;
1936
2065
  return feed && _.isNil(feed.approved) && this.canEdit();
@@ -1943,43 +2072,43 @@ class Feed extends Component {
1943
2072
  });
1944
2073
  });
1945
2074
  });
1946
- _defineProperty(this, "onAddComment", async () => {
1947
- const {
2075
+ _defineProperty(this, "onAddComment", /*#__PURE__*/_asyncToGenerator(function* () {
2076
+ var {
1948
2077
  commentInput,
1949
2078
  feedId,
1950
2079
  feed,
1951
2080
  comments
1952
- } = this.state;
2081
+ } = _this.state;
1953
2082
  try {
1954
- this.setState({
1955
- commentInput: ''
2083
+ _this.setState({
2084
+ commentInput: ""
1956
2085
  });
1957
- const res = await reactionActions.addComment(feedId, values.featureKey, feed.title, feed.site, commentInput);
1958
- this.setState({
2086
+ var res = yield reactionActions.addComment(feedId, values.featureKey, feed.title, feed.site, commentInput);
2087
+ _this.setState({
1959
2088
  comments: [...comments, res.data]
1960
2089
  });
1961
2090
  } catch (error) {
1962
- console.error('onAddComment', error);
2091
+ console.error("onAddComment", error);
1963
2092
  }
1964
- });
2093
+ }));
1965
2094
  _defineProperty(this, "onHandleChange", event => {
1966
2095
  var stateChange = {};
1967
- stateChange[event.target.getAttribute('id')] = event.target.value;
2096
+ stateChange[event.target.getAttribute("id")] = event.target.value;
1968
2097
  this.setState(stateChange);
1969
2098
  });
1970
- _defineProperty(this, "onReviewFeed", async function () {
1971
- let approved = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
2099
+ _defineProperty(this, "onReviewFeed", /*#__PURE__*/_asyncToGenerator(function* () {
2100
+ var approved = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
1972
2101
  if (window.confirm(approved ? values.textAreYouSureYouWantToApprove : values.textAreYouSureYouWantToReject)) {
1973
2102
  try {
1974
2103
  _this.setState({
1975
2104
  editing: true
1976
2105
  });
1977
- const {
2106
+ var {
1978
2107
  feed
1979
2108
  } = _this.state;
1980
- const res = await feedActions.reviewFeed(feed.id, approved);
2109
+ var res = yield feedActions.reviewFeed(feed.id, approved);
1981
2110
  // console.log('onReviewFeed:', res.data);
1982
- const updated = res.data && res.data.updated;
2111
+ var updated = res.data && res.data.updated;
1983
2112
  _this.props.removeFeedSubmission(updated.id);
1984
2113
  _this.setState({
1985
2114
  editing: false,
@@ -1989,17 +2118,17 @@ class Feed extends Component {
1989
2118
  _this.setState({
1990
2119
  editing: false
1991
2120
  });
1992
- console.log('onReviewFeed', error);
1993
- alert('Something went wrong with the request. Please try again.');
2121
+ console.log("onReviewFeed", error);
2122
+ alert("Something went wrong with the request. Please try again.");
1994
2123
  }
1995
2124
  }
1996
- });
2125
+ }));
1997
2126
  this.state = {
1998
- feedId: Helper$1.safeReadParams(props, 'feedId') ? props.match.params.feedId : null,
2127
+ feedId: Helper$1.safeReadParams(props, "feedId") ? props.match.params.feedId : null,
1999
2128
  feed: null,
2000
2129
  types: [],
2001
2130
  comments: [],
2002
- commentInput: '',
2131
+ commentInput: "",
2003
2132
  loadingComments: false,
2004
2133
  editing: false
2005
2134
  };
@@ -2015,205 +2144,248 @@ class Feed extends Component {
2015
2144
  }
2016
2145
  }
2017
2146
  renderComment(c) {
2018
- return /*#__PURE__*/React.createElement(Components$1.Comment, {
2019
- key: c.Id,
2147
+ return /*#__PURE__*/jsx(Components$1.Comment, {
2020
2148
  comment: c
2021
- });
2149
+ }, c.Id);
2022
2150
  }
2023
2151
  renderCommentSection() {
2024
2152
  if (this.state.loadingComments) return null;
2025
- return /*#__PURE__*/React.createElement("div", {
2026
- className: "padding-60 paddingTop-8 paddingLeft-20"
2027
- }, /*#__PURE__*/React.createElement("div", {
2028
- className: "newTopBar paddingLeft-40"
2029
- }, /*#__PURE__*/React.createElement(Components$1.Text, {
2030
- type: "formTitleSmall",
2031
- className: "marginBottom-16"
2032
- }, "Comments"), /*#__PURE__*/React.createElement("div", {
2033
- className: "commentSection"
2034
- }, this.state.comments.map(c => this.renderComment(c))), /*#__PURE__*/React.createElement("div", {
2035
- className: "commentReply"
2036
- }, /*#__PURE__*/React.createElement("div", {
2037
- className: "commentReply_button".concat(!_.isEmpty(this.state.commentInput) ? ' commentReply_button-active' : ''),
2038
- onClick: this.onAddComment
2039
- }, /*#__PURE__*/React.createElement(FontAwesome, {
2040
- className: "commentReply_icon",
2041
- name: "paper-plane-o"
2042
- })), /*#__PURE__*/React.createElement(Textarea, {
2043
- id: "commentInput",
2044
- placeholder: "Reply here...",
2045
- type: "text",
2046
- className: "commentReply_input",
2047
- value: this.state.commentInput,
2048
- onChange: e => this.onHandleChange(e)
2049
- }))));
2153
+ return /*#__PURE__*/jsx("div", {
2154
+ className: "padding-60 paddingTop-8 paddingLeft-20",
2155
+ children: /*#__PURE__*/jsxs("div", {
2156
+ className: "newTopBar paddingLeft-40",
2157
+ children: [/*#__PURE__*/jsx(Components$1.Text, {
2158
+ type: "formTitleSmall",
2159
+ className: "marginBottom-16",
2160
+ children: "Comments"
2161
+ }), /*#__PURE__*/jsx("div", {
2162
+ className: "commentSection",
2163
+ children: this.state.comments.map(c => this.renderComment(c))
2164
+ }), /*#__PURE__*/jsxs("div", {
2165
+ className: "commentReply",
2166
+ children: [/*#__PURE__*/jsx("div", {
2167
+ className: "commentReply_button".concat(!_.isEmpty(this.state.commentInput) ? " commentReply_button-active" : ""),
2168
+ onClick: this.onAddComment,
2169
+ children: /*#__PURE__*/jsx(Icon, {
2170
+ className: "commentReply_icon",
2171
+ icon: "paper-plane"
2172
+ })
2173
+ }), /*#__PURE__*/jsx(Textarea, {
2174
+ id: "commentInput",
2175
+ placeholder: "Reply here...",
2176
+ type: "text",
2177
+ className: "commentReply_input",
2178
+ value: this.state.commentInput,
2179
+ onChange: e => this.onHandleChange(e)
2180
+ })]
2181
+ })]
2182
+ })
2183
+ });
2050
2184
  }
2051
2185
  renderImages() {
2052
- const {
2186
+ var {
2053
2187
  feed
2054
2188
  } = this.state;
2055
2189
  if (_.isEmpty(feed.photo) && _.isEmpty(feed.photos)) return null;
2056
- const imagesToUse = _.isEmpty(feed.photo) ? feed.photos : [feed.photo];
2057
- return /*#__PURE__*/React.createElement("div", {
2058
- className: "imageGrid"
2059
- }, imagesToUse.map((image, i) => {
2060
- return /*#__PURE__*/React.createElement("a", {
2061
- href: image,
2062
- target: "_blank",
2063
- rel: "noopener noreferrer",
2064
- key: i
2065
- }, /*#__PURE__*/React.createElement("div", {
2066
- className: "imageGrid_image",
2067
- style: {
2068
- backgroundImage: "url('".concat(Helper$1.get1400(image), "')")
2069
- }
2070
- }));
2071
- }));
2190
+ var imagesToUse = _.isEmpty(feed.photo) ? feed.photos : [feed.photo];
2191
+ return /*#__PURE__*/jsx("div", {
2192
+ className: "imageGrid",
2193
+ children: imagesToUse.map((image, i) => {
2194
+ return /*#__PURE__*/jsx("a", {
2195
+ href: image,
2196
+ target: "_blank",
2197
+ rel: "noopener noreferrer",
2198
+ children: /*#__PURE__*/jsx("div", {
2199
+ className: "imageGrid_image",
2200
+ style: {
2201
+ backgroundImage: "url('".concat(Helper$1.get1400(image), "')")
2202
+ }
2203
+ })
2204
+ }, i);
2205
+ })
2206
+ });
2072
2207
  }
2073
2208
  renderInner() {
2074
- const {
2209
+ var {
2075
2210
  feed,
2076
2211
  types
2077
2212
  } = this.state;
2078
2213
  if (feed == null) return null;
2079
- const feedType = types.find(t => t.label === feed.type);
2080
- const editable = this.canEdit();
2081
- return /*#__PURE__*/React.createElement("div", {
2214
+ var feedType = types.find(t => t.label === feed.type);
2215
+ var editable = this.canEdit();
2216
+ return /*#__PURE__*/jsxs("div", {
2082
2217
  style: {
2083
2218
  paddingBottom: 40
2084
- }
2085
- }, /*#__PURE__*/React.createElement("div", {
2086
- className: "padding-60 paddingVertical-40 relative"
2087
- }, /*#__PURE__*/React.createElement(Components$1.Text, {
2088
- type: "formTitleLarge",
2089
- className: "marginBottom-8"
2090
- }, feed.title || 'Feed'), /*#__PURE__*/React.createElement("div", {
2091
- className: "marginTop-16"
2092
- }, /*#__PURE__*/React.createElement("div", {
2093
- className: 'fieldLabel'
2094
- }, "Posted to"), /*#__PURE__*/React.createElement("div", {
2095
- className: 'marginTop-5'
2096
- }, /*#__PURE__*/React.createElement(Components$1.UserListing, {
2097
- size: 25,
2098
- user: feed.user
2099
- }))), editable && feed.author ? /*#__PURE__*/React.createElement("div", {
2100
- className: "marginTop-16"
2101
- }, /*#__PURE__*/React.createElement("div", {
2102
- className: 'fieldLabel'
2103
- }, "Posted by"), /*#__PURE__*/React.createElement("div", {
2104
- className: 'marginTop-5'
2105
- }, /*#__PURE__*/React.createElement(Components$1.UserListing, {
2106
- size: 25,
2107
- user: feed.author
2108
- }))) : null, /*#__PURE__*/React.createElement("div", {
2109
- className: "marginTop-16"
2110
- }, /*#__PURE__*/React.createElement(Components$1.Tag, {
2111
- text: feed.type,
2112
- style: {
2113
- backgroundColor: feedType ? feedType.colour : undefined,
2114
- borderRadius: 8,
2115
- marginRight: 10
2116
- }
2117
- })), this.renderImages(), /*#__PURE__*/React.createElement("div", {
2118
- className: "marginTop-16"
2119
- }, /*#__PURE__*/React.createElement("div", {
2120
- className: 'fontRegular fontSize-16 text-dark marginTop-5'
2121
- }, feed.text))), feed.approved ? this.renderCommentSection() : null);
2219
+ },
2220
+ children: [/*#__PURE__*/jsxs("div", {
2221
+ className: "padding-60 paddingVertical-40 relative",
2222
+ children: [/*#__PURE__*/jsx(Components$1.Text, {
2223
+ type: "formTitleLarge",
2224
+ className: "marginBottom-8",
2225
+ children: feed.title || "Feed"
2226
+ }), /*#__PURE__*/jsxs("div", {
2227
+ className: "marginTop-16",
2228
+ children: [/*#__PURE__*/jsx("div", {
2229
+ className: "fieldLabel",
2230
+ children: "Posted to"
2231
+ }), /*#__PURE__*/jsx("div", {
2232
+ className: "marginTop-5",
2233
+ children: /*#__PURE__*/jsx(Components$1.UserListing, {
2234
+ size: 25,
2235
+ user: feed.user
2236
+ })
2237
+ })]
2238
+ }), editable && feed.author ? /*#__PURE__*/jsxs("div", {
2239
+ className: "marginTop-16",
2240
+ children: [/*#__PURE__*/jsx("div", {
2241
+ className: "fieldLabel",
2242
+ children: "Posted by"
2243
+ }), /*#__PURE__*/jsx("div", {
2244
+ className: "marginTop-5",
2245
+ children: /*#__PURE__*/jsx(Components$1.UserListing, {
2246
+ size: 25,
2247
+ user: feed.author
2248
+ })
2249
+ })]
2250
+ }) : null, /*#__PURE__*/jsx("div", {
2251
+ className: "marginTop-16",
2252
+ children: /*#__PURE__*/jsx(Components$1.Tag, {
2253
+ text: feed.type,
2254
+ style: {
2255
+ backgroundColor: feedType ? feedType.colour : undefined,
2256
+ borderRadius: 8,
2257
+ marginRight: 10
2258
+ }
2259
+ })
2260
+ }), this.renderImages(), /*#__PURE__*/jsx("div", {
2261
+ className: "marginTop-16",
2262
+ children: /*#__PURE__*/jsx("div", {
2263
+ className: "fontRegular fontSize-16 text-dark marginTop-5",
2264
+ children: feed.text
2265
+ })
2266
+ })]
2267
+ }), feed.approved ? this.renderCommentSection() : null]
2268
+ });
2122
2269
  }
2123
2270
  renderHistoryEntry(e, i) {
2124
- const action = (() => {
2125
- const {
2271
+ var action = (() => {
2272
+ var {
2126
2273
  approved,
2127
2274
  deleted
2128
2275
  } = e.changes;
2129
- if (approved && approved.new === true) return 'Approved';
2130
- if (approved && approved.new === false) return 'Rejected';
2131
- if (deleted && deleted.new === true) return 'Deleted';
2132
- return 'Edited';
2276
+ if (approved && approved.new === true) return "Approved";
2277
+ if (approved && approved.new === false) return "Rejected";
2278
+ if (deleted && deleted.new === true) return "Deleted";
2279
+ return "Edited";
2133
2280
  })();
2134
- return /*#__PURE__*/React.createElement("div", {
2281
+ return /*#__PURE__*/jsxs("div", {
2135
2282
  className: "ticketHistoryEntry",
2136
- key: i
2137
- }, /*#__PURE__*/React.createElement("p", {
2138
- className: "ticketHistoryEntry_timestamp"
2139
- }, moment.utc(e.timestamp).local().format('D MMM YYYY h:mma')), /*#__PURE__*/React.createElement("div", {
2140
- className: "statusLabel statusLabel-large statusLabel-full",
2141
- style: {
2142
- backgroundColor: Colours.COLOUR_DUSK
2143
- }
2144
- }, /*#__PURE__*/React.createElement("span", {
2145
- className: "statusLabel_text"
2146
- }, "".concat(action, " by ").concat(e.user.displayName))));
2283
+ children: [/*#__PURE__*/jsx("p", {
2284
+ className: "ticketHistoryEntry_timestamp",
2285
+ children: moment.utc(e.timestamp).local().format("D MMM YYYY h:mma")
2286
+ }), /*#__PURE__*/jsx("div", {
2287
+ className: "statusLabel statusLabel-large statusLabel-full",
2288
+ style: {
2289
+ backgroundColor: Colours.COLOUR_DUSK
2290
+ },
2291
+ children: /*#__PURE__*/jsx("span", {
2292
+ className: "statusLabel_text",
2293
+ children: "".concat(action, " by ").concat(e.user.displayName)
2294
+ })
2295
+ })]
2296
+ }, i);
2147
2297
  }
2148
2298
  renderEditHistory() {
2149
- const {
2299
+ var {
2150
2300
  feed
2151
2301
  } = this.state;
2152
2302
  if (!feed || !feed.history) return null;
2153
- const source = _.sortBy(feed.history, 'timestamp');
2303
+ var source = _.sortBy(feed.history, "timestamp");
2154
2304
  // console.log('renderEditHistory', JSON.stringify(source, null, 2));
2155
2305
 
2156
- return /*#__PURE__*/React.createElement("div", {
2157
- className: "padding-32 paddingVertical-40 bottomDivideBorder relative"
2158
- }, /*#__PURE__*/React.createElement("div", {
2159
- className: "newTopBar clearfix flex flex-reverse"
2160
- }, /*#__PURE__*/React.createElement(Components$1.Text, {
2161
- type: "formTitleSmall",
2162
- className: "flex-1"
2163
- }, "Edit History")), source.map(this.renderHistoryEntry));
2306
+ return /*#__PURE__*/jsxs("div", {
2307
+ className: "padding-32 paddingVertical-40 bottomDivideBorder relative",
2308
+ children: [/*#__PURE__*/jsx("div", {
2309
+ className: "newTopBar clearfix flex flex-reverse",
2310
+ children: /*#__PURE__*/jsx(Components$1.Text, {
2311
+ type: "formTitleSmall",
2312
+ className: "flex-1",
2313
+ children: "Edit History"
2314
+ })
2315
+ }), source.map(this.renderHistoryEntry)]
2316
+ });
2164
2317
  }
2165
2318
  renderButtons() {
2166
- const editable = this.canEdit();
2167
- const approvable = this.canApprove();
2168
- const isEditing = this.state.editing;
2169
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Components$1.Button, {
2170
- inline: true,
2171
- buttonType: "tertiary",
2172
- onClick: () => {
2173
- window.history.back();
2174
- },
2175
- isActive: true,
2176
- style: {
2177
- marginRight: 16
2178
- }
2179
- }, "Back"), !_.isEmpty(this.state.feed) ? /*#__PURE__*/React.createElement(React.Fragment, null, editable ? /*#__PURE__*/React.createElement(Link, {
2180
- to: "".concat(values.routeAddFeed, "/").concat(this.state.feedId)
2181
- }, /*#__PURE__*/React.createElement(Components$1.Button, {
2182
- inline: true,
2183
- style: {
2184
- marginRight: 25
2185
- },
2186
- buttonType: "outlined",
2187
- isActive: !isEditing,
2188
- onClick: this.editFeed
2189
- }, "Edit")) : null, approvable ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Components$1.Button, {
2190
- inline: true,
2191
- style: {
2192
- marginRight: 25
2193
- },
2194
- buttonType: "outlined",
2195
- isActive: !isEditing,
2196
- onClick: () => this.onReviewFeed(false)
2197
- }, "Reject"), /*#__PURE__*/React.createElement(Components$1.Button, {
2198
- inline: true,
2199
- style: {
2200
- marginRight: 25
2201
- },
2202
- buttonType: "primary",
2203
- isActive: !isEditing,
2204
- onClick: () => this.onReviewFeed(true)
2205
- }, "Approve")) : null) : null);
2319
+ var editable = this.canEdit();
2320
+ var approvable = this.canApprove();
2321
+ var isEditing = this.state.editing;
2322
+ return /*#__PURE__*/jsxs("div", {
2323
+ children: [/*#__PURE__*/jsx(Components$1.Button, {
2324
+ inline: true,
2325
+ buttonType: "tertiary",
2326
+ onClick: () => {
2327
+ window.history.back();
2328
+ },
2329
+ isActive: true,
2330
+ style: {
2331
+ marginRight: 16
2332
+ },
2333
+ children: "Back"
2334
+ }), !_.isEmpty(this.state.feed) ? /*#__PURE__*/jsxs(Fragment, {
2335
+ children: [editable ? /*#__PURE__*/jsx(Link, {
2336
+ to: "".concat(values.routeAddFeed, "/").concat(this.state.feedId),
2337
+ children: /*#__PURE__*/jsx(Components$1.Button, {
2338
+ inline: true,
2339
+ style: {
2340
+ marginRight: 25
2341
+ },
2342
+ buttonType: "outlined",
2343
+ isActive: !isEditing,
2344
+ onClick: this.editFeed,
2345
+ children: "Edit"
2346
+ })
2347
+ }) : null, approvable ? /*#__PURE__*/jsxs(Fragment, {
2348
+ children: [/*#__PURE__*/jsx(Components$1.Button, {
2349
+ inline: true,
2350
+ style: {
2351
+ marginRight: 25
2352
+ },
2353
+ buttonType: "outlined",
2354
+ isActive: !isEditing,
2355
+ onClick: () => this.onReviewFeed(false),
2356
+ children: "Reject"
2357
+ }), /*#__PURE__*/jsx(Components$1.Button, {
2358
+ inline: true,
2359
+ style: {
2360
+ marginRight: 25
2361
+ },
2362
+ buttonType: "primary",
2363
+ isActive: !isEditing,
2364
+ onClick: () => this.onReviewFeed(true),
2365
+ children: "Approve"
2366
+ })]
2367
+ }) : null]
2368
+ }) : null]
2369
+ });
2206
2370
  }
2207
2371
  render() {
2208
- return /*#__PURE__*/React.createElement(Components$1.OverlayPage, null, /*#__PURE__*/React.createElement(Components$1.OverlayPageContents, null, /*#__PURE__*/React.createElement(Components$1.OverlayPageSection, {
2209
- className: "pageSectionWrapper--fixedPopupSize"
2210
- }, this.renderInner()), /*#__PURE__*/React.createElement(Components$1.OverlayPageSection, {
2211
- className: "pageSectionWrapper--newPopupSide pageSectionWrapper--newPopupSide-fixedWidth"
2212
- }, this.renderEditHistory())), /*#__PURE__*/React.createElement(Components$1.OverlayPageBottomButtons, null, this.renderButtons()));
2372
+ return /*#__PURE__*/jsxs(Components$1.OverlayPage, {
2373
+ children: [/*#__PURE__*/jsxs(Components$1.OverlayPageContents, {
2374
+ children: [/*#__PURE__*/jsx(Components$1.OverlayPageSection, {
2375
+ className: "pageSectionWrapper--fixedPopupSize",
2376
+ children: this.renderInner()
2377
+ }), /*#__PURE__*/jsx(Components$1.OverlayPageSection, {
2378
+ className: "pageSectionWrapper--newPopupSide pageSectionWrapper--newPopupSide-fixedWidth",
2379
+ children: this.renderEditHistory()
2380
+ })]
2381
+ }), /*#__PURE__*/jsx(Components$1.OverlayPageBottomButtons, {
2382
+ children: this.renderButtons()
2383
+ })]
2384
+ });
2213
2385
  }
2214
2386
  }
2215
- const mapStateToProps$1 = state => {
2216
- const {
2387
+ var mapStateToProps$1 = state => {
2388
+ var {
2217
2389
  auth
2218
2390
  } = state;
2219
2391
  return {
@@ -2227,41 +2399,43 @@ var Feed$1 = connect(mapStateToProps$1, {
2227
2399
 
2228
2400
  function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
2229
2401
  function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
2230
- const {
2402
+ var {
2231
2403
  Components,
2232
2404
  Helper,
2233
2405
  Session
2234
2406
  } = PlussCore;
2235
2407
  class AddFeed extends Component {
2236
2408
  constructor(props) {
2409
+ var _this;
2237
2410
  super(props);
2238
- _defineProperty(this, "getFeed", async () => {
2411
+ _this = this;
2412
+ _defineProperty(this, "getFeed", /*#__PURE__*/_asyncToGenerator(function* () {
2239
2413
  try {
2240
- const res = await feedActions.getFeed(this.state.feedId);
2414
+ var res = yield feedActions.getFeed(_this.state.feedId);
2241
2415
  // console.log('getFeed:', res.data);
2242
- this.setState(_objectSpread$3(_objectSpread$3({}, res.data), {}, {
2416
+ _this.setState(_objectSpread$3(_objectSpread$3({}, res.data), {}, {
2243
2417
  selectedUser: res.data.user,
2244
2418
  userId: res.data.user.id,
2245
2419
  userName: res.data.user.displayName
2246
2420
  }));
2247
- this.checkSetImages(res.data.photos);
2421
+ _this.checkSetImages(res.data.photos);
2248
2422
  } catch (error) {
2249
2423
  console.error("getFeed", error);
2250
2424
  }
2251
- });
2252
- _defineProperty(this, "getFeedTypes", async () => {
2425
+ }));
2426
+ _defineProperty(this, "getFeedTypes", /*#__PURE__*/_asyncToGenerator(function* () {
2253
2427
  try {
2254
- const res = await feedActions.getFeedTypes(this.props.auth.site);
2255
- this.setState({
2428
+ var res = yield feedActions.getFeedTypes(_this.props.auth.site);
2429
+ _this.setState({
2256
2430
  types: res.data
2257
- }, this.setDefaultFeedType);
2431
+ }, _this.setDefaultFeedType);
2258
2432
  // if (res.data != null) this.props.feedTypesLoaded(res.data);
2259
2433
  } catch (error) {
2260
2434
  console.error("getFeedTypes", error);
2261
2435
  }
2262
- });
2436
+ }));
2263
2437
  _defineProperty(this, "setDefaultFeedType", () => {
2264
- const {
2438
+ var {
2265
2439
  types,
2266
2440
  feedId
2267
2441
  } = this.state;
@@ -2271,31 +2445,31 @@ class AddFeed extends Component {
2271
2445
  });
2272
2446
  }
2273
2447
  });
2274
- _defineProperty(this, "getUsers", async () => {
2448
+ _defineProperty(this, "getUsers", /*#__PURE__*/_asyncToGenerator(function* () {
2275
2449
  try {
2276
- const res = await userActions.fetchUsers(this.props.auth.site);
2450
+ var res = yield userActions.fetchUsers(_this.props.auth.site);
2277
2451
  if (res.userFetchFail) return;
2278
2452
  if (res.data != null && !_.isEmpty(res.data.results.Items)) {
2279
- const items = res.data.results.Items;
2280
- this.setState({
2453
+ var items = res.data.results.Items;
2454
+ _this.setState({
2281
2455
  users: _.sortBy(items, u => {
2282
2456
  return (u.displayName || "").toLowerCase();
2283
2457
  })
2284
- }, this.setDefaultUser);
2458
+ }, _this.setDefaultUser);
2285
2459
  }
2286
2460
  } catch (error) {
2287
2461
  console.error("getUsers", error);
2288
2462
  }
2289
- });
2463
+ }));
2290
2464
  _defineProperty(this, "getUserId", user => user.userId || user.Id || user.id);
2291
2465
  _defineProperty(this, "setDefaultUser", () => {
2292
- const {
2466
+ var {
2293
2467
  users,
2294
2468
  userId
2295
2469
  } = this.state;
2296
2470
  // console.log('setDefaultUser', { userId });
2297
2471
  if (userId) {
2298
- const user = users.find(u => this.getUserId(u) === userId);
2472
+ var user = users.find(u => this.getUserId(u) === userId);
2299
2473
  if (user) this.onSelectUser(user);
2300
2474
  } else {
2301
2475
  this.onUnselectUser();
@@ -2337,54 +2511,54 @@ class AddFeed extends Component {
2337
2511
  userName: ""
2338
2512
  });
2339
2513
  });
2340
- _defineProperty(this, "onSave", async () => {
2514
+ _defineProperty(this, "onSave", /*#__PURE__*/_asyncToGenerator(function* () {
2341
2515
  try {
2342
- this.setState({
2516
+ _this.setState({
2343
2517
  showWarnings: false
2344
2518
  });
2345
- if (!this.validateForm()) {
2346
- this.setState({
2519
+ if (!_this.validateForm()) {
2520
+ _this.setState({
2347
2521
  showWarnings: true
2348
2522
  });
2349
2523
  return;
2350
2524
  }
2351
- if (this.state.updating) return;
2352
- this.setState({
2525
+ if (_this.state.updating) return;
2526
+ _this.setState({
2353
2527
  updating: true
2354
2528
  });
2355
- const feed = {
2356
- id: this.state.id,
2357
- userId: this.state.userId,
2358
- type: this.state.type,
2359
- title: this.state.title,
2360
- text: this.state.text,
2361
- photos: this.state.photos,
2362
- site: this.props.auth.site
2529
+ var feed = {
2530
+ id: _this.state.id,
2531
+ userId: _this.state.userId,
2532
+ type: _this.state.type,
2533
+ title: _this.state.title,
2534
+ text: _this.state.text,
2535
+ photos: _this.state.photos,
2536
+ site: _this.props.auth.site
2363
2537
  };
2364
- if (this.state.id !== null) {
2365
- await feedActions.editFeed(feed);
2366
- this.setState({
2538
+ if (_this.state.id !== null) {
2539
+ yield feedActions.editFeed(feed);
2540
+ _this.setState({
2367
2541
  success: true,
2368
2542
  updating: false
2369
2543
  });
2370
- this.props.feedsLoaded([feed]);
2544
+ _this.props.feedsLoaded([feed]);
2371
2545
  } else {
2372
- await feedActions.createFeed(feed);
2373
- this.setState({
2546
+ yield feedActions.createFeed(feed);
2547
+ _this.setState({
2374
2548
  success: true,
2375
2549
  updating: false
2376
2550
  });
2377
- this.props.feedsUpdate(this.props.auth.site);
2551
+ _this.props.feedsUpdate(_this.props.auth.site);
2378
2552
  }
2379
2553
  } catch (error) {
2380
- this.setState({
2554
+ _this.setState({
2381
2555
  updating: false
2382
2556
  });
2383
2557
  alert("Something went wrong with the request. Please try again.");
2384
2558
  }
2385
- });
2559
+ }));
2386
2560
  this.imageInput = null;
2387
- const queryParams = new URLSearchParams(props.location.search);
2561
+ var queryParams = new URLSearchParams(props.location.search);
2388
2562
  this.state = {
2389
2563
  feedId: Helper.safeReadParams(props, "feedId") ? props.match.params.feedId : null,
2390
2564
  feed: null,
@@ -2426,8 +2600,8 @@ class AddFeed extends Component {
2426
2600
  }
2427
2601
  renderSuccess() {
2428
2602
  if (!this.state.success) return null;
2429
- const title = this.props.strings["".concat(values.featureKey, "_textTitleFeeds")] || values.textTitleFeeds;
2430
- return /*#__PURE__*/React.createElement(Components.SuccessPopup, {
2603
+ var title = this.props.strings["".concat(values.featureKey, "_textTitleFeeds")] || values.textTitleFeeds;
2604
+ return /*#__PURE__*/jsx(Components.SuccessPopup, {
2431
2605
  text: "Feed has been ".concat(this.state.id != null ? "edited" : "added"),
2432
2606
  buttons: [{
2433
2607
  type: "outlined",
@@ -2437,7 +2611,7 @@ class AddFeed extends Component {
2437
2611
  });
2438
2612
  }
2439
2613
  validateForm() {
2440
- const {
2614
+ var {
2441
2615
  userId,
2442
2616
  userName,
2443
2617
  type,
@@ -2453,166 +2627,186 @@ class AddFeed extends Component {
2453
2627
  }
2454
2628
  renderSubmit() {
2455
2629
  if (this.state.updating) {
2456
- return /*#__PURE__*/React.createElement(Components.Button, {
2457
- buttonType: "secondary"
2458
- }, "Saving...");
2630
+ return /*#__PURE__*/jsx(Components.Button, {
2631
+ buttonType: "secondary",
2632
+ children: "Saving..."
2633
+ });
2459
2634
  }
2460
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Components.Button, {
2461
- inline: true,
2462
- buttonType: "tertiary",
2463
- onClick: () => this.props.history.push(values.routeHub),
2464
- isActive: true,
2465
- style: {
2466
- marginRight: 16
2467
- }
2468
- }, "Cancel"), /*#__PURE__*/React.createElement(Components.Button, {
2469
- inline: true,
2470
- buttonType: "primary",
2471
- onClick: this.onSave,
2472
- isActive: this.validateForm()
2473
- }, "Save"));
2635
+ return /*#__PURE__*/jsxs("div", {
2636
+ children: [/*#__PURE__*/jsx(Components.Button, {
2637
+ inline: true,
2638
+ buttonType: "tertiary",
2639
+ onClick: () => this.props.history.push(values.routeHub),
2640
+ isActive: true,
2641
+ style: {
2642
+ marginRight: 16
2643
+ },
2644
+ children: "Cancel"
2645
+ }), /*#__PURE__*/jsx(Components.Button, {
2646
+ inline: true,
2647
+ buttonType: "primary",
2648
+ onClick: this.onSave,
2649
+ isActive: this.validateForm(),
2650
+ children: "Save"
2651
+ })]
2652
+ });
2474
2653
  }
2475
2654
  renderSelectUser() {
2476
- const {
2655
+ var {
2477
2656
  showWarnings,
2478
2657
  selectedUser
2479
2658
  } = this.state;
2480
- const isValid = !_.isNil(selectedUser);
2481
- const showError = showWarnings && !isValid;
2482
- return /*#__PURE__*/React.createElement("div", {
2483
- className: "genericInputContainer ".concat(isValid ? "genericInput-valid" : "", " ").concat(showError ? "genericInput-error" : "").trim()
2484
- }, /*#__PURE__*/React.createElement("div", {
2485
- style: {
2486
- display: "flex",
2487
- flexDirection: "row",
2488
- alignItems: "center",
2489
- marginBottom: 0,
2490
- justifyContent: "space-between"
2491
- }
2492
- }, /*#__PURE__*/React.createElement("div", {
2493
- className: "fieldLabel"
2494
- }, "Select User"), showError ? /*#__PURE__*/React.createElement("div", {
2495
- className: "fieldLabel fieldLabel-warning"
2496
- }, "Required") : null), /*#__PURE__*/React.createElement("div", {
2497
- style: {
2498
- display: "flex",
2499
- flexDirection: "row",
2500
- alignItems: "center"
2501
- }
2502
- }, /*#__PURE__*/React.createElement("div", {
2503
- className: "inputRequired "
2504
- }), selectedUser ? /*#__PURE__*/React.createElement(Components.Tag, {
2505
- className: "marginRight-10",
2506
- rightIcon: "close",
2507
- rightClick: this.onUnselectUser
2508
- }, /*#__PURE__*/React.createElement(Components.UserListing, {
2509
- size: 15,
2510
- user: selectedUser,
2511
- textClass: "tag_text"
2512
- })) : /*#__PURE__*/React.createElement(Components.Tag, {
2513
- onClick: this.onOpenUserSelector,
2514
- text: "Select User"
2515
- })));
2659
+ var isValid = !_.isNil(selectedUser);
2660
+ var showError = showWarnings && !isValid;
2661
+ return /*#__PURE__*/jsxs("div", {
2662
+ className: "genericInputContainer ".concat(isValid ? "genericInput-valid" : "", " ").concat(showError ? "genericInput-error" : "").trim(),
2663
+ children: [/*#__PURE__*/jsxs("div", {
2664
+ style: {
2665
+ display: "flex",
2666
+ flexDirection: "row",
2667
+ alignItems: "center",
2668
+ marginBottom: 0,
2669
+ justifyContent: "space-between"
2670
+ },
2671
+ children: [/*#__PURE__*/jsx("div", {
2672
+ className: "fieldLabel",
2673
+ children: "Select User"
2674
+ }), showError ? /*#__PURE__*/jsx("div", {
2675
+ className: "fieldLabel fieldLabel-warning",
2676
+ children: "Required"
2677
+ }) : null]
2678
+ }), /*#__PURE__*/jsxs("div", {
2679
+ style: {
2680
+ display: "flex",
2681
+ flexDirection: "row",
2682
+ alignItems: "center"
2683
+ },
2684
+ children: [/*#__PURE__*/jsx("div", {
2685
+ className: "inputRequired "
2686
+ }), selectedUser ? /*#__PURE__*/jsx(Components.Tag, {
2687
+ className: "marginRight-10",
2688
+ rightIcon: "close",
2689
+ rightClick: this.onUnselectUser,
2690
+ children: /*#__PURE__*/jsx(Components.UserListing, {
2691
+ size: 15,
2692
+ user: selectedUser,
2693
+ textClass: "tag_text"
2694
+ })
2695
+ }) : /*#__PURE__*/jsx(Components.Tag, {
2696
+ onClick: this.onOpenUserSelector,
2697
+ text: "Select User"
2698
+ })]
2699
+ })]
2700
+ });
2516
2701
  }
2517
2702
  renderTypeOptions() {
2518
- const {
2703
+ var {
2519
2704
  showWarnings,
2520
2705
  types,
2521
2706
  type
2522
2707
  } = this.state;
2523
- const isValid = !!type;
2524
- const showError = showWarnings && !isValid;
2525
- return /*#__PURE__*/React.createElement("div", {
2526
- className: "genericInputContainer ".concat(isValid ? "genericInput-valid" : "", " ").concat(showError ? "genericInput-error" : "").trim()
2527
- }, /*#__PURE__*/React.createElement("div", {
2528
- style: {
2529
- display: "flex",
2530
- flexDirection: "row",
2531
- alignItems: "center",
2532
- marginBottom: 0,
2533
- justifyContent: "space-between"
2534
- }
2535
- }, /*#__PURE__*/React.createElement(Components.Text, {
2536
- type: "formLabel"
2537
- }, "Select Type"), showError ? /*#__PURE__*/React.createElement("div", {
2538
- className: "fieldLabel fieldLabel-warning"
2539
- }, "Required") : null), /*#__PURE__*/React.createElement("div", {
2540
- className: "marginTop-4"
2541
- }, types.map(ev => {
2542
- if (ev === null) return null;
2543
- return /*#__PURE__*/React.createElement(Components.Tag, {
2544
- key: ev.id,
2545
- text: ev.label,
2708
+ var isValid = !!type;
2709
+ var showError = showWarnings && !isValid;
2710
+ return /*#__PURE__*/jsxs("div", {
2711
+ className: "genericInputContainer ".concat(isValid ? "genericInput-valid" : "", " ").concat(showError ? "genericInput-error" : "").trim(),
2712
+ children: [/*#__PURE__*/jsxs("div", {
2546
2713
  style: {
2547
- backgroundColor: ev.colour,
2548
- borderRadius: 8,
2549
- marginRight: 10,
2550
- opacity: ev.label === type ? 1 : 0.5
2714
+ display: "flex",
2715
+ flexDirection: "row",
2716
+ alignItems: "center",
2717
+ marginBottom: 0,
2718
+ justifyContent: "space-between"
2551
2719
  },
2552
- onClick: () => this.onSelectType(ev.label)
2553
- });
2554
- })));
2720
+ children: [/*#__PURE__*/jsx(Components.Text, {
2721
+ type: "formLabel",
2722
+ children: "Select Type"
2723
+ }), showError ? /*#__PURE__*/jsx("div", {
2724
+ className: "fieldLabel fieldLabel-warning",
2725
+ children: "Required"
2726
+ }) : null]
2727
+ }), /*#__PURE__*/jsx("div", {
2728
+ className: "marginTop-4",
2729
+ children: types.map(ev => {
2730
+ if (ev === null) return null;
2731
+ return /*#__PURE__*/jsx(Components.Tag, {
2732
+ text: ev.label,
2733
+ style: {
2734
+ backgroundColor: ev.colour,
2735
+ borderRadius: 8,
2736
+ marginRight: 10,
2737
+ opacity: ev.label === type ? 1 : 0.5
2738
+ },
2739
+ onClick: () => this.onSelectType(ev.label)
2740
+ }, ev.id);
2741
+ })
2742
+ })]
2743
+ });
2555
2744
  }
2556
2745
  renderMain() {
2557
- return /*#__PURE__*/React.createElement("div", {
2746
+ return /*#__PURE__*/jsx("div", {
2558
2747
  style: {
2559
2748
  marginBottom: 15
2560
- }
2561
- }, /*#__PURE__*/React.createElement("div", {
2562
- className: "padding-60 paddingVertical-40 bottomDivideBorder"
2563
- }, /*#__PURE__*/React.createElement(Components.Text, {
2564
- type: "formTitleLarge",
2565
- className: "marginBottom-24"
2566
- }, this.state.feedId == null ? "New" : "Edit", " Post"), this.renderSelectUser(), this.renderTypeOptions(), /*#__PURE__*/React.createElement(Components.GenericInput, {
2567
- id: "title",
2568
- label: "Title",
2569
- type: "textarea",
2570
- placeholder: "Title",
2571
- value: this.state.title,
2572
- onChange: e => this.onHandleChange(e),
2573
- inputStyle: {
2574
- height: 80
2575
- },
2576
- isRequired: true,
2577
- isValid: () => {
2578
- return !_.isEmpty(this.state.title);
2579
- },
2580
- showError: () => {
2581
- return this.state.showWarnings && _.isEmpty(this.state.title);
2582
- },
2583
- alwaysShowLabel: true
2584
- }), /*#__PURE__*/React.createElement(Components.GenericInput, {
2585
- id: "text",
2586
- label: "Text",
2587
- type: "textarea",
2588
- placeholder: "Text",
2589
- value: this.state.text,
2590
- onChange: e => this.onHandleChange(e),
2591
- inputStyle: {
2592
- height: 80
2593
2749
  },
2594
- alwaysShowLabel: true
2595
- }), /*#__PURE__*/React.createElement("div", {
2596
- className: "marginBottom-16"
2597
- }, /*#__PURE__*/React.createElement(Components.Text, {
2598
- type: "formLabel",
2599
- className: "marginBottom-4"
2600
- }, "Images"), /*#__PURE__*/React.createElement(Components.ImageInput, {
2601
- ref: ref => this.imageInput = ref,
2602
- multiple: true,
2603
- refreshCallback: photos => this.setState({
2604
- photos
2750
+ children: /*#__PURE__*/jsxs("div", {
2751
+ className: "padding-60 paddingVertical-40 bottomDivideBorder",
2752
+ children: [/*#__PURE__*/jsxs(Components.Text, {
2753
+ type: "formTitleLarge",
2754
+ className: "marginBottom-24",
2755
+ children: [this.state.feedId == null ? "New" : "Edit", " Post"]
2756
+ }), this.renderSelectUser(), this.renderTypeOptions(), /*#__PURE__*/jsx(Components.GenericInput, {
2757
+ id: "title",
2758
+ label: "Title",
2759
+ type: "textarea",
2760
+ placeholder: "Title",
2761
+ value: this.state.title,
2762
+ onChange: e => this.onHandleChange(e),
2763
+ inputStyle: {
2764
+ height: 80
2765
+ },
2766
+ isRequired: true,
2767
+ isValid: () => {
2768
+ return !_.isEmpty(this.state.title);
2769
+ },
2770
+ showError: () => {
2771
+ return this.state.showWarnings && _.isEmpty(this.state.title);
2772
+ },
2773
+ alwaysShowLabel: true
2774
+ }), /*#__PURE__*/jsx(Components.GenericInput, {
2775
+ id: "text",
2776
+ label: "Text",
2777
+ type: "textarea",
2778
+ placeholder: "Text",
2779
+ value: this.state.text,
2780
+ onChange: e => this.onHandleChange(e),
2781
+ inputStyle: {
2782
+ height: 80
2783
+ },
2784
+ alwaysShowLabel: true
2785
+ }), /*#__PURE__*/jsxs("div", {
2786
+ className: "marginBottom-16",
2787
+ children: [/*#__PURE__*/jsx(Components.Text, {
2788
+ type: "formLabel",
2789
+ className: "marginBottom-4",
2790
+ children: "Images"
2791
+ }), /*#__PURE__*/jsx(Components.ImageInput, {
2792
+ ref: _ref5 => this.imageInput = _ref5,
2793
+ multiple: true,
2794
+ refreshCallback: photos => this.setState({
2795
+ photos
2796
+ })
2797
+ })]
2798
+ })]
2605
2799
  })
2606
- }))));
2800
+ });
2607
2801
  }
2608
2802
  renderUserFilterPopup() {
2609
- const {
2803
+ var {
2610
2804
  userFilterOpen,
2611
2805
  userSearch,
2612
2806
  users
2613
2807
  } = this.state;
2614
2808
  if (!userFilterOpen) return null;
2615
- return /*#__PURE__*/React.createElement(Components.Popup, {
2809
+ return /*#__PURE__*/jsxs(Components.Popup, {
2616
2810
  title: "Select Requestor",
2617
2811
  maxWidth: 600,
2618
2812
  minWidth: 400,
@@ -2625,39 +2819,47 @@ class AddFeed extends Component {
2625
2819
  onClick: this.onCloseUserSelector,
2626
2820
  isActive: true,
2627
2821
  text: "Cancel"
2628
- }]
2629
- }, /*#__PURE__*/React.createElement(Components.GenericInput, {
2630
- id: "userSearch",
2631
- type: "text",
2632
- label: "Search User",
2633
- placeholder: "Search name",
2634
- value: userSearch,
2635
- onChange: e => this.onHandleChange(e),
2636
- alwaysShowLabel: true
2637
- }), _.sortBy(users, u => u.displayName.toUpperCase()).filter(u => {
2638
- if (_.isEmpty(userSearch)) return true;
2639
- return u.displayName.toUpperCase().indexOf(userSearch.toUpperCase()) > -1;
2640
- }).map(user => {
2641
- return /*#__PURE__*/React.createElement(Components.UserListing, {
2642
- key: this.getUserId(user),
2643
- user: user,
2644
- onClick: () => this.onSelectUser(user)
2645
- });
2646
- }));
2822
+ }],
2823
+ children: [/*#__PURE__*/jsx(Components.GenericInput, {
2824
+ id: "userSearch",
2825
+ type: "text",
2826
+ label: "Search User",
2827
+ placeholder: "Search name",
2828
+ value: userSearch,
2829
+ onChange: e => this.onHandleChange(e),
2830
+ alwaysShowLabel: true
2831
+ }), _.sortBy(users, u => u.displayName.toUpperCase()).filter(u => {
2832
+ if (_.isEmpty(userSearch)) return true;
2833
+ return u.displayName.toUpperCase().indexOf(userSearch.toUpperCase()) > -1;
2834
+ }).map(user => {
2835
+ return /*#__PURE__*/jsx(Components.UserListing, {
2836
+ user: user,
2837
+ onClick: () => this.onSelectUser(user)
2838
+ }, this.getUserId(user));
2839
+ })]
2840
+ });
2647
2841
  }
2648
2842
  render() {
2649
- const {
2843
+ var {
2650
2844
  success
2651
2845
  } = this.state;
2652
- return /*#__PURE__*/React.createElement(Components.OverlayPage, null, /*#__PURE__*/React.createElement(Components.OverlayPageContents, {
2653
- noBottomButtons: success
2654
- }, /*#__PURE__*/React.createElement(Components.OverlayPageSection, {
2655
- className: "pageSectionWrapper--newPopup"
2656
- }, /*#__PURE__*/React.createElement("div", null, this.renderSuccess(), !success && this.renderMain()), this.renderUserFilterPopup())), /*#__PURE__*/React.createElement(Components.OverlayPageBottomButtons, null, this.renderSubmit()));
2846
+ return /*#__PURE__*/jsxs(Components.OverlayPage, {
2847
+ children: [/*#__PURE__*/jsx(Components.OverlayPageContents, {
2848
+ noBottomButtons: success,
2849
+ children: /*#__PURE__*/jsxs(Components.OverlayPageSection, {
2850
+ className: "pageSectionWrapper--newPopup",
2851
+ children: [/*#__PURE__*/jsxs("div", {
2852
+ children: [this.renderSuccess(), !success && this.renderMain()]
2853
+ }), this.renderUserFilterPopup()]
2854
+ })
2855
+ }), /*#__PURE__*/jsx(Components.OverlayPageBottomButtons, {
2856
+ children: this.renderSubmit()
2857
+ })]
2858
+ });
2657
2859
  }
2658
2860
  }
2659
- const mapStateToProps = state => {
2660
- const {
2861
+ var mapStateToProps = state => {
2862
+ var {
2661
2863
  auth
2662
2864
  } = state;
2663
2865
  return {
@@ -2672,22 +2874,22 @@ var AddFeed$1 = connect(mapStateToProps, {
2672
2874
 
2673
2875
  function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
2674
2876
  function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
2675
- const INITIAL_STATE = {
2877
+ var INITIAL_STATE = {
2676
2878
  feeds: [],
2677
2879
  submissions: [],
2678
2880
  feedTypes: [],
2679
2881
  loading: false
2680
2882
  };
2681
2883
  var FeedReducer = (function () {
2682
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : INITIAL_STATE;
2683
- let action = arguments.length > 1 ? arguments[1] : undefined;
2884
+ var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : INITIAL_STATE;
2885
+ var action = arguments.length > 1 ? arguments[1] : undefined;
2684
2886
  switch (action.type) {
2685
2887
  case FEEDS_LOADING:
2686
2888
  return _objectSpread$2(_objectSpread$2({}, state), {}, {
2687
2889
  loading: true
2688
2890
  });
2689
2891
  case FEEDS_LOADED:
2690
- const feeds = _.unionWith(action.payload, state.feeds, (v1, v2) => {
2892
+ var feeds = _.unionWith(action.payload, state.feeds, (v1, v2) => {
2691
2893
  return v1 != null && v2 != null && v1.id === v2.id;
2692
2894
  });
2693
2895
  return _objectSpread$2(_objectSpread$2({}, state), {}, {
@@ -2695,11 +2897,11 @@ var FeedReducer = (function () {
2695
2897
  loading: false
2696
2898
  });
2697
2899
  case FEEDS_REMOVED:
2698
- const fIndex = _.findIndex(state.feeds, feed => {
2900
+ var fIndex = _.findIndex(state.feeds, feed => {
2699
2901
  return feed != null && feed.id === action.payload;
2700
2902
  });
2701
2903
  if (fIndex > -1) {
2702
- const newFeeds = [...state.feeds];
2904
+ var newFeeds = [...state.feeds];
2703
2905
  newFeeds.splice(fIndex, 1);
2704
2906
  return _objectSpread$2(_objectSpread$2({}, state), {}, {
2705
2907
  feeds: newFeeds
@@ -2714,11 +2916,11 @@ var FeedReducer = (function () {
2714
2916
  submissions: _.filter(submissions, feed => !feed.deleted)
2715
2917
  });
2716
2918
  case FEEDS_SUBMISSIONS_REMOVED:
2717
- const sIndex = _.findIndex(state.submissions, submission => {
2919
+ var sIndex = _.findIndex(state.submissions, submission => {
2718
2920
  return submission != null && submission.id === action.payload;
2719
2921
  });
2720
2922
  if (sIndex > -1) {
2721
- const newSubmissions = [...state.submissions];
2923
+ var newSubmissions = [...state.submissions];
2722
2924
  newSubmissions.splice(sIndex, 1);
2723
2925
  return _objectSpread$2(_objectSpread$2({}, state), {}, {
2724
2926
  submissions: newSubmissions
@@ -2726,7 +2928,7 @@ var FeedReducer = (function () {
2726
2928
  }
2727
2929
  return state;
2728
2930
  case FEED_TYPES_LOADED:
2729
- const feedTypes = _.unionWith(action.payload, state.feedTypes, (v1, v2) => {
2931
+ var feedTypes = _.unionWith(action.payload, state.feedTypes, (v1, v2) => {
2730
2932
  return v1 != null && v2 != null && v1.id === v2.id;
2731
2933
  });
2732
2934
  return _objectSpread$2(_objectSpread$2({}, state), {}, {
@@ -2741,14 +2943,14 @@ var img$3 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAxwAAAGGCAYAAADxZYcEA
2741
2943
 
2742
2944
  class ViewWidget extends Component {
2743
2945
  render() {
2744
- return /*#__PURE__*/React.createElement("img", {
2946
+ return /*#__PURE__*/jsx("img", {
2745
2947
  style: styles$3.image,
2746
2948
  src: img$3,
2747
2949
  alt: "widget"
2748
2950
  });
2749
2951
  }
2750
2952
  }
2751
- const styles$3 = {
2953
+ var styles$3 = {
2752
2954
  image: {
2753
2955
  width: 80
2754
2956
  }
@@ -2758,18 +2960,18 @@ var img$2 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAmAAAASICAYAAAC0rHMFA
2758
2960
 
2759
2961
  class ViewFull extends Component {
2760
2962
  render() {
2761
- return /*#__PURE__*/React.createElement("img", {
2963
+ return /*#__PURE__*/jsx("img", {
2762
2964
  style: styles$2.image,
2763
2965
  src: img$2,
2764
2966
  alt: "full"
2765
2967
  });
2766
2968
  }
2767
2969
  }
2768
- const styles$2 = {
2970
+ var styles$2 = {
2769
2971
  image: {
2770
- width: '100%',
2771
- height: '100%',
2772
- objectFit: 'contain'
2972
+ width: "100%",
2973
+ height: "100%",
2974
+ objectFit: "contain"
2773
2975
  }
2774
2976
  };
2775
2977
 
@@ -2779,31 +2981,33 @@ function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymb
2779
2981
  function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
2780
2982
  class PreviewWidget extends Component {
2781
2983
  render() {
2782
- const {
2984
+ var {
2783
2985
  backgroundColor,
2784
2986
  widgetTitle,
2785
2987
  titleClassName
2786
2988
  } = this.props;
2787
- return /*#__PURE__*/React.createElement("div", {
2788
- style: styles$1.container
2789
- }, /*#__PURE__*/React.createElement("img", {
2790
- style: _objectSpread$1(_objectSpread$1({}, styles$1.image), {}, {
2791
- backgroundColor
2792
- }),
2793
- src: img$1,
2794
- alt: "previewWidget"
2795
- }), /*#__PURE__*/React.createElement("p", {
2796
- className: titleClassName,
2797
- style: styles$1.title
2798
- }, widgetTitle));
2989
+ return /*#__PURE__*/jsxs("div", {
2990
+ style: styles$1.container,
2991
+ children: [/*#__PURE__*/jsx("img", {
2992
+ style: _objectSpread$1(_objectSpread$1({}, styles$1.image), {}, {
2993
+ backgroundColor
2994
+ }),
2995
+ src: img$1,
2996
+ alt: "previewWidget"
2997
+ }), /*#__PURE__*/jsx("p", {
2998
+ className: titleClassName,
2999
+ style: styles$1.title,
3000
+ children: widgetTitle
3001
+ })]
3002
+ });
2799
3003
  }
2800
3004
  }
2801
- const styles$1 = {
3005
+ var styles$1 = {
2802
3006
  container: {
2803
- position: 'relative'
3007
+ position: "relative"
2804
3008
  },
2805
3009
  image: {
2806
- width: '100%'
3010
+ width: "100%"
2807
3011
  }
2808
3012
  };
2809
3013
 
@@ -2813,71 +3017,73 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
2813
3017
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
2814
3018
  class PreviewFull extends Component {
2815
3019
  render() {
2816
- const {
3020
+ var {
2817
3021
  backgroundColor,
2818
3022
  widgetTitle,
2819
3023
  titleClassName
2820
3024
  } = this.props;
2821
- return /*#__PURE__*/React.createElement("div", {
2822
- style: styles.container
2823
- }, /*#__PURE__*/React.createElement("p", {
2824
- className: titleClassName
2825
- }, widgetTitle), /*#__PURE__*/React.createElement("img", {
2826
- style: _objectSpread(_objectSpread({}, styles.image), {}, {
2827
- backgroundColor
2828
- }),
2829
- src: img,
2830
- alt: "fullNoTitle"
2831
- }));
3025
+ return /*#__PURE__*/jsxs("div", {
3026
+ style: styles.container,
3027
+ children: [/*#__PURE__*/jsx("p", {
3028
+ className: titleClassName,
3029
+ children: widgetTitle
3030
+ }), /*#__PURE__*/jsx("img", {
3031
+ style: _objectSpread(_objectSpread({}, styles.image), {}, {
3032
+ backgroundColor
3033
+ }),
3034
+ src: img,
3035
+ alt: "fullNoTitle"
3036
+ })]
3037
+ });
2832
3038
  }
2833
3039
  }
2834
- const styles = {
3040
+ var styles = {
2835
3041
  container: {
2836
- position: 'relative'
3042
+ position: "relative"
2837
3043
  },
2838
3044
  image: {
2839
- width: '100%'
3045
+ width: "100%"
2840
3046
  }
2841
3047
  };
2842
3048
 
2843
- const SVG_PATH = values.svgPathGridIcon;
2844
- const SVG_VIEWBOX = values.svgPathGridIconViewBox ;
3049
+ var SVG_PATH = values.svgPathGridIcon;
3050
+ var SVG_VIEWBOX = values.svgPathGridIconViewBox ;
2845
3051
  class PreviewGrid extends Component {
2846
3052
  render() {
2847
- const {
3053
+ var {
2848
3054
  colour
2849
3055
  } = this.props;
2850
3056
  if (Array.isArray(SVG_PATH)) {
2851
- return /*#__PURE__*/React.createElement("svg", {
3057
+ return /*#__PURE__*/jsx("svg", {
2852
3058
  xmlns: "http://www.w3.org/2000/svg",
2853
- viewBox: SVG_VIEWBOX
2854
- }, SVG_PATH.map(p => {
2855
- return /*#__PURE__*/React.createElement("path", {
2856
- key: p.substring(0, 20),
2857
- d: p,
2858
- fill: colour
2859
- });
2860
- }));
3059
+ viewBox: SVG_VIEWBOX,
3060
+ children: SVG_PATH.map(p => {
3061
+ return /*#__PURE__*/jsx("path", {
3062
+ d: p,
3063
+ fill: colour
3064
+ }, p.substring(0, 20));
3065
+ })
3066
+ });
2861
3067
  } else {
2862
- return /*#__PURE__*/React.createElement("svg", {
3068
+ return /*#__PURE__*/jsx("svg", {
2863
3069
  xmlns: "http://www.w3.org/2000/svg",
2864
- viewBox: SVG_VIEWBOX
2865
- }, /*#__PURE__*/React.createElement("path", {
2866
- key: SVG_PATH.substring(0, 20),
2867
- d: SVG_PATH,
2868
- fill: colour
2869
- }));
3070
+ viewBox: SVG_VIEWBOX,
3071
+ children: /*#__PURE__*/jsx("path", {
3072
+ d: SVG_PATH,
3073
+ fill: colour
3074
+ }, SVG_PATH.substring(0, 20))
3075
+ });
2870
3076
  }
2871
3077
  }
2872
3078
  }
2873
3079
 
2874
- const Reducers = (() => {
2875
- const reducers = {};
3080
+ var Reducers = (() => {
3081
+ var reducers = {};
2876
3082
  reducers[values.reducerKey] = FeedReducer;
2877
3083
  return reducers;
2878
3084
  })();
2879
- const Screens = (() => {
2880
- const screens = {};
3085
+ var Screens = (() => {
3086
+ var screens = {};
2881
3087
  screens[values.screenFeedHub] = FeedHub$1;
2882
3088
  screens[values.screenFeed] = Feed$1;
2883
3089
  screens[values.screenAddFeed] = AddFeed$1;
@@ -2886,3 +3092,4 @@ const Screens = (() => {
2886
3092
  // export const Analytics = [AnalyticsHub];
2887
3093
 
2888
3094
  export { FeatureConfig as Config, PreviewFull, PreviewGrid, PreviewWidget, Reducers, Screens, ViewFull, ViewWidget };
3095
+ //# sourceMappingURL=index.js.map