strapi-plugin-comments 2.0.8 → 2.1.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 (267) hide show
  1. package/README.md +171 -127
  2. package/admin/src/components/ActionButton/styles.d.ts +2 -0
  3. package/admin/src/components/ActionButton/styles.js +13 -8
  4. package/admin/src/components/ConfirmationDialog/index.d.ts +26 -0
  5. package/admin/src/components/ConfirmationDialog/index.js +36 -55
  6. package/admin/src/components/DiscussionStatus/index.d.ts +9 -0
  7. package/admin/src/components/DiscussionStatus/index.js +22 -31
  8. package/admin/src/components/DiscussionThread/index.d.ts +16 -0
  9. package/admin/src/components/DiscussionThread/index.js +39 -56
  10. package/admin/src/components/DiscussionThreadItem/index.d.ts +9 -0
  11. package/admin/src/components/DiscussionThreadItem/index.js +28 -52
  12. package/admin/src/components/DiscussionThreadItem/styles.d.ts +4 -0
  13. package/admin/src/components/DiscussionThreadItem/styles.js +16 -11
  14. package/admin/src/components/DiscussionThreadItemActions/index.d.ts +19 -0
  15. package/admin/src/components/DiscussionThreadItemActions/index.js +121 -158
  16. package/admin/src/components/DiscussionThreadItemActions/styles.d.ts +2 -0
  17. package/admin/src/components/DiscussionThreadItemActions/styles.js +13 -7
  18. package/admin/src/components/DiscussionThreadItemApprovalFlowActions/index.d.ts +17 -0
  19. package/admin/src/components/DiscussionThreadItemApprovalFlowActions/index.js +38 -48
  20. package/admin/src/components/DiscussionThreadItemApprovalFlowActions/styles.d.ts +2 -0
  21. package/admin/src/components/DiscussionThreadItemApprovalFlowActions/styles.js +12 -6
  22. package/admin/src/components/DiscussionThreadItemFooter/index.d.ts +16 -0
  23. package/admin/src/components/DiscussionThreadItemFooter/index.js +35 -42
  24. package/admin/src/components/DiscussionThreadItemFooter/styles.d.ts +3 -0
  25. package/admin/src/components/DiscussionThreadItemFooter/styles.js +17 -12
  26. package/admin/src/components/DiscussionThreadItemReviewAction/index.d.ts +30 -0
  27. package/admin/src/components/DiscussionThreadItemReviewAction/index.js +77 -91
  28. package/admin/src/components/FormSwitch/index.d.ts +7 -0
  29. package/admin/src/components/FormSwitch/index.js +15 -18
  30. package/admin/src/components/FormSwitch/styles.d.ts +2 -0
  31. package/admin/src/components/FormSwitch/styles.js +14 -8
  32. package/admin/src/components/IconButton/styles.d.ts +2 -0
  33. package/admin/src/components/IconButton/styles.js +16 -9
  34. package/admin/src/components/Initializer/index.d.ts +5 -0
  35. package/admin/src/components/Initializer/index.js +12 -24
  36. package/admin/src/components/LoadingIndicatorOverlay/index.d.ts +3 -0
  37. package/admin/src/components/LoadingIndicatorOverlay/index.js +12 -15
  38. package/admin/src/components/LoadingIndicatorOverlay/styles.d.ts +3 -0
  39. package/admin/src/components/LoadingIndicatorOverlay/styles.js +22 -17
  40. package/admin/src/components/Nav/index.d.ts +7 -0
  41. package/admin/src/components/Nav/index.js +25 -48
  42. package/admin/src/components/PluginIcon/index.d.ts +3 -0
  43. package/admin/src/components/PluginIcon/index.js +10 -12
  44. package/admin/src/components/ReportsReviewModal/index.d.ts +21 -0
  45. package/admin/src/components/ReportsReviewModal/index.js +31 -46
  46. package/admin/src/components/ReportsReviewTable/index.d.ts +21 -0
  47. package/admin/src/components/ReportsReviewTable/index.js +120 -140
  48. package/admin/src/components/StatusBadge/index.d.ts +7 -0
  49. package/admin/src/components/StatusBadge/index.js +12 -17
  50. package/admin/src/components/StatusBadge/styles.d.ts +2 -0
  51. package/admin/src/components/StatusBadge/styles.js +19 -13
  52. package/admin/src/components/TableFilters/index.d.ts +10 -0
  53. package/admin/src/components/TableFilters/index.js +52 -49
  54. package/admin/src/components/TablePagination/index.d.ts +17 -0
  55. package/admin/src/components/TablePagination/index.js +27 -29
  56. package/admin/src/components/icons/comments.d.ts +6 -0
  57. package/admin/src/components/icons/comments.js +11 -8
  58. package/admin/src/components/icons/index.d.ts +6 -0
  59. package/admin/src/components/icons/index.js +15 -6
  60. package/admin/src/components/icons/lock.d.ts +7 -0
  61. package/admin/src/components/icons/lock.js +11 -21
  62. package/admin/src/components/icons/review.d.ts +7 -0
  63. package/admin/src/components/icons/review.js +11 -17
  64. package/admin/src/components/icons/unlock.d.ts +7 -0
  65. package/admin/src/components/icons/unlock.js +11 -19
  66. package/admin/src/hooks/useConfig.d.ts +8 -0
  67. package/admin/src/hooks/useConfig.js +40 -45
  68. package/admin/src/index.d.ts +7 -0
  69. package/admin/src/index.js +98 -92
  70. package/admin/src/pages/App/index.d.ts +4 -0
  71. package/admin/src/pages/App/index.js +43 -67
  72. package/admin/src/pages/App/reducer/actions.d.ts +8 -0
  73. package/admin/src/pages/App/reducer/actions.js +11 -7
  74. package/admin/src/pages/App/reducer/constants.d.ts +4 -0
  75. package/admin/src/pages/App/reducer/constants.js +7 -4
  76. package/admin/src/pages/App/reducer/index.d.ts +9 -0
  77. package/admin/src/pages/App/reducer/index.js +24 -22
  78. package/admin/src/pages/App/reducer/init.d.ts +3 -0
  79. package/admin/src/pages/App/reducer/init.js +6 -4
  80. package/admin/src/pages/App/reducer/selectors.d.ts +6 -0
  81. package/admin/src/pages/App/reducer/selectors.js +17 -34
  82. package/admin/src/pages/App/utils/api.d.ts +2 -0
  83. package/admin/src/pages/App/utils/api.js +14 -11
  84. package/admin/src/pages/ComingSoonPage/index.d.ts +3 -0
  85. package/admin/src/pages/ComingSoonPage/index.js +42 -24
  86. package/admin/src/pages/Details/components/DetailsEntity/index.d.ts +18 -0
  87. package/admin/src/pages/Details/components/DetailsEntity/index.js +49 -77
  88. package/admin/src/pages/Details/components/DetailsFilters/index.d.ts +12 -0
  89. package/admin/src/pages/Details/components/DetailsFilters/index.js +19 -26
  90. package/admin/src/pages/Details/components/DetailsFilters/styles.d.ts +2 -0
  91. package/admin/src/pages/Details/components/DetailsFilters/styles.js +14 -8
  92. package/admin/src/pages/Details/index.d.ts +4 -0
  93. package/admin/src/pages/Details/index.js +94 -133
  94. package/admin/src/pages/Discover/components/DiscoverTableRow/index.d.ts +20 -0
  95. package/admin/src/pages/Discover/components/DiscoverTableRow/index.js +128 -139
  96. package/admin/src/pages/Discover/components/DiscoverTableRow/styles.d.ts +2 -0
  97. package/admin/src/pages/Discover/components/DiscoverTableRow/styles.js +14 -8
  98. package/admin/src/pages/Discover/index.d.ts +4 -0
  99. package/admin/src/pages/Discover/index.js +129 -170
  100. package/admin/src/pages/Discover/utils/api.d.ts +2 -0
  101. package/admin/src/pages/Discover/utils/api.js +15 -13
  102. package/admin/src/pages/Discover/utils/filtersSchema.d.ts +11 -0
  103. package/admin/src/pages/Discover/utils/filtersSchema.js +8 -6
  104. package/admin/src/pages/Settings/components/RestartAlert/styles.d.ts +2 -0
  105. package/admin/src/pages/Settings/components/RestartAlert/styles.js +14 -8
  106. package/admin/src/pages/Settings/index.d.ts +3 -0
  107. package/admin/src/pages/Settings/index.js +225 -391
  108. package/admin/src/pages/Settings/utils/api.d.ts +7 -0
  109. package/admin/src/pages/Settings/utils/api.js +60 -55
  110. package/admin/src/pages/utils/api.d.ts +12 -0
  111. package/admin/src/pages/utils/api.js +58 -53
  112. package/admin/src/permissions.d.ts +28 -0
  113. package/admin/src/permissions.js +31 -17
  114. package/admin/src/pluginId.d.ts +2 -0
  115. package/admin/src/pluginId.js +29 -5
  116. package/admin/src/reducers.d.ts +7 -0
  117. package/admin/src/reducers.js +10 -6
  118. package/admin/src/translations/en.json +131 -130
  119. package/admin/src/translations/fr.json +1 -1
  120. package/admin/src/translations/pt-BR.json +132 -0
  121. package/admin/src/utils/axiosInstance.d.ts +3 -0
  122. package/admin/src/utils/axiosInstance.js +21 -27
  123. package/admin/src/utils/constants.d.ts +25 -0
  124. package/admin/src/utils/constants.js +23 -22
  125. package/admin/src/utils/getApiUrl.d.ts +3 -0
  126. package/admin/src/utils/getApiUrl.js +6 -5
  127. package/admin/src/utils/getMessage.d.ts +4 -0
  128. package/admin/src/utils/getMessage.js +15 -15
  129. package/admin/src/utils/getRelatedGroups.d.ts +4 -0
  130. package/admin/src/utils/getRelatedGroups.js +5 -3
  131. package/admin/src/utils/getUrl.d.ts +3 -0
  132. package/admin/src/utils/getUrl.js +6 -5
  133. package/admin/src/utils/handleAPIError.d.ts +4 -0
  134. package/admin/src/utils/handleAPIError.js +12 -11
  135. package/admin/src/utils/index.d.ts +12 -0
  136. package/admin/src/utils/index.js +29 -11
  137. package/admin/src/utils/parseRegExp.d.ts +6 -0
  138. package/admin/src/utils/parseRegExp.js +6 -5
  139. package/admin/src/utils/renderEntryTitle.d.ts +4 -0
  140. package/admin/src/utils/renderEntryTitle.js +11 -12
  141. package/admin/src/utils/renderInitials.d.ts +3 -0
  142. package/admin/src/utils/renderInitials.js +10 -5
  143. package/admin/src/utils/resolveCommentStatus.d.ts +4 -0
  144. package/admin/src/utils/resolveCommentStatus.js +17 -21
  145. package/admin/src/utils/resolveCommentStatusColor.d.ts +4 -0
  146. package/admin/src/utils/resolveCommentStatusColor.js +19 -19
  147. package/content-types/comment.d.ts +91 -0
  148. package/content-types/comment.js +87 -88
  149. package/content-types/index.d.ts +143 -0
  150. package/content-types/index.js +15 -10
  151. package/content-types/report.d.ts +48 -0
  152. package/content-types/report.js +44 -49
  153. package/package.json +24 -19
  154. package/permissions.d.ts +18 -0
  155. package/permissions.js +12 -13
  156. package/server/bootstrap.d.ts +4 -0
  157. package/server/bootstrap.js +56 -62
  158. package/server/config/index.d.ts +4 -0
  159. package/server/config/index.js +17 -15
  160. package/server/controllers/admin.d.ts +4 -0
  161. package/server/controllers/admin.js +134 -167
  162. package/server/controllers/client.d.ts +4 -0
  163. package/server/controllers/client.js +104 -115
  164. package/server/controllers/index.d.ts +6 -0
  165. package/server/controllers/index.js +12 -8
  166. package/server/controllers/utils/functions.d.ts +7 -0
  167. package/server/controllers/utils/functions.js +22 -17
  168. package/server/controllers/utils/parsers.d.ts +15 -0
  169. package/server/controllers/utils/parsers.js +17 -17
  170. package/server/destroy.d.ts +3 -0
  171. package/server/destroy.js +3 -4
  172. package/server/graphql/index.d.ts +4 -0
  173. package/server/graphql/index.js +27 -25
  174. package/server/graphql/mutations/createAbuseReport.d.ts +11 -0
  175. package/server/graphql/mutations/createAbuseReport.js +22 -24
  176. package/server/graphql/mutations/createComment.d.ts +14 -0
  177. package/server/graphql/mutations/createComment.js +22 -24
  178. package/server/graphql/mutations/index.d.ts +4 -0
  179. package/server/graphql/mutations/index.js +24 -19
  180. package/server/graphql/mutations/removeComment.d.ts +11 -0
  181. package/server/graphql/mutations/removeComment.js +22 -24
  182. package/server/graphql/mutations/updateComment.d.ts +11 -0
  183. package/server/graphql/mutations/updateComment.js +22 -24
  184. package/server/graphql/queries/findAllFlat.d.ts +19 -0
  185. package/server/graphql/queries/findAllFlat.js +31 -30
  186. package/server/graphql/queries/findAllInHierarchy.d.ts +18 -0
  187. package/server/graphql/queries/findAllInHierarchy.js +26 -30
  188. package/server/graphql/queries/index.d.ts +4 -0
  189. package/server/graphql/queries/index.js +20 -17
  190. package/server/graphql/resolvers-config.d.ts +23 -0
  191. package/server/graphql/resolvers-config.js +11 -11
  192. package/server/graphql/types/comment-author.d.ts +4 -0
  193. package/server/graphql/types/comment-author.js +10 -8
  194. package/server/graphql/types/comment-nested.d.ts +4 -0
  195. package/server/graphql/types/comment-nested.js +17 -15
  196. package/server/graphql/types/comment.d.ts +4 -0
  197. package/server/graphql/types/comment.js +16 -14
  198. package/server/graphql/types/create-comment-author.d.ts +4 -0
  199. package/server/graphql/types/create-comment-author.js +10 -8
  200. package/server/graphql/types/create-comment.d.ts +4 -0
  201. package/server/graphql/types/create-comment.js +10 -8
  202. package/server/graphql/types/create-report.d.ts +4 -0
  203. package/server/graphql/types/create-report.js +10 -8
  204. package/server/graphql/types/id.d.ts +4 -0
  205. package/server/graphql/types/id.js +24 -23
  206. package/server/graphql/types/identify-comment-author.d.ts +4 -0
  207. package/server/graphql/types/identify-comment-author.js +7 -5
  208. package/server/graphql/types/index.d.ts +4 -0
  209. package/server/graphql/types/index.js +36 -17
  210. package/server/graphql/types/remove-comment.d.ts +4 -0
  211. package/server/graphql/types/remove-comment.js +9 -7
  212. package/server/graphql/types/report-reason.d.ts +4 -0
  213. package/server/graphql/types/report-reason.js +10 -8
  214. package/server/graphql/types/report.d.ts +4 -0
  215. package/server/graphql/types/report.js +12 -10
  216. package/server/graphql/types/response-find-all.d.ts +4 -0
  217. package/server/graphql/types/response-find-all.js +8 -6
  218. package/server/graphql/types/response-meta.d.ts +4 -0
  219. package/server/graphql/types/response-meta.js +7 -5
  220. package/server/graphql/types/response-pagination.d.ts +4 -0
  221. package/server/graphql/types/response-pagination.js +12 -10
  222. package/server/graphql/types/update-comment.d.ts +4 -0
  223. package/server/graphql/types/update-comment.js +10 -8
  224. package/server/index.d.ts +26 -0
  225. package/server/index.js +24 -21
  226. package/server/register.d.ts +3 -0
  227. package/server/register.js +3 -4
  228. package/server/routes/admin.d.ts +4 -0
  229. package/server/routes/admin.js +103 -109
  230. package/server/routes/client.d.ts +4 -0
  231. package/server/routes/client.js +48 -46
  232. package/server/routes/index.d.ts +11 -0
  233. package/server/routes/index.js +18 -14
  234. package/server/services/admin.d.ts +5 -0
  235. package/server/services/admin.js +126 -158
  236. package/server/services/client.d.ts +5 -0
  237. package/server/services/client.js +135 -151
  238. package/server/services/common.d.ts +5 -0
  239. package/server/services/common.js +165 -194
  240. package/server/services/graphql.d.ts +5 -0
  241. package/server/services/graphql.js +117 -182
  242. package/server/services/index.d.ts +8 -0
  243. package/server/services/index.js +15 -12
  244. package/server/services/utils/functions.d.ts +13 -0
  245. package/server/services/utils/functions.js +100 -109
  246. package/server/utils/constants.d.ts +9 -0
  247. package/server/utils/constants.js +19 -23
  248. package/server/utils/error.d.ts +19 -0
  249. package/server/utils/error.js +23 -18
  250. package/server/utils/functions.d.ts +6 -0
  251. package/server/utils/functions.js +35 -18
  252. package/strapi-admin.d.ts +3 -0
  253. package/strapi-admin.js +8 -3
  254. package/strapi-server.d.ts +177 -0
  255. package/strapi-server.js +43 -46
  256. package/tsconfig.tsbuildinfo +1 -0
  257. package/types/contentTypes.d.ts +44 -0
  258. package/types/contentTypes.js +3 -0
  259. package/.husky/pre-commit +0 -4
  260. package/LICENSE.md +0 -7
  261. package/__mocks__/initSetup.js +0 -108
  262. package/jest.config.js +0 -7
  263. package/server/controllers/utils/__tests__/functions.test.js +0 -43
  264. package/server/controllers/utils/__tests__/parsers.test.js +0 -94
  265. package/server/services/__tests__/common.test.js +0 -399
  266. package/server/services/utils/__tests__/functions.test.js +0 -53
  267. package/server/utils/__tests__/functions.test.js +0 -17
