strapi-plugin-comments 1.0.1 → 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 (142) hide show
  1. package/.circleci/config.yml +2 -2
  2. package/.nvmrc +1 -1
  3. package/README.md +71 -95
  4. package/admin/src/components/ConfirmationDialog/index.js +56 -0
  5. package/admin/src/components/DiscussionStatus/index.js +33 -0
  6. package/admin/src/components/DiscussionThread/index.js +58 -0
  7. package/admin/src/components/DiscussionThreadItem/index.js +87 -0
  8. package/admin/src/components/DiscussionThreadItem/styles.js +87 -0
  9. package/admin/src/components/DiscussionThreadItemActions/index.js +176 -0
  10. package/admin/src/components/DiscussionThreadItemActions/styles.js +22 -0
  11. package/admin/src/components/DiscussionThreadItemMeta/index.js +31 -0
  12. package/admin/src/components/DiscussionThreadItemWarnings/index.js +137 -0
  13. package/admin/src/components/DiscussionThreadItemWarnings/styles.js +7 -0
  14. package/admin/src/components/EntityDetails/index.js +53 -0
  15. package/admin/src/{containers → components}/Initializer/index.js +4 -4
  16. package/admin/src/components/LoadingIndicatorOverlay/index.js +15 -0
  17. package/admin/src/components/LoadingIndicatorOverlay/styles.js +20 -0
  18. package/admin/src/components/Nav/index.js +45 -0
  19. package/admin/src/components/PluginIcon/index.js +12 -0
  20. package/admin/src/components/ReportsReviewModal/index.js +45 -0
  21. package/admin/src/components/ReportsReviewTable/index.js +142 -0
  22. package/admin/src/components/TableFilters/index.js +53 -0
  23. package/admin/src/components/TablePagination/index.js +35 -0
  24. package/admin/src/components/icons/comments.js +9 -0
  25. package/admin/src/index.js +56 -42
  26. package/admin/src/pages/App/index.js +32 -0
  27. package/admin/src/pages/ComingSoonPage/index.js +25 -0
  28. package/admin/src/pages/Details/index.js +109 -0
  29. package/admin/src/pages/Details/utils/api.js +41 -0
  30. package/admin/src/pages/Discover/index.js +185 -0
  31. package/admin/src/pages/Discover/utils/api.js +23 -0
  32. package/admin/src/pages/Discover/utils/filtersSchema.js +9 -0
  33. package/admin/src/permissions.js +13 -33
  34. package/admin/src/pluginId.js +2 -4
  35. package/admin/src/translations/en.json +72 -33
  36. package/admin/src/translations/fr.json +1 -0
  37. package/admin/src/utils/axiosInstance.js +35 -0
  38. package/admin/src/utils/constants.js +28 -0
  39. package/admin/src/utils/getApiUrl.js +5 -0
  40. package/admin/src/utils/getMessage.js +14 -0
  41. package/admin/src/utils/getRelatedGroups.js +5 -0
  42. package/admin/src/utils/getUrl.js +5 -0
  43. package/admin/src/utils/handleAPIError.js +15 -0
  44. package/admin/src/utils/index.js +6 -0
  45. package/codecov.yml +2 -1
  46. package/content-types/comment.js +97 -0
  47. package/content-types/index.js +11 -0
  48. package/content-types/report.js +54 -0
  49. package/package.json +12 -26
  50. package/server/bootstrap.js +5 -0
  51. package/server/config/index.js +6 -0
  52. package/server/controllers/admin.js +150 -0
  53. package/server/controllers/client.js +109 -0
  54. package/server/controllers/index.js +9 -0
  55. package/{controllers → server/controllers}/utils/__tests__/functions.test.js +0 -0
  56. package/{controllers → server/controllers}/utils/functions.js +1 -1
  57. package/server/destroy.js +5 -0
  58. package/server/index.js +22 -0
  59. package/server/register.js +5 -0
  60. package/server/routes/admin.js +92 -0
  61. package/server/routes/client.js +52 -0
  62. package/server/routes/index.js +15 -0
  63. package/server/services/admin.js +180 -0
  64. package/server/services/client.js +227 -0
  65. package/server/services/common.js +191 -0
  66. package/server/services/index.js +11 -0
  67. package/{services → server/services}/utils/__tests__/functions.test.js +7 -9
  68. package/{services → server/services}/utils/functions.js +19 -8
  69. package/server/utils/constants.js +16 -0
  70. package/{services → server}/utils/error.js +0 -0
  71. package/server/utils/functions.js +19 -0
  72. package/strapi-admin.js +3 -0
  73. package/strapi-server.js +9 -0
  74. package/admin/src/assets/images/icon-cross-blue.svg +0 -1
  75. package/admin/src/assets/images/icon_remove.svg +0 -19
  76. package/admin/src/assets/images/logo.svg +0 -5
  77. package/admin/src/components/AbuseReportsPopUp/ItemPreviewContainer.js +0 -8
  78. package/admin/src/components/AbuseReportsPopUp/ModalFooter.js +0 -31
  79. package/admin/src/components/AbuseReportsPopUp/TableContainer.js +0 -63
  80. package/admin/src/components/AbuseReportsPopUp/index.js +0 -148
  81. package/admin/src/components/Container/index.js +0 -7
  82. package/admin/src/components/EmptyView/index.js +0 -25
  83. package/admin/src/components/Filters/index.js +0 -151
  84. package/admin/src/components/Filters/index.styled.js +0 -82
  85. package/admin/src/components/Filters/utils.js +0 -21
  86. package/admin/src/components/Item/CardItem.js +0 -30
  87. package/admin/src/components/Item/CardWrapper.js +0 -10
  88. package/admin/src/components/Item/index.js +0 -92
  89. package/admin/src/components/ItemDetails/CardItem.js +0 -33
  90. package/admin/src/components/ItemDetails/CardLevelCounter.js +0 -46
  91. package/admin/src/components/ItemDetails/CardLevelCounterLink.js +0 -24
  92. package/admin/src/components/ItemDetails/CardLevelWrapper.js +0 -22
  93. package/admin/src/components/ItemDetails/CardWrapper.js +0 -52
  94. package/admin/src/components/ItemDetails/index.js +0 -151
  95. package/admin/src/components/ItemFooter/CardItemAuthor.js +0 -10
  96. package/admin/src/components/ItemFooter/CardItemRelation.js +0 -18
  97. package/admin/src/components/ItemFooter/Wrapper.js +0 -20
  98. package/admin/src/components/ItemFooter/index.js +0 -87
  99. package/admin/src/components/ItemHeader/CardHeaderBlocked.js +0 -24
  100. package/admin/src/components/ItemHeader/CardHeaderIndicator.js +0 -30
  101. package/admin/src/components/ItemHeader/CardHeaderIndicatorBlue.js +0 -11
  102. package/admin/src/components/ItemHeader/CardHeaderIndicatorRed.js +0 -11
  103. package/admin/src/components/ItemHeader/CardHeaderIndicatorsContainer.js +0 -18
  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 -80
  107. package/admin/src/components/ItemModeration/Wrapper.js +0 -19
  108. package/admin/src/components/ItemModeration/index.js +0 -47
  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 -11
  115. package/admin/src/containers/DataManagerProvider/index.js +0 -280
  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 -100
  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 -48
  136. package/config/routes.json +0 -124
  137. package/controllers/comments.js +0 -215
  138. package/models/comment.js +0 -8
  139. package/models/comment.settings.json +0 -90
  140. package/models/report.js +0 -8
  141. package/models/report.settings.json +0 -41
  142. package/services/comments.js +0 -478
