strapi-plugin-comments 2.0.10 → 2.0.11

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 (261) hide show
  1. package/README.md +39 -5
  2. package/admin/src/translations/fr.json +132 -1
  3. package/build/README.md +818 -0
  4. package/build/admin/src/components/ActionButton/styles.d.ts +2 -0
  5. package/build/admin/src/components/ActionButton/styles.js +17 -0
  6. package/build/admin/src/components/ConfirmationDialog/index.d.ts +26 -0
  7. package/build/admin/src/components/ConfirmationDialog/index.js +104 -0
  8. package/build/admin/src/components/DiscussionStatus/index.d.ts +9 -0
  9. package/build/admin/src/components/DiscussionStatus/index.js +38 -0
  10. package/build/admin/src/components/DiscussionThread/index.d.ts +16 -0
  11. package/build/admin/src/components/DiscussionThread/index.js +99 -0
  12. package/build/admin/src/components/DiscussionThreadItem/index.d.ts +9 -0
  13. package/build/admin/src/components/DiscussionThreadItem/index.js +72 -0
  14. package/build/admin/src/components/DiscussionThreadItem/styles.d.ts +4 -0
  15. package/build/admin/src/components/DiscussionThreadItem/styles.js +27 -0
  16. package/build/admin/src/components/DiscussionThreadItemActions/index.d.ts +19 -0
  17. package/build/admin/src/components/DiscussionThreadItemActions/index.js +414 -0
  18. package/build/admin/src/components/DiscussionThreadItemActions/styles.d.ts +2 -0
  19. package/build/admin/src/components/DiscussionThreadItemActions/styles.js +17 -0
  20. package/build/admin/src/components/DiscussionThreadItemApprovalFlowActions/index.d.ts +17 -0
  21. package/build/admin/src/components/DiscussionThreadItemApprovalFlowActions/index.js +103 -0
  22. package/build/admin/src/components/DiscussionThreadItemApprovalFlowActions/styles.d.ts +2 -0
  23. package/build/admin/src/components/DiscussionThreadItemApprovalFlowActions/styles.js +15 -0
  24. package/build/admin/src/components/DiscussionThreadItemFooter/index.d.ts +16 -0
  25. package/build/admin/src/components/DiscussionThreadItemFooter/index.js +73 -0
  26. package/build/admin/src/components/DiscussionThreadItemFooter/styles.d.ts +3 -0
  27. package/build/admin/src/components/DiscussionThreadItemFooter/styles.js +25 -0
  28. package/build/admin/src/components/DiscussionThreadItemReviewAction/index.d.ts +30 -0
  29. package/build/admin/src/components/DiscussionThreadItemReviewAction/index.js +233 -0
  30. package/build/admin/src/components/FormSwitch/index.d.ts +11 -0
  31. package/build/admin/src/components/FormSwitch/index.js +39 -0
  32. package/build/admin/src/components/FormSwitch/styles.d.ts +2 -0
  33. package/build/admin/src/components/FormSwitch/styles.js +16 -0
  34. package/build/admin/src/components/IconButton/styles.d.ts +2 -0
  35. package/build/admin/src/components/IconButton/styles.js +27 -0
  36. package/build/admin/src/components/Initializer/index.d.ts +3 -0
  37. package/build/admin/src/components/Initializer/index.js +14 -0
  38. package/build/admin/src/components/LoadingIndicatorOverlay/index.d.ts +3 -0
  39. package/build/admin/src/components/LoadingIndicatorOverlay/index.js +18 -0
  40. package/build/admin/src/components/LoadingIndicatorOverlay/styles.d.ts +3 -0
  41. package/build/admin/src/components/LoadingIndicatorOverlay/styles.js +32 -0
  42. package/build/admin/src/components/Nav/index.d.ts +7 -0
  43. package/build/admin/src/components/Nav/index.js +72 -0
  44. package/build/admin/src/components/PluginIcon/index.d.ts +3 -0
  45. package/build/admin/src/components/PluginIcon/index.js +13 -0
  46. package/build/admin/src/components/ReportsReviewModal/index.d.ts +21 -0
  47. package/build/admin/src/components/ReportsReviewModal/index.js +72 -0
  48. package/build/admin/src/components/ReportsReviewTable/index.d.ts +21 -0
  49. package/build/admin/src/components/ReportsReviewTable/index.js +321 -0
  50. package/build/admin/src/components/StatusBadge/index.d.ts +11 -0
  51. package/build/admin/src/components/StatusBadge/index.js +22 -0
  52. package/build/admin/src/components/StatusBadge/styles.d.ts +2 -0
  53. package/build/admin/src/components/StatusBadge/styles.js +25 -0
  54. package/build/admin/src/components/TableFilters/index.d.ts +10 -0
  55. package/build/admin/src/components/TableFilters/index.js +109 -0
  56. package/build/admin/src/components/TablePagination/index.d.ts +15 -0
  57. package/build/admin/src/components/TablePagination/index.js +45 -0
  58. package/build/admin/src/components/icons/comments.d.ts +9 -0
  59. package/build/admin/src/components/icons/comments.js +23 -0
  60. package/build/admin/src/components/icons/index.d.ts +6 -0
  61. package/build/admin/src/components/icons/index.js +21 -0
  62. package/build/admin/src/components/icons/lock.d.ts +11 -0
  63. package/build/admin/src/components/icons/lock.js +29 -0
  64. package/build/admin/src/components/icons/review.d.ts +11 -0
  65. package/build/admin/src/components/icons/review.js +31 -0
  66. package/build/admin/src/components/icons/unlock.d.ts +11 -0
  67. package/build/admin/src/components/icons/unlock.js +29 -0
  68. package/build/admin/src/hooks/useConfig.d.ts +8 -0
  69. package/build/admin/src/hooks/useConfig.js +52 -0
  70. package/build/admin/src/index.d.ts +7 -0
  71. package/build/admin/src/index.js +137 -0
  72. package/build/admin/src/pages/App/index.d.ts +4 -0
  73. package/build/admin/src/pages/App/index.js +90 -0
  74. package/build/admin/src/pages/App/reducer/actions.d.ts +8 -0
  75. package/build/admin/src/pages/App/reducer/actions.js +12 -0
  76. package/build/admin/src/pages/App/reducer/constants.d.ts +4 -0
  77. package/build/admin/src/pages/App/reducer/constants.js +7 -0
  78. package/build/admin/src/pages/App/reducer/index.d.ts +14 -0
  79. package/build/admin/src/pages/App/reducer/index.js +31 -0
  80. package/build/admin/src/pages/App/reducer/init.d.ts +3 -0
  81. package/build/admin/src/pages/App/reducer/init.js +9 -0
  82. package/build/admin/src/pages/App/reducer/selectors.d.ts +6 -0
  83. package/build/admin/src/pages/App/reducer/selectors.js +20 -0
  84. package/build/admin/src/pages/App/utils/api.d.ts +2 -0
  85. package/build/admin/src/pages/App/utils/api.js +16 -0
  86. package/build/admin/src/pages/ComingSoonPage/index.d.ts +3 -0
  87. package/build/admin/src/pages/ComingSoonPage/index.js +78 -0
  88. package/build/admin/src/pages/Details/components/DetailsEntity/index.d.ts +18 -0
  89. package/build/admin/src/pages/Details/components/DetailsEntity/index.js +132 -0
  90. package/build/admin/src/pages/Details/components/DetailsFilters/index.d.ts +12 -0
  91. package/build/admin/src/pages/Details/components/DetailsFilters/index.js +48 -0
  92. package/build/admin/src/pages/Details/components/DetailsFilters/styles.d.ts +2 -0
  93. package/build/admin/src/pages/Details/components/DetailsFilters/styles.js +16 -0
  94. package/build/admin/src/pages/Details/index.d.ts +4 -0
  95. package/build/admin/src/pages/Details/index.js +216 -0
  96. package/build/admin/src/pages/Discover/components/DiscoverTableRow/index.d.ts +20 -0
  97. package/build/admin/src/pages/Discover/components/DiscoverTableRow/index.js +344 -0
  98. package/build/admin/src/pages/Discover/components/DiscoverTableRow/styles.d.ts +2 -0
  99. package/build/admin/src/pages/Discover/components/DiscoverTableRow/styles.js +16 -0
  100. package/build/admin/src/pages/Discover/index.d.ts +4 -0
  101. package/build/admin/src/pages/Discover/index.js +332 -0
  102. package/build/admin/src/pages/Discover/utils/api.d.ts +2 -0
  103. package/build/admin/src/pages/Discover/utils/api.js +23 -0
  104. package/build/admin/src/pages/Discover/utils/filtersSchema.d.ts +11 -0
  105. package/build/admin/src/pages/Discover/utils/filtersSchema.js +11 -0
  106. package/build/admin/src/pages/Settings/components/RestartAlert/styles.d.ts +2 -0
  107. package/build/admin/src/pages/Settings/components/RestartAlert/styles.js +16 -0
  108. package/build/admin/src/pages/Settings/index.d.ts +3 -0
  109. package/build/admin/src/pages/Settings/index.js +712 -0
  110. package/build/admin/src/pages/Settings/utils/api.d.ts +7 -0
  111. package/build/admin/src/pages/Settings/utils/api.js +80 -0
  112. package/build/admin/src/pages/utils/api.d.ts +12 -0
  113. package/build/admin/src/pages/utils/api.js +83 -0
  114. package/build/admin/src/permissions.d.ts +28 -0
  115. package/build/admin/src/permissions.js +65 -0
  116. package/build/admin/src/pluginId.d.ts +2 -0
  117. package/build/admin/src/pluginId.js +50 -0
  118. package/build/admin/src/reducers.d.ts +12 -0
  119. package/build/admin/src/reducers.js +14 -0
  120. package/build/admin/src/translations/en.json +132 -0
  121. package/build/admin/src/translations/fr.json +1 -0
  122. package/build/admin/src/translations/pt-BR.json +132 -0
  123. package/build/admin/src/utils/axiosInstance.d.ts +3 -0
  124. package/build/admin/src/utils/axiosInstance.js +37 -0
  125. package/build/admin/src/utils/constants.d.ts +25 -0
  126. package/build/admin/src/utils/constants.js +30 -0
  127. package/build/admin/src/utils/getApiUrl.d.ts +3 -0
  128. package/build/admin/src/utils/getApiUrl.js +6 -0
  129. package/build/admin/src/utils/getMessage.d.ts +4 -0
  130. package/build/admin/src/utils/getMessage.js +25 -0
  131. package/build/admin/src/utils/getRelatedGroups.d.ts +4 -0
  132. package/build/admin/src/utils/getRelatedGroups.js +6 -0
  133. package/build/admin/src/utils/getUrl.d.ts +3 -0
  134. package/build/admin/src/utils/getUrl.js +6 -0
  135. package/build/admin/src/utils/handleAPIError.d.ts +4 -0
  136. package/build/admin/src/utils/handleAPIError.js +20 -0
  137. package/build/admin/src/utils/index.d.ts +12 -0
  138. package/build/admin/src/utils/index.js +97 -0
  139. package/build/admin/src/utils/parseRegExp.d.ts +6 -0
  140. package/build/admin/src/utils/parseRegExp.js +11 -0
  141. package/build/admin/src/utils/renderEntryTitle.d.ts +4 -0
  142. package/build/admin/src/utils/renderEntryTitle.js +16 -0
  143. package/build/admin/src/utils/renderInitials.d.ts +3 -0
  144. package/build/admin/src/utils/renderInitials.js +11 -0
  145. package/build/admin/src/utils/resolveCommentStatus.d.ts +4 -0
  146. package/build/admin/src/utils/resolveCommentStatus.js +32 -0
  147. package/build/admin/src/utils/resolveCommentStatusColor.d.ts +4 -0
  148. package/build/admin/src/utils/resolveCommentStatusColor.js +22 -0
  149. package/build/content-types/comment.d.ts +91 -0
  150. package/build/content-types/comment.js +92 -0
  151. package/build/content-types/index.d.ts +143 -0
  152. package/build/content-types/index.js +18 -0
  153. package/build/content-types/report.d.ts +48 -0
  154. package/build/content-types/report.js +49 -0
  155. package/build/package.json +94 -0
  156. package/build/permissions.d.ts +18 -0
  157. package/build/permissions.js +18 -0
  158. package/build/server/bootstrap.d.ts +4 -0
  159. package/build/server/bootstrap.js +65 -0
  160. package/build/server/config/index.d.ts +4 -0
  161. package/build/server/config/index.js +19 -0
  162. package/build/server/controllers/admin.d.ts +4 -0
  163. package/build/server/controllers/admin.js +124 -0
  164. package/build/server/controllers/client.d.ts +4 -0
  165. package/build/server/controllers/client.js +111 -0
  166. package/build/server/controllers/index.d.ts +6 -0
  167. package/build/server/controllers/index.js +15 -0
  168. package/build/server/controllers/utils/functions.d.ts +7 -0
  169. package/build/server/controllers/utils/functions.js +24 -0
  170. package/build/server/controllers/utils/parsers.d.ts +15 -0
  171. package/build/server/controllers/utils/parsers.js +25 -0
  172. package/build/server/destroy.d.ts +3 -0
  173. package/build/server/destroy.js +3 -0
  174. package/build/server/graphql/index.d.ts +4 -0
  175. package/build/server/graphql/index.js +37 -0
  176. package/build/server/graphql/mutations/createAbuseReport.d.ts +11 -0
  177. package/build/server/graphql/mutations/createAbuseReport.js +27 -0
  178. package/build/server/graphql/mutations/createComment.d.ts +14 -0
  179. package/build/server/graphql/mutations/createComment.js +26 -0
  180. package/build/server/graphql/mutations/index.d.ts +4 -0
  181. package/build/server/graphql/mutations/index.js +28 -0
  182. package/build/server/graphql/mutations/removeComment.d.ts +11 -0
  183. package/build/server/graphql/mutations/removeComment.js +27 -0
  184. package/build/server/graphql/mutations/updateComment.d.ts +11 -0
  185. package/build/server/graphql/mutations/updateComment.js +27 -0
  186. package/build/server/graphql/queries/findAllFlat.d.ts +19 -0
  187. package/build/server/graphql/queries/findAllFlat.js +47 -0
  188. package/build/server/graphql/queries/findAllInHierarchy.d.ts +18 -0
  189. package/build/server/graphql/queries/findAllInHierarchy.js +38 -0
  190. package/build/server/graphql/queries/index.d.ts +4 -0
  191. package/build/server/graphql/queries/index.js +24 -0
  192. package/build/server/graphql/resolvers-config.d.ts +23 -0
  193. package/build/server/graphql/resolvers-config.js +13 -0
  194. package/build/server/graphql/types/comment-author.d.ts +4 -0
  195. package/build/server/graphql/types/comment-author.js +12 -0
  196. package/build/server/graphql/types/comment-nested.d.ts +4 -0
  197. package/build/server/graphql/types/comment-nested.js +19 -0
  198. package/build/server/graphql/types/comment.d.ts +4 -0
  199. package/build/server/graphql/types/comment.js +18 -0
  200. package/build/server/graphql/types/create-comment-author.d.ts +4 -0
  201. package/build/server/graphql/types/create-comment-author.js +12 -0
  202. package/build/server/graphql/types/create-comment.d.ts +4 -0
  203. package/build/server/graphql/types/create-comment.js +12 -0
  204. package/build/server/graphql/types/create-report.d.ts +4 -0
  205. package/build/server/graphql/types/create-report.js +12 -0
  206. package/build/server/graphql/types/id.d.ts +4 -0
  207. package/build/server/graphql/types/id.js +26 -0
  208. package/build/server/graphql/types/identify-comment-author.d.ts +4 -0
  209. package/build/server/graphql/types/identify-comment-author.js +9 -0
  210. package/build/server/graphql/types/index.d.ts +4 -0
  211. package/build/server/graphql/types/index.js +44 -0
  212. package/build/server/graphql/types/remove-comment.d.ts +4 -0
  213. package/build/server/graphql/types/remove-comment.js +11 -0
  214. package/build/server/graphql/types/report-reason.d.ts +4 -0
  215. package/build/server/graphql/types/report-reason.js +12 -0
  216. package/build/server/graphql/types/report.d.ts +4 -0
  217. package/build/server/graphql/types/report.js +14 -0
  218. package/build/server/graphql/types/response-find-all.d.ts +4 -0
  219. package/build/server/graphql/types/response-find-all.js +10 -0
  220. package/build/server/graphql/types/response-meta.d.ts +4 -0
  221. package/build/server/graphql/types/response-meta.js +9 -0
  222. package/build/server/graphql/types/response-pagination.d.ts +4 -0
  223. package/build/server/graphql/types/response-pagination.js +14 -0
  224. package/build/server/graphql/types/update-comment.d.ts +4 -0
  225. package/build/server/graphql/types/update-comment.js +12 -0
  226. package/build/server/index.d.ts +26 -0
  227. package/build/server/index.js +25 -0
  228. package/build/server/register.d.ts +3 -0
  229. package/build/server/register.js +3 -0
  230. package/build/server/routes/admin.d.ts +4 -0
  231. package/build/server/routes/admin.js +118 -0
  232. package/build/server/routes/client.d.ts +4 -0
  233. package/build/server/routes/client.js +54 -0
  234. package/build/server/routes/index.d.ts +11 -0
  235. package/build/server/routes/index.js +21 -0
  236. package/build/server/services/admin.d.ts +5 -0
  237. package/build/server/services/admin.js +296 -0
  238. package/build/server/services/client.d.ts +5 -0
  239. package/build/server/services/client.js +247 -0
  240. package/build/server/services/common.d.ts +5 -0
  241. package/build/server/services/common.js +266 -0
  242. package/build/server/services/graphql.d.ts +5 -0
  243. package/build/server/services/graphql.js +136 -0
  244. package/build/server/services/index.d.ts +8 -0
  245. package/build/server/services/index.js +16 -0
  246. package/build/server/services/utils/functions.d.ts +13 -0
  247. package/build/server/services/utils/functions.js +141 -0
  248. package/build/server/utils/constants.d.ts +9 -0
  249. package/build/server/utils/constants.js +23 -0
  250. package/build/server/utils/error.d.ts +23 -0
  251. package/build/server/utils/error.js +29 -0
  252. package/build/server/utils/functions.d.ts +14 -0
  253. package/build/server/utils/functions.js +50 -0
  254. package/build/strapi-admin.d.ts +3 -0
  255. package/build/strapi-admin.js +10 -0
  256. package/build/strapi-server.d.ts +177 -0
  257. package/build/strapi-server.js +46 -0
  258. package/build/tsconfig.tsbuildinfo +1 -0
  259. package/build/types/contentTypes.d.ts +46 -0
  260. package/build/types/contentTypes.js +3 -0
  261. package/package.json +3 -3