@@ -1,21 +1,21 @@
1
-
2
- import { useIntl } from 'react-intl';
3
- import { isString } from 'lodash';
4
-
5
- import pluginId from '../pluginId';
6
-
7
- const getMessage = (input, defaultMessage = '', inPluginScope = true) => {
8
- const { formatMessage } = useIntl();
9
- let formattedId = ''
10
- if (isString(input)) {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const react_intl_1 = require("react-intl");
4
+ const lodash_1 = require("lodash");
5
+ const pluginId_1 = require("../pluginId");
6
+ const getMessage = (input, defaultMessage = "", inPluginScope = true) => {
7
+ const { formatMessage } = (0, react_intl_1.useIntl)();
8
+ let formattedId = "";
9
+ if ((0, lodash_1.isString)(input)) {
11
10
  formattedId = input;
12
- } else {
11
+ }
12
+ else {
13
13
  formattedId = input?.id;
14
14
  }
15
15
  return formatMessage({
16
- id: `${inPluginScope ? pluginId : 'app.components'}.${formattedId}`,
16
+ id: `${inPluginScope ? pluginId_1.pluginId : "app.components"}.${formattedId}`,
17
17
  defaultMessage,
18
- }, input?.props || undefined)
18
+ }, input?.props || undefined);
19
19
  };