@@ -1,280 +0,0 @@
1
- import React, { memo, useCallback, useEffect, useReducer, useRef } from 'react';
2
- import PropTypes from 'prop-types';
3
- import { get } from 'lodash';
4
- import {
5
- request,
6
- storeData,
7
- LoadingIndicatorPage,
8
- useGlobalContext,
9
- generateFiltersFromSearch,
10
- generateSearchFromFilters,
11
- generateSearchFromObject,
12
- getQueryParameters,
13
- } from 'strapi-helper-plugin';
14
- import { useHistory, useLocation, useRouteMatch } from 'react-router-dom';
15
- import moment from 'moment';
16
- import DataManagerContext from '../../contexts/DataManagerContext';
17
- import Container from '../../components/Container';
18
- import Search from '../../components/Search';
19
- import getTrad from '../../utils/getTrad';
20
- import pluginId from '../../pluginId';
21
- import init from './init';
22
- import reducer, { initialState } from './reducer';
23
- import {
24
- BLOCK_COMMENT,
25
- BLOCK_COMMENT_SUCCESS,
26
- BLOCK_COMMENT_THREAD,
27
- BLOCK_COMMENT_THREAD_SUCCESS,
28
- GET_DATA,
29
- GET_DATA_SUCCEEDED,
30
- GET_SINGLE_DATA,
31
- GET_SINGLE_DATA_SUCCEEDED,
32
- RESOLVE_ABUSE_REPORT,
33
- RESOLVE_ABUSE_REPORT_SUCCESS,
34
- } from './actions';
35
-
36
- const RECENTLY_VIEVEW_KEY = `${pluginId}-recently-viewed`;
37
-
38
- const getCurrent = async (dispatch, searchParams = {}, recentlyViewed = undefined) => {
39
- try {
40
- const generatedSearch = generateSearchFromObject(searchParams);
41
- dispatch({
42
- type: GET_DATA,
43
- });
44
- const result = await request(`/${pluginId}/moderation/all?${generatedSearch}`, {
45
- method: 'GET',
46
- });
47
- const { items, total: itemsTotal } = result;
48
-
49
- dispatch({
50
- type: GET_DATA_SUCCEEDED,
51
- items,
52
- itemsTotal,
53
- recentlyViewed,
54
- });
55
- } catch (err) {
56
- console.error({ err });
57
- strapi.notification.error('notification.error');
58
- }
59
- };
60
-
61
- const getDetails = async (dispatch, activeId) => {
62
- try {
63
- if (activeId) {
64
- dispatch({
65
- type: GET_SINGLE_DATA,
66
- });
67
-
68
- const activeItem = await request(`/${pluginId}/moderation/single/${activeId}`, {
69
- method: 'GET',
70
- });
71
-
72
- dispatch({
73
- type: GET_SINGLE_DATA_SUCCEEDED,
74
- activeItem,
75
- });
76
- }
77
- } catch (err) {
78
- console.error({ err });
79
- strapi.notification.error('notification.error');
80
- }
81
- };
82
-
83
- const DataManagerProvider = ({ children }) => {
84
- const [reducerState, dispatch] = useReducer(reducer, initialState, init);
85
- const {
86
- autoReload,
87
- currentEnvironment,
88
- emitEvent,
89
- formatMessage,
90
- } = useGlobalContext();
91
- const {
92
- items,
93
- itemsTotal,
94
- activeItem,
95
- isLoading,
96
- isLoadingForDetailsDataToBeSet,
97
- initialData,
98
- } = reducerState.toJS();
99
- const { pathname, search } = useLocation();
100
- const { push } = useHistory();
101
-
102
- const formatMessageRef = useRef();
103
- formatMessageRef.current = formatMessage;
104
-
105
- const isInDevelopmentMode = currentEnvironment === 'development' && autoReload;
106
-
107
- const detailsViewMatch = useRouteMatch(`/plugins/${pluginId}/display/:id`);
108
- const activeId = get(detailsViewMatch, 'params.id', null);
109
-
110
- useEffect(() => {
111
- getCurrent(dispatch, getSearchParams(), moment(storeData.get(RECENTLY_VIEVEW_KEY) || undefined));
112
- storeData.set(RECENTLY_VIEVEW_KEY, moment().toString());
113
- }, [search, dispatch]);
114
-
115
- useEffect(() => {
116
- // We need to set the modifiedData after the data has been retrieved
117
- // and also on pathname change
118
- if (!isLoading) {
119
- getDetails(dispatch, activeId);
120
- }
121
- // eslint-disable-next-line react-hooks/exhaustive-deps
122
- }, [isLoading, pathname, dispatch, activeId]);
123
-
124
- useEffect(() => {
125
- if (currentEnvironment === 'development' && !autoReload) {
126
- strapi.notification.info(
127
- formatMessageRef.current({
128
- id: getTrad('notification.info.autoreaload-disable'),
129
- }),
130
- );
131
- }
132
- }, [autoReload, currentEnvironment]);
133
-
134
- const blockComment = async (id) => {
135
- try {
136
- emitEvent('willBlockComment');
137
- dispatch({ type: BLOCK_COMMENT });
138
-
139
- await request(`/${pluginId}/moderation/block/${id}`, {
140
- method: 'PUT',
141
- });
142
-
143
- getCurrent(dispatch, getSearchParams());
144
- getDetails(dispatch, activeId);
145
-
146
- emitEvent('didBlockComment');
147
- dispatch({ type: BLOCK_COMMENT_SUCCESS });
148
-
149
- strapi.notification.success(`${pluginId}.notification.comment.visibility`);
150
-
151
- } catch (err) {
152
- emitEvent('didNotBlockComment');
153
- console.error({ err: err.response });
154
- strapi.notification.error('notification.error');
155
- }
156
- };
157
-
158
- const blockCommentThread = async (id) => {
159
- try {
160
- emitEvent('willBlockCommentThread');
161
- dispatch({ type: BLOCK_COMMENT_THREAD });
162
-
163
- await request(`/${pluginId}/moderation/block-thread/${id}`, {
164
- method: 'PUT',
165
- });
166
-
167
- getCurrent(dispatch, getSearchParams());
168
- getDetails(dispatch, activeId);
169
-
170
- emitEvent('didBlockCommentThread');
171
- dispatch({ type: BLOCK_COMMENT_THREAD_SUCCESS });
172
-
173
- strapi.notification.success(`${pluginId}.notification.thread.visibility`);
174
-
175
- } catch (err) {
176
- emitEvent('didNotBlockCommentThread');
177
- console.error({ err: err.response });
178
- strapi.notification.error('notification.error');
179
- }
180
- };
181
-
182
- const resolveAbuseReport = async (id, commentId) => {
183
- try {
184
- emitEvent('willResolveAbuseReport');
185
- dispatch({ type: RESOLVE_ABUSE_REPORT });
186
-
187
- await request(`/${pluginId}/moderation/abuse-reports/${commentId}/resolve/${id}`, {
188
- method: 'PATCH',
189
- });
190
-
191
- getCurrent(dispatch, getSearchParams());
192
- getDetails(dispatch, activeId);
193
-
194
- emitEvent('didResolveAbuseReport');
195
- dispatch({ type: RESOLVE_ABUSE_REPORT_SUCCESS });
196
-
197
- strapi.notification.success(`${pluginId}.notification.abuse-report.resolution`);
198
-
199
- } catch (err) {
200
- emitEvent('didNotResolveAbuseReport');
201
- console.error({ err: err.response });
202
- strapi.notification.error('notification.error');
203
- }
204
- };
205
-
206
- const getSearchParams = useCallback(
207
- (updatedParams = {}) => {
208
- return {
209
- _limit: getQueryParameters(search, '_limit') || 10,
210
- _page: getQueryParameters(search, '_page') || 1,
211
- _q: getQueryParameters(search, '_q') || '',
212
- filters: generateFiltersFromSearch(search),
213
- ...updatedParams,
214
- };
215
- },
216
- [search],
217
- );
218
-
219
- const handleChangeParams = ({ target: { name, value } }) => {
220
- const currentParams = getSearchParams();
221
- const updatedParams = {
222
- ...currentParams,
223
- [name]: value,
224
- };
225
- const updatedSearch = getSearchParams({
226
- ...updatedParams,
227
- _start: name === '_q' ? 0 : updatedParams._start,
228
- _page: name === '_q' ? 1 : updatedParams._page,
229
- });
230
- const newSearch = generateSearchFromFilters(updatedSearch);
231
-
232
- if (name === '_limit') {
233
- emitEvent('willChangeNumberOfEntriesPerPage');
234
- }
235
-
236
- push({ search: newSearch });
237
- };
238
-
239
- return (
240
- <DataManagerContext.Provider
241
- value={{
242
- items,
243
- itemsTotal,
244
- search: getSearchParams(),
245
- getSearchParams,
246
- activeItem,
247
- initialData,
248
- isLoading,
249
- isLoadingForDetailsDataToBeSet,
250
- blockComment,
251
- blockCommentThread,
252
- resolveAbuseReport,
253
- isInDevelopmentMode,
254
- handleChangeParams,
255
- }}
256
- >
257
- {isLoading ? (
258
- <LoadingIndicatorPage />
259
- ) : (
260
- <>
261
- <Container>
262
- <Search
263
- changeParams={handleChangeParams}
264
- initValue={getQueryParameters(search, '_q') || ''}
265
- model="Comments"
266
- value={getQueryParameters(search, '_q') || ''}
267
- />
268
- </Container>
269
- {children}
270
- </>
271
- )}
272
- </DataManagerContext.Provider>
273
- );
274
- };
275
-
276
- DataManagerProvider.propTypes = {
277
- children: PropTypes.node.isRequired,
278
- };
279
-
280
- export default memo(DataManagerProvider);
@@ -1,5 +0,0 @@
1
- function init(initialState) {
2
- return initialState;
3
- }
4
-
5
- export default init;
@@ -1,59 +0,0 @@
1
- import { fromJS } from 'immutable';
2
- import moment from 'moment';
3
- import {
4
- BLOCK_COMMENT,
5
- BLOCK_COMMENT_THREAD,
6
- GET_DATA,
7
- GET_DATA_SUCCEEDED,
8
- GET_SINGLE_DATA,
9
- GET_SINGLE_DATA_SUCCEEDED,
10
- RELOAD_PLUGIN,
11
- } from './actions';
12
-
13
- const initialState = fromJS({
14
- items: [],
15
- itemsTotal: 0,
16
- activeItem: undefined,
17
- isLoading: true,
18
- isLoadingForDataToBeSet: false,
19
- isLoadingForDetailsDataToBeSet: false,
20
- });
21
-
22
- const reducer = (state, action) => {
23
- switch (action.type) {
24
- case GET_DATA: {
25
- return state
26
- .removeIn('items')
27
- .update('isLoadingForDataToBeSet', () => true);
28
- }
29
- case GET_DATA_SUCCEEDED: {
30
- return state
31
- .update('items', () => fromJS(action.items.map(_ => ({
32
- ..._,
33
- isNew: moment(_.created_at).diff(moment(action.recentlyViewed), 'seconds') > 0,
34
- }))))
35
- .update('itemsTotal', () => fromJS(action.itemsTotal))
36
- .update('isLoading', () => false)
37
- .update('isLoadingForDataToBeSet', () => false);
38
- }
39
- case GET_SINGLE_DATA:
40
- case BLOCK_COMMENT:
41
- case BLOCK_COMMENT_THREAD: {
42
- return state
43
- .removeIn('activeItem')
44
- .update('isLoadingForDetailsDataToBeSet', () => true);
45
- }
46
- case GET_SINGLE_DATA_SUCCEEDED: {
47
- return state
48
- .update('activeItem', () => fromJS(action.activeItem))
49
- .update('isLoadingForDetailsDataToBeSet', () => false);
50
- }
51
- case RELOAD_PLUGIN:
52
- return initialState;
53
- default:
54
- return state;
55
- }
56
- };
57
-
58
- export default reducer;
59
- export { initialState };
@@ -1,18 +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: column;
8
- width: 100%;
9
- background-color: ${colors.leftMenu.mediumGrey};
10
- padding-top: 1.8rem;
11
- padding-left: 2rem;
12
- padding-right: 2rem;
13
-
14
- overflow-x: hidden;
15
- overflow-y: auto;
16
- `;
17
-
18
- export default Wrapper;
@@ -1,100 +0,0 @@
1
- /*
2
- *
3
- * DetailsView
4
- *
5
- */
6
-
7
- import React from 'react';
8
- import { useHistory } from 'react-router-dom';
9
- import { FormattedMessage } from 'react-intl';
10
- import { isNil } from 'lodash';
11
- import { useGlobalContext, LoadingIndicatorPage } from 'strapi-helper-plugin';
12
- import { Header } from '@buffetjs/custom';
13
-
14
- import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
15
- import { faComments } from '@fortawesome/free-solid-svg-icons';
16
-
17
- import Wrapper from './Wrapper';
18
- import ItemDetails from '../../components/ItemDetails';
19
- import CardWrapper from '../../components/ItemDetails/CardWrapper';
20
- import CardLevelWrapper from '../../components/ItemDetails/CardLevelWrapper';
21
- import EmptyView from '../../components/EmptyView';
22
-
23
- import pluginId from '../../pluginId';
24
- import getTradId from '../../utils/getTradId';
25
- import getTrad from '../../utils/getTrad';
26
-
27
- import useDataManager from '../../hooks/useDataManager';
28
-
29
- const DetailsView = () => {
30
- const {
31
- activeItem,
32
- isLoadingForDetailsDataToBeSet,
33
- blockComment,
34
- blockCommentThread,
35
- resolveAbuseReport,
36
- } = useDataManager();
37
-
38
- const { formatMessage } = useGlobalContext();
39
- const { push } = useHistory();
40
-
41
- const onCommentClick = (e, id) => {
42
- e.preventDefault();
43
- e.stopPropagation();
44
- push(`/plugins/${pluginId}/display/${id}`)
45
- }
46
-
47
- const renderCommentsTree = (selected, items) => {
48
- return (<CardLevelWrapper>
49
- {
50
- items.map((item, n) => {
51
- const active = item.id === selected.id;
52
- const threadsCount = item.children && item.children.length;
53
- const hasThreads = threadsCount > 0;
54
- const clickable = !active && hasThreads && !isNil(selected.threadOf);
55
- return (<ItemDetails
56
- key={`list-item-details-${item.id || n}`}
57
- {...item}
58
- active={active}
59
- root={selected.threadOf === null}
60
- clickable={clickable}
61
- threadsCount={threadsCount}
62
- onAbuseReportResolve={resolveAbuseReport}
63
- onBlockClick={blockComment}
64
- onBlockThreadClick={blockCommentThread}
65
- onClick={e => onCommentClick(e, hasThreads ? item.children[0].id : item.id)}
66
- />)
67
- })
68
- }
69
- </CardLevelWrapper>)
70
- }
71
-
72
- const { selected, level } = activeItem || {};
73
-
74
- return (
75
- <Wrapper className="col-md-8">
76
- { isLoadingForDetailsDataToBeSet && <LoadingIndicatorPage />}
77
- { !isLoadingForDetailsDataToBeSet && !activeItem && (<EmptyView fixPosition>
78
- <FontAwesomeIcon icon={faComments} size="5x" />
79
- <FormattedMessage id={getTrad('moderation.content.empty')} />
80
- </EmptyView>)}
81
- { activeItem && (<>
82
- { selected.threadOf && (<CardLevelWrapper>
83
- <ItemDetails
84
- {...selected.threadOf}
85
- clickable={true}
86
- root={true}
87
- onAbuseReportResolve={resolveAbuseReport}
88
- onClick={e => onCommentClick(e, selected.threadOf.id)}
89
- />
90
- <CardWrapper root={true}>
91
- {renderCommentsTree(selected, level)}
92
- </CardWrapper>
93
- </CardLevelWrapper>)}
94
- {!selected.threadOf && renderCommentsTree(selected, level)}
95
- </>)}
96
- </Wrapper>
97
- );
98
- };
99
-
100
- export default DetailsView;
@@ -1,42 +0,0 @@
1
- import styled from 'styled-components';
2
-
3
- import { colors, sizes } from 'strapi-helper-plugin';
4
-
5
- const FadedWrapper = styled.div`
6
- display: flex;
7
- flex-direction: column;
8
- flex-grow: 1;
9
- padding: 0;
10
- margin: ${-2*sizes.margin}px;
11
-
12
- position: relative;
13
- z-index: 0;
14
-
15
- overflow: hidden;
16
-
17
- &:before,
18
- &:after {
19
- display: block;
20
- content: '';
21
- height: ${4*sizes.margin}px;
22
-
23
- position: absolute;
24
- left: 0;
25
- right: 0;
26
- z-index: 1;
27
-
28
- background: #ffffff;
29
- }
30
-
31
- &:before {
32
- top: 0;
33
- background: linear-gradient(180deg, rgba(250,250,251,1) 0%, rgba(250,250,251,0) 100%);
34
- }
35
-
36
- &:after {
37
- bottom: 0;
38
- background: linear-gradient(0deg, rgba(250,250,251,1) 0%, rgba(250,250,251,0) 100%);
39
- }
40
- `;
41
-
42
- export default FadedWrapper;
@@ -1,53 +0,0 @@
1
- import React, { memo } from 'react';
2
- import { FormattedMessage } from 'react-intl';
3
- import { GlobalPagination, InputSelect, sizes } from 'strapi-helper-plugin';
4
- import useDataManager from '../../hooks/useDataManager';
5
- import { FooterWrapper, SelectWrapper, Label } from './components';
6
-
7
- function Footer() {
8
- const {
9
- search: { _limit, _page },
10
- itemsTotal,
11
- handleChangeParams
12
- } = useDataManager();
13
-
14
- return (
15
- <FooterWrapper className="row">
16
- <div className="col-6">
17
- <SelectWrapper style={{ marginBottom: `${2*sizes.margin}px` }}>
18
- <InputSelect
19
- style={{ width: '75px', height: '32px', marginTop: '-1px' }}
20
- name="_limit"
21
- onChange={handleChangeParams}
22
- selectOptions={['10', '20', '50', '100']}
23
- value={_limit}
24
- />
25
- <Label htmlFor="_limit" style={{
26
- textOverflow: 'ellipsis',
27
- overflow: 'hidden',
28
- display: 'inline-block',
29
- whiteSpace: 'nowrap'
30
- }}>
31
- <FormattedMessage id="components.PageFooter.select" />
32
- </Label>
33
- </SelectWrapper>
34
- </div>
35
- <div className="col-6">
36
- <GlobalPagination
37
- style={{ marginBottom: `${2*sizes.margin}px` }}
38
- count={itemsTotal}
39
- onChangeParams={({ target: { value } }) => {
40
- handleChangeParams({ target: { name: '_page', value } });
41
- }}
42
- params={{
43
- currentPage: parseInt(_page, 10),
44
- _limit: parseInt(_limit, 10),
45
- _page: parseInt(_page, 10),
46
- }}
47
- />
48
- </div>
49
- </FooterWrapper>
50
- );
51
- }
52
-
53
- export default memo(Footer);
@@ -1,17 +0,0 @@
1
- import styled from 'styled-components';
2
-
3
- import { sizes } from 'strapi-helper-plugin';
4
-
5
- const Wrapper = styled.div`
6
- display: flex;
7
- flex-direction: column;
8
- width: 100%;
9
- height: calc(100vh - ${sizes.header.height} - 15rem);
10
- min-height: calc(100vh - ${sizes.header.height} - 15rem);
11
- max-height: calc(100vh - ${sizes.header.height});
12
- padding-top: 1.8rem;
13
- padding-left: 2rem;
14
- padding-right: 2rem;
15
- `;
16
-
17
- export default Wrapper;