@plusscommunities/pluss-feeds-web 1.0.10-beta.0 → 1.0.11-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +283 -300
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
2
1
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
3
2
|
import { Component } from 'react';
|
|
4
3
|
import { connect } from 'react-redux';
|
|
@@ -13,7 +12,7 @@ import moment from 'moment';
|
|
|
13
12
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
14
13
|
import Textarea from 'react-textarea-autosize';
|
|
15
14
|
|
|
16
|
-
|
|
15
|
+
const values = {
|
|
17
16
|
featureKey: "feeds",
|
|
18
17
|
aliases: [],
|
|
19
18
|
serviceKey: "feeds",
|
|
@@ -54,7 +53,7 @@ var values = {
|
|
|
54
53
|
};
|
|
55
54
|
|
|
56
55
|
// import * as PlussCore from '../../pluss-core/src';
|
|
57
|
-
|
|
56
|
+
const FeatureConfig = {
|
|
58
57
|
key: values.featureKey,
|
|
59
58
|
aliases: values.aliases,
|
|
60
59
|
singularName: values.textSingularName,
|
|
@@ -158,22 +157,22 @@ var FeatureConfig = {
|
|
|
158
157
|
}
|
|
159
158
|
};
|
|
160
159
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
160
|
+
const FEEDS_LOADED = values.actionFeedsLoaded;
|
|
161
|
+
const FEED_TYPES_LOADED = values.actionFeedTypeLoaded;
|
|
162
|
+
const FEEDS_REMOVED = values.actionFeedRemoved;
|
|
163
|
+
const FEEDS_LOADING = values.actionFeedsLoading;
|
|
164
|
+
const FEEDS_SUBMISSIONS_LOADED = values.actionFeedsSubmissionsLoaded;
|
|
165
|
+
const FEEDS_SUBMISSIONS_REMOVED = values.actionFeedsSubmissionsRemoved;
|
|
167
166
|
|
|
168
167
|
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; }
|
|
169
168
|
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; }
|
|
170
|
-
|
|
169
|
+
const {
|
|
171
170
|
Helper: Helper$5,
|
|
172
171
|
Session: Session$7
|
|
173
172
|
} = PlussCore;
|
|
174
|
-
|
|
173
|
+
const feedActions = {
|
|
175
174
|
getFeedTypes: site => {
|
|
176
|
-
|
|
175
|
+
let url = Helper$5.getUrl(values.serviceKey, "getTypes", {
|
|
177
176
|
site
|
|
178
177
|
});
|
|
179
178
|
return Session$7.authedFunction({
|
|
@@ -215,7 +214,7 @@ var feedActions = {
|
|
|
215
214
|
});
|
|
216
215
|
},
|
|
217
216
|
getFeed: id => {
|
|
218
|
-
|
|
217
|
+
const query = {
|
|
219
218
|
id
|
|
220
219
|
};
|
|
221
220
|
return Session$7.authedFunction({
|
|
@@ -224,7 +223,7 @@ var feedActions = {
|
|
|
224
223
|
});
|
|
225
224
|
},
|
|
226
225
|
getFeedSubmissions: site => {
|
|
227
|
-
|
|
226
|
+
const query = {
|
|
228
227
|
site
|
|
229
228
|
};
|
|
230
229
|
return Session$7.authedFunction({
|
|
@@ -233,7 +232,7 @@ var feedActions = {
|
|
|
233
232
|
});
|
|
234
233
|
},
|
|
235
234
|
getFeeds: (site, userId, authorId, lastKey) => {
|
|
236
|
-
|
|
235
|
+
const query = {
|
|
237
236
|
site
|
|
238
237
|
};
|
|
239
238
|
if (userId) query.userId = userId;
|
|
@@ -244,11 +243,11 @@ var feedActions = {
|
|
|
244
243
|
url: Helper$5.getUrl(values.serviceKey, "getPosts", query)
|
|
245
244
|
});
|
|
246
245
|
},
|
|
247
|
-
getFeedsRecursive: function
|
|
248
|
-
|
|
246
|
+
getFeedsRecursive: function (site, userId, authorId, lastKey) {
|
|
247
|
+
let feeds = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
|
|
249
248
|
return new Promise(resolve => {
|
|
250
249
|
feedActions.getFeeds(site, userId, authorId, lastKey).then(res => {
|
|
251
|
-
|
|
250
|
+
const newFeeds = [...feeds, ...res.data.Items];
|
|
252
251
|
if (!res.data.LastKey) {
|
|
253
252
|
return resolve(newFeeds);
|
|
254
253
|
}
|
|
@@ -291,13 +290,13 @@ var feedActions = {
|
|
|
291
290
|
}
|
|
292
291
|
};
|
|
293
292
|
|
|
294
|
-
|
|
293
|
+
const {
|
|
295
294
|
Helper: Helper$4,
|
|
296
295
|
Session: Session$6
|
|
297
296
|
} = PlussCore;
|
|
298
|
-
|
|
297
|
+
const reactionActions = {
|
|
299
298
|
addComment: (entityId, entityType, entityName, site, comment, image, parentId) => {
|
|
300
|
-
|
|
299
|
+
const data = {
|
|
301
300
|
entityId,
|
|
302
301
|
entityType,
|
|
303
302
|
entityName,
|
|
@@ -324,7 +323,7 @@ var reactionActions = {
|
|
|
324
323
|
// });
|
|
325
324
|
// },
|
|
326
325
|
getComments: (entityId, entityType, minTime) => {
|
|
327
|
-
|
|
326
|
+
const query = {
|
|
328
327
|
entityId,
|
|
329
328
|
entityType
|
|
330
329
|
};
|
|
@@ -338,22 +337,22 @@ var reactionActions = {
|
|
|
338
337
|
}
|
|
339
338
|
};
|
|
340
339
|
|
|
341
|
-
|
|
340
|
+
const {
|
|
342
341
|
Apis
|
|
343
342
|
} = PlussCore;
|
|
344
343
|
Apis.analyticsActions;
|
|
345
|
-
|
|
344
|
+
const userActions = Apis.userActions;
|
|
346
345
|
|
|
347
|
-
|
|
346
|
+
const {
|
|
348
347
|
Helper: Helper$3
|
|
349
348
|
} = PlussCore;
|
|
350
|
-
|
|
349
|
+
const feedsUpdate = (site, isdashboard) => {
|
|
351
350
|
return dispatch => {
|
|
352
351
|
if (isdashboard) dispatch({
|
|
353
352
|
type: FEEDS_LOADING
|
|
354
353
|
});
|
|
355
354
|
feedActions.getFeedsRecursive(site).then(res => {
|
|
356
|
-
|
|
355
|
+
const currentSite = Helper$3.readStorageWithCookie("site");
|
|
357
356
|
if (!_.isEmpty(res) && res[0].site === currentSite) {
|
|
358
357
|
dispatch({
|
|
359
358
|
type: FEEDS_LOADED,
|
|
@@ -368,31 +367,31 @@ var feedsUpdate = (site, isdashboard) => {
|
|
|
368
367
|
});
|
|
369
368
|
};
|
|
370
369
|
};
|
|
371
|
-
|
|
370
|
+
const feedsLoaded = feeds => {
|
|
372
371
|
return {
|
|
373
372
|
type: FEEDS_LOADED,
|
|
374
373
|
payload: feeds
|
|
375
374
|
};
|
|
376
375
|
};
|
|
377
|
-
|
|
376
|
+
const removeFeed = id => {
|
|
378
377
|
return {
|
|
379
378
|
type: FEEDS_REMOVED,
|
|
380
379
|
payload: id
|
|
381
380
|
};
|
|
382
381
|
};
|
|
383
|
-
|
|
382
|
+
const feedsSubmissionsLoaded = submissions => {
|
|
384
383
|
return {
|
|
385
384
|
type: FEEDS_SUBMISSIONS_LOADED,
|
|
386
385
|
payload: submissions
|
|
387
386
|
};
|
|
388
387
|
};
|
|
389
|
-
|
|
388
|
+
const removeFeedSubmission = id => {
|
|
390
389
|
return {
|
|
391
390
|
type: FEEDS_SUBMISSIONS_REMOVED,
|
|
392
391
|
payload: id
|
|
393
392
|
};
|
|
394
393
|
};
|
|
395
|
-
|
|
394
|
+
const feedTypesUpdate = site => {
|
|
396
395
|
return dispatch => {
|
|
397
396
|
feedActions.getFeedTypes(site).then(res => {
|
|
398
397
|
dispatch({
|
|
@@ -402,21 +401,21 @@ var feedTypesUpdate = site => {
|
|
|
402
401
|
});
|
|
403
402
|
};
|
|
404
403
|
};
|
|
405
|
-
|
|
404
|
+
const feedTypesLoaded = feedTypes => {
|
|
406
405
|
return {
|
|
407
406
|
type: FEED_TYPES_LOADED,
|
|
408
407
|
payload: feedTypes
|
|
409
408
|
};
|
|
410
409
|
};
|
|
411
410
|
|
|
412
|
-
|
|
411
|
+
const {
|
|
413
412
|
Actions
|
|
414
413
|
} = PlussCore;
|
|
415
|
-
|
|
414
|
+
const usersLoaded = Actions.usersLoaded;
|
|
416
415
|
|
|
417
416
|
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; }
|
|
418
417
|
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; }
|
|
419
|
-
|
|
418
|
+
const {
|
|
420
419
|
Session: Session$5,
|
|
421
420
|
Components: Components$4,
|
|
422
421
|
Analytics
|
|
@@ -426,34 +425,34 @@ class FeedList extends Component {
|
|
|
426
425
|
var _this;
|
|
427
426
|
super(props);
|
|
428
427
|
_this = this;
|
|
429
|
-
_defineProperty(this, "getUsers",
|
|
430
|
-
|
|
428
|
+
_defineProperty(this, "getUsers", async () => {
|
|
429
|
+
const {
|
|
431
430
|
auth
|
|
432
|
-
} =
|
|
431
|
+
} = this.props;
|
|
433
432
|
try {
|
|
434
|
-
|
|
433
|
+
const res = await userActions.fetchUsers(auth.site);
|
|
435
434
|
if (res.data != null && !_.isEmpty(res.data.results.Items) && res.data.results.Items[0].site === auth.site) {
|
|
436
|
-
|
|
435
|
+
this.props.usersLoaded(res.data.results.Items);
|
|
437
436
|
}
|
|
438
437
|
} catch (error) {
|
|
439
438
|
console.error("getUsers", error);
|
|
440
439
|
}
|
|
441
|
-
})
|
|
442
|
-
_defineProperty(this, "getFeeds",
|
|
443
|
-
|
|
440
|
+
});
|
|
441
|
+
_defineProperty(this, "getFeeds", async () => {
|
|
442
|
+
const {
|
|
444
443
|
auth
|
|
445
|
-
} =
|
|
444
|
+
} = this.props;
|
|
446
445
|
try {
|
|
447
|
-
|
|
446
|
+
const res = await feedActions.getFeedsRecursive(auth.site);
|
|
448
447
|
if (!_.isEmpty(res) && res[0].site === auth.site) {
|
|
449
|
-
|
|
448
|
+
this.props.feedsLoaded(res);
|
|
450
449
|
}
|
|
451
450
|
} catch (error) {
|
|
452
451
|
console.error("getFeeds", error);
|
|
453
452
|
}
|
|
454
|
-
})
|
|
453
|
+
});
|
|
455
454
|
_defineProperty(this, "sortByCol", col => {
|
|
456
|
-
|
|
455
|
+
const {
|
|
457
456
|
sortColumn,
|
|
458
457
|
sortDesc
|
|
459
458
|
} = this.state;
|
|
@@ -468,23 +467,18 @@ class FeedList extends Component {
|
|
|
468
467
|
});
|
|
469
468
|
}
|
|
470
469
|
});
|
|
471
|
-
_defineProperty(this, "onRemoveFeed",
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
alert("Something went wrong with the request. Please try again.");
|
|
481
|
-
}
|
|
470
|
+
_defineProperty(this, "onRemoveFeed", async feed => {
|
|
471
|
+
if (window.confirm(values.textAreYouSureYouWantToDelete)) {
|
|
472
|
+
this.props.removeFeed(feed.id);
|
|
473
|
+
try {
|
|
474
|
+
await feedActions.deleteFeed(feed.id);
|
|
475
|
+
this.getFeeds();
|
|
476
|
+
} catch (error) {
|
|
477
|
+
console.log("onRemoveFeed", error);
|
|
478
|
+
alert("Something went wrong with the request. Please try again.");
|
|
482
479
|
}
|
|
483
|
-
}
|
|
484
|
-
|
|
485
|
-
return _ref3.apply(this, arguments);
|
|
486
|
-
};
|
|
487
|
-
}());
|
|
480
|
+
}
|
|
481
|
+
});
|
|
488
482
|
_defineProperty(this, "openFilter", filter => {
|
|
489
483
|
this.setState({
|
|
490
484
|
filterOpen: filter
|
|
@@ -519,15 +513,15 @@ class FeedList extends Component {
|
|
|
519
513
|
});
|
|
520
514
|
_defineProperty(this, "saveTimeFilter", () => {
|
|
521
515
|
if (!this.isValidTimeFilter()) return;
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
516
|
+
let startTime = 0;
|
|
517
|
+
let endTime = moment().endOf("d").valueOf();
|
|
518
|
+
let text = "";
|
|
525
519
|
if (this.state.selectedTimeFilter.dayCount > 0) {
|
|
526
520
|
startTime = moment().add(-this.state.selectedTimeFilter.dayCount, "d").startOf("d").valueOf();
|
|
527
521
|
text = this.state.selectedTimeFilter.text;
|
|
528
522
|
} else {
|
|
529
|
-
|
|
530
|
-
|
|
523
|
+
const startDate = moment(this.state.timeFilterStart).startOf("d");
|
|
524
|
+
const endDate = moment(this.state.timeFilterEnd).endOf("d");
|
|
531
525
|
startTime = startDate.valueOf();
|
|
532
526
|
endTime = endDate.valueOf();
|
|
533
527
|
text = "".concat(startDate.format("DD/MM/YYYY"), " to ").concat(endDate.format("DD/MM/YYYY"));
|
|
@@ -552,7 +546,7 @@ class FeedList extends Component {
|
|
|
552
546
|
this.setState(stateChange);
|
|
553
547
|
});
|
|
554
548
|
_defineProperty(this, "onSelectUser", function (userKey) {
|
|
555
|
-
|
|
549
|
+
let user = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
556
550
|
_this.setState({
|
|
557
551
|
[userKey]: user
|
|
558
552
|
});
|
|
@@ -566,8 +560,8 @@ class FeedList extends Component {
|
|
|
566
560
|
if (userKey === "selectedUser" && this.props.onUserSelected) this.props.onUserSelected("");
|
|
567
561
|
});
|
|
568
562
|
_defineProperty(this, "saveUserFilter", userKey => {
|
|
569
|
-
|
|
570
|
-
|
|
563
|
+
const selected = this.state[userKey];
|
|
564
|
+
let userId = "";
|
|
571
565
|
if (!selected) {
|
|
572
566
|
this.removeUserFilter(userKey);
|
|
573
567
|
} else {
|
|
@@ -583,14 +577,14 @@ class FeedList extends Component {
|
|
|
583
577
|
this.closeFilter();
|
|
584
578
|
});
|
|
585
579
|
_defineProperty(this, "getSource", () => {
|
|
586
|
-
|
|
580
|
+
const {
|
|
587
581
|
selectedTimeFilterStart,
|
|
588
582
|
selectedTimeFilterEnd,
|
|
589
583
|
selectedTypeFilter,
|
|
590
584
|
selectedUserFilter,
|
|
591
585
|
selectedAuthorFilter
|
|
592
586
|
} = this.state;
|
|
593
|
-
|
|
587
|
+
let source = this.props.source;
|
|
594
588
|
|
|
595
589
|
// filter by time
|
|
596
590
|
if (selectedTimeFilterStart && selectedTimeFilterEnd) {
|
|
@@ -651,11 +645,11 @@ class FeedList extends Component {
|
|
|
651
645
|
});
|
|
652
646
|
_defineProperty(this, "getExportSource", () => {
|
|
653
647
|
return this.getSource().map(r => {
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
648
|
+
const userName = r.user.displayName;
|
|
649
|
+
const userId = r.user.id;
|
|
650
|
+
const authorName = r.author.displayName;
|
|
651
|
+
const authorId = r.author.id;
|
|
652
|
+
const created = moment.utc(r.created).format();
|
|
659
653
|
return _objectSpread$4(_objectSpread$4({}, r), {}, {
|
|
660
654
|
userName,
|
|
661
655
|
userId,
|
|
@@ -734,7 +728,7 @@ class FeedList extends Component {
|
|
|
734
728
|
this.getFeeds();
|
|
735
729
|
}
|
|
736
730
|
renderTimePopup() {
|
|
737
|
-
|
|
731
|
+
const {
|
|
738
732
|
selectedTimeFilter
|
|
739
733
|
} = this.state;
|
|
740
734
|
return /*#__PURE__*/jsx(Components$4.Popup, {
|
|
@@ -763,11 +757,11 @@ class FeedList extends Component {
|
|
|
763
757
|
});
|
|
764
758
|
}
|
|
765
759
|
renderUserPopup(userKey, label) {
|
|
766
|
-
|
|
760
|
+
const {
|
|
767
761
|
userSearch
|
|
768
762
|
} = this.state;
|
|
769
|
-
|
|
770
|
-
|
|
763
|
+
const selected = this.state[userKey];
|
|
764
|
+
let userContent = null;
|
|
771
765
|
if (selected) {
|
|
772
766
|
userContent = /*#__PURE__*/jsx("div", {
|
|
773
767
|
children: /*#__PURE__*/jsx(Components$4.UserListing, {
|
|
@@ -818,8 +812,8 @@ class FeedList extends Component {
|
|
|
818
812
|
});
|
|
819
813
|
}
|
|
820
814
|
renderTypePopup() {
|
|
821
|
-
|
|
822
|
-
|
|
815
|
+
const validTypes = _.uniq(this.props.source.map(r => r.type)).filter(t => t);
|
|
816
|
+
const orderedTypes = _.sortBy(validTypes, t => t.toLowerCase());
|
|
823
817
|
return /*#__PURE__*/jsx(Components$4.Popup, {
|
|
824
818
|
title: "Select Type",
|
|
825
819
|
maxWidth: 600,
|
|
@@ -845,7 +839,7 @@ class FeedList extends Component {
|
|
|
845
839
|
}
|
|
846
840
|
renderFeeds() {
|
|
847
841
|
// Posts can only be edited or deleted by those with full admin privileges
|
|
848
|
-
|
|
842
|
+
const canEdit = Session$5.validateAccess(this.props.auth.site, values.permissionFeedManagement, this.props.auth);
|
|
849
843
|
return this.getSource().map((feed, index) => {
|
|
850
844
|
if (!feed) {
|
|
851
845
|
return null;
|
|
@@ -900,7 +894,7 @@ class FeedList extends Component {
|
|
|
900
894
|
});
|
|
901
895
|
}
|
|
902
896
|
renderSort(col) {
|
|
903
|
-
|
|
897
|
+
const {
|
|
904
898
|
sortColumn,
|
|
905
899
|
sortDesc
|
|
906
900
|
} = this.state;
|
|
@@ -917,7 +911,7 @@ class FeedList extends Component {
|
|
|
917
911
|
return " table--columnActive";
|
|
918
912
|
}
|
|
919
913
|
renderEmpty() {
|
|
920
|
-
|
|
914
|
+
const title = this.props.strings["".concat(values.featureKey, "_textTitleRequests")] || values.textTitleRequests;
|
|
921
915
|
return /*#__PURE__*/jsxs("div", {
|
|
922
916
|
style: {
|
|
923
917
|
display: "flex",
|
|
@@ -1015,7 +1009,7 @@ class FeedList extends Component {
|
|
|
1015
1009
|
});
|
|
1016
1010
|
}
|
|
1017
1011
|
renderFilters() {
|
|
1018
|
-
|
|
1012
|
+
let typeFilter = /*#__PURE__*/jsx(Components$4.Tag, {
|
|
1019
1013
|
className: "marginRight-10",
|
|
1020
1014
|
onClick: () => this.openFilter("type"),
|
|
1021
1015
|
text: "Type"
|
|
@@ -1034,7 +1028,7 @@ class FeedList extends Component {
|
|
|
1034
1028
|
text: this.state.selectedTypeFilter
|
|
1035
1029
|
});
|
|
1036
1030
|
}
|
|
1037
|
-
|
|
1031
|
+
let timeFilter = /*#__PURE__*/jsx(Components$4.Tag, {
|
|
1038
1032
|
className: "marginRight-10",
|
|
1039
1033
|
onClick: () => {
|
|
1040
1034
|
this.openFilter("time");
|
|
@@ -1055,7 +1049,7 @@ class FeedList extends Component {
|
|
|
1055
1049
|
text: this.state.selectedTimeFilterText
|
|
1056
1050
|
});
|
|
1057
1051
|
}
|
|
1058
|
-
|
|
1052
|
+
let userFilter = /*#__PURE__*/jsx(Components$4.Tag, {
|
|
1059
1053
|
className: "marginRight-10",
|
|
1060
1054
|
onClick: () => {
|
|
1061
1055
|
this.openFilter("user");
|
|
@@ -1076,7 +1070,7 @@ class FeedList extends Component {
|
|
|
1076
1070
|
text: this.state.selectedUserFilterText
|
|
1077
1071
|
});
|
|
1078
1072
|
}
|
|
1079
|
-
|
|
1073
|
+
let authorFilter = /*#__PURE__*/jsx(Components$4.Tag, {
|
|
1080
1074
|
className: "marginRight-10",
|
|
1081
1075
|
onClick: () => {
|
|
1082
1076
|
this.openFilter("author");
|
|
@@ -1138,11 +1132,11 @@ class FeedList extends Component {
|
|
|
1138
1132
|
});
|
|
1139
1133
|
}
|
|
1140
1134
|
}
|
|
1141
|
-
|
|
1142
|
-
|
|
1135
|
+
const mapStateToProps$5 = state => {
|
|
1136
|
+
const {
|
|
1143
1137
|
users
|
|
1144
1138
|
} = state.users;
|
|
1145
|
-
|
|
1139
|
+
const {
|
|
1146
1140
|
auth
|
|
1147
1141
|
} = state;
|
|
1148
1142
|
return {
|
|
@@ -1158,35 +1152,33 @@ var FeedList$1 = connect(mapStateToProps$5, {
|
|
|
1158
1152
|
usersLoaded
|
|
1159
1153
|
})(withRouter(FeedList));
|
|
1160
1154
|
|
|
1161
|
-
|
|
1155
|
+
const {
|
|
1162
1156
|
Session: Session$4
|
|
1163
1157
|
} = PlussCore;
|
|
1164
1158
|
class FeedSubmissions extends Component {
|
|
1165
1159
|
constructor() {
|
|
1166
|
-
var _this;
|
|
1167
1160
|
super(...arguments);
|
|
1168
|
-
_this = this;
|
|
1169
1161
|
_defineProperty(this, "state", {
|
|
1170
1162
|
feedSubmissions: [],
|
|
1171
1163
|
sortColumn: "created",
|
|
1172
1164
|
// column to sort by
|
|
1173
1165
|
sortDesc: false // if true, sort descending rather than ascending
|
|
1174
1166
|
});
|
|
1175
|
-
_defineProperty(this, "getData",
|
|
1176
|
-
|
|
1167
|
+
_defineProperty(this, "getData", async () => {
|
|
1168
|
+
const {
|
|
1177
1169
|
auth
|
|
1178
|
-
} =
|
|
1170
|
+
} = this.props;
|
|
1179
1171
|
try {
|
|
1180
|
-
|
|
1181
|
-
|
|
1172
|
+
const res = await feedActions.getFeedSubmissions(auth.site);
|
|
1173
|
+
const submissions = res.data.Items;
|
|
1182
1174
|
// console.log('getSubmissions', submissions && submissions[0]);
|
|
1183
1175
|
if (!_.isEmpty(submissions) && submissions[0].site === auth.site) {
|
|
1184
|
-
|
|
1176
|
+
this.props.feedsSubmissionsLoaded(submissions);
|
|
1185
1177
|
}
|
|
1186
1178
|
} catch (error) {
|
|
1187
1179
|
console.log("getData error", error);
|
|
1188
1180
|
}
|
|
1189
|
-
})
|
|
1181
|
+
});
|
|
1190
1182
|
}
|
|
1191
1183
|
UNSAFE_componentWillMount() {
|
|
1192
1184
|
Session$4.checkLoggedIn(this, this.props.auth);
|
|
@@ -1216,7 +1208,7 @@ class FeedSubmissions extends Component {
|
|
|
1216
1208
|
}
|
|
1217
1209
|
}
|
|
1218
1210
|
renderSubmissions() {
|
|
1219
|
-
|
|
1211
|
+
let source = _.sortBy(this.props.source, feed => {
|
|
1220
1212
|
if (this.state.sortColumn === "userName") return feed.user.displayName;
|
|
1221
1213
|
if (this.state.sortColumn === "authorName") return feed.author.displayName;
|
|
1222
1214
|
if (this.state.sortColumn !== "created") return feed[this.state.sortColumn];
|
|
@@ -1327,8 +1319,8 @@ class FeedSubmissions extends Component {
|
|
|
1327
1319
|
});
|
|
1328
1320
|
}
|
|
1329
1321
|
}
|
|
1330
|
-
|
|
1331
|
-
|
|
1322
|
+
const mapStateToProps$4 = state => {
|
|
1323
|
+
const {
|
|
1332
1324
|
auth
|
|
1333
1325
|
} = state;
|
|
1334
1326
|
return {
|
|
@@ -1340,7 +1332,7 @@ var FeedSubmissions$1 = connect(mapStateToProps$4, {
|
|
|
1340
1332
|
feedsSubmissionsLoaded
|
|
1341
1333
|
})(FeedSubmissions);
|
|
1342
1334
|
|
|
1343
|
-
|
|
1335
|
+
const {
|
|
1344
1336
|
Session: Session$3,
|
|
1345
1337
|
Components: Components$3
|
|
1346
1338
|
} = PlussCore;
|
|
@@ -1349,18 +1341,18 @@ class FeedTypes extends Component {
|
|
|
1349
1341
|
var _this;
|
|
1350
1342
|
super(props);
|
|
1351
1343
|
_this = this;
|
|
1352
|
-
_defineProperty(this, "getFeedTypes",
|
|
1344
|
+
_defineProperty(this, "getFeedTypes", async () => {
|
|
1353
1345
|
try {
|
|
1354
|
-
|
|
1355
|
-
if (res.data != null)
|
|
1346
|
+
const res = await feedActions.getFeedTypes(this.props.auth.site);
|
|
1347
|
+
if (res.data != null) this.props.feedTypesLoaded(res.data);
|
|
1356
1348
|
} catch (error) {
|
|
1357
1349
|
console.error("getFeedTypes", error);
|
|
1358
1350
|
} finally {
|
|
1359
|
-
|
|
1351
|
+
this.setState({
|
|
1360
1352
|
loading: false
|
|
1361
1353
|
});
|
|
1362
1354
|
}
|
|
1363
|
-
})
|
|
1355
|
+
});
|
|
1364
1356
|
_defineProperty(this, "sortByCol", col => {
|
|
1365
1357
|
if (this.state.sortColumn === col) {
|
|
1366
1358
|
this.setState({
|
|
@@ -1374,7 +1366,7 @@ class FeedTypes extends Component {
|
|
|
1374
1366
|
}
|
|
1375
1367
|
});
|
|
1376
1368
|
_defineProperty(this, "isFeedTypeValid", () => {
|
|
1377
|
-
|
|
1369
|
+
const {
|
|
1378
1370
|
feedTypeLabel,
|
|
1379
1371
|
feedTypeColour
|
|
1380
1372
|
} = this.state;
|
|
@@ -1382,30 +1374,25 @@ class FeedTypes extends Component {
|
|
|
1382
1374
|
if (_.isEmpty(feedTypeColour)) return false;
|
|
1383
1375
|
return true;
|
|
1384
1376
|
});
|
|
1385
|
-
_defineProperty(this, "onRemoveFeedType",
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
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.");
|
|
1377
|
+
_defineProperty(this, "onRemoveFeedType", async ev => {
|
|
1378
|
+
if (!window.confirm("Are you sure you want to delete ".concat(ev.label, "?"))) return;
|
|
1379
|
+
try {
|
|
1380
|
+
await feedActions.deleteFeedType(this.props.auth.site, ev.id);
|
|
1381
|
+
const index = _.findIndex(this.state.feedTypeList, feedType => {
|
|
1382
|
+
return feedType != null && feedType.id === ev.id;
|
|
1383
|
+
});
|
|
1384
|
+
if (index > -1) {
|
|
1385
|
+
const newFeedTypes = [...this.state.feedTypeList];
|
|
1386
|
+
newFeedTypes[index].Deleted = true;
|
|
1387
|
+
this.props.feedTypesLoaded(newFeedTypes);
|
|
1401
1388
|
}
|
|
1402
|
-
})
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
}
|
|
1406
|
-
}
|
|
1389
|
+
} catch (error) {
|
|
1390
|
+
console.error("onRemoveFeedType", error);
|
|
1391
|
+
alert("Something went wrong with the request. Please try again.");
|
|
1392
|
+
}
|
|
1393
|
+
});
|
|
1407
1394
|
_defineProperty(this, "onShowFeedType", function () {
|
|
1408
|
-
|
|
1395
|
+
let feedType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
1409
1396
|
_this.setState({
|
|
1410
1397
|
showFeedType: true,
|
|
1411
1398
|
feedTypeId: feedType ? feedType.id : null,
|
|
@@ -1429,10 +1416,10 @@ class FeedTypes extends Component {
|
|
|
1429
1416
|
this.setState(stateChange);
|
|
1430
1417
|
});
|
|
1431
1418
|
_defineProperty(this, "onSave", () => {
|
|
1432
|
-
|
|
1419
|
+
const {
|
|
1433
1420
|
site
|
|
1434
1421
|
} = this.props.auth;
|
|
1435
|
-
|
|
1422
|
+
const {
|
|
1436
1423
|
submitting,
|
|
1437
1424
|
feedTypeId,
|
|
1438
1425
|
feedTypeLabel,
|
|
@@ -1447,25 +1434,25 @@ class FeedTypes extends Component {
|
|
|
1447
1434
|
}
|
|
1448
1435
|
this.setState({
|
|
1449
1436
|
submitting: true
|
|
1450
|
-
},
|
|
1437
|
+
}, async () => {
|
|
1451
1438
|
try {
|
|
1452
1439
|
if (feedTypeId) {
|
|
1453
|
-
|
|
1440
|
+
await feedActions.editFeedType(site, feedTypeId, feedTypeLabel, feedTypeColour);
|
|
1454
1441
|
} else {
|
|
1455
|
-
|
|
1442
|
+
await feedActions.addFeedType(site, feedTypeLabel, feedTypeColour);
|
|
1456
1443
|
}
|
|
1457
|
-
|
|
1458
|
-
|
|
1444
|
+
this.props.feedTypesUpdate(site);
|
|
1445
|
+
this.setState({
|
|
1459
1446
|
submitting: false
|
|
1460
|
-
},
|
|
1447
|
+
}, this.onHideFeedType);
|
|
1461
1448
|
} catch (error) {
|
|
1462
1449
|
console.error("onSave", error);
|
|
1463
|
-
|
|
1450
|
+
this.setState({
|
|
1464
1451
|
submitting: false
|
|
1465
1452
|
});
|
|
1466
1453
|
alert("Something went wrong with the request. Please try again.");
|
|
1467
1454
|
}
|
|
1468
|
-
})
|
|
1455
|
+
});
|
|
1469
1456
|
});
|
|
1470
1457
|
this.state = {
|
|
1471
1458
|
feedTypeList: [],
|
|
@@ -1496,8 +1483,8 @@ class FeedTypes extends Component {
|
|
|
1496
1483
|
});
|
|
1497
1484
|
}
|
|
1498
1485
|
renderList() {
|
|
1499
|
-
|
|
1500
|
-
|
|
1486
|
+
const canEdit = Session$3.validateAccess(this.props.auth.site, values.permissionFeedManagement, this.props.auth);
|
|
1487
|
+
let source = _.sortBy(this.state.feedTypeList, this.state.sortColumn);
|
|
1501
1488
|
if (this.state.sortDesc) source.reverse();
|
|
1502
1489
|
source = _.filter(source, ev => {
|
|
1503
1490
|
if (!ev) return false;
|
|
@@ -1638,11 +1625,11 @@ class FeedTypes extends Component {
|
|
|
1638
1625
|
return this.renderView();
|
|
1639
1626
|
}
|
|
1640
1627
|
renderFeedTypes() {
|
|
1641
|
-
|
|
1628
|
+
const {
|
|
1642
1629
|
feedTypeList,
|
|
1643
1630
|
loading
|
|
1644
1631
|
} = this.state;
|
|
1645
|
-
|
|
1632
|
+
const canAdd = Session$3.validateAccess(this.props.auth.site, values.permissionFeedManagement, this.props.auth);
|
|
1646
1633
|
if (feedTypeList.length === 0 && loading) {
|
|
1647
1634
|
return /*#__PURE__*/jsx("div", {
|
|
1648
1635
|
iconStyle: {
|
|
@@ -1679,7 +1666,7 @@ class FeedTypes extends Component {
|
|
|
1679
1666
|
});
|
|
1680
1667
|
}
|
|
1681
1668
|
renderNewFeedTypePopup() {
|
|
1682
|
-
|
|
1669
|
+
const {
|
|
1683
1670
|
submitting,
|
|
1684
1671
|
showFeedType,
|
|
1685
1672
|
feedTypeId,
|
|
@@ -1753,8 +1740,8 @@ class FeedTypes extends Component {
|
|
|
1753
1740
|
});
|
|
1754
1741
|
}
|
|
1755
1742
|
}
|
|
1756
|
-
|
|
1757
|
-
|
|
1743
|
+
const mapStateToProps$3 = state => {
|
|
1744
|
+
const {
|
|
1758
1745
|
auth
|
|
1759
1746
|
} = state;
|
|
1760
1747
|
return {
|
|
@@ -1767,19 +1754,17 @@ var FeedTypes$1 = connect(mapStateToProps$3, {
|
|
|
1767
1754
|
feedTypesUpdate
|
|
1768
1755
|
})(withRouter(FeedTypes));
|
|
1769
1756
|
|
|
1770
|
-
|
|
1757
|
+
const {
|
|
1771
1758
|
Components: Components$2,
|
|
1772
1759
|
Session: Session$2,
|
|
1773
1760
|
Helper: Helper$2
|
|
1774
1761
|
} = PlussCore;
|
|
1775
1762
|
class FeedHub extends Component {
|
|
1776
1763
|
constructor(props) {
|
|
1777
|
-
var _this;
|
|
1778
1764
|
super(props);
|
|
1779
|
-
_this = this;
|
|
1780
1765
|
_defineProperty(this, "setData", () => {
|
|
1781
|
-
|
|
1782
|
-
|
|
1766
|
+
const feeds = [];
|
|
1767
|
+
const feedSubmissions = [];
|
|
1783
1768
|
this.state.feeds.forEach(ev => {
|
|
1784
1769
|
if (ev != null && !ev.deleted) feeds.push(ev);
|
|
1785
1770
|
});
|
|
@@ -1792,59 +1777,59 @@ class FeedHub extends Component {
|
|
|
1792
1777
|
});
|
|
1793
1778
|
});
|
|
1794
1779
|
_defineProperty(this, "getFeeds", () => {
|
|
1795
|
-
|
|
1780
|
+
const {
|
|
1796
1781
|
auth
|
|
1797
1782
|
} = this.props;
|
|
1798
1783
|
this.setState({
|
|
1799
1784
|
loadingFeeds: true
|
|
1800
|
-
},
|
|
1785
|
+
}, async () => {
|
|
1801
1786
|
try {
|
|
1802
|
-
|
|
1787
|
+
const res = await feedActions.getFeedsRecursive(auth.site);
|
|
1803
1788
|
if (!_.isEmpty(res) && res[0].site === auth.site) {
|
|
1804
|
-
|
|
1789
|
+
this.props.feedsLoaded(res);
|
|
1805
1790
|
}
|
|
1806
1791
|
} catch (error) {
|
|
1807
1792
|
console.error("getFeeds", error);
|
|
1808
1793
|
} finally {
|
|
1809
|
-
|
|
1794
|
+
this.setState({
|
|
1810
1795
|
loadingFeeds: false
|
|
1811
1796
|
});
|
|
1812
1797
|
}
|
|
1813
|
-
})
|
|
1798
|
+
});
|
|
1814
1799
|
});
|
|
1815
1800
|
_defineProperty(this, "getSubmissions", () => {
|
|
1816
|
-
|
|
1801
|
+
const {
|
|
1817
1802
|
auth
|
|
1818
1803
|
} = this.props;
|
|
1819
1804
|
if (!Session$2.validateAccess(auth.site, values.permissionFeedManagement, auth)) return;
|
|
1820
1805
|
this.setState({
|
|
1821
1806
|
loadingSubmissions: true
|
|
1822
|
-
},
|
|
1807
|
+
}, async () => {
|
|
1823
1808
|
try {
|
|
1824
|
-
|
|
1825
|
-
|
|
1809
|
+
const res = await feedActions.getFeedSubmissions(auth.site);
|
|
1810
|
+
const submissions = res.data.Items;
|
|
1826
1811
|
// console.log('getSubmissions', submissions && submissions[0]);
|
|
1827
1812
|
if (!_.isEmpty(submissions) && submissions[0].site === auth.site) {
|
|
1828
|
-
|
|
1813
|
+
this.props.feedsSubmissionsLoaded(submissions);
|
|
1829
1814
|
}
|
|
1830
1815
|
} catch (error) {
|
|
1831
1816
|
console.log("getSubmissions error", error);
|
|
1832
1817
|
} finally {
|
|
1833
|
-
|
|
1818
|
+
this.setState({
|
|
1834
1819
|
loadingSubmissions: false
|
|
1835
1820
|
});
|
|
1836
1821
|
}
|
|
1837
|
-
})
|
|
1822
|
+
});
|
|
1838
1823
|
});
|
|
1839
1824
|
_defineProperty(this, "canAddNew", isClass => {
|
|
1840
|
-
|
|
1825
|
+
const {
|
|
1841
1826
|
auth
|
|
1842
1827
|
} = this.props;
|
|
1843
1828
|
if (Session$2.validateAccess(auth.site, values.permissionFeedPost, auth) || Session$2.validateAccess(auth.site, values.permissionFeedDraft, auth)) return isClass ? "" : true;
|
|
1844
1829
|
return isClass ? " hub-sideContent-topButton--hide" : false;
|
|
1845
1830
|
});
|
|
1846
1831
|
_defineProperty(this, "onAddNew", () => {
|
|
1847
|
-
|
|
1832
|
+
const {
|
|
1848
1833
|
selectedUserId
|
|
1849
1834
|
} = this.state;
|
|
1850
1835
|
if (this.canAddNew()) {
|
|
@@ -1886,7 +1871,7 @@ class FeedHub extends Component {
|
|
|
1886
1871
|
}, this.setData);
|
|
1887
1872
|
}
|
|
1888
1873
|
renderLeftBar() {
|
|
1889
|
-
|
|
1874
|
+
const sectionItems = [];
|
|
1890
1875
|
if (this.canAddNew()) {
|
|
1891
1876
|
sectionItems.push({
|
|
1892
1877
|
type: "newButton",
|
|
@@ -1907,7 +1892,7 @@ class FeedHub extends Component {
|
|
|
1907
1892
|
}
|
|
1908
1893
|
});
|
|
1909
1894
|
if (Session$2.validateAccess(this.props.auth.site, values.permissionFeedManagement, this.props.auth)) {
|
|
1910
|
-
|
|
1895
|
+
let submissionText = "View Submissions";
|
|
1911
1896
|
if (!this.state.loadingSubmissions) {
|
|
1912
1897
|
submissionText = "View Submission".concat(Helper$2.getPluralS(this.state.feedSubmissions.length), " (").concat(this.state.feedSubmissions.length, ")");
|
|
1913
1898
|
}
|
|
@@ -1950,7 +1935,7 @@ class FeedHub extends Component {
|
|
|
1950
1935
|
});
|
|
1951
1936
|
}
|
|
1952
1937
|
renderRight() {
|
|
1953
|
-
|
|
1938
|
+
const {
|
|
1954
1939
|
selectedSection,
|
|
1955
1940
|
feeds,
|
|
1956
1941
|
feedSubmissions
|
|
@@ -1983,7 +1968,7 @@ class FeedHub extends Component {
|
|
|
1983
1968
|
});
|
|
1984
1969
|
}
|
|
1985
1970
|
}
|
|
1986
|
-
|
|
1971
|
+
const styles$4 = {
|
|
1987
1972
|
sideBarTitleSection: {
|
|
1988
1973
|
lineHeight: "40px",
|
|
1989
1974
|
marginTop: 30,
|
|
@@ -2006,8 +1991,8 @@ var styles$4 = {
|
|
|
2006
1991
|
color: FeatureConfig.env.colourBrandingOff
|
|
2007
1992
|
}
|
|
2008
1993
|
};
|
|
2009
|
-
|
|
2010
|
-
|
|
1994
|
+
const mapStateToProps$2 = state => {
|
|
1995
|
+
const {
|
|
2011
1996
|
auth
|
|
2012
1997
|
} = state;
|
|
2013
1998
|
return {
|
|
@@ -2022,7 +2007,7 @@ var FeedHub$1 = connect(mapStateToProps$2, {
|
|
|
2022
2007
|
feedsSubmissionsLoaded
|
|
2023
2008
|
})(withRouter(FeedHub));
|
|
2024
2009
|
|
|
2025
|
-
|
|
2010
|
+
const {
|
|
2026
2011
|
Helper: Helper$1,
|
|
2027
2012
|
Session: Session$1,
|
|
2028
2013
|
Colours,
|
|
@@ -2033,33 +2018,33 @@ class Feed extends Component {
|
|
|
2033
2018
|
var _this;
|
|
2034
2019
|
super(props);
|
|
2035
2020
|
_this = this;
|
|
2036
|
-
_defineProperty(this, "getFeed",
|
|
2021
|
+
_defineProperty(this, "getFeed", async () => {
|
|
2037
2022
|
try {
|
|
2038
|
-
|
|
2023
|
+
const res = await feedActions.getFeed(this.state.feedId);
|
|
2039
2024
|
// console.log('getFeed:', res.data);
|
|
2040
|
-
|
|
2025
|
+
this.setState({
|
|
2041
2026
|
feed: res.data
|
|
2042
2027
|
});
|
|
2043
|
-
|
|
2028
|
+
this.props.feedsLoaded([res.data]);
|
|
2044
2029
|
} catch (error) {
|
|
2045
2030
|
console.error("getFeed", error);
|
|
2046
2031
|
}
|
|
2047
|
-
})
|
|
2048
|
-
_defineProperty(this, "getFeedTypes",
|
|
2032
|
+
});
|
|
2033
|
+
_defineProperty(this, "getFeedTypes", async () => {
|
|
2049
2034
|
try {
|
|
2050
|
-
|
|
2051
|
-
|
|
2035
|
+
const res = await feedActions.getFeedTypes(this.props.auth.site);
|
|
2036
|
+
this.setState({
|
|
2052
2037
|
types: res.data
|
|
2053
2038
|
});
|
|
2054
2039
|
} catch (error) {
|
|
2055
2040
|
console.error("getFeedTypes", error);
|
|
2056
2041
|
}
|
|
2057
|
-
})
|
|
2042
|
+
});
|
|
2058
2043
|
_defineProperty(this, "canEdit", () => {
|
|
2059
2044
|
return Session$1.validateAccess(this.props.auth.site, values.permissionFeedManagement, this.props.auth);
|
|
2060
2045
|
});
|
|
2061
2046
|
_defineProperty(this, "canApprove", () => {
|
|
2062
|
-
|
|
2047
|
+
const {
|
|
2063
2048
|
feed
|
|
2064
2049
|
} = this.state;
|
|
2065
2050
|
return feed && _.isNil(feed.approved) && this.canEdit();
|
|
@@ -2072,43 +2057,43 @@ class Feed extends Component {
|
|
|
2072
2057
|
});
|
|
2073
2058
|
});
|
|
2074
2059
|
});
|
|
2075
|
-
_defineProperty(this, "onAddComment",
|
|
2076
|
-
|
|
2060
|
+
_defineProperty(this, "onAddComment", async () => {
|
|
2061
|
+
const {
|
|
2077
2062
|
commentInput,
|
|
2078
2063
|
feedId,
|
|
2079
2064
|
feed,
|
|
2080
2065
|
comments
|
|
2081
|
-
} =
|
|
2066
|
+
} = this.state;
|
|
2082
2067
|
try {
|
|
2083
|
-
|
|
2068
|
+
this.setState({
|
|
2084
2069
|
commentInput: ""
|
|
2085
2070
|
});
|
|
2086
|
-
|
|
2087
|
-
|
|
2071
|
+
const res = await reactionActions.addComment(feedId, values.featureKey, feed.title, feed.site, commentInput);
|
|
2072
|
+
this.setState({
|
|
2088
2073
|
comments: [...comments, res.data]
|
|
2089
2074
|
});
|
|
2090
2075
|
} catch (error) {
|
|
2091
2076
|
console.error("onAddComment", error);
|
|
2092
2077
|
}
|
|
2093
|
-
})
|
|
2078
|
+
});
|
|
2094
2079
|
_defineProperty(this, "onHandleChange", event => {
|
|
2095
2080
|
var stateChange = {};
|
|
2096
2081
|
stateChange[event.target.getAttribute("id")] = event.target.value;
|
|
2097
2082
|
this.setState(stateChange);
|
|
2098
2083
|
});
|
|
2099
|
-
_defineProperty(this, "onReviewFeed",
|
|
2100
|
-
|
|
2084
|
+
_defineProperty(this, "onReviewFeed", async function () {
|
|
2085
|
+
let approved = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
2101
2086
|
if (window.confirm(approved ? values.textAreYouSureYouWantToApprove : values.textAreYouSureYouWantToReject)) {
|
|
2102
2087
|
try {
|
|
2103
2088
|
_this.setState({
|
|
2104
2089
|
editing: true
|
|
2105
2090
|
});
|
|
2106
|
-
|
|
2091
|
+
const {
|
|
2107
2092
|
feed
|
|
2108
2093
|
} = _this.state;
|
|
2109
|
-
|
|
2094
|
+
const res = await feedActions.reviewFeed(feed.id, approved);
|
|
2110
2095
|
// console.log('onReviewFeed:', res.data);
|
|
2111
|
-
|
|
2096
|
+
const updated = res.data && res.data.updated;
|
|
2112
2097
|
_this.props.removeFeedSubmission(updated.id);
|
|
2113
2098
|
_this.setState({
|
|
2114
2099
|
editing: false,
|
|
@@ -2122,7 +2107,7 @@ class Feed extends Component {
|
|
|
2122
2107
|
alert("Something went wrong with the request. Please try again.");
|
|
2123
2108
|
}
|
|
2124
2109
|
}
|
|
2125
|
-
})
|
|
2110
|
+
});
|
|
2126
2111
|
this.state = {
|
|
2127
2112
|
feedId: Helper$1.safeReadParams(props, "feedId") ? props.match.params.feedId : null,
|
|
2128
2113
|
feed: null,
|
|
@@ -2183,11 +2168,11 @@ class Feed extends Component {
|
|
|
2183
2168
|
});
|
|
2184
2169
|
}
|
|
2185
2170
|
renderImages() {
|
|
2186
|
-
|
|
2171
|
+
const {
|
|
2187
2172
|
feed
|
|
2188
2173
|
} = this.state;
|
|
2189
2174
|
if (_.isEmpty(feed.photo) && _.isEmpty(feed.photos)) return null;
|
|
2190
|
-
|
|
2175
|
+
const imagesToUse = _.isEmpty(feed.photo) ? feed.photos : [feed.photo];
|
|
2191
2176
|
return /*#__PURE__*/jsx("div", {
|
|
2192
2177
|
className: "imageGrid",
|
|
2193
2178
|
children: imagesToUse.map((image, i) => {
|
|
@@ -2206,13 +2191,13 @@ class Feed extends Component {
|
|
|
2206
2191
|
});
|
|
2207
2192
|
}
|
|
2208
2193
|
renderInner() {
|
|
2209
|
-
|
|
2194
|
+
const {
|
|
2210
2195
|
feed,
|
|
2211
2196
|
types
|
|
2212
2197
|
} = this.state;
|
|
2213
2198
|
if (feed == null) return null;
|
|
2214
|
-
|
|
2215
|
-
|
|
2199
|
+
const feedType = types.find(t => t.label === feed.type);
|
|
2200
|
+
const editable = this.canEdit();
|
|
2216
2201
|
return /*#__PURE__*/jsxs("div", {
|
|
2217
2202
|
iconStyle: {
|
|
2218
2203
|
paddingBottom: 40
|
|
@@ -2268,8 +2253,8 @@ class Feed extends Component {
|
|
|
2268
2253
|
});
|
|
2269
2254
|
}
|
|
2270
2255
|
renderHistoryEntry(e, i) {
|
|
2271
|
-
|
|
2272
|
-
|
|
2256
|
+
const action = (() => {
|
|
2257
|
+
const {
|
|
2273
2258
|
approved,
|
|
2274
2259
|
deleted
|
|
2275
2260
|
} = e.changes;
|
|
@@ -2296,11 +2281,11 @@ class Feed extends Component {
|
|
|
2296
2281
|
}, i);
|
|
2297
2282
|
}
|
|
2298
2283
|
renderEditHistory() {
|
|
2299
|
-
|
|
2284
|
+
const {
|
|
2300
2285
|
feed
|
|
2301
2286
|
} = this.state;
|
|
2302
2287
|
if (!feed || !feed.history) return null;
|
|
2303
|
-
|
|
2288
|
+
const source = _.sortBy(feed.history, "timestamp");
|
|
2304
2289
|
// console.log('renderEditHistory', JSON.stringify(source, null, 2));
|
|
2305
2290
|
|
|
2306
2291
|
return /*#__PURE__*/jsxs("div", {
|
|
@@ -2316,9 +2301,9 @@ class Feed extends Component {
|
|
|
2316
2301
|
});
|
|
2317
2302
|
}
|
|
2318
2303
|
renderButtons() {
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2304
|
+
const editable = this.canEdit();
|
|
2305
|
+
const approvable = this.canApprove();
|
|
2306
|
+
const isEditing = this.state.editing;
|
|
2322
2307
|
return /*#__PURE__*/jsxs("div", {
|
|
2323
2308
|
children: [/*#__PURE__*/jsx(Components$1.Button, {
|
|
2324
2309
|
inline: true,
|
|
@@ -2384,8 +2369,8 @@ class Feed extends Component {
|
|
|
2384
2369
|
});
|
|
2385
2370
|
}
|
|
2386
2371
|
}
|
|
2387
|
-
|
|
2388
|
-
|
|
2372
|
+
const mapStateToProps$1 = state => {
|
|
2373
|
+
const {
|
|
2389
2374
|
auth
|
|
2390
2375
|
} = state;
|
|
2391
2376
|
return {
|
|
@@ -2399,43 +2384,41 @@ var Feed$1 = connect(mapStateToProps$1, {
|
|
|
2399
2384
|
|
|
2400
2385
|
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; }
|
|
2401
2386
|
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; }
|
|
2402
|
-
|
|
2387
|
+
const {
|
|
2403
2388
|
Components,
|
|
2404
2389
|
Helper,
|
|
2405
2390
|
Session
|
|
2406
2391
|
} = PlussCore;
|
|
2407
2392
|
class AddFeed extends Component {
|
|
2408
2393
|
constructor(props) {
|
|
2409
|
-
var _this;
|
|
2410
2394
|
super(props);
|
|
2411
|
-
|
|
2412
|
-
_defineProperty(this, "getFeed", /*#__PURE__*/_asyncToGenerator(function* () {
|
|
2395
|
+
_defineProperty(this, "getFeed", async () => {
|
|
2413
2396
|
try {
|
|
2414
|
-
|
|
2397
|
+
const res = await feedActions.getFeed(this.state.feedId);
|
|
2415
2398
|
// console.log('getFeed:', res.data);
|
|
2416
|
-
|
|
2399
|
+
this.setState(_objectSpread$3(_objectSpread$3({}, res.data), {}, {
|
|
2417
2400
|
selectedUser: res.data.user,
|
|
2418
2401
|
userId: res.data.user.id,
|
|
2419
2402
|
userName: res.data.user.displayName
|
|
2420
2403
|
}));
|
|
2421
|
-
|
|
2404
|
+
this.checkSetImages(res.data.photos);
|
|
2422
2405
|
} catch (error) {
|
|
2423
2406
|
console.error("getFeed", error);
|
|
2424
2407
|
}
|
|
2425
|
-
})
|
|
2426
|
-
_defineProperty(this, "getFeedTypes",
|
|
2408
|
+
});
|
|
2409
|
+
_defineProperty(this, "getFeedTypes", async () => {
|
|
2427
2410
|
try {
|
|
2428
|
-
|
|
2429
|
-
|
|
2411
|
+
const res = await feedActions.getFeedTypes(this.props.auth.site);
|
|
2412
|
+
this.setState({
|
|
2430
2413
|
types: res.data
|
|
2431
|
-
},
|
|
2414
|
+
}, this.setDefaultFeedType);
|
|
2432
2415
|
// if (res.data != null) this.props.feedTypesLoaded(res.data);
|
|
2433
2416
|
} catch (error) {
|
|
2434
2417
|
console.error("getFeedTypes", error);
|
|
2435
2418
|
}
|
|
2436
|
-
})
|
|
2419
|
+
});
|
|
2437
2420
|
_defineProperty(this, "setDefaultFeedType", () => {
|
|
2438
|
-
|
|
2421
|
+
const {
|
|
2439
2422
|
types,
|
|
2440
2423
|
feedId
|
|
2441
2424
|
} = this.state;
|
|
@@ -2445,31 +2428,31 @@ class AddFeed extends Component {
|
|
|
2445
2428
|
});
|
|
2446
2429
|
}
|
|
2447
2430
|
});
|
|
2448
|
-
_defineProperty(this, "getUsers",
|
|
2431
|
+
_defineProperty(this, "getUsers", async () => {
|
|
2449
2432
|
try {
|
|
2450
|
-
|
|
2433
|
+
const res = await userActions.fetchUsers(this.props.auth.site);
|
|
2451
2434
|
if (res.userFetchFail) return;
|
|
2452
2435
|
if (res.data != null && !_.isEmpty(res.data.results.Items)) {
|
|
2453
|
-
|
|
2454
|
-
|
|
2436
|
+
const items = res.data.results.Items;
|
|
2437
|
+
this.setState({
|
|
2455
2438
|
users: _.sortBy(items, u => {
|
|
2456
2439
|
return (u.displayName || "").toLowerCase();
|
|
2457
2440
|
})
|
|
2458
|
-
},
|
|
2441
|
+
}, this.setDefaultUser);
|
|
2459
2442
|
}
|
|
2460
2443
|
} catch (error) {
|
|
2461
2444
|
console.error("getUsers", error);
|
|
2462
2445
|
}
|
|
2463
|
-
})
|
|
2446
|
+
});
|
|
2464
2447
|
_defineProperty(this, "getUserId", user => user.userId || user.Id || user.id);
|
|
2465
2448
|
_defineProperty(this, "setDefaultUser", () => {
|
|
2466
|
-
|
|
2449
|
+
const {
|
|
2467
2450
|
users,
|
|
2468
2451
|
userId
|
|
2469
2452
|
} = this.state;
|
|
2470
2453
|
// console.log('setDefaultUser', { userId });
|
|
2471
2454
|
if (userId) {
|
|
2472
|
-
|
|
2455
|
+
const user = users.find(u => this.getUserId(u) === userId);
|
|
2473
2456
|
if (user) this.onSelectUser(user);
|
|
2474
2457
|
} else {
|
|
2475
2458
|
this.onUnselectUser();
|
|
@@ -2511,54 +2494,54 @@ class AddFeed extends Component {
|
|
|
2511
2494
|
userName: ""
|
|
2512
2495
|
});
|
|
2513
2496
|
});
|
|
2514
|
-
_defineProperty(this, "onSave",
|
|
2497
|
+
_defineProperty(this, "onSave", async () => {
|
|
2515
2498
|
try {
|
|
2516
|
-
|
|
2499
|
+
this.setState({
|
|
2517
2500
|
showWarnings: false
|
|
2518
2501
|
});
|
|
2519
|
-
if (!
|
|
2520
|
-
|
|
2502
|
+
if (!this.validateForm()) {
|
|
2503
|
+
this.setState({
|
|
2521
2504
|
showWarnings: true
|
|
2522
2505
|
});
|
|
2523
2506
|
return;
|
|
2524
2507
|
}
|
|
2525
|
-
if (
|
|
2526
|
-
|
|
2508
|
+
if (this.state.updating) return;
|
|
2509
|
+
this.setState({
|
|
2527
2510
|
updating: true
|
|
2528
2511
|
});
|
|
2529
|
-
|
|
2530
|
-
id:
|
|
2531
|
-
userId:
|
|
2532
|
-
type:
|
|
2533
|
-
title:
|
|
2534
|
-
text:
|
|
2535
|
-
photos:
|
|
2536
|
-
site:
|
|
2512
|
+
const feed = {
|
|
2513
|
+
id: this.state.id,
|
|
2514
|
+
userId: this.state.userId,
|
|
2515
|
+
type: this.state.type,
|
|
2516
|
+
title: this.state.title,
|
|
2517
|
+
text: this.state.text,
|
|
2518
|
+
photos: this.state.photos,
|
|
2519
|
+
site: this.props.auth.site
|
|
2537
2520
|
};
|
|
2538
|
-
if (
|
|
2539
|
-
|
|
2540
|
-
|
|
2521
|
+
if (this.state.id !== null) {
|
|
2522
|
+
await feedActions.editFeed(feed);
|
|
2523
|
+
this.setState({
|
|
2541
2524
|
success: true,
|
|
2542
2525
|
updating: false
|
|
2543
2526
|
});
|
|
2544
|
-
|
|
2527
|
+
this.props.feedsLoaded([feed]);
|
|
2545
2528
|
} else {
|
|
2546
|
-
|
|
2547
|
-
|
|
2529
|
+
await feedActions.createFeed(feed);
|
|
2530
|
+
this.setState({
|
|
2548
2531
|
success: true,
|
|
2549
2532
|
updating: false
|
|
2550
2533
|
});
|
|
2551
|
-
|
|
2534
|
+
this.props.feedsUpdate(this.props.auth.site);
|
|
2552
2535
|
}
|
|
2553
2536
|
} catch (error) {
|
|
2554
|
-
|
|
2537
|
+
this.setState({
|
|
2555
2538
|
updating: false
|
|
2556
2539
|
});
|
|
2557
2540
|
alert("Something went wrong with the request. Please try again.");
|
|
2558
2541
|
}
|
|
2559
|
-
})
|
|
2542
|
+
});
|
|
2560
2543
|
this.imageInput = null;
|
|
2561
|
-
|
|
2544
|
+
const queryParams = new URLSearchParams(props.location.search);
|
|
2562
2545
|
this.state = {
|
|
2563
2546
|
feedId: Helper.safeReadParams(props, "feedId") ? props.match.params.feedId : null,
|
|
2564
2547
|
feed: null,
|
|
@@ -2600,7 +2583,7 @@ class AddFeed extends Component {
|
|
|
2600
2583
|
}
|
|
2601
2584
|
renderSuccess() {
|
|
2602
2585
|
if (!this.state.success) return null;
|
|
2603
|
-
|
|
2586
|
+
const title = this.props.strings["".concat(values.featureKey, "_textTitleFeeds")] || values.textTitleFeeds;
|
|
2604
2587
|
return /*#__PURE__*/jsx(Components.SuccessPopup, {
|
|
2605
2588
|
text: "Feed has been ".concat(this.state.id != null ? "edited" : "added"),
|
|
2606
2589
|
buttons: [{
|
|
@@ -2611,7 +2594,7 @@ class AddFeed extends Component {
|
|
|
2611
2594
|
});
|
|
2612
2595
|
}
|
|
2613
2596
|
validateForm() {
|
|
2614
|
-
|
|
2597
|
+
const {
|
|
2615
2598
|
userId,
|
|
2616
2599
|
userName,
|
|
2617
2600
|
type,
|
|
@@ -2652,12 +2635,12 @@ class AddFeed extends Component {
|
|
|
2652
2635
|
});
|
|
2653
2636
|
}
|
|
2654
2637
|
renderSelectUser() {
|
|
2655
|
-
|
|
2638
|
+
const {
|
|
2656
2639
|
showWarnings,
|
|
2657
2640
|
selectedUser
|
|
2658
2641
|
} = this.state;
|
|
2659
|
-
|
|
2660
|
-
|
|
2642
|
+
const isValid = !_.isNil(selectedUser);
|
|
2643
|
+
const showError = showWarnings && !isValid;
|
|
2661
2644
|
return /*#__PURE__*/jsxs("div", {
|
|
2662
2645
|
className: "genericInputContainer ".concat(isValid ? "genericInput-valid" : "", " ").concat(showError ? "genericInput-error" : "").trim(),
|
|
2663
2646
|
children: [/*#__PURE__*/jsxs("div", {
|
|
@@ -2700,13 +2683,13 @@ class AddFeed extends Component {
|
|
|
2700
2683
|
});
|
|
2701
2684
|
}
|
|
2702
2685
|
renderTypeOptions() {
|
|
2703
|
-
|
|
2686
|
+
const {
|
|
2704
2687
|
showWarnings,
|
|
2705
2688
|
types,
|
|
2706
2689
|
type
|
|
2707
2690
|
} = this.state;
|
|
2708
|
-
|
|
2709
|
-
|
|
2691
|
+
const isValid = !!type;
|
|
2692
|
+
const showError = showWarnings && !isValid;
|
|
2710
2693
|
return /*#__PURE__*/jsxs("div", {
|
|
2711
2694
|
className: "genericInputContainer ".concat(isValid ? "genericInput-valid" : "", " ").concat(showError ? "genericInput-error" : "").trim(),
|
|
2712
2695
|
children: [/*#__PURE__*/jsxs("div", {
|
|
@@ -2789,7 +2772,7 @@ class AddFeed extends Component {
|
|
|
2789
2772
|
className: "marginBottom-4",
|
|
2790
2773
|
children: "Images"
|
|
2791
2774
|
}), /*#__PURE__*/jsx(Components.ImageInput, {
|
|
2792
|
-
ref:
|
|
2775
|
+
ref: ref => this.imageInput = ref,
|
|
2793
2776
|
multiple: true,
|
|
2794
2777
|
refreshCallback: photos => this.setState({
|
|
2795
2778
|
photos
|
|
@@ -2800,7 +2783,7 @@ class AddFeed extends Component {
|
|
|
2800
2783
|
});
|
|
2801
2784
|
}
|
|
2802
2785
|
renderUserFilterPopup() {
|
|
2803
|
-
|
|
2786
|
+
const {
|
|
2804
2787
|
userFilterOpen,
|
|
2805
2788
|
userSearch,
|
|
2806
2789
|
users
|
|
@@ -2840,7 +2823,7 @@ class AddFeed extends Component {
|
|
|
2840
2823
|
});
|
|
2841
2824
|
}
|
|
2842
2825
|
render() {
|
|
2843
|
-
|
|
2826
|
+
const {
|
|
2844
2827
|
success
|
|
2845
2828
|
} = this.state;
|
|
2846
2829
|
return /*#__PURE__*/jsxs(Components.OverlayPage, {
|
|
@@ -2858,8 +2841,8 @@ class AddFeed extends Component {
|
|
|
2858
2841
|
});
|
|
2859
2842
|
}
|
|
2860
2843
|
}
|
|
2861
|
-
|
|
2862
|
-
|
|
2844
|
+
const mapStateToProps = state => {
|
|
2845
|
+
const {
|
|
2863
2846
|
auth
|
|
2864
2847
|
} = state;
|
|
2865
2848
|
return {
|
|
@@ -2874,22 +2857,22 @@ var AddFeed$1 = connect(mapStateToProps, {
|
|
|
2874
2857
|
|
|
2875
2858
|
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; }
|
|
2876
2859
|
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; }
|
|
2877
|
-
|
|
2860
|
+
const INITIAL_STATE = {
|
|
2878
2861
|
feeds: [],
|
|
2879
2862
|
submissions: [],
|
|
2880
2863
|
feedTypes: [],
|
|
2881
2864
|
loading: false
|
|
2882
2865
|
};
|
|
2883
2866
|
var FeedReducer = (function () {
|
|
2884
|
-
|
|
2885
|
-
|
|
2867
|
+
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : INITIAL_STATE;
|
|
2868
|
+
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
2886
2869
|
switch (action.type) {
|
|
2887
2870
|
case FEEDS_LOADING:
|
|
2888
2871
|
return _objectSpread$2(_objectSpread$2({}, state), {}, {
|
|
2889
2872
|
loading: true
|
|
2890
2873
|
});
|
|
2891
2874
|
case FEEDS_LOADED:
|
|
2892
|
-
|
|
2875
|
+
const feeds = _.unionWith(action.payload, state.feeds, (v1, v2) => {
|
|
2893
2876
|
return v1 != null && v2 != null && v1.id === v2.id;
|
|
2894
2877
|
});
|
|
2895
2878
|
return _objectSpread$2(_objectSpread$2({}, state), {}, {
|
|
@@ -2897,11 +2880,11 @@ var FeedReducer = (function () {
|
|
|
2897
2880
|
loading: false
|
|
2898
2881
|
});
|
|
2899
2882
|
case FEEDS_REMOVED:
|
|
2900
|
-
|
|
2883
|
+
const fIndex = _.findIndex(state.feeds, feed => {
|
|
2901
2884
|
return feed != null && feed.id === action.payload;
|
|
2902
2885
|
});
|
|
2903
2886
|
if (fIndex > -1) {
|
|
2904
|
-
|
|
2887
|
+
const newFeeds = [...state.feeds];
|
|
2905
2888
|
newFeeds.splice(fIndex, 1);
|
|
2906
2889
|
return _objectSpread$2(_objectSpread$2({}, state), {}, {
|
|
2907
2890
|
feeds: newFeeds
|
|
@@ -2916,11 +2899,11 @@ var FeedReducer = (function () {
|
|
|
2916
2899
|
submissions: _.filter(submissions, feed => !feed.deleted)
|
|
2917
2900
|
});
|
|
2918
2901
|
case FEEDS_SUBMISSIONS_REMOVED:
|
|
2919
|
-
|
|
2902
|
+
const sIndex = _.findIndex(state.submissions, submission => {
|
|
2920
2903
|
return submission != null && submission.id === action.payload;
|
|
2921
2904
|
});
|
|
2922
2905
|
if (sIndex > -1) {
|
|
2923
|
-
|
|
2906
|
+
const newSubmissions = [...state.submissions];
|
|
2924
2907
|
newSubmissions.splice(sIndex, 1);
|
|
2925
2908
|
return _objectSpread$2(_objectSpread$2({}, state), {}, {
|
|
2926
2909
|
submissions: newSubmissions
|
|
@@ -2928,7 +2911,7 @@ var FeedReducer = (function () {
|
|
|
2928
2911
|
}
|
|
2929
2912
|
return state;
|
|
2930
2913
|
case FEED_TYPES_LOADED:
|
|
2931
|
-
|
|
2914
|
+
const feedTypes = _.unionWith(action.payload, state.feedTypes, (v1, v2) => {
|
|
2932
2915
|
return v1 != null && v2 != null && v1.id === v2.id;
|
|
2933
2916
|
});
|
|
2934
2917
|
return _objectSpread$2(_objectSpread$2({}, state), {}, {
|
|
@@ -2950,7 +2933,7 @@ class ViewWidget extends Component {
|
|
|
2950
2933
|
});
|
|
2951
2934
|
}
|
|
2952
2935
|
}
|
|
2953
|
-
|
|
2936
|
+
const styles$3 = {
|
|
2954
2937
|
image: {
|
|
2955
2938
|
width: 80
|
|
2956
2939
|
}
|
|
@@ -2967,7 +2950,7 @@ class ViewFull extends Component {
|
|
|
2967
2950
|
});
|
|
2968
2951
|
}
|
|
2969
2952
|
}
|
|
2970
|
-
|
|
2953
|
+
const styles$2 = {
|
|
2971
2954
|
image: {
|
|
2972
2955
|
width: "100%",
|
|
2973
2956
|
height: "100%",
|
|
@@ -2981,7 +2964,7 @@ function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymb
|
|
|
2981
2964
|
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; }
|
|
2982
2965
|
class PreviewWidget extends Component {
|
|
2983
2966
|
render() {
|
|
2984
|
-
|
|
2967
|
+
const {
|
|
2985
2968
|
backgroundColor,
|
|
2986
2969
|
widgetTitle,
|
|
2987
2970
|
titleClassName
|
|
@@ -3002,7 +2985,7 @@ class PreviewWidget extends Component {
|
|
|
3002
2985
|
});
|
|
3003
2986
|
}
|
|
3004
2987
|
}
|
|
3005
|
-
|
|
2988
|
+
const styles$1 = {
|
|
3006
2989
|
container: {
|
|
3007
2990
|
position: "relative"
|
|
3008
2991
|
},
|
|
@@ -3017,7 +3000,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
3017
3000
|
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; }
|
|
3018
3001
|
class PreviewFull extends Component {
|
|
3019
3002
|
render() {
|
|
3020
|
-
|
|
3003
|
+
const {
|
|
3021
3004
|
backgroundColor,
|
|
3022
3005
|
widgetTitle,
|
|
3023
3006
|
titleClassName
|
|
@@ -3037,7 +3020,7 @@ class PreviewFull extends Component {
|
|
|
3037
3020
|
});
|
|
3038
3021
|
}
|
|
3039
3022
|
}
|
|
3040
|
-
|
|
3023
|
+
const styles = {
|
|
3041
3024
|
container: {
|
|
3042
3025
|
position: "relative"
|
|
3043
3026
|
},
|
|
@@ -3046,11 +3029,11 @@ var styles = {
|
|
|
3046
3029
|
}
|
|
3047
3030
|
};
|
|
3048
3031
|
|
|
3049
|
-
|
|
3050
|
-
|
|
3032
|
+
const SVG_PATH = values.svgPathGridIcon;
|
|
3033
|
+
const SVG_VIEWBOX = values.svgPathGridIconViewBox ;
|
|
3051
3034
|
class PreviewGrid extends Component {
|
|
3052
3035
|
render() {
|
|
3053
|
-
|
|
3036
|
+
const {
|
|
3054
3037
|
colour
|
|
3055
3038
|
} = this.props;
|
|
3056
3039
|
if (Array.isArray(SVG_PATH)) {
|
|
@@ -3077,13 +3060,13 @@ class PreviewGrid extends Component {
|
|
|
3077
3060
|
}
|
|
3078
3061
|
}
|
|
3079
3062
|
|
|
3080
|
-
|
|
3081
|
-
|
|
3063
|
+
const Reducers = (() => {
|
|
3064
|
+
const reducers = {};
|
|
3082
3065
|
reducers[values.reducerKey] = FeedReducer;
|
|
3083
3066
|
return reducers;
|
|
3084
3067
|
})();
|
|
3085
|
-
|
|
3086
|
-
|
|
3068
|
+
const Screens = (() => {
|
|
3069
|
+
const screens = {};
|
|
3087
3070
|
screens[values.screenFeedHub] = FeedHub$1;
|
|
3088
3071
|
screens[values.screenFeed] = Feed$1;
|
|
3089
3072
|
screens[values.screenAddFeed] = AddFeed$1;
|