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,31 @@
|
|
|
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 initSize = 16;
|
|
10
|
+
const ReviewIcon = ({ width, height, size = 16 }) =>
|
|
11
|
+
react_1.default.createElement(
|
|
12
|
+
"svg",
|
|
13
|
+
{
|
|
14
|
+
width: width || size,
|
|
15
|
+
height: height || size,
|
|
16
|
+
viewBox: `0 0 ${width || size} ${height || size}`,
|
|
17
|
+
style: { width: `${width || size}px`, height: `${height || size}px` },
|
|
18
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
19
|
+
},
|
|
20
|
+
react_1.default.createElement(
|
|
21
|
+
"g",
|
|
22
|
+
{ style: { transform: `scale(${(width || size) / initSize})` } },
|
|
23
|
+
react_1.default.createElement("path", {
|
|
24
|
+
fillRule: "evenodd",
|
|
25
|
+
clipRule: "evenodd",
|
|
26
|
+
d: "M0 4a4 4 0 014-4h8a4 4 0 014 4v8a4 4 0 01-4 4H4a4 4 0 01-4-4V4zm6.996.165a1.017 1.017 0 112.012 0L8 11 6.996 4.165zM8 11a1 1 0 110 2 1 1 0 010-2z",
|
|
27
|
+
})
|
|
28
|
+
)
|
|
29
|
+
);
|
|
30
|
+
exports.default = ReviewIcon;
|
|
31
|
+
//# sourceMappingURL=review.js.map
|
|
@@ -0,0 +1,29 @@
|
|
|
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 initSize = 330;
|
|
10
|
+
const UnlockIcon = ({ width, height, size = 16 }) =>
|
|
11
|
+
react_1.default.createElement(
|
|
12
|
+
"svg",
|
|
13
|
+
{
|
|
14
|
+
width: width || size,
|
|
15
|
+
height: height || size,
|
|
16
|
+
viewBox: `0 0 ${width || size} ${height || size}`,
|
|
17
|
+
style: { width: `${width || size}px`, height: `${height || size}px` },
|
|
18
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
19
|
+
},
|
|
20
|
+
react_1.default.createElement(
|
|
21
|
+
"g",
|
|
22
|
+
{ style: { transform: `scale(${(width || size) / initSize})` } },
|
|
23
|
+
react_1.default.createElement("path", {
|
|
24
|
+
d: "M15,160c8.283,0,15-6.716,15-15V85c0-30.327,24.672-55,55-55c30.326,0,55,24.673,55,55v42.893\n c-24.479,21.105-40,52.327-40,87.107c0,63.411,51.588,115,115,115c63.41,0,115-51.589,115-115s-51.59-115-115-115\n c-15.961,0-31.172,3.271-45,9.174V85c0-46.869-38.131-85-85-85S0,38.131,0,85v60C0,153.284,6.715,160,15,160z",
|
|
25
|
+
})
|
|
26
|
+
)
|
|
27
|
+
);
|
|
28
|
+
exports.default = UnlockIcon;
|
|
29
|
+
//# sourceMappingURL=unlock.js.map
|
|
@@ -0,0 +1,52 @@
|
|
|
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_query_1 = require("react-query");
|
|
9
|
+
const api_1 = require("../pages/Settings/utils/api");
|
|
10
|
+
const pluginId_1 = __importDefault(require("../pluginId"));
|
|
11
|
+
const useConfig = (toggleNotification) => {
|
|
12
|
+
const queryClient = (0, react_query_1.useQueryClient)();
|
|
13
|
+
const fetch = (0, react_query_1.useQuery)("get-config", () =>
|
|
14
|
+
(0, api_1.fetchConfig)(toggleNotification)
|
|
15
|
+
);
|
|
16
|
+
const handleError = (type, callback = () => {}) => {
|
|
17
|
+
toggleNotification({
|
|
18
|
+
type: "warning",
|
|
19
|
+
message: `${pluginId_1.default}.page.settings.notification.${type}.error`,
|
|
20
|
+
});
|
|
21
|
+
callback();
|
|
22
|
+
};
|
|
23
|
+
const handleSuccess = (
|
|
24
|
+
type,
|
|
25
|
+
callback = () => {},
|
|
26
|
+
invalidateQueries = true
|
|
27
|
+
) => {
|
|
28
|
+
if (invalidateQueries) {
|
|
29
|
+
queryClient.invalidateQueries("get-config");
|
|
30
|
+
}
|
|
31
|
+
toggleNotification({
|
|
32
|
+
type: "success",
|
|
33
|
+
message: `${pluginId_1.default}.page.settings.notification.${type}.success`,
|
|
34
|
+
});
|
|
35
|
+
callback();
|
|
36
|
+
};
|
|
37
|
+
const submitMutation = (0, react_query_1.useMutation)(api_1.updateConfig, {
|
|
38
|
+
onSuccess: () => handleSuccess("submit"),
|
|
39
|
+
onError: () => handleError("submit"),
|
|
40
|
+
});
|
|
41
|
+
const restoreMutation = (0, react_query_1.useMutation)(api_1.restoreConfig, {
|
|
42
|
+
onSuccess: () => handleSuccess("restore"),
|
|
43
|
+
onError: () => handleError("restore"),
|
|
44
|
+
});
|
|
45
|
+
const restartMutation = (0, react_query_1.useMutation)(api_1.restartStrapi, {
|
|
46
|
+
onSuccess: () => handleSuccess("restart", () => {}, false),
|
|
47
|
+
onError: () => handleError("restart"),
|
|
48
|
+
});
|
|
49
|
+
return { fetch, restartMutation, submitMutation, restoreMutation };
|
|
50
|
+
};
|
|
51
|
+
exports.default = useConfig;
|
|
52
|
+
//# sourceMappingURL=useConfig.js.map
|
|
@@ -0,0 +1,137 @@
|
|
|
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
|
+
const helper_plugin_1 = require("@strapi/helper-plugin");
|
|
53
|
+
const pluginPkg = __importStar(require("../../package.json"));
|
|
54
|
+
const pluginId_1 = require("./pluginId");
|
|
55
|
+
const Initializer_1 = __importDefault(require("./components/Initializer"));
|
|
56
|
+
const PluginIcon_1 = __importDefault(require("./components/PluginIcon"));
|
|
57
|
+
const permissions_1 = __importDefault(require("./permissions"));
|
|
58
|
+
const reducers_1 = __importDefault(require("./reducers"));
|
|
59
|
+
const { name, displayName } = pluginPkg.strapi;
|
|
60
|
+
exports.default = {
|
|
61
|
+
register(app) {
|
|
62
|
+
app.addMenuLink({
|
|
63
|
+
to: `/plugins/${pluginId_1.pluginId}/discover`,
|
|
64
|
+
badgeContent: 1,
|
|
65
|
+
icon: PluginIcon_1.default,
|
|
66
|
+
intlLabel: {
|
|
67
|
+
id: `${pluginId_1.pluginId}.plugin.name`,
|
|
68
|
+
defaultMessage: displayName,
|
|
69
|
+
},
|
|
70
|
+
Component: async () => {
|
|
71
|
+
const component = await Promise.resolve().then(() =>
|
|
72
|
+
__importStar(require("./pages/App"))
|
|
73
|
+
);
|
|
74
|
+
return component;
|
|
75
|
+
},
|
|
76
|
+
permissions: permissions_1.default.access,
|
|
77
|
+
});
|
|
78
|
+
app.createSettingSection(
|
|
79
|
+
{
|
|
80
|
+
id: pluginId_1.pluginId,
|
|
81
|
+
intlLabel: {
|
|
82
|
+
id: `${pluginId_1.pluginId}.plugin.section`,
|
|
83
|
+
defaultMessage: `${displayName} plugin`,
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
[
|
|
87
|
+
{
|
|
88
|
+
intlLabel: {
|
|
89
|
+
id: `${pluginId_1.pluginId}.plugin.section.item`,
|
|
90
|
+
defaultMessage: "Configuration",
|
|
91
|
+
},
|
|
92
|
+
id: "comments",
|
|
93
|
+
to: `/settings/${pluginId_1.pluginId}`,
|
|
94
|
+
Component: async () => {
|
|
95
|
+
const component = await Promise.resolve().then(() =>
|
|
96
|
+
__importStar(require("./pages/Settings"))
|
|
97
|
+
);
|
|
98
|
+
return component;
|
|
99
|
+
},
|
|
100
|
+
permissions: permissions_1.default.settings,
|
|
101
|
+
},
|
|
102
|
+
]
|
|
103
|
+
);
|
|
104
|
+
app.addReducers(reducers_1.default);
|
|
105
|
+
app.registerPlugin({
|
|
106
|
+
id: pluginId_1.pluginId,
|
|
107
|
+
initializer: Initializer_1.default,
|
|
108
|
+
isReady: false,
|
|
109
|
+
name,
|
|
110
|
+
});
|
|
111
|
+
},
|
|
112
|
+
async registerTrads({ locales }) {
|
|
113
|
+
const importedTrads = await Promise.all(
|
|
114
|
+
locales.map((locale) => {
|
|
115
|
+
return Promise.resolve()
|
|
116
|
+
.then(() => __importStar(require(`./translations/${locale}.json`)))
|
|
117
|
+
.then(({ default: data }) => {
|
|
118
|
+
return {
|
|
119
|
+
data: (0, helper_plugin_1.prefixPluginTranslations)(
|
|
120
|
+
data,
|
|
121
|
+
pluginId_1.pluginId
|
|
122
|
+
),
|
|
123
|
+
locale,
|
|
124
|
+
};
|
|
125
|
+
})
|
|
126
|
+
.catch(() => {
|
|
127
|
+
return {
|
|
128
|
+
data: {},
|
|
129
|
+
locale,
|
|
130
|
+
};
|
|
131
|
+
});
|
|
132
|
+
})
|
|
133
|
+
);
|
|
134
|
+
return Promise.resolve(importedTrads);
|
|
135
|
+
},
|
|
136
|
+
};
|
|
137
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,90 @@
|
|
|
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.mapDispatchToProps = void 0;
|
|
9
|
+
const react_1 = __importDefault(require("react"));
|
|
10
|
+
const react_redux_1 = require("react-redux");
|
|
11
|
+
const redux_1 = require("redux");
|
|
12
|
+
const react_router_dom_1 = require("react-router-dom");
|
|
13
|
+
const react_query_1 = require("react-query");
|
|
14
|
+
const helper_plugin_1 = require("@strapi/helper-plugin");
|
|
15
|
+
const ComingSoonPage_1 = __importDefault(require("../ComingSoonPage"));
|
|
16
|
+
const getUrl_1 = __importDefault(require("../../utils/getUrl"));
|
|
17
|
+
const Discover_1 = __importDefault(require("../Discover"));
|
|
18
|
+
const Details_1 = __importDefault(require("../Details"));
|
|
19
|
+
const api_1 = require("./utils/api");
|
|
20
|
+
const actions_1 = require("./reducer/actions");
|
|
21
|
+
const selectors_1 = __importDefault(require("./reducer/selectors"));
|
|
22
|
+
const App = ({ setConfig }) => {
|
|
23
|
+
const toggleNotification = (0, helper_plugin_1.useNotification)();
|
|
24
|
+
const { isLoading, isFetching } = (0, react_query_1.useQuery)(
|
|
25
|
+
"get-config",
|
|
26
|
+
() => (0, api_1.fetchConfig)(toggleNotification),
|
|
27
|
+
{
|
|
28
|
+
initialData: {},
|
|
29
|
+
onSuccess: (response) => {
|
|
30
|
+
setConfig(response);
|
|
31
|
+
},
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
if (isLoading || isFetching) {
|
|
35
|
+
return react_1.default.createElement(
|
|
36
|
+
helper_plugin_1.LoadingIndicatorPage,
|
|
37
|
+
null
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
return react_1.default.createElement(
|
|
41
|
+
"div",
|
|
42
|
+
null,
|
|
43
|
+
react_1.default.createElement(
|
|
44
|
+
react_router_dom_1.Switch,
|
|
45
|
+
null,
|
|
46
|
+
react_1.default.createElement(react_router_dom_1.Route, {
|
|
47
|
+
path: (0, getUrl_1.default)("dashboard"),
|
|
48
|
+
component: ComingSoonPage_1.default,
|
|
49
|
+
exact: true,
|
|
50
|
+
}),
|
|
51
|
+
react_1.default.createElement(react_router_dom_1.Route, {
|
|
52
|
+
path: (0, getUrl_1.default)("discover"),
|
|
53
|
+
component: Discover_1.default,
|
|
54
|
+
exact: true,
|
|
55
|
+
}),
|
|
56
|
+
react_1.default.createElement(react_router_dom_1.Route, {
|
|
57
|
+
path: (0, getUrl_1.default)("discover/:id"),
|
|
58
|
+
component: Details_1.default,
|
|
59
|
+
exact: true,
|
|
60
|
+
}),
|
|
61
|
+
react_1.default.createElement(react_router_dom_1.Route, {
|
|
62
|
+
path: (0, getUrl_1.default)("reports"),
|
|
63
|
+
component: ComingSoonPage_1.default,
|
|
64
|
+
exact: true,
|
|
65
|
+
}),
|
|
66
|
+
react_1.default.createElement(react_router_dom_1.Route, {
|
|
67
|
+
path: (0, getUrl_1.default)("settings"),
|
|
68
|
+
component: ComingSoonPage_1.default,
|
|
69
|
+
exact: true,
|
|
70
|
+
}),
|
|
71
|
+
react_1.default.createElement(react_router_dom_1.Route, {
|
|
72
|
+
component: helper_plugin_1.NotFound,
|
|
73
|
+
})
|
|
74
|
+
)
|
|
75
|
+
);
|
|
76
|
+
};
|
|
77
|
+
const mapStateToProps = (0, selectors_1.default)();
|
|
78
|
+
function mapDispatchToProps(dispatch) {
|
|
79
|
+
return (0, redux_1.bindActionCreators)(
|
|
80
|
+
{ setConfig: actions_1.setConfig },
|
|
81
|
+
dispatch
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
exports.mapDispatchToProps = mapDispatchToProps;
|
|
85
|
+
const withConnect = (0, react_redux_1.connect)(
|
|
86
|
+
mapStateToProps,
|
|
87
|
+
mapDispatchToProps
|
|
88
|
+
);
|
|
89
|
+
exports.default = (0, redux_1.compose)(withConnect)(App);
|
|
90
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
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) => ({
|
|
6
|
+
data,
|
|
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,7 @@
|
|
|
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,31 @@
|
|
|
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.initialState = void 0;
|
|
9
|
+
const immer_1 = __importDefault(require("immer"));
|
|
10
|
+
const lodash_1 = require("lodash");
|
|
11
|
+
const constants_1 = require("./constants");
|
|
12
|
+
const initialState = {
|
|
13
|
+
config: {},
|
|
14
|
+
};
|
|
15
|
+
exports.initialState = initialState;
|
|
16
|
+
const reducer = (state = initialState, action) =>
|
|
17
|
+
(0, immer_1.default)(state, (draftState) => {
|
|
18
|
+
switch (action.type) {
|
|
19
|
+
case constants_1.SET_CONFIG: {
|
|
20
|
+
(0, lodash_1.set)(draftState, "config", action.data);
|
|
21
|
+
break;
|
|
22
|
+
}
|
|
23
|
+
case constants_1.GET_CONFIG: {
|
|
24
|
+
return draftState?.config;
|
|
25
|
+
}
|
|
26
|
+
default:
|
|
27
|
+
return draftState;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
exports.default = reducer;
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
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) =>
|
|
8
|
+
state[constants_1.REDUCER_NAME] || _1.initialState;
|
|
9
|
+
exports.appView = appView;
|
|
10
|
+
const makeAppView = () =>
|
|
11
|
+
(0, reselect_1.createSelector)(appView(), (substate) => {
|
|
12
|
+
return substate;
|
|
13
|
+
});
|
|
14
|
+
const selectConfig = (state) => {
|
|
15
|
+
const { config } = state;
|
|
16
|
+
return config;
|
|
17
|
+
};
|
|
18
|
+
exports.selectConfig = selectConfig;
|
|
19
|
+
exports.default = makeAppView;
|
|
20
|
+
//# sourceMappingURL=selectors.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
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(
|
|
8
|
+
(0, utils_1.getApiURL)(`moderate/config`)
|
|
9
|
+
);
|
|
10
|
+
return data;
|
|
11
|
+
} catch (err) {
|
|
12
|
+
(0, utils_1.handleAPIError)(err, toggleNotification);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
exports.fetchConfig = fetchConfig;
|
|
16
|
+
//# sourceMappingURL=api.js.map
|
|
@@ -0,0 +1,78 @@
|
|
|
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
|
+
const react_1 = __importStar(require("react"));
|
|
53
|
+
const Box_1 = require("@strapi/design-system/Box");
|
|
54
|
+
const EmptyStateLayout_1 = require("@strapi/design-system/EmptyStateLayout");
|
|
55
|
+
const Layout_1 = require("@strapi/design-system/Layout");
|
|
56
|
+
const icons_1 = require("@strapi/icons");
|
|
57
|
+
const getMessage_1 = __importDefault(require("../../utils/getMessage"));
|
|
58
|
+
const Nav_1 = __importDefault(require("../../components/Nav"));
|
|
59
|
+
const ComingSoonPage = () => {
|
|
60
|
+
return react_1.default.createElement(
|
|
61
|
+
Box_1.Box,
|
|
62
|
+
{ background: "neutral100" },
|
|
63
|
+
react_1.default.createElement(
|
|
64
|
+
Layout_1.Layout,
|
|
65
|
+
{ sideNav: react_1.default.createElement(Nav_1.default, null) },
|
|
66
|
+
react_1.default.createElement(
|
|
67
|
+
Box_1.Box,
|
|
68
|
+
{ padding: 8, background: "neutral100" },
|
|
69
|
+
react_1.default.createElement(EmptyStateLayout_1.EmptyStateLayout, {
|
|
70
|
+
icon: react_1.default.createElement(icons_1.Illo, null),
|
|
71
|
+
content: (0, getMessage_1.default)("page.coming.soon"),
|
|
72
|
+
})
|
|
73
|
+
)
|
|
74
|
+
)
|
|
75
|
+
);
|
|
76
|
+
};
|
|
77
|
+
exports.default = (0, react_1.memo)(ComingSoonPage);
|
|
78
|
+
//# 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
|