strapi-plugin-comments 1.0.2-beta.1 → 2.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/.circleci/config.yml +2 -2
  2. package/README.md +71 -95
  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 +58 -42
  25. package/admin/src/pages/App/index.js +60 -0
  26. package/admin/src/pages/App/reducer/actions.js +8 -0
  27. package/admin/src/pages/App/reducer/constants.js +4 -0
  28. package/admin/src/pages/App/reducer/index.js +27 -0
  29. package/admin/src/pages/App/reducer/init.js +7 -0
  30. package/admin/src/pages/App/reducer/selectors.js +35 -0
  31. package/admin/src/pages/App/utils/api.js +20 -0
  32. package/admin/src/pages/ComingSoonPage/index.js +25 -0
  33. package/admin/src/pages/Details/index.js +109 -0
  34. package/admin/src/pages/Details/utils/api.js +41 -0
  35. package/admin/src/pages/Discover/index.js +203 -0
  36. package/admin/src/pages/Discover/utils/api.js +20 -0
  37. package/admin/src/pages/Discover/utils/filtersSchema.js +9 -0
  38. package/admin/src/permissions.js +13 -33
  39. package/admin/src/pluginId.js +2 -4
  40. package/admin/src/reducers.js +8 -0
  41. package/admin/src/translations/en.json +72 -33
  42. package/admin/src/translations/fr.json +1 -0
  43. package/admin/src/utils/axiosInstance.js +35 -0
  44. package/admin/src/utils/constants.js +28 -0
  45. package/admin/src/utils/getApiUrl.js +5 -0
  46. package/admin/src/utils/getMessage.js +14 -0
  47. package/admin/src/utils/getRelatedGroups.js +5 -0
  48. package/admin/src/utils/getUrl.js +5 -0
  49. package/admin/src/utils/handleAPIError.js +15 -0
  50. package/admin/src/utils/index.js +6 -0
  51. package/codecov.yml +2 -1
  52. package/content-types/comment.js +97 -0
  53. package/content-types/index.js +11 -0
  54. package/content-types/report.js +54 -0
  55. package/package.json +11 -25
  56. package/server/bootstrap.js +5 -0
  57. package/server/config/index.js +10 -0
  58. package/server/controllers/admin.js +134 -0
  59. package/server/controllers/client.js +109 -0
  60. package/server/controllers/index.js +9 -0
  61. package/{controllers → server/controllers}/utils/__tests__/functions.test.js +0 -0
  62. package/{controllers → server/controllers}/utils/functions.js +1 -1
  63. package/server/destroy.js +5 -0
  64. package/server/index.js +22 -0
  65. package/server/register.js +5 -0
  66. package/server/routes/admin.js +92 -0
  67. package/server/routes/client.js +52 -0
  68. package/server/routes/index.js +15 -0
  69. package/server/services/admin.js +186 -0
  70. package/server/services/client.js +227 -0
  71. package/server/services/common.js +191 -0
  72. package/server/services/index.js +11 -0
  73. package/{services → server/services}/utils/__tests__/functions.test.js +7 -9
  74. package/{services → server/services}/utils/functions.js +19 -8
  75. package/server/utils/constants.js +16 -0
  76. package/{services → server}/utils/error.js +0 -0
  77. package/server/utils/functions.js +19 -0
  78. package/strapi-admin.js +3 -0
  79. package/strapi-server.js +9 -0
  80. package/admin/src/assets/images/icon-cross-blue.svg +0 -1
  81. package/admin/src/assets/images/icon_remove.svg +0 -19
  82. package/admin/src/assets/images/logo.svg +0 -5
  83. package/admin/src/components/AbuseReportsPopUp/ItemPreviewContainer.js +0 -8
  84. package/admin/src/components/AbuseReportsPopUp/ModalFooter.js +0 -31
  85. package/admin/src/components/AbuseReportsPopUp/TableContainer.js +0 -63
  86. package/admin/src/components/AbuseReportsPopUp/index.js +0 -148
  87. package/admin/src/components/Container/index.js +0 -7
  88. package/admin/src/components/EmptyView/index.js +0 -25
  89. package/admin/src/components/Filters/index.js +0 -151
  90. package/admin/src/components/Filters/index.styled.js +0 -82
  91. package/admin/src/components/Filters/utils.js +0 -21
  92. package/admin/src/components/Item/CardItem.js +0 -30
  93. package/admin/src/components/Item/CardWrapper.js +0 -10
  94. package/admin/src/components/Item/index.js +0 -92
  95. package/admin/src/components/ItemDetails/CardItem.js +0 -33
  96. package/admin/src/components/ItemDetails/CardLevelCounter.js +0 -46
  97. package/admin/src/components/ItemDetails/CardLevelCounterLink.js +0 -24
  98. package/admin/src/components/ItemDetails/CardLevelWrapper.js +0 -22
  99. package/admin/src/components/ItemDetails/CardWrapper.js +0 -52
  100. package/admin/src/components/ItemDetails/index.js +0 -151
  101. package/admin/src/components/ItemFooter/CardItemAuthor.js +0 -10
  102. package/admin/src/components/ItemFooter/CardItemRelation.js +0 -18
  103. package/admin/src/components/ItemFooter/Wrapper.js +0 -20
  104. package/admin/src/components/ItemFooter/index.js +0 -87
  105. package/admin/src/components/ItemHeader/CardHeaderBlocked.js +0 -24
  106. package/admin/src/components/ItemHeader/CardHeaderIndicator.js +0 -30
  107. package/admin/src/components/ItemHeader/CardHeaderIndicatorBlue.js +0 -11
  108. package/admin/src/components/ItemHeader/CardHeaderIndicatorRed.js +0 -11
  109. package/admin/src/components/ItemHeader/CardHeaderIndicatorsContainer.js +0 -18
  110. package/admin/src/components/ItemHeader/CardHeaderReports.js +0 -40
  111. package/admin/src/components/ItemHeader/Wrapper.js +0 -16
  112. package/admin/src/components/ItemHeader/index.js +0 -80
  113. package/admin/src/components/ItemModeration/Wrapper.js +0 -19
  114. package/admin/src/components/ItemModeration/index.js +0 -47
  115. package/admin/src/components/List/Container.js +0 -20
  116. package/admin/src/components/List/index.js +0 -21
  117. package/admin/src/components/Search/index.js +0 -83
  118. package/admin/src/containers/App/Wrapper.js +0 -14
  119. package/admin/src/containers/App/index.js +0 -47
  120. package/admin/src/containers/DataManagerProvider/actions.js +0 -11
  121. package/admin/src/containers/DataManagerProvider/index.js +0 -280
  122. package/admin/src/containers/DataManagerProvider/init.js +0 -5
  123. package/admin/src/containers/DataManagerProvider/reducer.js +0 -59
  124. package/admin/src/containers/DetailsView/Wrapper.js +0 -18
  125. package/admin/src/containers/DetailsView/index.js +0 -100
  126. package/admin/src/containers/ListView/FadedWrapper.js +0 -42
  127. package/admin/src/containers/ListView/Footer.js +0 -53
  128. package/admin/src/containers/ListView/Wrapper.js +0 -17
  129. package/admin/src/containers/ListView/components.js +0 -138
  130. package/admin/src/containers/ListView/index.js +0 -45
  131. package/admin/src/containers/Panel/actions.js +0 -5
  132. package/admin/src/containers/Panel/index.js +0 -191
  133. package/admin/src/containers/Panel/index.styled.js +0 -6
  134. package/admin/src/containers/Panel/reducer.js +0 -44
  135. package/admin/src/contexts/DataManagerContext.js +0 -5
  136. package/admin/src/hooks/useDataManager.js +0 -6
  137. package/admin/src/lifecycles.js +0 -3
  138. package/admin/src/translations/index.js +0 -7
  139. package/admin/src/utils/getTrad.js +0 -5
  140. package/admin/src/utils/getTradId.js +0 -5
  141. package/config/functions/bootstrap.js +0 -48
  142. package/config/routes.json +0 -116
  143. package/config/schema.graphql.js +0 -270
  144. package/controllers/comments.js +0 -211
  145. package/models/comment.js +0 -8
  146. package/models/comment.settings.json +0 -98
  147. package/models/report.js +0 -8
  148. package/models/report.settings.json +0 -49
  149. package/services/comments.js +0 -486
