strapi-plugin-comments 1.0.4 → 2.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/.circleci/config.yml +2 -2
  2. package/README.md +47 -125
  3. package/admin/src/components/ConfirmationDialog/index.js +56 -0
  4. package/admin/src/components/DiscussionStatus/index.js +33 -0
  5. package/admin/src/components/DiscussionThread/index.js +58 -0
  6. package/admin/src/components/DiscussionThreadItem/index.js +87 -0
  7. package/admin/src/components/DiscussionThreadItem/styles.js +87 -0
  8. package/admin/src/components/DiscussionThreadItemActions/index.js +176 -0
  9. package/admin/src/components/DiscussionThreadItemActions/styles.js +22 -0
  10. package/admin/src/components/DiscussionThreadItemMeta/index.js +31 -0
  11. package/admin/src/components/DiscussionThreadItemWarnings/index.js +137 -0
  12. package/admin/src/components/DiscussionThreadItemWarnings/styles.js +7 -0
  13. package/admin/src/components/EntityDetails/index.js +53 -0
  14. package/admin/src/{containers → components}/Initializer/index.js +4 -4
  15. package/admin/src/components/LoadingIndicatorOverlay/index.js +15 -0
  16. package/admin/src/components/LoadingIndicatorOverlay/styles.js +20 -0
  17. package/admin/src/components/Nav/index.js +45 -0
  18. package/admin/src/components/PluginIcon/index.js +12 -0
  19. package/admin/src/components/ReportsReviewModal/index.js +45 -0
  20. package/admin/src/components/ReportsReviewTable/index.js +142 -0
  21. package/admin/src/components/TableFilters/index.js +53 -0
  22. package/admin/src/components/TablePagination/index.js +35 -0
  23. package/admin/src/components/icons/comments.js +9 -0
  24. package/admin/src/index.js +56 -42
  25. package/admin/src/pages/App/index.js +32 -0
  26. package/admin/src/pages/ComingSoonPage/index.js +25 -0
  27. package/admin/src/pages/Details/index.js +109 -0
  28. package/admin/src/pages/Details/utils/api.js +41 -0
  29. package/admin/src/pages/Discover/index.js +185 -0
  30. package/admin/src/pages/Discover/utils/api.js +23 -0
  31. package/admin/src/pages/Discover/utils/filtersSchema.js +9 -0
  32. package/admin/src/permissions.js +13 -37
  33. package/admin/src/pluginId.js +2 -4
  34. package/admin/src/translations/en.json +72 -37
  35. package/admin/src/translations/fr.json +1 -0
  36. package/admin/src/utils/axiosInstance.js +35 -0
  37. package/admin/src/utils/constants.js +25 -6
  38. package/admin/src/utils/getApiUrl.js +5 -0
  39. package/admin/src/utils/getMessage.js +14 -0
  40. package/admin/src/utils/getRelatedGroups.js +5 -0
  41. package/admin/src/utils/getUrl.js +5 -0
  42. package/admin/src/utils/handleAPIError.js +15 -0
  43. package/admin/src/utils/index.js +6 -0
  44. package/codecov.yml +2 -1
  45. package/content-types/comment.js +97 -0
  46. package/content-types/index.js +11 -0
  47. package/content-types/report.js +54 -0
  48. package/package.json +11 -25
  49. package/server/bootstrap.js +5 -0
  50. package/server/config/index.js +6 -0
  51. package/server/controllers/admin.js +150 -0
  52. package/server/controllers/client.js +109 -0
  53. package/server/controllers/index.js +9 -0
  54. package/{controllers → server/controllers}/utils/__tests__/functions.test.js +0 -0
  55. package/{controllers → server/controllers}/utils/functions.js +1 -1
  56. package/server/destroy.js +5 -0
  57. package/server/index.js +22 -0
  58. package/server/register.js +5 -0
  59. package/server/routes/admin.js +92 -0
  60. package/server/routes/client.js +52 -0
  61. package/server/routes/index.js +15 -0
  62. package/server/services/admin.js +180 -0
  63. package/server/services/client.js +227 -0
  64. package/server/services/common.js +191 -0
  65. package/server/services/index.js +11 -0
  66. package/{services → server/services}/utils/__tests__/functions.test.js +0 -0
  67. package/{services → server/services}/utils/functions.js +17 -6
  68. package/server/utils/constants.js +16 -0
  69. package/{services → server}/utils/error.js +0 -0
  70. package/server/utils/functions.js +19 -0
  71. package/strapi-admin.js +3 -0
  72. package/strapi-server.js +9 -0
  73. package/admin/src/assets/images/icon-cross-blue.svg +0 -1
  74. package/admin/src/assets/images/icon_remove.svg +0 -19
  75. package/admin/src/assets/images/logo.svg +0 -5
  76. package/admin/src/components/AbuseReportsPopUp/ItemPreviewContainer.js +0 -8
  77. package/admin/src/components/AbuseReportsPopUp/ModalFooter.js +0 -31
  78. package/admin/src/components/AbuseReportsPopUp/TableContainer.js +0 -63
  79. package/admin/src/components/AbuseReportsPopUp/index.js +0 -148
  80. package/admin/src/components/Container/index.js +0 -7
  81. package/admin/src/components/EmptyView/index.js +0 -25
  82. package/admin/src/components/Filters/index.js +0 -151
  83. package/admin/src/components/Filters/index.styled.js +0 -82
  84. package/admin/src/components/Filters/utils.js +0 -21
  85. package/admin/src/components/Item/CardItem.js +0 -30
  86. package/admin/src/components/Item/CardWrapper.js +0 -10
  87. package/admin/src/components/Item/index.js +0 -107
  88. package/admin/src/components/ItemDetails/CardItem.js +0 -33
  89. package/admin/src/components/ItemDetails/CardLevelCounter.js +0 -46
  90. package/admin/src/components/ItemDetails/CardLevelCounterLink.js +0 -24
  91. package/admin/src/components/ItemDetails/CardLevelWrapper.js +0 -22
  92. package/admin/src/components/ItemDetails/CardWrapper.js +0 -52
  93. package/admin/src/components/ItemDetails/index.js +0 -167
  94. package/admin/src/components/ItemFooter/CardItemAuthor.js +0 -10
  95. package/admin/src/components/ItemFooter/CardItemRelation.js +0 -18
  96. package/admin/src/components/ItemFooter/Wrapper.js +0 -20
  97. package/admin/src/components/ItemFooter/index.js +0 -87
  98. package/admin/src/components/ItemHeader/CardHeaderBlocked.js +0 -24
  99. package/admin/src/components/ItemHeader/CardHeaderIndicator.js +0 -30
  100. package/admin/src/components/ItemHeader/CardHeaderIndicatorBlue.js +0 -11
  101. package/admin/src/components/ItemHeader/CardHeaderIndicatorRed.js +0 -11
  102. package/admin/src/components/ItemHeader/CardHeaderIndicatorsContainer.js +0 -18
  103. package/admin/src/components/ItemHeader/CardHeaderPending.js +0 -11
  104. package/admin/src/components/ItemHeader/CardHeaderReports.js +0 -40
  105. package/admin/src/components/ItemHeader/Wrapper.js +0 -16
  106. package/admin/src/components/ItemHeader/index.js +0 -97
  107. package/admin/src/components/ItemModeration/Wrapper.js +0 -19
  108. package/admin/src/components/ItemModeration/index.js +0 -84
  109. package/admin/src/components/List/Container.js +0 -20
  110. package/admin/src/components/List/index.js +0 -21
  111. package/admin/src/components/Search/index.js +0 -83
  112. package/admin/src/containers/App/Wrapper.js +0 -14
  113. package/admin/src/containers/App/index.js +0 -47
  114. package/admin/src/containers/DataManagerProvider/actions.js +0 -15
  115. package/admin/src/containers/DataManagerProvider/index.js +0 -332
  116. package/admin/src/containers/DataManagerProvider/init.js +0 -5
  117. package/admin/src/containers/DataManagerProvider/reducer.js +0 -59
  118. package/admin/src/containers/DetailsView/Wrapper.js +0 -18
  119. package/admin/src/containers/DetailsView/index.js +0 -106
  120. package/admin/src/containers/ListView/FadedWrapper.js +0 -42
  121. package/admin/src/containers/ListView/Footer.js +0 -53
  122. package/admin/src/containers/ListView/Wrapper.js +0 -17
  123. package/admin/src/containers/ListView/components.js +0 -138
  124. package/admin/src/containers/ListView/index.js +0 -45
  125. package/admin/src/containers/Panel/actions.js +0 -5
  126. package/admin/src/containers/Panel/index.js +0 -191
  127. package/admin/src/containers/Panel/index.styled.js +0 -6
  128. package/admin/src/containers/Panel/reducer.js +0 -44
  129. package/admin/src/contexts/DataManagerContext.js +0 -5
  130. package/admin/src/hooks/useDataManager.js +0 -6
  131. package/admin/src/lifecycles.js +0 -3
  132. package/admin/src/translations/index.js +0 -7
  133. package/admin/src/utils/getTrad.js +0 -5
  134. package/admin/src/utils/getTradId.js +0 -5
  135. package/config/functions/bootstrap.js +0 -62
  136. package/config/routes.json +0 -142
  137. package/config/schema.graphql.js +0 -268
  138. package/controllers/comments.js +0 -228
  139. package/models/comment.js +0 -8
  140. package/models/comment.settings.json +0 -102
  141. package/models/report.js +0 -8
  142. package/models/report.settings.json +0 -49
  143. package/services/comments.js +0 -539
  144. package/services/utils/constants.js +0 -9
