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,94 +1,100 @@
1
- import { prefixPluginTranslations } from '@strapi/helper-plugin';
2
- import pluginPkg from '../../package.json';
3
- import pluginId from './pluginId';
4
- import Initializer from './components/Initializer';
5
- import PluginIcon from './components/PluginIcon';
6
- import pluginPermissions from './permissions';
7
- import reducers from './reducers';
8
-
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ const helper_plugin_1 = require("@strapi/helper-plugin");
30
+ const pluginPkg = __importStar(require("../../package.json"));
31
+ const pluginId_1 = require("./pluginId");
32
+ const Initializer_1 = __importDefault(require("./components/Initializer"));
33
+ const PluginIcon_1 = __importDefault(require("./components/PluginIcon"));
34
+ const permissions_1 = __importDefault(require("./permissions"));
35
+ const reducers_1 = __importDefault(require("./reducers"));
9
36
  const { name, displayName } = pluginPkg.strapi;
10
-
11
- export default {
12
- register(app) {
13
- app.addMenuLink({
14
- to: `/plugins/${pluginId}/discover`,
15
- badgeContent: 1,
16
- icon: PluginIcon,
17
- intlLabel: {
18
- id: `${pluginId}.plugin.name`,
19
- defaultMessage: displayName,
20
- },
21
- Component: async () => {
22
- const component = await import(/* webpackChunkName: "[request]" */ './pages/App');
23
-
24
- return component;
25
- },
26
- permissions: pluginPermissions.access,
27
- });
28
-
29
- app.createSettingSection(
30
- {
31
- id: pluginId,
32
- intlLabel: {
33
- id: `${pluginId}.plugin.section`,
34
- defaultMessage: `${displayName} plugin`,
35
- },
36
- },
37
- [
38
- {
39
- intlLabel: {
40
- id: `${pluginId}.plugin.section.item`,
41
- defaultMessage: 'Configuration',
42
- },
43
- id: 'comments',
44
- to: `/settings/${pluginId}`,
45
- Component: async () => {
46
- const component = await import(
47
- /* webpackChunkName: "documentation-settings" */ './pages/Settings'
48
- );
49
-
50
- return component;
51
- },
52
- permissions: pluginPermissions.settings,
53
- },
54
- ]
55
- );
56
-
57
- app.addReducers(reducers);
58
- app.registerPlugin({
59
- id: pluginId,
60
- initializer: Initializer,
61
- isReady: false,
62
- name,
63
- });
64
- },
65
-
66
- bootstrap(app) {
67
- // app.injectContentManagerComponent('editView', 'informations', {
68
- // name: 'comments-link',
69
- // Component: () => 'TODO: Comments count',
70
- // });
71
- },
72
-
73
- async registerTrads({ locales }) {
74
- const importedTrads = await Promise.all(
75
- locales.map(locale => {
76
- return import(`./translations/${locale}.json`)
77
- .then(({ default: data }) => {
78
- return {
79
- data: prefixPluginTranslations(data, pluginId),
80
- locale,
81
- };
82
- })
83
- .catch(() => {
84
- return {
85
- data: {},
86
- locale,
87
- };
88
- });
89
- })
90
- );
91
-
92
- return Promise.resolve(importedTrads);
93
- },
37
+ exports.default = {
38
+ register(app) {
39
+ app.addMenuLink({
40
+ to: `/plugins/${pluginId_1.pluginId}/discover`,
41
+ badgeContent: 1,
42
+ icon: PluginIcon_1.default,
43
+ intlLabel: {
44
+ id: `${pluginId_1.pluginId}.plugin.name`,
45
+ defaultMessage: displayName,
46
+ },
47
+ Component: async () => {
48
+ const component = await Promise.resolve().then(() => __importStar(require("./pages/App")));
49
+ return component;
50
+ },
51
+ permissions: permissions_1.default.access,
52
+ });
53
+ app.createSettingSection({
54
+ id: pluginId_1.pluginId,
55
+ intlLabel: {
56
+ id: `${pluginId_1.pluginId}.plugin.section`,
57
+ defaultMessage: `${displayName} plugin`,
58
+ },
59
+ }, [
60
+ {
61
+ intlLabel: {
62
+ id: `${pluginId_1.pluginId}.plugin.section.item`,
63
+ defaultMessage: "Configuration",
64
+ },
65
+ id: "comments",
66
+ to: `/settings/${pluginId_1.pluginId}`,
67
+ Component: async () => {
68
+ const component = await Promise.resolve().then(() => __importStar(require("./pages/Settings")));
69
+ return component;
70
+ },
71
+ permissions: permissions_1.default.settings,
72
+ },
73
+ ]);
74
+ app.addReducers(reducers_1.default);
75
+ app.registerPlugin({
76
+ id: pluginId_1.pluginId,
77
+ initializer: Initializer_1.default,
78
+ isReady: false,
79
+ name,
80
+ });
81
+ },
82
+ async registerTrads({ locales }) {
83
+ const importedTrads = await Promise.all(locales.map((locale) => {
84
+ return Promise.resolve().then(() => __importStar(require(`./translations/${locale}.json`))).then(({ default: data }) => {
85
+ return {
86
+ data: (0, helper_plugin_1.prefixPluginTranslations)(data, pluginId_1.pluginId),
87
+ locale,
88
+ };
89
+ })
90
+ .catch(() => {
91
+ return {
92
+ data: {},
93
+ locale,
94
+ };
95
+ });
96
+ }));
97
+ return Promise.resolve(importedTrads);
98
+ },
94
99
  };
100
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,4 @@
1
+ export declare function mapDispatchToProps(dispatch: any): any;
2
+ declare const _default: any;
3
+ export default _default;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -1,71 +1,47 @@
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 from 'react';
9
- import { connect } from 'react-redux';
10
- import { bindActionCreators, compose } from 'redux';
11
- import { Switch, Route } from 'react-router-dom';
12
- import { useQuery } from 'react-query';
13
- import {
14
- NotFound,
15
- LoadingIndicatorPage,
16
- useNotification } from '@strapi/helper-plugin';
17
-
18
- import ComingSoonPage from '../ComingSoonPage';
19
- import getUrl from '../../utils/getUrl';
20
- import Discover from '../Discover';
21
- import Details from '../Details';
22
- import { fetchConfig } from './utils/api';
23
- import { setConfig } from './reducer/actions';
24
- import makeAppView from './reducer/selectors';
25
-
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.mapDispatchToProps = void 0;
7
+ const react_1 = __importDefault(require("react"));
8
+ const react_redux_1 = require("react-redux");
9
+ const redux_1 = require("redux");
10
+ const react_router_dom_1 = require("react-router-dom");
11
+ const react_query_1 = require("react-query");
12
+ const helper_plugin_1 = require("@strapi/helper-plugin");
13
+ const ComingSoonPage_1 = __importDefault(require("../ComingSoonPage"));
14
+ const getUrl_1 = __importDefault(require("../../utils/getUrl"));
15
+ const Discover_1 = __importDefault(require("../Discover"));
16
+ const Details_1 = __importDefault(require("../Details"));
17
+ const api_1 = require("./utils/api");
18
+ const actions_1 = require("./reducer/actions");
19
+ const selectors_1 = __importDefault(require("./reducer/selectors"));
26
20
  const App = ({ setConfig }) => {
27
-
28
- const toggleNotification = useNotification();
29
-
30
- const { isLoading, isFetching } = useQuery(
31
- 'get-config', () => fetchConfig(toggleNotification),
32
- {
33
- initialData: { },
34
- onSuccess: (response) => {
35
- setConfig(response);
36
- }
21
+ const toggleNotification = (0, helper_plugin_1.useNotification)();
22
+ const { isLoading, isFetching } = (0, react_query_1.useQuery)("get-config", () => (0, api_1.fetchConfig)(toggleNotification), {
23
+ initialData: {},
24
+ onSuccess: (response) => {
25
+ setConfig(response);
26
+ },
27
+ });
28
+ if (isLoading || isFetching) {
29
+ return react_1.default.createElement(helper_plugin_1.LoadingIndicatorPage, null);
37
30
  }
38
- );
39
-
40
- if (isLoading || isFetching) {
41
- return (<LoadingIndicatorPage />)
42
- }
43
-
44
- return (
45
- <div>
46
- <Switch>
47
- <Route path={ getUrl('dashboard') } component={ComingSoonPage} exact />
48
- <Route path={ getUrl('discover') } component={Discover} exact />
49
- <Route path={ getUrl('discover/:id') } component={Details} exact />
50
- <Route path={ getUrl('reports') } component={ComingSoonPage} exact />
51
- <Route path={ getUrl('settings') } component={ComingSoonPage} exact />
52
- <Route component={NotFound} />
53
- </Switch>
54
- </div>
55
- );
31
+ return (react_1.default.createElement("div", null,
32
+ react_1.default.createElement(react_router_dom_1.Switch, null,
33
+ react_1.default.createElement(react_router_dom_1.Route, { path: (0, getUrl_1.default)("dashboard"), component: ComingSoonPage_1.default, exact: true }),
34
+ react_1.default.createElement(react_router_dom_1.Route, { path: (0, getUrl_1.default)("discover"), component: Discover_1.default, exact: true }),
35
+ react_1.default.createElement(react_router_dom_1.Route, { path: (0, getUrl_1.default)("discover/:id"), component: Details_1.default, exact: true }),
36
+ react_1.default.createElement(react_router_dom_1.Route, { path: (0, getUrl_1.default)("reports"), component: ComingSoonPage_1.default, exact: true }),
37
+ react_1.default.createElement(react_router_dom_1.Route, { path: (0, getUrl_1.default)("settings"), component: ComingSoonPage_1.default, exact: true }),
38
+ react_1.default.createElement(react_router_dom_1.Route, { component: helper_plugin_1.NotFound }))));
56
39
  };
57
-
58
- const mapStateToProps = makeAppView();
59
-
60
- export function mapDispatchToProps(dispatch) {
61
- return bindActionCreators(
62
- { setConfig },
63
- dispatch
64
- );
40
+ const mapStateToProps = (0, selectors_1.default)();
41
+ function mapDispatchToProps(dispatch) {
42
+ return (0, redux_1.bindActionCreators)({ setConfig: actions_1.setConfig }, dispatch);
65
43
  }
66
- const withConnect = connect(
67
- mapStateToProps,
68
- mapDispatchToProps
69
- );
70
-
71
- export default compose(withConnect)(App);
44
+ exports.mapDispatchToProps = mapDispatchToProps;
45
+ const withConnect = (0, react_redux_1.connect)(mapStateToProps, mapDispatchToProps);
46
+ exports.default = (0, redux_1.compose)(withConnect)(App);
47
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,8 @@
1
+ export declare const setConfig: (data: any) => {
2
+ data: any;
3
+ type: string;
4
+ };
5
+ export declare const getConfig: () => {
6
+ type: string;
7
+ };
8
+ //# sourceMappingURL=actions.d.ts.map
@@ -1,8 +1,12 @@
1
- import { GET_CONFIG, SET_CONFIG } from "./constants";
2
-
3
- export const setConfig = data => ({
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getConfig = exports.setConfig = void 0;
4
+ const constants_1 = require("./constants");
5
+ const setConfig = (data) => ({
4
6
  data,
5
- type: SET_CONFIG,
6
- });
7
-
8
- export const getConfig = () => ({ type: GET_CONFIG });
7
+ type: constants_1.SET_CONFIG,
8
+ });
9
+ exports.setConfig = setConfig;
10
+ const getConfig = () => ({ type: constants_1.GET_CONFIG });
11
+ exports.getConfig = getConfig;
12
+ //# sourceMappingURL=actions.js.map
@@ -0,0 +1,4 @@
1
+ export declare const REDUCER_NAME = "plugin-comments_app";
2
+ export declare const SET_CONFIG = "SET_CONFIG";
3
+ export declare const GET_CONFIG = "GET_CONFIG";
4
+ //# sourceMappingURL=constants.d.ts.map
@@ -1,4 +1,7 @@
1
- export const REDUCER_NAME = 'plugin-comments_app';
2
-
3
- export const SET_CONFIG = 'SET_CONFIG';
4
- export const GET_CONFIG = 'GET_CONFIG';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GET_CONFIG = exports.SET_CONFIG = exports.REDUCER_NAME = void 0;
4
+ exports.REDUCER_NAME = "plugin-comments_app";
5
+ exports.SET_CONFIG = "SET_CONFIG";
6
+ exports.GET_CONFIG = "GET_CONFIG";
7
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1,9 @@
1
+ declare const initialState: {
2
+ config: {};
3
+ };
4
+ declare const reducer: (state: {
5
+ config: {};
6
+ } | undefined, action: any) => any;
7
+ export default reducer;
8
+ export { initialState };
9
+ //# sourceMappingURL=index.d.ts.map
@@ -1,26 +1,28 @@
1
- import produce from 'immer'; // current
2
- import { set } from 'lodash';
3
- import { GET_CONFIG, SET_CONFIG } from './constants';
4
-
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.initialState = void 0;
7
+ const immer_1 = __importDefault(require("immer"));
8
+ const lodash_1 = require("lodash");
9
+ const constants_1 = require("./constants");
5
10
  const initialState = {
6
- config: {},
11
+ config: {},
7
12
  };
8
-
9
- const reducer = (state = initialState, action) =>
10
- // eslint-disable-next-line consistent-return
11
- produce(state, draftState => {
13
+ exports.initialState = initialState;
14
+ const reducer = (state = initialState, action) => (0, immer_1.default)(state, (draftState) => {
12
15
  switch (action.type) {
13
- case SET_CONFIG: {
14
- set(draftState, 'config', action.data);
15
- break;
16
- }
17
- case GET_CONFIG: {
18
- return draftState?.config;
19
- }
20
- default:
21
- return draftState;
16
+ case constants_1.SET_CONFIG: {
17
+ (0, lodash_1.set)(draftState, "config", action.data);
18
+ break;
19
+ }
20
+ case constants_1.GET_CONFIG: {
21
+ return draftState?.config;
22
+ }
23
+ default:
24
+ return draftState;
22
25
  }
23
- });
24
-
25
- export default reducer;
26
- export { initialState };
26
+ });
27
+ exports.default = reducer;
28
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,3 @@
1
+ declare const initReducer: (initialState: any) => any;
2
+ export default initReducer;
3
+ //# sourceMappingURL=init.d.ts.map
@@ -1,7 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
1
3
  const initReducer = (initialState) => {
2
4
  return {
3
- ...initialState,
5
+ ...initialState,
4
6
  };
5
- };
6
-
7
- export default initReducer;
7
+ };
8
+ exports.default = initReducer;
9
+ //# sourceMappingURL=init.js.map
@@ -0,0 +1,6 @@
1
+ declare const appView: () => (state: any) => any;
2
+ declare const makeAppView: () => any;
3
+ declare const selectConfig: (state: any) => any;
4
+ export default makeAppView;
5
+ export { appView, selectConfig };
6
+ //# sourceMappingURL=selectors.d.ts.map
@@ -1,35 +1,18 @@
1
-
2
-
3
- import { createSelector } from 'reselect';
4
- import { initialState } from './';
5
- import { REDUCER_NAME } from './constants';
6
-
7
- /**
8
- * Direct selector to the listView state domain
9
- */
10
- const appView = () => state => state[REDUCER_NAME] || initialState;
11
-
12
- /**
13
- * Other specific selectors
14
- */
15
-
16
- /**
17
- * Default selector used by listView
18
- */
19
-
20
- const makeAppView = () =>
21
- createSelector(
22
- appView(),
23
- substate => {
24
- return substate;
25
- }
26
- );
27
-
28
- const selectConfig = state => {
29
- const { config } = state;
30
-
31
- return config;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.selectConfig = exports.appView = void 0;
4
+ const reselect_1 = require("reselect");
5
+ const _1 = require("./");
6
+ const constants_1 = require("./constants");
7
+ const appView = () => (state) => state[constants_1.REDUCER_NAME] || _1.initialState;
8
+ exports.appView = appView;
9
+ const makeAppView = () => (0, reselect_1.createSelector)(appView(), (substate) => {
10
+ return substate;
11
+ });
12
+ const selectConfig = (state) => {
13
+ const { config } = state;
14
+ return config;
32
15
  };
33
-
34
- export default makeAppView;
35
- export { appView, selectConfig };
16
+ exports.selectConfig = selectConfig;
17
+ exports.default = makeAppView;
18
+ //# sourceMappingURL=selectors.js.map
@@ -0,0 +1,2 @@
1
+ export declare const fetchConfig: (toggleNotification: any) => Promise<any>;
2
+ //# sourceMappingURL=api.d.ts.map
@@ -1,12 +1,15 @@
1
- import { getApiURL, axiosInstance, handleAPIError } from '../../../utils';
2
-
3
- // eslint-disable-next-line import/prefer-default-export
4
- export const fetchConfig = async (toggleNotification) => {
5
- try {
6
- const { data } = await axiosInstance.get(getApiURL(`moderate/config`));
7
-
8
- return data;
9
- } catch (err) {
10
- handleAPIError(err, toggleNotification);
11
- }
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fetchConfig = void 0;
4
+ const utils_1 = require("../../../utils");
5
+ const fetchConfig = async (toggleNotification) => {
6
+ try {
7
+ const { data } = await utils_1.axiosInstance.get((0, utils_1.getApiURL)(`moderate/config`));
8
+ return data;
9
+ }
10
+ catch (err) {
11
+ (0, utils_1.handleAPIError)(err, toggleNotification);
12
+ }
12
13
  };
14
+ exports.fetchConfig = fetchConfig;
15
+ //# sourceMappingURL=api.js.map
@@ -0,0 +1,3 @@
1
+ declare const _default: any;
2
+ export default _default;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -1,25 +1,43 @@
1
- /*
2
- *
3
- * Coming soon page
4
- *
5
- */
6
-
7
- import React, { memo } from 'react';
8
- import { Box } from '@strapi/design-system/Box';
9
- import { EmptyStateLayout } from '@strapi/design-system/EmptyStateLayout';
10
- import { Layout } from '@strapi/design-system/Layout';
11
- import { Illo } from '@strapi/icons';
12
- import getMessage from '../../utils/getMessage';
13
- import Nav from '../../components/Nav';
14
-
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ const react_1 = __importStar(require("react"));
30
+ const Box_1 = require("@strapi/design-system/Box");
31
+ const EmptyStateLayout_1 = require("@strapi/design-system/EmptyStateLayout");
32
+ const Layout_1 = require("@strapi/design-system/Layout");
33
+ const icons_1 = require("@strapi/icons");
34
+ const getMessage_1 = __importDefault(require("../../utils/getMessage"));
35
+ const Nav_1 = __importDefault(require("../../components/Nav"));
15
36
  const ComingSoonPage = () => {
16
- return (<Box background="neutral100">
17
- <Layout sideNav={<Nav />}>
18
- <Box padding={8} background="neutral100">
19
- <EmptyStateLayout icon={<Illo />} content={getMessage('page.coming.soon')} />
20
- </Box>
21
- </Layout>
22
- </Box>);
23
- }
24
-
25
- export default memo(ComingSoonPage);
37
+ return (react_1.default.createElement(Box_1.Box, { background: "neutral100" },
38
+ react_1.default.createElement(Layout_1.Layout, { sideNav: react_1.default.createElement(Nav_1.default, null) },
39
+ react_1.default.createElement(Box_1.Box, { padding: 8, background: "neutral100" },
40
+ react_1.default.createElement(EmptyStateLayout_1.EmptyStateLayout, { icon: react_1.default.createElement(icons_1.Illo, null), content: (0, getMessage_1.default)("page.coming.soon") })))));
41
+ };
42
+ exports.default = (0, react_1.memo)(ComingSoonPage);
43
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,18 @@
1
+ declare const DetailsEntity: {
2
+ ({ data, schema, config, filters, onFiltersChange, }: {
3
+ data?: {} | undefined;
4
+ schema?: {} | undefined;
5
+ config?: {} | undefined;
6
+ filters: any;
7
+ onFiltersChange: any;
8
+ }): any;
9
+ propTypes: {
10
+ data: any;
11
+ schema: any;
12
+ config: any;
13
+ filters: any;
14
+ onFiltersChange: any;
15
+ };
16
+ };
17
+ export default DetailsEntity;
18
+ //# sourceMappingURL=index.d.ts.map