@@ -1,270 +0,0 @@
1
- const BASE_COMMENTS = `
2
- id: ID!
3
- content: String!
4
- blocked: Boolean
5
- blockedThread: Boolean
6
- blockReason: String
7
- points: Int
8
- authorUser: UsersPermissionsUser
9
- authorType: String
10
- authorId: String
11
- authorName: String
12
- authorAvatar: String
13
- removed: Boolean
14
- relatedSlug: String
15
- reports: [CommentReport]
16
- `;
17
- const jsonParse = (json) => {
18
- try {
19
- return JSON.parse(json);
20
- } catch (e) {
21
- return {};
22
- }
23
- };
24
- const configRelatedContentTypes = Object.keys(strapi.config
25
- .get('plugins.comments.relatedContentTypes') || {})
26
- .map(key => `${key}: CommentsRelatedContentType`)
27
- .join('\n');
28
- // reports: [CommentReport]
29
- module.exports = {
30
- // language=GraphQL
31
- definition: `
32
- scalar Relation
33
- enum CommentReportReason {
34
- BAD_LANGAUGE
35
- DISCRIMINATION
36
- OTHER
37
- }
38
- type CommentReport {
39
- id: ID!
40
- content: String
41
- reason: CommentReportReason!
42
- resolved: Boolean!
43
- related: Comment
44
- }
45
-
46
- type Comment {
47
- ${BASE_COMMENTS}
48
- }
49
-
50
- type CommentsInHierarchy {
51
- ${BASE_COMMENTS}
52
- children: [Comment]
53
- }
54
-
55
- type CommentsPagination {
56
- items: [Comment]!
57
- total: Int!
58
- page: Float
59
- }
60
-
61
- type CommentsWithThread {
62
- ${BASE_COMMENTS}
63
- threadOf: Comment
64
- }
65
-
66
- type CommentsFindOne {
67
- selected: CommentsWithThread
68
- level: [Comment]!
69
- }
70
-
71
- type CommentsContentTypes {
72
- key: String!
73
- value: String!
74
- }
75
-
76
- type CommentsRelatedContentType {
77
- contentManager: Boolean
78
- isSingle: Boolean
79
- url: String
80
- }
81
-
82
- type CommentsRelatedContentTypes {
83
- ${configRelatedContentTypes}
84
- }
85
-
86
- type CommentsConfig {
87
- contentsTypes: [CommentsContentTypes]!
88
- relatedContentTypes: CommentsRelatedContentTypes
89
- }
90
-
91
- type CommentsContentType {
92
- key: String!
93
- value: String
94
- }
95
-
96
- type CommentRemove {
97
- id: ID!
98
- }
99
-
100
- input NewCommentRelated {
101
- refId: String!
102
- ref: String!
103
- field: String!
104
- }
105
-
106
- input CommentNew {
107
- authorId: String
108
- authorName: String
109
- authorEmail: String
110
- content: String!
111
- authorUsername: String
112
- threadOf: String
113
- related: [NewCommentRelated!]!
114
- }
115
- `,
116
- // language=GraphQL
117
- query: `
118
- findAllInHierarchy(relation: Relation!, where: JSON): [CommentsInHierarchy]!
119
- findAllFlat(relation: Relation!, where: JSON): [Comment]!
120
- findAll(related: Relation, entity: ID, where: JSON): CommentsPagination!
121
- findOne(id: ID!): CommentsFindOne
122
- config: CommentsConfig
123
- contentTypeName(contentType: String!): [CommentsContentType]!
124
- `,
125
- type: {
126
- Relation: 'It is related slug given when comment was created',
127
- },
128
- // language=GraphQL
129
- mutation: `
130
- commentAdd(comment: CommentNew): Comment!
131
- commentUpdate(id: ID!, content: String!, related: NewCommentRelated): Comment!
132
- commentReportAbuse(id: ID!, relation: Relation!, reason: CommentReportReason!, content: String!): CommentReport
133
- commentLike(id: ID!, relation: Relation!): Comment
134
- commentRemove(id: ID!, relation: Relation!, authorId: ID!): CommentRemove
135
- commentBlock(id: ID!): Comment
136
- commentThreadBlock(id: ID!): Comment
137
- commentResolveReport(reportId: ID!, commentId: ID!): CommentReport
138
- `,
139
- resolver: {
140
- Query: {
141
- findAllInHierarchy: {
142
- resolverOf: 'plugins::comments.comments.findAllInHierarchy',
143
- resolver(obj, options) {
144
- const { relation, where } = options;
145
- const query = jsonParse(where);
146
- return strapi.plugins.comments.services.comments.findAllInHierarchy({
147
- relation,
148
- query,
149
- dropBlockedThreads: true,
150
- });
151
- },
152
- },
153
- findAllFlat: {
154
- resolverOf: 'plugins::comments.comments.findAllFlat',
155
- resolver(obj, options) {
156
- const { relation, where } = options;
157
- const query = jsonParse(where);
158
- return strapi.plugins.comments.services.comments.findAllFlat(relation, query);
159
- },
160
- },
161
- findAll: {
162
- resolverOf: 'plugins::comments.comments.findAll',
163
- resolver(obj, options) {
164
- const { related, entity, where } = options;
165
- const query = jsonParse(where);
166
- return strapi.plugins.comments.services.comments.findAll({
167
- ...query,
168
- related,
169
- entity,
170
- });
171
- },
172
- },
173
- findOne: {
174
- resolverOf: 'plugins::comments.comments.findOne',
175
- resolver(obj, options) {
176
- const { id } = options;
177
- return strapi.plugins.comments.services.comments.findOneAndThread(id);
178
- },
179
- },
180
- config: {
181
- resolverOf: 'plugins::comments.comments.config',
182
- resolver(obj, options, { context }) {
183
- return strapi.plugins.comments.controllers.comments.config(context);
184
- },
185
- },
186
- contentTypeName: {
187
- resolverOf: 'plugins::comments.comments.contentTypeName',
188
- resolver(obj, options) {
189
- const { contentType } = options;
190
- return strapi.plugins.comments.services.comments.contentTypeName(contentType);
191
- },
192
- },
193
- },
194
- Mutation: {
195
- commentAdd: {
196
- resolverOf: 'plugins::comments.comments.post',
197
- policies: ['plugins::users-permissions.isAuthenticated'],
198
- resolver(obj, options, { context }) {
199
- const user = context.state.user;
200
- const { comment } = options;
201
- return strapi.plugins.comments.services.comments
202
- .create(comment, user);
203
- },
204
- },
205
- commentUpdate: {
206
- resolverOf: 'plugins::comments.comments.put',
207
- policies: ['plugins::users-permissions.isAuthenticated'],
208
- resolver(obj, options, { context }) {
209
- const user = context.state.user;
210
- const { id, ...data } = options;
211
- return strapi.plugins.comments.services.comments
212
- .update(id, data, user);
213
- },
214
- },
215
- commentReportAbuse: {
216
- resolverOf: 'plugins::comments.comments.reportAbuse',
217
- policies: ['plugins::users-permissions.isAuthenticated'],
218
- resolver(obj, options, { context }) {
219
- const user = context.state.user;
220
- const { id, relation, reason, content } = options;
221
- return strapi.plugins.comments.services.comments
222
- .reportAbuse(id, relation, { reason, content }, user);
223
- },
224
- },
225
- commentLike: {
226
- resolverOf: 'plugins::comments.comments.pointsUp',
227
- policies: ['plugins::users-permissions.isAuthenticated'],
228
- resolver(obj, options, { context }) {
229
- const user = context.state.user;
230
- const { id, relation } = options;
231
- return strapi.plugins.comments.services.comments
232
- .pointsUp(id, relation, user);
233
- },
234
- },
235
- commentRemove: {
236
- resolverOf: 'plugins::comments.comments.removeComment',
237
- resolver(obj, options) {
238
- const { id, relation, authorId } = options;
239
- return strapi.plugins.comments.services.comments
240
- .markAsRemoved(relation, id, authorId);
241
- },
242
- },
243
- commentBlock: {
244
- resolverOf: 'plugins::comments.comments.blockComment',
245
- resolver(obj, options) {
246
- const { id } = options;
247
- return strapi.plugins.comments.services.comments
248
- .blockComment(id);
249
- },
250
- },
251
- commentThreadBlock: {
252
- resolverOf: 'plugins::comments.comments.blockCommentThread',
253
- resolver(obj, options) {
254
- const { id } = options;
255
- return strapi.plugins.comments.services.comments
256
- .blockCommentThread(id);
257
- },
258
- },
259
- commentResolveReport: {
260
- resolverOf: 'plugins::comments.comments.resolveAbuseReport',
261
- resolver(obj, options) {
262
- const { reportId, commentId } = options;
263
- return strapi.plugins.comments.services.comments
264
- .resolveAbuseReport(reportId, commentId);
265
- },
266
- },
267
- },
268
- },
269
- };
270
-
@@ -1,211 +0,0 @@
1
- 'use strict';
2
-
3
- const { parseParams, throwError } = require('./utils/functions');
4
- const _ = require('lodash');
5
-
6
- /**
7
- * comments.js controller
8
- *
9
- * @description: A set of functions called "actions" of the `comments` plugin.
10
- */
11
-
12
- module.exports = {
13
-
14
- getService() {
15
- return strapi.plugins.comments.services.comments;
16
- },
17
-
18
- /**
19
- * Default action.
20
- *
21
- * @return {Object}
22
- */
23
- async findAll(ctx) {
24
- return strapi.plugins.comments.services.comments.findAll(ctx.query);
25
- },
26
-
27
- async findAllFlat(ctx) {
28
- const { params = {}, query } = ctx;
29
- const { relation } = parseParams(params);
30
- try {
31
- return await strapi.plugins.comments.services.comments.findAllFlat(relation, query);
32
- } catch (e) {
33
- throwError(ctx, e);
34
- }
35
- },
36
-
37
- async findAllInHierarchy(ctx) {
38
- const { params = {}, query } = ctx;
39
- const { relation } = parseParams(params);
40
- try {
41
- return await strapi.plugins.comments.services.comments.findAllInHierarchy({
42
- relation,
43
- query,
44
- dropBlockedThreads: true,
45
- });
46
- } catch (e) {
47
- throwError(ctx, e);
48
- }
49
- },
50
-
51
- async post(ctx) {
52
- const { request, state = {} } = ctx;
53
- const { user } = state;
54
- const { body = {} } = request;
55
- try {
56
- const entity = await strapi.plugins.comments.services.comments.create(body, user);
57
- if (entity) {
58
- return entity;
59
- }
60
- } catch (e) {
61
- throwError(ctx, e);
62
- }
63
- },
64
-
65
- async put(ctx) {
66
- const { request, state, params = {} } = ctx;
67
- const { body = {} } = request;
68
- const { user } = state;
69
- const { commentId } = parseParams(params);
70
- try {
71
- return await strapi.plugins.comments.services.comments.update(commentId, body, user);
72
- } catch (e) {
73
- throwError(ctx, e);
74
- }
75
- },
76
-
77
- async pointsUp(ctx) {
78
- const { state, params = {} } = ctx;
79
- const { user } = state;
80
- const { relation, commentId } = parseParams(params);
81
- try {
82
- return await strapi.plugins.comments.services.comments.pointsUp(commentId, relation, user);
83
- } catch (e) {
84
- throwError(ctx, e);
85
- }
86
- },
87
-
88
- async reportAbuse(ctx) {
89
- const { request, state, params = {} } = ctx;
90
- const { body = {} } = request;
91
- if (!body.content) {
92
- return ctx.badRequest(null, 'Content field is required');
93
- }
94
- const { user } = state;
95
- const { relation, commentId } = parseParams(params);
96
- try {
97
- return await strapi.plugins.comments.services.comments.reportAbuse(commentId, relation, body, user);
98
- } catch (e) {
99
- throwError(ctx, e);
100
- }
101
- },
102
-
103
- async removeComment(ctx) {
104
- const { params: { relationId, commentId }, query: { authorId } } = ctx;
105
- if (authorId) {
106
- try {
107
- return await this.getService().markAsRemoved(
108
- relationId,
109
- commentId,
110
- authorId,
111
- );
112
- } catch (e) {
113
- if (!e.isBoom) {
114
- throwError(ctx, e);
115
- }
116
- throw e;
117
- }
118
- }
119
- return ctx.badRequest('Not provided authorId');
120
- },
121
-
122
- //
123
- // Moderation
124
- //
125
-
126
- async findOne(ctx) {
127
- const { params = {} } = ctx;
128
- const { id } = parseParams(params);
129
- try {
130
- return await strapi.plugins.comments.services.comments.findOneAndThread(id);
131
- } catch (e) {
132
- throwError(ctx, e);
133
- }
134
- },
135
-
136
- async blockComment(ctx) {
137
- const { params = {} } = ctx;
138
- const { id } = parseParams(params);
139
- try {
140
- return await strapi.plugins.comments.services.comments.blockComment(id);
141
- } catch (e) {
142
- throwError(ctx, e);
143
- }
144
- },
145
-
146
- async blockCommentThread(ctx) {
147
- const { params = {} } = ctx;
148
- const { id } = parseParams(params);
149
- try {
150
- return await strapi.plugins.comments.services.comments.blockCommentThread(id);
151
- } catch (e) {
152
- throwError(ctx, e);
153
- }
154
- },
155
-
156
- async resolveAbuseReport(ctx) {
157
- const { params = {} } = ctx;
158
- const { id, commentId } = parseParams(params);
159
- try {
160
- return await strapi.plugins.comments.services.comments.resolveAbuseReport(id, commentId);
161
- } catch (e) {
162
- throwError(ctx, e);
163
- }
164
- },
165
-
166
- async config(ctx) {
167
- const configRelatedContentTypes = _.get(strapi.config, ['plugins', 'comments', 'relatedContentTypes'], {});
168
- const contentsTypes = this.getContentsTypes();
169
- const relatedContentTypes = Object
170
- .keys(configRelatedContentTypes)
171
- .reduce((acc, currentKey) => {
172
- const current = configRelatedContentTypes[currentKey];
173
- const { key } = contentsTypes.find(content => content.value === currentKey) || {};
174
- return {
175
- ...acc,
176
- [currentKey]: {
177
- ...current,
178
- globalName: _.snakeCase(key),
179
- },
180
- };
181
- },
182
- {},
183
- );
184
- return {
185
- relatedContentTypes,
186
- contentsTypes,
187
- };
188
- },
189
-
190
- getContentsTypes() {
191
- return Object.entries(strapi.contentTypes)
192
- .filter(([, contentType]) => (
193
- contentType.associations || []).some(_ => _.plugin === 'comments' && _.collection === 'comment'),
194
- )
195
- .reduce((acc, [, contentType]) => [
196
- ...acc,
197
- { key: contentType.globalName, value: contentType.collectionName }],
198
- [],
199
- );
200
- },
201
-
202
- async contentTypeName(ctx) {
203
- const { params: { contentTypeName } } = ctx;
204
- try {
205
- const result = await strapi.plugins.comments.services.comments.contentTypeName(contentTypeName);
206
- return { list: result };
207
- } catch (e) {
208
- throwError(ctx, e);
209
- }
210
- },
211
- };
package/models/comment.js DELETED
@@ -1,8 +0,0 @@
1
- 'use strict';
2
-
3
- /**
4
- * Read the documentation (https://strapi.io/documentation/3.0.0-beta.x/concepts/models.html#life-cycle-callbacks)
5
- * to customize this model
6
- */
7
-
8
- module.exports = {};
@@ -1,98 +0,0 @@
1
- {
2
- "collectionName": "comments",
3
- "info": {
4
- "name": "comment",
5
- "description": ""
6
- },
7
- "options": {
8
- "increments": true,
9
- "timestamps": true,
10
- "isManaged": false,
11
- "comment": ""
12
- },
13
- "pluginOptions": {
14
- "content-manager": {
15
- "visible": false
16
- },
17
- "content-type-builder": {
18
- "visible": false
19
- }
20
- },
21
- "attributes": {
22
- "content": {
23
- "type": "text",
24
- "configurable": false,
25
- "required": true
26
- },
27
- "blocked": {
28
- "type": "boolean",
29
- "default": false,
30
- "configurable": false
31
- },
32
- "blockedThread": {
33
- "type": "boolean",
34
- "default": false,
35
- "configurable": false
36
- },
37
- "blockReason": {
38
- "type": "string",
39
- "configurable": false
40
- },
41
- "points": {
42
- "type": "integer",
43
- "default": 0,
44
- "configurable": false
45
- },
46
- "authorUser": {
47
- "model": "user",
48
- "plugin": "users-permissions",
49
- "configurable": false
50
- },
51
- "authorType": {
52
- "type": "string",
53
- "configurable": false
54
- },
55
- "authorId": {
56
- "type": "string",
57
- "configurable": false
58
- },
59
- "authorName": {
60
- "type": "string",
61
- "configurable": false
62
- },
63
- "authorEmail": {
64
- "type": "email",
65
- "configurable": false
66
- },
67
- "authorAvatar": {
68
- "type": "string",
69
- "configurable": false
70
- },
71
- "removed": {
72
- "type": "boolean",
73
- "configurable": false
74
- },
75
- "relatedSlug": {
76
- "type": "string",
77
- "private": true,
78
- "configurable": false
79
- },
80
- "related": {
81
- "collection": "*",
82
- "filter": "field",
83
- "configurable": false
84
- },
85
- "reports": {
86
- "collection": "report",
87
- "plugin": "comments",
88
- "via": "related",
89
- "configurable": false
90
- },
91
- "threadOf": {
92
- "columnName": "threadOf",
93
- "model": "comment",
94
- "plugin": "comments",
95
- "configurable": false
96
- }
97
- }
98
- }
package/models/report.js DELETED
@@ -1,8 +0,0 @@
1
- 'use strict';
2
-
3
- /**
4
- * Read the documentation (https://strapi.io/documentation/3.0.0-beta.x/concepts/models.html#life-cycle-callbacks)
5
- * to customize this model
6
- */
7
-
8
- module.exports = {};
@@ -1,49 +0,0 @@
1
- {
2
- "collectionName": "comments_report",
3
- "info": {
4
- "name": "report",
5
- "description": ""
6
- },
7
- "options": {
8
- "increments": true,
9
- "timestamps": true,
10
- "isManaged": false,
11
- "comment": ""
12
- },
13
- "pluginOptions": {
14
- "content-manager": {
15
- "visible": false
16
- },
17
- "content-type-builder": {
18
- "visible": false
19
- }
20
- },
21
- "attributes": {
22
- "content": {
23
- "type": "text",
24
- "configurable": false
25
- },
26
- "reason": {
27
- "type": "enumeration",
28
- "enum": [
29
- "BAD_LANGUAGE",
30
- "DISCRIMINATION",
31
- "OTHER"
32
- ],
33
- "default": "OTHER",
34
- "configurable": false,
35
- "required": true
36
- },
37
- "resolved": {
38
- "type": "boolean",
39
- "default": false,
40
- "configurable": false
41
- },
42
- "related": {
43
- "fieldName": "related",
44
- "model": "comment",
45
- "plugin": "comments",
46
- "configurable": false
47
- }
48
- }
49
- }