@@ -1,11 +0,0 @@
1
- import styled from 'styled-components';
2
-
3
- import { colors } from 'strapi-helper-plugin';
4
-
5
- import CardHeaderBlocked from './CardHeaderBlocked';
6
-
7
- const CardHeaderPending = styled(CardHeaderBlocked)`
8
- color: ${colors.blue};
9
- `;
10
-
11
- export default CardHeaderPending;
@@ -1,40 +0,0 @@
1
- import styled from 'styled-components';
2
-
3
- import { colors } from 'strapi-helper-plugin';
4
-
5
- const CardHeaderReports = styled.a`
6
- display: inline-flex;
7
- flex-direction: row;
8
- align-items: center;
9
- justify-items: center;
10
- height: 2.5rem;
11
- margin-right: 1rem;
12
- padding: .25rem 1rem;
13
-
14
- color: red;
15
- text-decoration: none;
16
-
17
- border: 1px dotted red;
18
- border-radius: 1.25rem;
19
- background: transparent;
20
-
21
- transition: .25s ease-in-out all;
22
-
23
- svg {
24
- margin-right: .5rem;
25
- }
26
-
27
- &:hover {
28
- color: ${colors.beige};
29
- text-decoration: none;
30
-
31
- border-style: solid;
32
- background: red;
33
-
34
- transform: translateY(-.25rem);
35
-
36
- cursor: pointer;
37
- }
38
- `;
39
-
40
- export default CardHeaderReports;
@@ -1,16 +0,0 @@
1
- import styled from 'styled-components';
2
-
3
- import { colors } from 'strapi-helper-plugin';
4
-
5
- const Wrapper = styled.div`
6
- display: flex;
7
- flex-direction: row;
8
- justify-content: space-between;
9
- margin-bottom: ${props => props.hasMargin ? '1rem' : 0};
10
-
11
- color: ${colors.leftMenu.grey};
12
- font-size: 1.25rem;
13
- font-weight: 500;
14
- `;
15
-
16
- export default Wrapper;
@@ -1,97 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import { FormattedMessage } from 'react-intl';
4
- import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
5
- import { useGlobalContext, CheckPermissions } from 'strapi-helper-plugin';
6
- import { faLock, faStream, faAsterisk, faFire, faExclamationCircle } from '@fortawesome/free-solid-svg-icons';
7
- import Wrapper from './Wrapper';
8
- import CardHeaderBlocked from './CardHeaderBlocked';
9
- import CardHeaderPending from './CardHeaderPending';
10
- import pluginId from '../../pluginId';
11
- import CardHeaderIndicatorsContainer from './CardHeaderIndicatorsContainer';
12
- import CardHeaderIndicatorBlue from './CardHeaderIndicatorBlue';
13
- import CardHeaderIndicatorRed from './CardHeaderIndicatorRed';
14
- import CardHeaderReports from './CardHeaderReports';
15
- import pluginPermissions from '../../permissions';
16
- import { APPROVAL_STATUS } from "../../utils/constants";
17
-
18
- const ItemHeader = ({ active, isDetailedView, blocked, blockedThread, isNew, isAbuseReported, isRemoved, abuseReports, onReportsClick, approvalStatus }) => {
19
- const { formatMessage } = useGlobalContext();
20
- const isBlocked = blocked || blockedThread;
21
- const hasAnyIndicators = isNew || (isAbuseReported && !isDetailedView);
22
-
23
- return (
24
- <Wrapper hasMargin={isBlocked || isRemoved || (isAbuseReported && isDetailedView)}>
25
- {isBlocked && (
26
- <CheckPermissions permissions={pluginPermissions.moderate}>
27
- <CardHeaderBlocked>
28
- <FontAwesomeIcon icon={faLock} />
29
- {blockedThread && <FontAwesomeIcon icon={faStream} />}
30
- <FormattedMessage id={`${pluginId}.list.item.header.blocked${blockedThread ? '.thread' : ''}`} />
31
- </CardHeaderBlocked>
32
- </CheckPermissions>
33
- )}
34
- {
35
- isRemoved && (
36
- <CheckPermissions permissions={pluginPermissions.moderate}>
37
- <CardHeaderBlocked>
38
- <FontAwesomeIcon icon={faLock} />
39
- {blockedThread && <FontAwesomeIcon icon={faStream} />}
40
- <FormattedMessage id={`${pluginId}.list.item.header.removed`} />
41
- </CardHeaderBlocked>
42
- </CheckPermissions>
43
- )
44
- }
45
- {
46
- approvalStatus === APPROVAL_STATUS.PENDING && (
47
- <CheckPermissions permissions={pluginPermissions.moderate}>
48
- <CardHeaderPending>
49
- <FontAwesomeIcon icon={faExclamationCircle} />
50
- <FormattedMessage id={`${pluginId}.list.item.header.pending`} />
51
- </CardHeaderPending>
52
- </CheckPermissions>
53
- )
54
- }
55
- {(isDetailedView && active) && (<>
56
- {isAbuseReported && (
57
- <CheckPermissions permissions={pluginPermissions.moderateReports}>
58
- <CardHeaderReports href="#abuse-reports" onClick={onReportsClick}>
59
- <FontAwesomeIcon icon={faFire} />
60
- <FormattedMessage id={`${pluginId}.list.item.header.abuse`} values={{ count: abuseReports.length }} />
61
- </CardHeaderReports>
62
- </CheckPermissions>
63
- )}
64
- </>)}
65
- {hasAnyIndicators && <CardHeaderIndicatorsContainer>
66
- {isNew && (<CardHeaderIndicatorBlue title={formatMessage({ id: `${pluginId}.list.item.indication.new`})}>
67
- <FontAwesomeIcon icon={faAsterisk} />
68
- </CardHeaderIndicatorBlue>)}
69
- <CheckPermissions permissions={pluginPermissions.moderateReports}>
70
- {isAbuseReported && (<CardHeaderIndicatorRed title={formatMessage({ id: `${pluginId}.list.item.indication.abuse`})}>
71
- <FontAwesomeIcon icon={faFire} />
72
- </CardHeaderIndicatorRed>)}
73
- </CheckPermissions>
74
- </CardHeaderIndicatorsContainer>
75
- }
76
- </Wrapper>
77
- );
78
- };
79
-
80
- ItemHeader.propTypes = {
81
- active: PropTypes.bool,
82
- isDetailedView: PropTypes.bool,
83
- blocked: PropTypes.bool,
84
- blockedThread: PropTypes.bool,
85
- isNew: PropTypes.bool,
86
- removed: PropTypes.bool,
87
- isAbuseReported: PropTypes.bool,
88
- abuseReports: PropTypes.array,
89
- onReportsClick: PropTypes.func,
90
- approvalStatus: PropTypes.oneOf([
91
- APPROVAL_STATUS.APPROVED,
92
- APPROVAL_STATUS.PENDING,
93
- APPROVAL_STATUS
94
- ])
95
- };
96
-
97
- export default ItemHeader;
@@ -1,19 +0,0 @@
1
- import styled from 'styled-components';
2
-
3
- import { Button } from '@buffetjs/styles';
4
- import { colors } from 'strapi-helper-plugin';
5
-
6
- const Wrapper = styled.div`
7
- display: flex;
8
- margin-top: 1rem;
9
-
10
- flex-wrap: wrap;
11
- justify-items: center;
12
- align-items: stretch;
13
-
14
- ${Button} {
15
- margin-right: 1rem;
16
- }
17
- `;
18
-
19
- export default Wrapper;
@@ -1,84 +0,0 @@
1
- import React, { useMemo } from 'react';
2
- import PropTypes from 'prop-types';
3
- import { useGlobalContext, CheckPermissions } from 'strapi-helper-plugin';
4
- import { Button } from '@buffetjs/core';
5
- import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
6
- import { faComment, faCommentSlash, faComments, faExclamationCircle } from '@fortawesome/free-solid-svg-icons';
7
- import Wrapper from './Wrapper';
8
- import pluginId from '../../pluginId';
9
- import pluginPermissions from '../../permissions';
10
- import { APPROVAL_STATUS } from '../../utils/constants';
11
-
12
- const ItemModeration = ({ id, blocked, blockedThread, onBlockClick, onBlockThreadClick, onApproveCommentClick, onRejectCommentClick, approvalStatus }) => {
13
- const { formatMessage } = useGlobalContext();
14
- const canBeApproved =
15
- approvalStatus === APPROVAL_STATUS.PENDING ||
16
- approvalStatus === APPROVAL_STATUS.REJECTED;
17
- const approvalButtonProps = useMemo(
18
- () =>
19
- canBeApproved
20
- ? {
21
- onClick: onApproveCommentClick.bind(null, id),
22
- color: 'primary',
23
- label: formatMessage({
24
- id: `${pluginId}.list.item.moderation.button.comment.approval.approve`,
25
- }),
26
- }
27
- : {
28
- onClick: onRejectCommentClick.bind(null, id),
29
- color: 'delete',
30
- label: formatMessage({
31
- id: `${pluginId}.list.item.moderation.button.comment.approval.reject`,
32
- }),
33
- },
34
- [canBeApproved, id],
35
- );
36
-
37
- return (
38
- <CheckPermissions permissions={pluginPermissions.moderate}>
39
- <Wrapper>
40
- {approvalStatus ? (
41
- <CheckPermissions permissions={pluginPermissions.moderateComments}>
42
- <Button
43
- {...approvalButtonProps}
44
- icon={<FontAwesomeIcon icon={faExclamationCircle} />}
45
- />
46
- </CheckPermissions>
47
- ) : null}
48
- {!blockedThread && (
49
- <CheckPermissions permissions={pluginPermissions.moderateComments}>
50
- <Button
51
- onClick={e => onBlockClick(id)}
52
- color={blocked ? 'primary' : 'delete'}
53
- icon={<FontAwesomeIcon icon={blocked ? faComment : faCommentSlash} />}
54
- label={formatMessage({ id: `${pluginId}.list.item.moderation.button.comment.${blocked ? 'restore' : 'hide'}` })} />
55
- </CheckPermissions>
56
- )}
57
- <CheckPermissions permissions={pluginPermissions.moderateThreads}>
58
- <Button
59
- onClick={e => onBlockThreadClick(id)}
60
- color={blockedThread ? 'primary' : 'delete'}
61
- icon={<FontAwesomeIcon icon={faComments} />}
62
- label={formatMessage({ id: `${pluginId}.list.item.moderation.button.thread.${blockedThread ? 'restore' : 'hide'}` })} />
63
- </CheckPermissions>
64
- </Wrapper>
65
- </CheckPermissions>
66
- );
67
- };
68
-
69
- ItemModeration.propTypes = {
70
- id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
71
- blocked: PropTypes.bool,
72
- blockedThread: PropTypes.bool,
73
- onBlockClick: PropTypes.func.isRequired,
74
- onBlockThreadClick: PropTypes.func.isRequired,
75
- approvalStatus: PropTypes.oneOf([
76
- APPROVAL_STATUS.APPROVED,
77
- APPROVAL_STATUS.PENDING,
78
- APPROVAL_STATUS
79
- ]),
80
- onApproveCommentClick: PropTypes.func,
81
- onRejectCommentClick: PropTypes.func,
82
- };
83
-
84
- export default ItemModeration;
@@ -1,20 +0,0 @@
1
- import styled from 'styled-components';
2
-
3
- import { colors, sizes } from 'strapi-helper-plugin';
4
-
5
- const Container = styled.ul`
6
- display: flex;
7
- padding: ${2*sizes.margin}px;
8
- flex-direction: column;
9
- flex-grow: 1;
10
- margin: 0;
11
-
12
- z-index: 0;
13
-
14
- overflow-x: hidden;
15
- overflow-y: auto;
16
-
17
- list-style: none;
18
- `;
19
-
20
- export default Container;
@@ -1,21 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import Item from '../Item';
4
- import Container from './Container';
5
-
6
- const List = ({ items, relatedContentTypes }) => (
7
- <Container>
8
- {items.map((item, n) => (
9
- <Item
10
- key={`list-item-${item.id || n}`}
11
- relatedContentTypes={relatedContentTypes}
12
- {...item}
13
- />))}
14
- </Container>
15
- );
16
-
17
- List.propTypes = {
18
- items: PropTypes.array,
19
- };
20
-
21
- export default List;
@@ -1,83 +0,0 @@
1
- /*
2
- *
3
- * Search
4
- *
5
- */
6
-
7
- import React, { memo } from 'react';
8
- import { isEmpty, upperFirst } from 'lodash';
9
- import PropTypes from 'prop-types';
10
- import { FormattedMessage } from 'react-intl';
11
- import { HeaderSearch } from 'strapi-helper-plugin';
12
- import getTrad from '../../utils/getTrad';
13
-
14
- const WAIT = 400;
15
-
16
- class Search extends React.Component {
17
- state = { value: this.props.initValue };
18
-
19
- timer = null;
20
-
21
- componentDidUpdate(prevProps) {
22
- const { model, value } = this.props;
23
-
24
- if (prevProps.model !== model || (!isEmpty(prevProps.value) && isEmpty(value))) {
25
- this.resetState();
26
- }
27
- }
28
-
29
- resetState = () => this.setState({ value: '' });
30
-
31
- handleChange = ({ target }) => {
32
- clearTimeout(this.timer);
33
- this.setState({ value: target.value });
34
- this.timer = setTimeout(() => this.triggerChange(target.value), WAIT);
35
- };
36
-
37
- handleClick = () => {
38
- this.setState({ value: '' });
39
- this.triggerChange('');
40
- };
41
-
42
- triggerChange = value =>
43
- this.props.changeParams({
44
- target: {
45
- name: '_q',
46
- value,
47
- },
48
- });
49
-
50
- render() {
51
- const { model } = this.props;
52
- const { value } = this.state;
53
-
54
- return (
55
- <FormattedMessage id={getTrad('components.Search.placeholder')}>
56
- {placeholder => (
57
- <HeaderSearch
58
- label={upperFirst(model)}
59
- onChange={this.handleChange}
60
- onClear={this.handleClick}
61
- placeholder={placeholder}
62
- value={value}
63
- />
64
- )}
65
- </FormattedMessage>
66
- );
67
- }
68
- }
69
-
70
- Search.defaultProps = {
71
- changeParams: () => {},
72
- model: '',
73
- value: '',
74
- };
75
-
76
- Search.propTypes = {
77
- changeParams: PropTypes.func,
78
- initValue: PropTypes.string.isRequired,
79
- model: PropTypes.string,
80
- value: PropTypes.string,
81
- };
82
-
83
- export default memo(Search);
@@ -1,14 +0,0 @@
1
- import styled from 'styled-components';
2
-
3
- import { sizes } from 'strapi-helper-plugin';
4
-
5
- const Wrapper = styled.div`
6
- min-height: calc(100vh - ${sizes.header.height});
7
- .centered {
8
- position: fixed;
9
- top: calc(50% - 13px);
10
- right: calc(50% - 13px);
11
- }
12
- `;
13
-
14
- export default Wrapper;
@@ -1,47 +0,0 @@
1
- /**
2
- *
3
- * This component is the skeleton around the actual pages, and should only
4
- * contain code that should be seen on all pages. (e.g. navigation bar)
5
- *
6
- */
7
-
8
- import React, { Suspense, lazy }from 'react';
9
- import { Switch, Route } from 'react-router-dom';
10
- import { NotFound, LoadingIndicatorPage, CheckPagePermissions } from 'strapi-helper-plugin';
11
- import Wrapper from './Wrapper';
12
- // Utils
13
- import pluginId from '../../pluginId';
14
- import DataManagerProvider from '../DataManagerProvider';
15
- import pluginPermissions from '../../permissions';
16
- // Containers
17
-
18
-
19
- const Panel = lazy(() => import('../Panel'));
20
-
21
- const App = () => {
22
- return (
23
- <CheckPagePermissions permissions={pluginPermissions.main}>
24
- <Wrapper>
25
- <DataManagerProvider>
26
- <Suspense fallback={<LoadingIndicatorPage />}>
27
- <Switch>
28
- <Route
29
- path={`/plugins/${pluginId}`}
30
- component={Panel}
31
- exact
32
- />
33
- <Route
34
- path={`/plugins/${pluginId}/display/:id`}
35
- component={Panel}
36
- exact
37
- />
38
- <Route component={NotFound} />
39
- </Switch>
40
- </Suspense>
41
- </DataManagerProvider>
42
- </Wrapper>
43
- </CheckPagePermissions>
44
- );
45
- };
46
-
47
- export default App;
@@ -1,15 +0,0 @@
1
- export const GET_DATA = 'GET_DATA';
2
- export const GET_DATA_SUCCEEDED = 'GET_DATA_SUCCEEDED';
3
- export const GET_SINGLE_DATA = 'GET_SINGLE_DATA';
4
- export const BLOCK_COMMENT = 'BLOCK_COMMENT';
5
- export const BLOCK_COMMENT_THREAD = 'BLOCK_COMMENT_THREAD';
6
- export const GET_SINGLE_DATA_SUCCEEDED = 'GET_SINGLE_DATA_SUCCEEDED';
7
- export const RELOAD_PLUGIN = 'RELOAD_PLUGIN';
8
- export const BLOCK_COMMENT_SUCCESS = 'BLOCK_COMMENT_SUCCESS';
9
- export const BLOCK_COMMENT_THREAD_SUCCESS = 'BLOCK_COMMENT_THREAD_SUCCESS';
10
- export const RESOLVE_ABUSE_REPORT = 'RESOLVE_ABUSE_REPORT';
11
- export const RESOLVE_ABUSE_REPORT_SUCCESS = 'RESOLVE_ABUSE_REPORT_SUCCESS';
12
- export const APPROVE_COMMENT = 'APPROVE_COMMENT';
13
- export const REJECT_COMMENT = 'REJECT_COMMENT';
14
- export const APPROVE_COMMENT_SUCCESS = 'APPROVE_COMMENT_SUCCESS';
15
- export const REJECT_COMMENT_SUCCESS = 'REJECT_COMMENT_SUCCESS';