strapi-plugin-comments 2.0.8 → 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.
- package/README.md +45 -11
- package/admin/src/translations/en.json +1 -0
- package/admin/src/translations/fr.json +132 -1
- package/admin/src/translations/pt-BR.json +132 -0
- package/build/README.md +818 -0
- package/build/admin/src/components/ActionButton/styles.d.ts +2 -0
- package/build/admin/src/components/ActionButton/styles.js +17 -0
- package/build/admin/src/components/ConfirmationDialog/index.d.ts +26 -0
- package/build/admin/src/components/ConfirmationDialog/index.js +104 -0
- package/build/admin/src/components/DiscussionStatus/index.d.ts +9 -0
- package/build/admin/src/components/DiscussionStatus/index.js +38 -0
- package/build/admin/src/components/DiscussionThread/index.d.ts +16 -0
- package/build/admin/src/components/DiscussionThread/index.js +99 -0
- package/build/admin/src/components/DiscussionThreadItem/index.d.ts +9 -0
- package/build/admin/src/components/DiscussionThreadItem/index.js +72 -0
- package/build/admin/src/components/DiscussionThreadItem/styles.d.ts +4 -0
- package/build/admin/src/components/DiscussionThreadItem/styles.js +27 -0
- package/build/admin/src/components/DiscussionThreadItemActions/index.d.ts +19 -0
- package/build/admin/src/components/DiscussionThreadItemActions/index.js +414 -0
- package/build/admin/src/components/DiscussionThreadItemActions/styles.d.ts +2 -0
- package/build/admin/src/components/DiscussionThreadItemActions/styles.js +17 -0
- package/build/admin/src/components/DiscussionThreadItemApprovalFlowActions/index.d.ts +17 -0
- package/build/admin/src/components/DiscussionThreadItemApprovalFlowActions/index.js +103 -0
- package/build/admin/src/components/DiscussionThreadItemApprovalFlowActions/styles.d.ts +2 -0
- package/build/admin/src/components/DiscussionThreadItemApprovalFlowActions/styles.js +15 -0
- package/build/admin/src/components/DiscussionThreadItemFooter/index.d.ts +16 -0
- package/build/admin/src/components/DiscussionThreadItemFooter/index.js +73 -0
- package/build/admin/src/components/DiscussionThreadItemFooter/styles.d.ts +3 -0
- package/build/admin/src/components/DiscussionThreadItemFooter/styles.js +25 -0
- package/build/admin/src/components/DiscussionThreadItemReviewAction/index.d.ts +30 -0
- package/build/admin/src/components/DiscussionThreadItemReviewAction/index.js +233 -0
- package/build/admin/src/components/FormSwitch/index.d.ts +11 -0
- package/build/admin/src/components/FormSwitch/index.js +39 -0
- package/build/admin/src/components/FormSwitch/styles.d.ts +2 -0
- package/build/admin/src/components/FormSwitch/styles.js +16 -0
- package/build/admin/src/components/IconButton/styles.d.ts +2 -0
- package/build/admin/src/components/IconButton/styles.js +27 -0
- package/build/admin/src/components/Initializer/index.d.ts +3 -0
- package/build/admin/src/components/Initializer/index.js +14 -0
- package/build/admin/src/components/LoadingIndicatorOverlay/index.d.ts +3 -0
- package/build/admin/src/components/LoadingIndicatorOverlay/index.js +18 -0
- package/build/admin/src/components/LoadingIndicatorOverlay/styles.d.ts +3 -0
- package/build/admin/src/components/LoadingIndicatorOverlay/styles.js +32 -0
- package/build/admin/src/components/Nav/index.d.ts +7 -0
- package/build/admin/src/components/Nav/index.js +72 -0
- package/build/admin/src/components/PluginIcon/index.d.ts +3 -0
- package/build/admin/src/components/PluginIcon/index.js +13 -0
- package/build/admin/src/components/ReportsReviewModal/index.d.ts +21 -0
- package/build/admin/src/components/ReportsReviewModal/index.js +72 -0
- package/build/admin/src/components/ReportsReviewTable/index.d.ts +21 -0
- package/build/admin/src/components/ReportsReviewTable/index.js +321 -0
- package/build/admin/src/components/StatusBadge/index.d.ts +11 -0
- package/build/admin/src/components/StatusBadge/index.js +22 -0
- package/build/admin/src/components/StatusBadge/styles.d.ts +2 -0
- package/build/admin/src/components/StatusBadge/styles.js +25 -0
- package/build/admin/src/components/TableFilters/index.d.ts +10 -0
- package/build/admin/src/components/TableFilters/index.js +109 -0
- package/build/admin/src/components/TablePagination/index.d.ts +15 -0
- package/build/admin/src/components/TablePagination/index.js +45 -0
- package/build/admin/src/components/icons/comments.d.ts +9 -0
- package/build/admin/src/components/icons/comments.js +23 -0
- package/build/admin/src/components/icons/index.d.ts +6 -0
- package/build/admin/src/components/icons/index.js +21 -0
- package/build/admin/src/components/icons/lock.d.ts +11 -0
- package/build/admin/src/components/icons/lock.js +29 -0
- package/build/admin/src/components/icons/review.d.ts +11 -0
- package/build/admin/src/components/icons/review.js +31 -0
- package/build/admin/src/components/icons/unlock.d.ts +11 -0
- package/build/admin/src/components/icons/unlock.js +29 -0
- package/build/admin/src/hooks/useConfig.d.ts +8 -0
- package/build/admin/src/hooks/useConfig.js +52 -0
- package/build/admin/src/index.d.ts +7 -0
- package/build/admin/src/index.js +137 -0
- package/build/admin/src/pages/App/index.d.ts +4 -0
- package/build/admin/src/pages/App/index.js +90 -0
- package/build/admin/src/pages/App/reducer/actions.d.ts +8 -0
- package/build/admin/src/pages/App/reducer/actions.js +12 -0
- package/build/admin/src/pages/App/reducer/constants.d.ts +4 -0
- package/build/admin/src/pages/App/reducer/constants.js +7 -0
- package/build/admin/src/pages/App/reducer/index.d.ts +14 -0
- package/build/admin/src/pages/App/reducer/index.js +31 -0
- package/build/admin/src/pages/App/reducer/init.d.ts +3 -0
- package/build/admin/src/pages/App/reducer/init.js +9 -0
- package/build/admin/src/pages/App/reducer/selectors.d.ts +6 -0
- package/build/admin/src/pages/App/reducer/selectors.js +20 -0
- package/build/admin/src/pages/App/utils/api.d.ts +2 -0
- package/build/admin/src/pages/App/utils/api.js +16 -0
- package/build/admin/src/pages/ComingSoonPage/index.d.ts +3 -0
- package/build/admin/src/pages/ComingSoonPage/index.js +78 -0
- package/build/admin/src/pages/Details/components/DetailsEntity/index.d.ts +18 -0
- package/build/admin/src/pages/Details/components/DetailsEntity/index.js +132 -0
- package/build/admin/src/pages/Details/components/DetailsFilters/index.d.ts +12 -0
- package/build/admin/src/pages/Details/components/DetailsFilters/index.js +48 -0
- package/build/admin/src/pages/Details/components/DetailsFilters/styles.d.ts +2 -0
- package/build/admin/src/pages/Details/components/DetailsFilters/styles.js +16 -0
- package/build/admin/src/pages/Details/index.d.ts +4 -0
- package/build/admin/src/pages/Details/index.js +216 -0
- package/build/admin/src/pages/Discover/components/DiscoverTableRow/index.d.ts +20 -0
- package/build/admin/src/pages/Discover/components/DiscoverTableRow/index.js +344 -0
- package/build/admin/src/pages/Discover/components/DiscoverTableRow/styles.d.ts +2 -0
- package/build/admin/src/pages/Discover/components/DiscoverTableRow/styles.js +16 -0
- package/build/admin/src/pages/Discover/index.d.ts +4 -0
- package/build/admin/src/pages/Discover/index.js +332 -0
- package/build/admin/src/pages/Discover/utils/api.d.ts +2 -0
- package/build/admin/src/pages/Discover/utils/api.js +23 -0
- package/build/admin/src/pages/Discover/utils/filtersSchema.d.ts +11 -0
- package/build/admin/src/pages/Discover/utils/filtersSchema.js +11 -0
- package/build/admin/src/pages/Settings/components/RestartAlert/styles.d.ts +2 -0
- package/build/admin/src/pages/Settings/components/RestartAlert/styles.js +16 -0
- package/build/admin/src/pages/Settings/index.d.ts +3 -0
- package/build/admin/src/pages/Settings/index.js +712 -0
- package/build/admin/src/pages/Settings/utils/api.d.ts +7 -0
- package/build/admin/src/pages/Settings/utils/api.js +80 -0
- package/build/admin/src/pages/utils/api.d.ts +12 -0
- package/build/admin/src/pages/utils/api.js +83 -0
- package/build/admin/src/permissions.d.ts +28 -0
- package/build/admin/src/permissions.js +65 -0
- package/build/admin/src/pluginId.d.ts +2 -0
- package/build/admin/src/pluginId.js +50 -0
- package/build/admin/src/reducers.d.ts +12 -0
- package/build/admin/src/reducers.js +14 -0
- package/build/admin/src/translations/en.json +132 -0
- package/build/admin/src/translations/fr.json +1 -0
- package/build/admin/src/translations/pt-BR.json +132 -0
- package/build/admin/src/utils/axiosInstance.d.ts +3 -0
- package/build/admin/src/utils/axiosInstance.js +37 -0
- package/build/admin/src/utils/constants.d.ts +25 -0
- package/build/admin/src/utils/constants.js +30 -0
- package/build/admin/src/utils/getApiUrl.d.ts +3 -0
- package/build/admin/src/utils/getApiUrl.js +6 -0
- package/build/admin/src/utils/getMessage.d.ts +4 -0
- package/build/admin/src/utils/getMessage.js +25 -0
- package/build/admin/src/utils/getRelatedGroups.d.ts +4 -0
- package/build/admin/src/utils/getRelatedGroups.js +6 -0
- package/build/admin/src/utils/getUrl.d.ts +3 -0
- package/build/admin/src/utils/getUrl.js +6 -0
- package/build/admin/src/utils/handleAPIError.d.ts +4 -0
- package/build/admin/src/utils/handleAPIError.js +20 -0
- package/build/admin/src/utils/index.d.ts +12 -0
- package/build/admin/src/utils/index.js +97 -0
- package/build/admin/src/utils/parseRegExp.d.ts +6 -0
- package/build/admin/src/utils/parseRegExp.js +11 -0
- package/build/admin/src/utils/renderEntryTitle.d.ts +4 -0
- package/build/admin/src/utils/renderEntryTitle.js +16 -0
- package/build/admin/src/utils/renderInitials.d.ts +3 -0
- package/build/admin/src/utils/renderInitials.js +11 -0
- package/build/admin/src/utils/resolveCommentStatus.d.ts +4 -0
- package/build/admin/src/utils/resolveCommentStatus.js +32 -0
- package/build/admin/src/utils/resolveCommentStatusColor.d.ts +4 -0
- package/build/admin/src/utils/resolveCommentStatusColor.js +22 -0
- package/build/content-types/comment.d.ts +91 -0
- package/build/content-types/comment.js +92 -0
- package/build/content-types/index.d.ts +143 -0
- package/build/content-types/index.js +18 -0
- package/build/content-types/report.d.ts +48 -0
- package/build/content-types/report.js +49 -0
- package/build/package.json +94 -0
- package/build/permissions.d.ts +18 -0
- package/build/permissions.js +18 -0
- package/build/server/bootstrap.d.ts +4 -0
- package/build/server/bootstrap.js +65 -0
- package/build/server/config/index.d.ts +4 -0
- package/build/server/config/index.js +19 -0
- package/build/server/controllers/admin.d.ts +4 -0
- package/build/server/controllers/admin.js +124 -0
- package/build/server/controllers/client.d.ts +4 -0
- package/build/server/controllers/client.js +111 -0
- package/build/server/controllers/index.d.ts +6 -0
- package/build/server/controllers/index.js +15 -0
- package/build/server/controllers/utils/functions.d.ts +7 -0
- package/build/server/controllers/utils/functions.js +24 -0
- package/build/server/controllers/utils/parsers.d.ts +15 -0
- package/build/server/controllers/utils/parsers.js +25 -0
- package/build/server/destroy.d.ts +3 -0
- package/build/server/destroy.js +3 -0
- package/build/server/graphql/index.d.ts +4 -0
- package/build/server/graphql/index.js +37 -0
- package/build/server/graphql/mutations/createAbuseReport.d.ts +11 -0
- package/build/server/graphql/mutations/createAbuseReport.js +27 -0
- package/build/server/graphql/mutations/createComment.d.ts +14 -0
- package/build/server/graphql/mutations/createComment.js +26 -0
- package/build/server/graphql/mutations/index.d.ts +4 -0
- package/build/server/graphql/mutations/index.js +28 -0
- package/build/server/graphql/mutations/removeComment.d.ts +11 -0
- package/build/server/graphql/mutations/removeComment.js +27 -0
- package/build/server/graphql/mutations/updateComment.d.ts +11 -0
- package/build/server/graphql/mutations/updateComment.js +27 -0
- package/build/server/graphql/queries/findAllFlat.d.ts +19 -0
- package/build/server/graphql/queries/findAllFlat.js +47 -0
- package/build/server/graphql/queries/findAllInHierarchy.d.ts +18 -0
- package/build/server/graphql/queries/findAllInHierarchy.js +38 -0
- package/build/server/graphql/queries/index.d.ts +4 -0
- package/build/server/graphql/queries/index.js +24 -0
- package/build/server/graphql/resolvers-config.d.ts +23 -0
- package/build/server/graphql/resolvers-config.js +13 -0
- package/build/server/graphql/types/comment-author.d.ts +4 -0
- package/build/server/graphql/types/comment-author.js +12 -0
- package/build/server/graphql/types/comment-nested.d.ts +4 -0
- package/build/server/graphql/types/comment-nested.js +19 -0
- package/build/server/graphql/types/comment.d.ts +4 -0
- package/build/server/graphql/types/comment.js +18 -0
- package/build/server/graphql/types/create-comment-author.d.ts +4 -0
- package/build/server/graphql/types/create-comment-author.js +12 -0
- package/build/server/graphql/types/create-comment.d.ts +4 -0
- package/build/server/graphql/types/create-comment.js +12 -0
- package/build/server/graphql/types/create-report.d.ts +4 -0
- package/build/server/graphql/types/create-report.js +12 -0
- package/build/server/graphql/types/id.d.ts +4 -0
- package/build/server/graphql/types/id.js +26 -0
- package/build/server/graphql/types/identify-comment-author.d.ts +4 -0
- package/build/server/graphql/types/identify-comment-author.js +9 -0
- package/build/server/graphql/types/index.d.ts +4 -0
- package/build/server/graphql/types/index.js +44 -0
- package/build/server/graphql/types/remove-comment.d.ts +4 -0
- package/build/server/graphql/types/remove-comment.js +11 -0
- package/build/server/graphql/types/report-reason.d.ts +4 -0
- package/build/server/graphql/types/report-reason.js +12 -0
- package/build/server/graphql/types/report.d.ts +4 -0
- package/build/server/graphql/types/report.js +14 -0
- package/build/server/graphql/types/response-find-all.d.ts +4 -0
- package/build/server/graphql/types/response-find-all.js +10 -0
- package/build/server/graphql/types/response-meta.d.ts +4 -0
- package/build/server/graphql/types/response-meta.js +9 -0
- package/build/server/graphql/types/response-pagination.d.ts +4 -0
- package/build/server/graphql/types/response-pagination.js +14 -0
- package/build/server/graphql/types/update-comment.d.ts +4 -0
- package/build/server/graphql/types/update-comment.js +12 -0
- package/build/server/index.d.ts +26 -0
- package/build/server/index.js +25 -0
- package/build/server/register.d.ts +3 -0
- package/build/server/register.js +3 -0
- package/build/server/routes/admin.d.ts +4 -0
- package/build/server/routes/admin.js +118 -0
- package/build/server/routes/client.d.ts +4 -0
- package/build/server/routes/client.js +54 -0
- package/build/server/routes/index.d.ts +11 -0
- package/build/server/routes/index.js +21 -0
- package/build/server/services/admin.d.ts +5 -0
- package/build/server/services/admin.js +296 -0
- package/build/server/services/client.d.ts +5 -0
- package/build/server/services/client.js +247 -0
- package/build/server/services/common.d.ts +5 -0
- package/build/server/services/common.js +266 -0
- package/build/server/services/graphql.d.ts +5 -0
- package/build/server/services/graphql.js +136 -0
- package/build/server/services/index.d.ts +8 -0
- package/build/server/services/index.js +16 -0
- package/build/server/services/utils/functions.d.ts +13 -0
- package/build/server/services/utils/functions.js +141 -0
- package/build/server/utils/constants.d.ts +9 -0
- package/build/server/utils/constants.js +23 -0
- package/build/server/utils/error.d.ts +23 -0
- package/build/server/utils/error.js +29 -0
- package/build/server/utils/functions.d.ts +14 -0
- package/build/server/utils/functions.js +50 -0
- package/build/strapi-admin.d.ts +3 -0
- package/build/strapi-admin.js +10 -0
- package/build/strapi-server.d.ts +177 -0
- package/build/strapi-server.js +46 -0
- package/build/tsconfig.tsbuildinfo +1 -0
- package/build/types/contentTypes.d.ts +46 -0
- package/build/types/contentTypes.js +3 -0
- package/package.json +3 -3
- package/server/controllers/client.js +0 -3
- package/server/graphql/queries/findAllFlat.js +6 -2
- package/server/services/common.js +2 -2
|
@@ -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,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,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,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
|