20
-
21
- export default getMessage;
20
+ exports.default = getMessage;
21
+ //# sourceMappingURL=getMessage.js.map
@@ -0,0 +1,4 @@
1
+ import { ToBeFixed } from "../../../types";
2
+ declare const getRelatedGroups: (related: string, config: ToBeFixed) => string[];
3
+ export default getRelatedGroups;
4
+ //# sourceMappingURL=getRelatedGroups.d.ts.map
@@ -1,3 +1,5 @@
1
- const getRelatedGroups = (related, config) => related.split(config.regex.relatedUid).filter(s => s && s.length > 0);
2
-
3
- export default getRelatedGroups;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const getRelatedGroups = (related, config) => related.split(config.regex.relatedUid).filter((s) => s && s.length > 0);
4
+ exports.default = getRelatedGroups;
5
+ //# sourceMappingURL=getRelatedGroups.js.map
@@ -0,0 +1,3 @@
1
+ declare const getUrl: (path?: string) => string;
2
+ export default getUrl;
3
+ //# sourceMappingURL=getUrl.d.ts.map
@@ -1,5 +1,6 @@
1
- import pluginId from '../pluginId';
2
-
3
- const getUrl = (path = '') => `/plugins/${pluginId}/${path}`;
4
-
5
- export default getUrl;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const pluginId_1 = require("../pluginId");
4
+ const getUrl = (path = "") => `/plugins/${pluginId_1.pluginId}/${path}`;
5
+ exports.default = getUrl;
6
+ //# sourceMappingURL=getUrl.js.map
@@ -0,0 +1,4 @@
1
+ import { ToBeFixed } from "../../../types";
2
+ declare const handleAPIError: (err?: null, toggleNotification?: ToBeFixed, message?: string) => never;
3
+ export default handleAPIError;
4
+ //# sourceMappingURL=handleAPIError.d.ts.map
@@ -1,16 +1,17 @@
1
- import pluginId from "../pluginId";
2
-
3
- const handleAPIError = (err = null, toggleNotification = null, message = 'app.components.notification.error') => {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const pluginId_1 = require("../pluginId");
4
+ const handleAPIError = (err = null, toggleNotification = null, message = "app.components.notification.error") => {
4
5
  toggleNotification({
5
- type: 'warning',
6
- message: `${pluginId}.${message}`,
6
+ type: "warning",
7
+ message: `${pluginId_1.pluginId}.${message}`,
7
8
  });
8
-
9
9
  if (err) {
10
10
  throw err;
11
- } else {
12
- throw new Error('error');
13
11
  }
14
- }
15
-
16
- export default handleAPIError;
12
+ else {
13
+ throw new Error("error");
14
+ }
15
+ };
16
+ exports.default = handleAPIError;
17
+ //# sourceMappingURL=handleAPIError.js.map
@@ -0,0 +1,12 @@
1
+ export { default as axiosInstance } from "./axiosInstance";
2
+ export { default as getApiURL } from "./getApiUrl";
3
+ export { default as getUrl } from "./getUrl";
4
+ export { default as getMessage } from "./getMessage";
5
+ export { default as handleAPIError } from "./handleAPIError";
6
+ export { default as getRelatedGroups } from "./getRelatedGroups";
7
+ export { default as renderEntryTitle } from "./renderEntryTitle";
8
+ export { default as renderInitials } from "./renderInitials";
9
+ export { default as resolveCommentStatus } from "./resolveCommentStatus";
10
+ export { default as resolveCommentStatusColor } from "./resolveCommentStatusColor";
11
+ export { default as parseRegExp } from "./parseRegExp";
12
+ //# sourceMappingURL=index.d.ts.map
@@ -1,11 +1,29 @@
1
- export { default as axiosInstance } from './axiosInstance';
2
- export { default as getApiURL } from './getApiUrl';
3
- export { default as getUrl } from './getUrl';
4
- export { default as getMessage } from './getMessage';
5
- export { default as handleAPIError } from './handleAPIError';
6
- export { default as getRelatedGroups } from './getRelatedGroups';
7
- export { default as renderEntryTitle } from './renderEntryTitle';
8
- export { default as renderInitials } from './renderInitials';
9
- export { default as resolveCommentStatus } from './resolveCommentStatus';
10
- export { default as resolveCommentStatusColor } from './resolveCommentStatusColor';
11
- export { default as parseRegExp } from './parseRegExp';
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.parseRegExp = exports.resolveCommentStatusColor = exports.resolveCommentStatus = exports.renderInitials = exports.renderEntryTitle = exports.getRelatedGroups = exports.handleAPIError = exports.getMessage = exports.getUrl = exports.getApiURL = exports.axiosInstance = void 0;
7
+ var axiosInstance_1 = require("./axiosInstance");
8
+ Object.defineProperty(exports, "axiosInstance", { enumerable: true, get: function () { return __importDefault(axiosInstance_1).default; } });
9
+ var getApiUrl_1 = require("./getApiUrl");
10
+ Object.defineProperty(exports, "getApiURL", { enumerable: true, get: function () { return __importDefault(getApiUrl_1).default; } });
11
+ var getUrl_1 = require("./getUrl");
12
+ Object.defineProperty(exports, "getUrl", { enumerable: true, get: function () { return __importDefault(getUrl_1).default; } });
13
+ var getMessage_1 = require("./getMessage");
14
+ Object.defineProperty(exports, "getMessage", { enumerable: true, get: function () { return __importDefault(getMessage_1).default; } });
15
+ var handleAPIError_1 = require("./handleAPIError");
16
+ Object.defineProperty(exports, "handleAPIError", { enumerable: true, get: function () { return __importDefault(handleAPIError_1).default; } });
17
+ var getRelatedGroups_1 = require("./getRelatedGroups");
18
+ Object.defineProperty(exports, "getRelatedGroups", { enumerable: true, get: function () { return __importDefault(getRelatedGroups_1).default; } });
19
+ var renderEntryTitle_1 = require("./renderEntryTitle");
20
+ Object.defineProperty(exports, "renderEntryTitle", { enumerable: true, get: function () { return __importDefault(renderEntryTitle_1).default; } });
21
+ var renderInitials_1 = require("./renderInitials");
22
+ Object.defineProperty(exports, "renderInitials", { enumerable: true, get: function () { return __importDefault(renderInitials_1).default; } });
23
+ var resolveCommentStatus_1 = require("./resolveCommentStatus");
24
+ Object.defineProperty(exports, "resolveCommentStatus", { enumerable: true, get: function () { return __importDefault(resolveCommentStatus_1).default; } });
25
+ var resolveCommentStatusColor_1 = require("./resolveCommentStatusColor");
26
+ Object.defineProperty(exports, "resolveCommentStatusColor", { enumerable: true, get: function () { return __importDefault(resolveCommentStatusColor_1).default; } });
27
+ var parseRegExp_1 = require("./parseRegExp");
28
+ Object.defineProperty(exports, "parseRegExp", { enumerable: true, get: function () { return __importDefault(parseRegExp_1).default; } });
29
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,6 @@
1
+ declare const parseRegExp: (regexpString: string) => {
2
+ value: string;
3
+ flags: string;
4
+ };
5
+ export default parseRegExp;
6
+ //# sourceMappingURL=parseRegExp.d.ts.map
@@ -1,10 +1,11 @@
1
-
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
2
3
  const parseRegExp = (regexpString) => {
3
- const [value, flags] = regexpString.split('/').filter(_ => _.length > 0);
4
+ const [value, flags] = regexpString.split("/").filter((_) => _.length > 0);
4
5
  return {
5
6
  value,
6
7
  flags,
7
8
  };
8
- }
9
-
10
- export default parseRegExp;
9
+ };
10
+ exports.default = parseRegExp;
11
+ //# sourceMappingURL=parseRegExp.js.map
@@ -0,0 +1,4 @@
1
+ import { ToBeFixed } from "../../../types";
2
+ declare const renderEntryTitle: (entry: ToBeFixed, config?: ToBeFixed) => any;
3
+ export default renderEntryTitle;
4
+ //# sourceMappingURL=renderEntryTitle.d.ts.map
@@ -1,14 +1,13 @@
1
- import { first } from 'lodash';
2
-
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const lodash_1 = require("lodash");
3
4
  const renderEntryTitle = (entry, config = {}) => {
4
5
  const { entryLabel } = config;
5
- const rule = entry.uid in entryLabel ? entryLabel[entry.uid] : entryLabel['*'];
6
- return first(
7
- Object.keys(entry)
8
- .filter(_ => (rule === _) || rule.includes(_))
9
- .map(_ => entry[_])
10
- .filter(_ => _)
11
- );
12
- };
13
-
14
- export default renderEntryTitle;
6
+ const rule = entry.uid in entryLabel ? entryLabel[entry.uid] : entryLabel["*"];
7
+ return (0, lodash_1.first)(Object.keys(entry)
8
+ .filter((_) => rule === _ || rule.includes(_))
9
+ .map((_) => entry[_])
10
+ .filter((_) => _));
11
+ };
12
+ exports.default = renderEntryTitle;
13
+ //# sourceMappingURL=renderEntryTitle.js.map
@@ -0,0 +1,3 @@
1
+ declare const renderInitials: (value?: string) => string;
2
+ export default renderInitials;
3
+ //# sourceMappingURL=renderInitials.d.ts.map
@@ -1,5 +1,10 @@
1
- import { first } from 'lodash';
2
-
3
- const renderInitials = (value = '') => value.split(' ').map(_ => first(_)).join('').toUpperCase();
4
-
5
- export default renderInitials;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const lodash_1 = require("lodash");
4
+ const renderInitials = (value = "") => value
5
+ .split(" ")
6
+ .map((_) => (0, lodash_1.first)(_))
7
+ .join("")
8
+ .toUpperCase();
9
+ exports.default = renderInitials;
10
+ //# sourceMappingURL=renderInitials.js.map
@@ -0,0 +1,4 @@
1
+ import { ToBeFixed } from "../../../types";
2
+ declare const resolveCommentStatus: ({ removed, blocked, blockedThread, approvalStatus, reviewFlowEnabled, }: ToBeFixed) => any;
3
+ export default resolveCommentStatus;
4
+ //# sourceMappingURL=resolveCommentStatus.d.ts.map
@@ -1,30 +1,26 @@
1
- import { isNil } from 'lodash';
2
- import { COMMENT_STATUS } from './constants';
3
-
4
- const resolveCommentStatus = ({ removed, blocked, blockedThread, approvalStatus, reviewFlowEnabled }) => {
5
- const gotApprovalFlow = !isNil(approvalStatus);
6
-
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const lodash_1 = require("lodash");
4
+ const constants_1 = require("./constants");
5
+ const resolveCommentStatus = ({ removed, blocked, blockedThread, approvalStatus, reviewFlowEnabled, }) => {
6
+ const gotApprovalFlow = !(0, lodash_1.isNil)(approvalStatus);
7
7
  if (removed) {
8
- return COMMENT_STATUS.REMOVED;
9
- }
10
-
8
+ return constants_1.COMMENT_STATUS.REMOVED;
9
+ }
11
10
  if (blocked || blockedThread) {
12
- return COMMENT_STATUS.BLOCKED;
13
- }
14
-
11
+ return constants_1.COMMENT_STATUS.BLOCKED;
12
+ }
15
13
  if (reviewFlowEnabled) {
16
- return COMMENT_STATUS.TO_REVIEW;
14
+ return constants_1.COMMENT_STATUS.TO_REVIEW;
17
15
  }