@@ -0,0 +1,132 @@
1
+ "use strict";
2
+ var __importDefault =
3
+ (this && this.__importDefault) ||
4
+ function (mod) {
5
+ return mod && mod.__esModule ? mod : { default: mod };
6
+ };
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ const react_1 = __importDefault(require("react"));
9
+ const prop_types_1 = __importDefault(require("prop-types"));
10
+ const lodash_1 = require("lodash");
11
+ const Box_1 = require("@strapi/design-system/Box");
12
+ const Divider_1 = require("@strapi/design-system/Divider");
13
+ const Flex_1 = require("@strapi/design-system/Flex");
14
+ const Stack_1 = require("@strapi/design-system/Stack");
15
+ const Typography_1 = require("@strapi/design-system/Typography");
16
+ const utils_1 = require("../../../../utils");
17
+ const DetailsFilters_1 = __importDefault(require("../DetailsFilters"));
18
+ const DetailsEntity = ({
19
+ data = {},
20
+ schema = {},
21
+ config = {},
22
+ filters,
23
+ onFiltersChange,
24
+ }) => {
25
+ const { entryLabel = {} } = config;
26
+ const { attributes = {} } = schema;
27
+ const keys = Object.keys(attributes);
28
+ const entityLabelKey = (0, lodash_1.first)(entryLabel[data?.uid]);
29
+ const FIELDS_LIMIT = 5;
30
+ const itemKeys = (0, lodash_1.take)(
31
+ keys.filter(
32
+ (_) =>
33
+ attributes[_].type === "string" &&
34
+ !(0, lodash_1.isNil)(data[_]) &&
35
+ _ !== entityLabelKey
36
+ ),
37
+ FIELDS_LIMIT
38
+ );
39
+ const formatLabel = (label = "") =>
40
+ label
41
+ .split("_")
42
+ .map((_) => (0, lodash_1.capitalize)(_))
43
+ .join(" ");
44
+ const entityIsRenderable =
45
+ data &&
46
+ !(0, lodash_1.isEmpty)(data) &&
47
+ (!(0, lodash_1.isEmpty)(itemKeys) || data[entityLabelKey]);
48
+ return react_1.default.createElement(
49
+ Box_1.Box,
50
+ { padding: 4 },
51
+ entityIsRenderable &&
52
+ react_1.default.createElement(
53
+ Box_1.Box,
54
+ { marginBottom: 4 },
55
+ react_1.default.createElement(
56
+ Typography_1.Typography,
57
+ { variant: "sigma", textColor: "neutral600", id: "entity-details" },
58
+ (0, utils_1.getMessage)("page.details.panel.entity", "Details")
59
+ ),
60
+ react_1.default.createElement(
61
+ Box_1.Box,
62
+ { paddingTop: 2, paddingBottom: 4 },
63
+ react_1.default.createElement(Divider_1.Divider, null)
64
+ ),
65
+ react_1.default.createElement(
66
+ Stack_1.Stack,
67
+ { size: itemKeys.length },
68
+ react_1.default.createElement(
69
+ Flex_1.Flex,
70
+ { direction: "column", alignItems: "flex-start" },
71
+ react_1.default.createElement(
72
+ Typography_1.Typography,
73
+ { fontWeight: "bold" },
74
+ formatLabel(entityLabelKey)
75
+ ),
76
+ react_1.default.createElement(
77
+ Typography_1.Typography,
78
+ null,
79
+ data[entityLabelKey]
80
+ )
81
+ ),
82
+ itemKeys.map((_) =>
83
+ react_1.default.createElement(
84
+ Flex_1.Flex,
85
+ {
86
+ key: `prop_${_}`,
87
+ direction: "column",
88
+ alignItems: "flex-start",
89
+ },
90
+ react_1.default.createElement(
91
+ Typography_1.Typography,
92
+ { fontWeight: "bold" },
93
+ formatLabel(_)
94
+ ),
95
+ react_1.default.createElement(
96
+ Typography_1.Typography,
97
+ null,
98
+ data[_]
99
+ )
100
+ )
101
+ )
102
+ )
103
+ ),
104
+ react_1.default.createElement(
105
+ Box_1.Box,
106
+ null,
107
+ react_1.default.createElement(
108
+ Typography_1.Typography,
109
+ { variant: "sigma", textColor: "neutral600", id: "view-filters" },
110
+ (0, utils_1.getMessage)("page.details.filters.label", "View")
111
+ ),
112
+ react_1.default.createElement(
113
+ Box_1.Box,
114
+ { paddingTop: 2, paddingBottom: 4 },
115
+ react_1.default.createElement(Divider_1.Divider, null)
116
+ ),
117
+ react_1.default.createElement(DetailsFilters_1.default, {
118
+ data: filters,
119
+ onChange: onFiltersChange,
120
+ })
121
+ )
122
+ );
123
+ };
124
+ DetailsEntity.propTypes = {
125
+ data: prop_types_1.default.object.isRequired,
126
+ schema: prop_types_1.default.object.isRequired,
127
+ config: prop_types_1.default.object.isRequired,
128
+ filters: prop_types_1.default.object.isRequired,
129
+ onFiltersChange: prop_types_1.default.func.isRequired,
130
+ };
131
+ exports.default = DetailsEntity;
132
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,12 @@
1
+ declare const DetailsFilters: {
2
+ ({ data, onChange }: {
3
+ data: any;
4
+ onChange: any;
5
+ }): any;
6
+ propTypes: {
7
+ data: any;
8
+ onChange: any;
9
+ };
10
+ };
11
+ export default DetailsFilters;
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ var __importDefault =
3
+ (this && this.__importDefault) ||
4
+ function (mod) {
5
+ return mod && mod.__esModule ? mod : { default: mod };
6
+ };
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ const react_1 = __importDefault(require("react"));
9
+ const prop_types_1 = __importDefault(require("prop-types"));
10
+ const Box_1 = require("@strapi/design-system/Box");
11
+ const Flex_1 = require("@strapi/design-system/Flex");
12
+ const Stack_1 = require("@strapi/design-system/Stack");
13
+ const Checkbox_1 = require("@strapi/design-system/Checkbox");
14
+ const utils_1 = require("../../../../utils");
15
+ const DetailsFilters = ({ data, onChange }) => {
16
+ const { removed = false } = data;
17
+ const handleOnChange = (prop, value) =>
18
+ onChange({
19
+ ...data,
20
+ [prop]: !value ? undefined : value,
21
+ });
22
+ return react_1.default.createElement(
23
+ Box_1.Box,
24
+ { as: Flex_1.Flex },
25
+ react_1.default.createElement(
26
+ Stack_1.Stack,
27
+ { size: 2, vertical: true },
28
+ react_1.default.createElement(
29
+ Checkbox_1.Checkbox,
30
+ {
31
+ checked: removed,
32
+ onChange: () => handleOnChange("removed", !removed),
33
+ visibleLabels: true,
34
+ },
35
+ (0, utils_1.getMessage)(
36
+ "page.details.filters.removed.label",
37
+ "Show removed comments"
38
+ )
39
+ )
40
+ )
41
+ );
42
+ };
43
+ DetailsFilters.propTypes = {
44
+ data: prop_types_1.default.object.isRequired,
45
+ onChange: prop_types_1.default.func.isRequired,
46
+ };
47
+ exports.default = DetailsFilters;
48
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,2 @@
1
+ export declare const TableLink: any;
2
+ //# sourceMappingURL=styles.d.ts.map
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ var __importDefault =
3
+ (this && this.__importDefault) ||
4
+ function (mod) {
5
+ return mod && mod.__esModule ? mod : { default: mod };
6
+ };
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.TableLink = void 0;
9
+ const styled_components_1 = __importDefault(require("styled-components"));
10
+ const Link_1 = require("@strapi/design-system/Link");
11
+ exports.TableLink = (0, styled_components_1.default)(Link_1.Link)`
12
+ display: block;
13
+ text-overflow: ellipsis;
14
+ overflow: hidden;
15
+ `;
16
+ //# sourceMappingURL=styles.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
@@ -0,0 +1,216 @@
1
+ "use strict";
2
+ var __createBinding =
3
+ (this && this.__createBinding) ||
4
+ (Object.create
5
+ ? function (o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (
9
+ !desc ||
10
+ ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)
11
+ ) {
12
+ desc = {
13
+ enumerable: true,
14
+ get: function () {
15
+ return m[k];
16
+ },
17
+ };
18
+ }
19
+ Object.defineProperty(o, k2, desc);
20
+ }
21
+ : function (o, m, k, k2) {
22
+ if (k2 === undefined) k2 = k;
23
+ o[k2] = m[k];
24
+ });
25
+ var __setModuleDefault =
26
+ (this && this.__setModuleDefault) ||
27
+ (Object.create
28
+ ? function (o, v) {
29
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
30
+ }
31
+ : function (o, v) {
32
+ o["default"] = v;
33
+ });
34
+ var __importStar =
35
+ (this && this.__importStar) ||
36
+ function (mod) {
37
+ if (mod && mod.__esModule) return mod;
38
+ var result = {};
39
+ if (mod != null)
40
+ for (var k in mod)
41
+ if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
42
+ __createBinding(result, mod, k);
43
+ __setModuleDefault(result, mod);
44
+ return result;
45
+ };
46
+ var __importDefault =
47
+ (this && this.__importDefault) ||
48
+ function (mod) {
49
+ return mod && mod.__esModule ? mod : { default: mod };
50
+ };
51
+ Object.defineProperty(exports, "__esModule", { value: true });
52
+ exports.mapDispatchToProps = void 0;
53
+ const react_1 = __importStar(require("react"));
54
+ const react_redux_1 = require("react-redux");
55
+ const redux_1 = require("redux");
56
+ const react_fast_compare_1 = __importDefault(require("react-fast-compare"));
57
+ const react_query_1 = require("react-query");
58
+ const react_router_dom_1 = require("react-router-dom");
59
+ const Layout_1 = require("@strapi/design-system/Layout");
60
+ const Box_1 = require("@strapi/design-system/Box");
61
+ const Link_1 = require("@strapi/design-system/Link");
62
+ const LiveRegions_1 = require("@strapi/design-system/LiveRegions");
63
+ const icons_1 = require("@strapi/icons");
64
+ const lodash_1 = require("lodash");
65
+ const helper_plugin_1 = require("@strapi/helper-plugin");
66
+ const getMessage_1 = __importDefault(require("../../utils/getMessage"));
67
+ const api_1 = require("../utils/api");
68
+ const permissions_1 = __importDefault(require("../../permissions"));
69
+ const utils_1 = require("../../utils");
70
+ const DetailsEntity_1 = __importDefault(require("./components/DetailsEntity"));
71
+ const DiscussionThread_1 = __importDefault(
72
+ require("../../components/DiscussionThread")
73
+ );
74
+ const selectors_1 = __importDefault(require("../App/reducer/selectors"));
75
+ const Details = ({ config }) => {
76
+ (0, helper_plugin_1.useFocusWhenNavigate)();
77
+ const {
78
+ params: { id },
79
+ } = (0, react_router_dom_1.useRouteMatch)(
80
+ (0, utils_1.getUrl)(`discover/:id`)
81
+ );
82
+ const { notifyStatus } = (0, LiveRegions_1.useNotifyAT)();
83
+ const { trackUsage } = (0, helper_plugin_1.useTracking)();
84
+ const trackUsageRef = (0, react_1.useRef)(trackUsage);
85
+ const toggleNotification = (0, helper_plugin_1.useNotification)();
86
+ const viewPermissions = (0, react_1.useMemo)(
87
+ () => ({
88
+ access: permissions_1.default.access,
89
+ moderate: permissions_1.default.moderate,
90
+ accessReports: permissions_1.default.reports,
91
+ reviewReports: permissions_1.default.reportsReview,
92
+ }),
93
+ []
94
+ );
95
+ const {
96
+ isLoading: isLoadingForPermissions,
97
+ allowedActions: {
98
+ canAccess,
99
+ canModerate,
100
+ canAccessReports,
101
+ canReviewReports,
102
+ },
103
+ } = (0, helper_plugin_1.useRBAC)(viewPermissions);
104
+ const [filters, setFilters] = (0, react_1.useState)({});
105
+ const regexUID = new RegExp(
106
+ (0, utils_1.parseRegExp)(config.regex.uid).value,
107
+ (0, utils_1.parseRegExp)(config.regex.uid).flags
108
+ );
109
+ const {
110
+ isLoading: isLoadingForData,
111
+ data,
112
+ isFetching,
113
+ } = (0, react_query_1.useQuery)(
114
+ ["get-details-data", id, filters, canAccess],
115
+ () => (0, api_1.fetchDetailsData)(id, filters, toggleNotification),
116
+ {
117
+ initialData: {},
118
+ }
119
+ );
120
+ const { entity, level, selected } = data;
121
+ const entityUidValid = entity?.uid && regexUID.test(entity.uid);
122
+ const { data: contentTypeData } = (0, react_query_1.useQuery)(
123
+ ["get-additional-data", entity?.uid, canAccess],
124
+ () => (0, api_1.fetchContentTypeData)(entity?.uid, toggleNotification),
125
+ {
126
+ enabled: !!entity?.uid,
127
+ suspense: !entityUidValid,
128
+ }
129
+ );
130
+ const handleChangeFilters = (props) => setFilters(props);
131
+ const isLoading = isLoadingForData || isFetching;
132
+ if (canAccess) {
133
+ return react_1.default.createElement(
134
+ Box_1.Box,
135
+ { background: "neutral100" },
136
+ react_1.default.createElement(
137
+ Layout_1.Layout,
138
+ null,
139
+ (isLoading || isLoadingForPermissions) && (0, lodash_1.isEmpty)(data)
140
+ ? react_1.default.createElement(
141
+ helper_plugin_1.LoadingIndicatorPage,
142
+ null
143
+ )
144
+ : react_1.default.createElement(
145
+ react_1.default.Fragment,
146
+ null,
147
+ react_1.default.createElement(Layout_1.HeaderLayout, {
148
+ navigationAction: react_1.default.createElement(
149
+ Link_1.Link,
150
+ {
151
+ startIcon: react_1.default.createElement(
152
+ icons_1.ArrowLeft,
153
+ null
154
+ ),
155
+ to: (0, utils_1.getUrl)(`discover`),
156
+ },
157
+ (0, getMessage_1.default)(
158
+ "HeaderLayout.link.go-back",
159
+ "Back",
160
+ false
161
+ )
162
+ ),
163
+ title: (0, getMessage_1.default)("page.details.header"),
164
+ subtitle: (0, getMessage_1.default)(
165
+ "page.details.header.description"
166
+ ),
167
+ as: "h2",
168
+ }),
169
+ react_1.default.createElement(
170
+ Layout_1.ContentLayout,
171
+ null,
172
+ react_1.default.createElement(Layout_1.TwoColsLayout, {
173
+ startCol: react_1.default.createElement(
174
+ DiscussionThread_1.default,
175
+ {
176
+ level: level,
177
+ selected: selected,
178
+ isReloading: isLoading,
179
+ allowedActions: {
180
+ canModerate,
181
+ canAccessReports,
182
+ canReviewReports,
183
+ },
184
+ }
185
+ ),
186
+ endCol: react_1.default.createElement(
187
+ DetailsEntity_1.default,
188
+ {
189
+ data: entity,
190
+ schema: contentTypeData?.schema,
191
+ config: config,
192
+ filters: filters,
193
+ onFiltersChange: handleChangeFilters,
194
+ }
195
+ ),
196
+ })
197
+ )
198
+ )
199
+ )
200
+ );
201
+ }
202
+ return null;
203
+ };
204
+ const mapStateToProps = (0, selectors_1.default)();
205
+ function mapDispatchToProps(dispatch) {
206
+ return (0, redux_1.bindActionCreators)({}, dispatch);
207
+ }
208
+ exports.mapDispatchToProps = mapDispatchToProps;
209
+ const withConnect = (0, react_redux_1.connect)(
210
+ mapStateToProps,
211
+ mapDispatchToProps
212
+ );
213
+ exports.default = (0, redux_1.compose)(withConnect)(
214
+ (0, react_1.memo)(Details, react_fast_compare_1.default)
215
+ );
216
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,20 @@
1
+ declare const DiscoverTableRow: {
2
+ ({ config, item, allowedActions: { canModerate, canAccessReports, canReviewReports }, onClick, }: {
3
+ config: any;
4
+ item: any;
5
+ allowedActions: {
6
+ canModerate: any;
7
+ canAccessReports: any;
8
+ canReviewReports: any;
9
+ };
10
+ onClick: any;
11
+ }): any;
12
+ propTypes: {
13
+ config: any;
14
+ item: any;
15
+ allowedActions: any;
16
+ onClick: any;
17
+ };
18
+ };
19
+ export default DiscoverTableRow;
20
+ //# sourceMappingURL=index.d.ts.map