18
-
19
16
  if (gotApprovalFlow) {
20
17
  const status = approvalStatus.toUpperCase();
21
- if (Object.keys(COMMENT_STATUS).includes(status)) {
18
+ if (Object.keys(constants_1.COMMENT_STATUS).includes(status)) {
22
19
  return status;
23
20
  }
24
- return COMMENT_STATUS.UNKNOWN;
21
+ return constants_1.COMMENT_STATUS.UNKNOWN;
25
22
  }
26
-
27
- return COMMENT_STATUS.OPEN;
28
- }
29
-
30
- export default resolveCommentStatus;
23
+ return constants_1.COMMENT_STATUS.OPEN;
24
+ };
25
+ exports.default = resolveCommentStatus;
26
+ //# sourceMappingURL=resolveCommentStatus.js.map
@@ -0,0 +1,4 @@
1
+ import { ToBeFixed } from "../../../types";
2
+ declare const resolveCommentStatusColor: (status: ToBeFixed) => "warning" | "secondary" | "danger" | "success";
3
+ export default resolveCommentStatusColor;
4
+ //# sourceMappingURL=resolveCommentStatusColor.d.ts.map
@@ -1,22 +1,22 @@
1
- import { isNil } from 'lodash';
2
- import { COMMENT_STATUS } from './constants';
3
-
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const constants_1 = require("./constants");
4
4
  const resolveCommentStatusColor = (status) => {
5
- if (Object.keys(COMMENT_STATUS).includes(status)) {
5
+ if (Object.keys(constants_1.COMMENT_STATUS).includes(status)) {
6
6
  switch (status) {
7
- case COMMENT_STATUS.REMOVED:
8
- return 'secondary';
9
- case COMMENT_STATUS.TO_REVIEW:
10
- case COMMENT_STATUS.REJECTED:
11
- return 'warning';
12
- case COMMENT_STATUS.BLOCKED:
13
- return 'danger';
14
- case COMMENT_STATUS.OPEN:
15
- case COMMENT_STATUS.APPROVED:
16
- return 'success';
17
- };
7
+ case constants_1.COMMENT_STATUS.REMOVED:
8
+ return "secondary";
9
+ case constants_1.COMMENT_STATUS.TO_REVIEW:
10
+ case constants_1.COMMENT_STATUS.REJECTED:
11
+ return "warning";
12
+ case constants_1.COMMENT_STATUS.BLOCKED:
13
+ return "danger";
14
+ case constants_1.COMMENT_STATUS.OPEN:
15
+ case constants_1.COMMENT_STATUS.APPROVED:
16
+ return "success";
17
+ }
18
18
  }
19
- return 'secondary';
20
- }
21
-
22
- export default resolveCommentStatusColor;
19
+ return "secondary";
20
+ };
21
+ exports.default = resolveCommentStatusColor;
22
+ //# sourceMappingURL=resolveCommentStatusColor.js.map
@@ -0,0 +1,91 @@
1
+ declare const _default: {
2
+ info: {
3
+ tableName: string;
4
+ singularName: string;
5
+ pluralName: string;
6
+ displayName: string;
7
+ description: string;
8
+ kind: string;
9
+ };
10
+ options: {
11
+ draftAndPublish: boolean;
12
+ };
13
+ pluginOptions: {
14
+ "content-manager": {
15
+ visible: boolean;
16
+ };
17
+ "content-type-builder": {
18
+ visible: boolean;
19
+ };
20
+ };
21
+ attributes: {
22
+ content: {
23
+ type: string;
24
+ configurable: boolean;
25
+ required: boolean;
26
+ };
27
+ blocked: {
28
+ type: string;
29
+ default: boolean;
30
+ configurable: boolean;
31
+ };
32
+ blockedThread: {
33
+ type: string;
34
+ default: boolean;
35
+ configurable: boolean;
36
+ };
37
+ blockReason: {
38
+ type: string;
39
+ configurable: boolean;
40
+ };
41
+ authorUser: {
42
+ type: string;
43
+ relation: string;
44
+ target: string;
45
+ configurable: boolean;
46
+ };
47
+ authorId: {
48
+ type: string;
49
+ configurable: boolean;
50
+ };
51
+ authorName: {
52
+ type: string;
53
+ configurable: boolean;
54
+ };
55
+ authorEmail: {
56
+ type: string;
57
+ configurable: boolean;
58
+ };
59
+ authorAvatar: {
60
+ type: string;
61
+ configurable: boolean;
62
+ };
63
+ removed: {
64
+ type: string;
65
+ configurable: boolean;
66
+ };
67
+ approvalStatus: {
68
+ type: string;
69
+ configurable: boolean;
70
+ };
71
+ related: {
72
+ type: string;
73
+ configurable: boolean;
74
+ };
75
+ reports: {
76
+ type: string;
77
+ relation: string;
78
+ target: string;
79
+ mappedBy: string;
80
+ configurable: boolean;
81
+ };
82
+ threadOf: {
83
+ type: string;
84
+ relation: string;
85
+ target: string;
86
+ configurable: boolean;
87
+ };
88
+ };
89
+ };
90
+ export default _default;
91
+ //# sourceMappingURL=comment.d.ts.map
@@ -1,93 +1,92 @@
1
- /**
2
- * Comments Collection Type
3
- */
4
-
5
- module.exports = {
6
- info: {
7
- tableName: 'plugin-comments-comments',
8
- singularName: 'comment',
9
- pluralName: 'comments',
10
- displayName: 'Comment',
11
- description: 'Comment content type',
12
- kind: 'collectionType',
13
- },
14
- options: {
15
- draftAndPublish: false,
16
- },
17
- pluginOptions: {
18
- 'content-manager': {
19
- visible: false
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = {
4
+ info: {
5
+ tableName: "plugin-comments-comments",
6
+ singularName: "comment",
7
+ pluralName: "comments",
8
+ displayName: "Comment",
9
+ description: "Comment content type",
10
+ kind: "collectionType",
20
11
  },
21
- 'content-type-builder': {
22
- visible: false
23
- }
24
- },
25
- attributes: {
26
- content: {
27
- type: 'text',
28
- configurable: false,
29
- required: true
12
+ options: {
13
+ draftAndPublish: false,
30
14
  },
31
- blocked: {
32
- type: 'boolean',
33
- default: false,
34
- configurable: false
15
+ pluginOptions: {
16
+ "content-manager": {
17
+ visible: false,
18
+ },
19
+ "content-type-builder": {
20
+ visible: false,
21
+ },
35
22
  },
36
- blockedThread: {
37
- type: 'boolean',
38
- default: false,
39
- configurable: false
23
+ attributes: {
24
+ content: {
25
+ type: "text",
26
+ configurable: false,
27
+ required: true,
28
+ },
29
+ blocked: {
30
+ type: "boolean",
31
+ default: false,
32
+ configurable: false,
33
+ },
34
+ blockedThread: {
35
+ type: "boolean",
36
+ default: false,
37
+ configurable: false,
38
+ },
39
+ blockReason: {
40
+ type: "string",
41
+ configurable: false,
42
+ },
43
+ authorUser: {
44
+ type: "relation",
45
+ relation: "oneToOne",
46
+ target: "plugin::users-permissions.user",
47
+ configurable: false,
48
+ },
49
+ authorId: {
50
+ type: "string",
51
+ configurable: false,
52
+ },
53
+ authorName: {
54
+ type: "string",
55
+ configurable: false,
56
+ },
57
+ authorEmail: {
58
+ type: "email",
59
+ configurable: false,
60
+ },
61
+ authorAvatar: {
62
+ type: "string",
63
+ configurable: false,
64
+ },
65
+ removed: {
66
+ type: "boolean",
67
+ configurable: false,
68
+ },
69
+ approvalStatus: {
70
+ type: "string",
71
+ configurable: false,
72
+ },
73
+ related: {
74
+ type: "string",
75
+ configurable: false,
76
+ },
77
+ reports: {
78
+ type: "relation",
79
+ relation: "oneToMany",
80
+ target: "plugin::comments.comment-report",
81
+ mappedBy: "related",
82
+ configurable: false,
83
+ },
84
+ threadOf: {
85
+ type: "relation",
86
+ relation: "oneToOne",
87
+ target: "plugin::comments.comment",
88
+ configurable: false,
89
+ },
40
90
  },
41
- blockReason: {
42
- type: 'string',
43
- configurable: false
44
- },
45
- authorUser: {
46
- type: 'relation',
47
- relation: 'oneToOne',
48
- target: 'plugin::users-permissions.user',
49
- configurable: false,
50
- },
51
- authorId: {
52
- type: 'string',
53
- configurable: false
54
- },
55
- authorName: {
56
- type: 'string',
57
- configurable: false
58
- },
59
- authorEmail: {
60
- type: 'email',
61
- configurable: false
62
- },
63
- authorAvatar: {
64
- type: 'string',
65
- configurable: false
66
- },
67
- removed: {
68
- type: 'boolean',
69
- configurable: false
70
- },
71
- approvalStatus: {
72
- type: 'string',
73
- configurable: false
74
- },
75
- related: {
76
- type: 'string',
77
- configurable: false
78
- },
79
- reports: {
80
- type: 'relation',
81
- relation: 'oneToMany',
82
- target: 'plugin::comments.comment-report',
83
- mappedBy: 'related',
84
- configurable: false,
85
- },
86
- threadOf: {
87
- type: 'relation',
88
- relation: 'oneToOne',
89
- target: 'plugin::comments.comment',
90
- configurable: false,
91
- },
92
- },
93
91
  };
92
+ //# sourceMappingURL=comment.js.map