strapi-plugin-comments 2.0.10 → 2.1.0
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 +204 -124
- package/admin/src/components/ActionButton/styles.d.ts +2 -0
- package/admin/src/components/ActionButton/styles.js +13 -8
- package/admin/src/components/Avatar/index.d.ts +12 -0
- package/admin/src/components/Avatar/index.js +26 -0
- package/admin/src/components/ConfirmationDialog/index.d.ts +26 -0
- package/admin/src/components/ConfirmationDialog/index.js +36 -55
- package/admin/src/components/DiscussionStatus/index.d.ts +9 -0
- package/admin/src/components/DiscussionStatus/index.js +22 -31
- package/admin/src/components/DiscussionThread/index.d.ts +16 -0
- package/admin/src/components/DiscussionThread/index.js +39 -56
- package/admin/src/components/DiscussionThreadItem/index.d.ts +9 -0
- package/admin/src/components/DiscussionThreadItem/index.js +28 -52
- package/admin/src/components/DiscussionThreadItem/styles.d.ts +4 -0
- package/admin/src/components/DiscussionThreadItem/styles.js +16 -11
- package/admin/src/components/DiscussionThreadItemActions/index.d.ts +19 -0
- package/admin/src/components/DiscussionThreadItemActions/index.js +121 -158
- package/admin/src/components/DiscussionThreadItemActions/styles.d.ts +2 -0
- package/admin/src/components/DiscussionThreadItemActions/styles.js +13 -7
- package/admin/src/components/DiscussionThreadItemApprovalFlowActions/index.d.ts +17 -0
- package/admin/src/components/DiscussionThreadItemApprovalFlowActions/index.js +38 -48
- package/admin/src/components/DiscussionThreadItemApprovalFlowActions/styles.d.ts +2 -0
- package/admin/src/components/DiscussionThreadItemApprovalFlowActions/styles.js +12 -6
- package/admin/src/components/DiscussionThreadItemFooter/index.d.ts +16 -0
- package/admin/src/components/DiscussionThreadItemFooter/index.js +34 -42
- package/admin/src/components/DiscussionThreadItemFooter/styles.d.ts +3 -0
- package/admin/src/components/DiscussionThreadItemFooter/styles.js +17 -12
- package/admin/src/components/DiscussionThreadItemReviewAction/index.d.ts +30 -0
- package/admin/src/components/DiscussionThreadItemReviewAction/index.js +77 -91
- package/admin/src/components/FormSwitch/index.d.ts +7 -0
- package/admin/src/components/FormSwitch/index.js +15 -18
- package/admin/src/components/FormSwitch/styles.d.ts +2 -0
- package/admin/src/components/FormSwitch/styles.js +14 -8
- package/admin/src/components/IconButton/styles.d.ts +2 -0
- package/admin/src/components/IconButton/styles.js +16 -9
- package/admin/src/components/Initializer/index.d.ts +5 -0
- package/admin/src/components/Initializer/index.js +12 -24
- package/admin/src/components/LoadingIndicatorOverlay/index.d.ts +3 -0
- package/admin/src/components/LoadingIndicatorOverlay/index.js +12 -15
- package/admin/src/components/LoadingIndicatorOverlay/styles.d.ts +3 -0
- package/admin/src/components/LoadingIndicatorOverlay/styles.js +22 -17
- package/admin/src/components/Nav/index.d.ts +7 -0
- package/admin/src/components/Nav/index.js +25 -48
- package/admin/src/components/PluginIcon/index.d.ts +3 -0
- package/admin/src/components/PluginIcon/index.js +10 -12
- package/admin/src/components/ReportsReviewModal/index.d.ts +21 -0
- package/admin/src/components/ReportsReviewModal/index.js +31 -46
- package/admin/src/components/ReportsReviewTable/index.d.ts +21 -0
- package/admin/src/components/ReportsReviewTable/index.js +120 -140
- package/admin/src/components/StatusBadge/index.d.ts +7 -0
- package/admin/src/components/StatusBadge/index.js +12 -17
- package/admin/src/components/StatusBadge/styles.d.ts +2 -0
- package/admin/src/components/StatusBadge/styles.js +19 -13
- package/admin/src/components/TableFilters/index.d.ts +10 -0
- package/admin/src/components/TableFilters/index.js +52 -49
- package/admin/src/components/TablePagination/index.d.ts +17 -0
- package/admin/src/components/TablePagination/index.js +27 -29
- package/admin/src/components/icons/comments.d.ts +6 -0
- package/admin/src/components/icons/comments.js +11 -8
- package/admin/src/components/icons/index.d.ts +6 -0
- package/admin/src/components/icons/index.js +15 -6
- package/admin/src/components/icons/lock.d.ts +7 -0
- package/admin/src/components/icons/lock.js +11 -21
- package/admin/src/components/icons/review.d.ts +7 -0
- package/admin/src/components/icons/review.js +11 -17
- package/admin/src/components/icons/unlock.d.ts +7 -0
- package/admin/src/components/icons/unlock.js +11 -19
- package/admin/src/hooks/useConfig.d.ts +8 -0
- package/admin/src/hooks/useConfig.js +40 -45
- package/admin/src/index.d.ts +7 -0
- package/admin/src/index.js +98 -92
- package/admin/src/pages/App/index.d.ts +4 -0
- package/admin/src/pages/App/index.js +43 -67
- package/admin/src/pages/App/reducer/actions.d.ts +8 -0
- package/admin/src/pages/App/reducer/actions.js +11 -7
- package/admin/src/pages/App/reducer/constants.d.ts +4 -0
- package/admin/src/pages/App/reducer/constants.js +7 -4
- package/admin/src/pages/App/reducer/index.d.ts +9 -0
- package/admin/src/pages/App/reducer/index.js +24 -22
- package/admin/src/pages/App/reducer/init.d.ts +3 -0
- package/admin/src/pages/App/reducer/init.js +6 -4
- package/admin/src/pages/App/reducer/selectors.d.ts +6 -0
- package/admin/src/pages/App/reducer/selectors.js +17 -34
- package/admin/src/pages/App/utils/api.d.ts +2 -0
- package/admin/src/pages/App/utils/api.js +14 -11
- package/admin/src/pages/ComingSoonPage/index.d.ts +3 -0
- package/admin/src/pages/ComingSoonPage/index.js +42 -24
- package/admin/src/pages/Details/components/DetailsEntity/index.d.ts +18 -0
- package/admin/src/pages/Details/components/DetailsEntity/index.js +49 -77
- package/admin/src/pages/Details/components/DetailsFilters/index.d.ts +12 -0
- package/admin/src/pages/Details/components/DetailsFilters/index.js +19 -26
- package/admin/src/pages/Details/components/DetailsFilters/styles.d.ts +2 -0
- package/admin/src/pages/Details/components/DetailsFilters/styles.js +14 -8
- package/admin/src/pages/Details/index.d.ts +4 -0
- package/admin/src/pages/Details/index.js +94 -133
- package/admin/src/pages/Discover/components/DiscoverTableRow/index.d.ts +20 -0
- package/admin/src/pages/Discover/components/DiscoverTableRow/index.js +128 -139
- package/admin/src/pages/Discover/components/DiscoverTableRow/styles.d.ts +2 -0
- package/admin/src/pages/Discover/components/DiscoverTableRow/styles.js +14 -8
- package/admin/src/pages/Discover/index.d.ts +4 -0
- package/admin/src/pages/Discover/index.js +129 -170
- package/admin/src/pages/Discover/utils/api.d.ts +2 -0
- package/admin/src/pages/Discover/utils/api.js +15 -13
- package/admin/src/pages/Discover/utils/filtersSchema.d.ts +11 -0
- package/admin/src/pages/Discover/utils/filtersSchema.js +8 -6
- package/admin/src/pages/Settings/components/RestartAlert/styles.d.ts +2 -0
- package/admin/src/pages/Settings/components/RestartAlert/styles.js +14 -8
- package/admin/src/pages/Settings/index.d.ts +3 -0
- package/admin/src/pages/Settings/index.js +225 -391
- package/admin/src/pages/Settings/utils/api.d.ts +7 -0
- package/admin/src/pages/Settings/utils/api.js +60 -55
- package/admin/src/pages/utils/api.d.ts +12 -0
- package/admin/src/pages/utils/api.js +58 -53
- package/admin/src/permissions.d.ts +28 -0
- package/admin/src/permissions.js +31 -17
- package/admin/src/pluginId.d.ts +2 -0
- package/admin/src/pluginId.js +29 -5
- package/admin/src/reducers.d.ts +7 -0
- package/admin/src/reducers.js +10 -6
- package/admin/src/translations/en.json +131 -131
- package/admin/src/translations/fr.json +132 -1
- package/admin/src/translations/pt-BR.json +130 -130
- package/admin/src/utils/axiosInstance.d.ts +3 -0
- package/admin/src/utils/axiosInstance.js +21 -27
- package/admin/src/utils/constants.d.ts +25 -0
- package/admin/src/utils/constants.js +23 -22
- package/admin/src/utils/getApiUrl.d.ts +3 -0
- package/admin/src/utils/getApiUrl.js +6 -5
- package/admin/src/utils/getMessage.d.ts +4 -0
- package/admin/src/utils/getMessage.js +15 -15
- package/admin/src/utils/getRelatedGroups.d.ts +4 -0
- package/admin/src/utils/getRelatedGroups.js +5 -3
- package/admin/src/utils/getUrl.d.ts +3 -0
- package/admin/src/utils/getUrl.js +6 -5
- package/admin/src/utils/handleAPIError.d.ts +4 -0
- package/admin/src/utils/handleAPIError.js +12 -11
- package/admin/src/utils/index.d.ts +12 -0
- package/admin/src/utils/index.js +29 -11
- package/admin/src/utils/parseRegExp.d.ts +6 -0
- package/admin/src/utils/parseRegExp.js +6 -5
- package/admin/src/utils/renderEntryTitle.d.ts +4 -0
- package/admin/src/utils/renderEntryTitle.js +11 -12
- package/admin/src/utils/renderInitials.d.ts +3 -0
- package/admin/src/utils/renderInitials.js +10 -5
- package/admin/src/utils/resolveCommentStatus.d.ts +4 -0
- package/admin/src/utils/resolveCommentStatus.js +17 -21
- package/admin/src/utils/resolveCommentStatusColor.d.ts +4 -0
- package/admin/src/utils/resolveCommentStatusColor.js +19 -19
- package/content-types/comment.d.ts +91 -0
- package/content-types/comment.js +87 -88
- package/content-types/index.d.ts +143 -0
- package/content-types/index.js +15 -10
- package/content-types/report.d.ts +48 -0
- package/content-types/report.js +44 -49
- package/package.json +24 -19
- package/permissions.d.ts +18 -0
- package/permissions.js +12 -13
- package/server/bootstrap.d.ts +4 -0
- package/server/bootstrap.js +56 -62
- package/server/config/index.d.ts +4 -0
- package/server/config/index.js +17 -15
- package/server/controllers/admin.d.ts +4 -0
- package/server/controllers/admin.js +134 -167
- package/server/controllers/client.d.ts +4 -0
- package/server/controllers/client.js +120 -112
- package/server/controllers/index.d.ts +6 -0
- package/server/controllers/index.js +12 -8
- package/server/controllers/utils/functions.d.ts +7 -0
- package/server/controllers/utils/functions.js +22 -17
- package/server/controllers/utils/parsers.d.ts +10 -0
- package/server/controllers/utils/parsers.js +47 -19
- package/server/destroy.d.ts +3 -0
- package/server/destroy.js +3 -4
- package/server/graphql/index.d.ts +4 -0
- package/server/graphql/index.js +27 -25
- package/server/graphql/mutations/createAbuseReport.d.ts +11 -0
- package/server/graphql/mutations/createAbuseReport.js +22 -24
- package/server/graphql/mutations/createComment.d.ts +14 -0
- package/server/graphql/mutations/createComment.js +22 -24
- package/server/graphql/mutations/index.d.ts +4 -0
- package/server/graphql/mutations/index.js +24 -19
- package/server/graphql/mutations/removeComment.d.ts +11 -0
- package/server/graphql/mutations/removeComment.js +22 -24
- package/server/graphql/mutations/updateComment.d.ts +11 -0
- package/server/graphql/mutations/updateComment.js +22 -24
- package/server/graphql/queries/findAllFlat.d.ts +19 -0
- package/server/graphql/queries/findAllFlat.js +36 -34
- package/server/graphql/queries/findAllInHierarchy.d.ts +17 -0
- package/server/graphql/queries/findAllInHierarchy.js +30 -30
- package/server/graphql/queries/index.d.ts +4 -0
- package/server/graphql/queries/index.js +20 -17
- package/server/graphql/resolvers-config.d.ts +23 -0
- package/server/graphql/resolvers-config.js +11 -11
- package/server/graphql/types/comment-author.d.ts +4 -0
- package/server/graphql/types/comment-author.js +10 -8
- package/server/graphql/types/comment-nested.d.ts +4 -0
- package/server/graphql/types/comment-nested.js +17 -15
- package/server/graphql/types/comment.d.ts +4 -0
- package/server/graphql/types/comment.js +16 -14
- package/server/graphql/types/create-comment-author.d.ts +4 -0
- package/server/graphql/types/create-comment-author.js +10 -8
- package/server/graphql/types/create-comment.d.ts +4 -0
- package/server/graphql/types/create-comment.js +10 -8
- package/server/graphql/types/create-report.d.ts +4 -0
- package/server/graphql/types/create-report.js +10 -8
- package/server/graphql/types/id.d.ts +4 -0
- package/server/graphql/types/id.js +24 -23
- package/server/graphql/types/identify-comment-author.d.ts +4 -0
- package/server/graphql/types/identify-comment-author.js +7 -5
- package/server/graphql/types/index.d.ts +4 -0
- package/server/graphql/types/index.js +36 -17
- package/server/graphql/types/remove-comment.d.ts +4 -0
- package/server/graphql/types/remove-comment.js +9 -7
- package/server/graphql/types/report-reason.d.ts +4 -0
- package/server/graphql/types/report-reason.js +10 -8
- package/server/graphql/types/report.d.ts +4 -0
- package/server/graphql/types/report.js +12 -10
- package/server/graphql/types/response-find-all.d.ts +4 -0
- package/server/graphql/types/response-find-all.js +8 -6
- package/server/graphql/types/response-meta.d.ts +4 -0
- package/server/graphql/types/response-meta.js +7 -5
- package/server/graphql/types/response-pagination.d.ts +4 -0
- package/server/graphql/types/response-pagination.js +12 -10
- package/server/graphql/types/update-comment.d.ts +4 -0
- package/server/graphql/types/update-comment.js +10 -8
- package/server/index.d.ts +26 -0
- package/server/index.js +24 -21
- package/server/register.d.ts +3 -0
- package/server/register.js +3 -4
- package/server/routes/admin.d.ts +4 -0
- package/server/routes/admin.js +103 -109
- package/server/routes/client.d.ts +4 -0
- package/server/routes/client.js +84 -46
- package/server/routes/index.d.ts +11 -0
- package/server/routes/index.js +18 -14
- package/server/services/admin.d.ts +5 -0
- package/server/services/admin.js +134 -161
- package/server/services/client.d.ts +5 -0
- package/server/services/client.js +164 -168
- package/server/services/common.d.ts +5 -0
- package/server/services/common.js +192 -202
- package/server/services/graphql.d.ts +5 -0
- package/server/services/graphql.js +117 -182
- package/server/services/index.d.ts +8 -0
- package/server/services/index.js +15 -12
- package/server/services/utils/functions.d.ts +13 -0
- package/server/services/utils/functions.js +105 -109
- package/server/utils/constants.d.ts +9 -0
- package/server/utils/constants.js +19 -23
- package/server/utils/error.d.ts +19 -0
- package/server/utils/error.js +23 -18
- package/server/utils/functions.d.ts +6 -0
- package/server/utils/functions.js +35 -18
- package/strapi-admin.d.ts +3 -0
- package/strapi-admin.js +8 -3
- package/strapi-server.d.ts +177 -0
- package/strapi-server.js +43 -46
- package/tsconfig.tsbuildinfo +1 -0
- package/types/contentTypes.d.ts +48 -0
- package/types/contentTypes.js +3 -0
- package/.husky/pre-commit +0 -4
- package/LICENSE.md +0 -7
- package/__mocks__/initSetup.js +0 -108
- package/jest.config.js +0 -7
- package/server/controllers/utils/__tests__/functions.test.js +0 -43
- package/server/controllers/utils/__tests__/parsers.test.js +0 -94
- package/server/services/__tests__/common.test.js +0 -399
- package/server/services/utils/__tests__/functions.test.js +0 -53
- package/server/utils/__tests__/functions.test.js +0 -17
|
@@ -1,53 +1,56 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
const react_1 = __importStar(require("react"));
|
|
30
|
+
const prop_types_1 = __importDefault(require("prop-types"));
|
|
31
|
+
const Button_1 = require("@strapi/design-system/Button");
|
|
32
|
+
const Box_1 = require("@strapi/design-system/Box");
|
|
33
|
+
const icons_1 = require("@strapi/icons");
|
|
34
|
+
const helper_plugin_1 = require("@strapi/helper-plugin");
|
|
35
|
+
const utils_1 = require("../../utils");
|
|
9
36
|
const TableFilters = ({ displayedFilters }) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
<Button
|
|
21
|
-
variant="tertiary"
|
|
22
|
-
ref={buttonRef}
|
|
23
|
-
startIcon={<Filter />}
|
|
24
|
-
onClick={handleToggle}
|
|
25
|
-
size="S"
|
|
26
|
-
>
|
|
27
|
-
{getMessage('page.discover.table.filters')}
|
|
28
|
-
</Button>
|
|
29
|
-
{isVisible && (
|
|
30
|
-
<FilterPopoverURLQuery
|
|
31
|
-
displayedFilters={displayedFilters}
|
|
32
|
-
isVisible={isVisible}
|
|
33
|
-
onToggle={handleToggle}
|
|
34
|
-
source={buttonRef}
|
|
35
|
-
/>
|
|
36
|
-
)}
|
|
37
|
-
</Box>
|
|
38
|
-
<FilterListURLQuery filtersSchema={displayedFilters} />
|
|
39
|
-
</>
|
|
40
|
-
);
|
|
37
|
+
const [isVisible, setIsVisible] = (0, react_1.useState)(false);
|
|
38
|
+
const buttonRef = (0, react_1.useRef)();
|
|
39
|
+
const handleToggle = () => {
|
|
40
|
+
setIsVisible((prev) => !prev);
|
|
41
|
+
};
|
|
42
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
43
|
+
react_1.default.createElement(Box_1.Box, { paddingTop: 1, paddingBottom: 1 },
|
|
44
|
+
react_1.default.createElement(Button_1.Button, { variant: "tertiary", ref: buttonRef, startIcon: react_1.default.createElement(icons_1.Filter, null), onClick: handleToggle, size: "S" }, (0, utils_1.getMessage)("page.discover.table.filters")),
|
|
45
|
+
isVisible && (react_1.default.createElement(helper_plugin_1.FilterPopoverURLQuery, { displayedFilters: displayedFilters, isVisible: isVisible, onToggle: handleToggle, source: buttonRef }))),
|
|
46
|
+
react_1.default.createElement(helper_plugin_1.FilterListURLQuery, { filtersSchema: displayedFilters })));
|
|
41
47
|
};
|
|
42
|
-
|
|
43
48
|
TableFilters.propTypes = {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
})
|
|
50
|
-
).isRequired,
|
|
49
|
+
displayedFilters: prop_types_1.default.arrayOf(prop_types_1.default.shape({
|
|
50
|
+
name: prop_types_1.default.string.isRequired,
|
|
51
|
+
metadatas: prop_types_1.default.shape({ label: prop_types_1.default.string }),
|
|
52
|
+
fieldSchema: prop_types_1.default.shape({ type: prop_types_1.default.string }),
|
|
53
|
+
})).isRequired,
|
|
51
54
|
};
|
|
52
|
-
|
|
53
|
-
|
|
55
|
+
exports.default = TableFilters;
|
|
56
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare const TablePagination: {
|
|
2
|
+
({ pagination }: {
|
|
3
|
+
pagination: any;
|
|
4
|
+
}): any;
|
|
5
|
+
defaultProps: {
|
|
6
|
+
pagination: {
|
|
7
|
+
pageCount: number;
|
|
8
|
+
pageSize: number;
|
|
9
|
+
total: number;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
propTypes: {
|
|
13
|
+
pagination: any;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export default TablePagination;
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,35 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const prop_types_1 = __importDefault(require("prop-types"));
|
|
8
|
+
const Box_1 = require("@strapi/design-system/Box");
|
|
9
|
+
const Flex_1 = require("@strapi/design-system/Flex");
|
|
10
|
+
const helper_plugin_1 = require("@strapi/helper-plugin");
|
|
7
11
|
const TablePagination = ({ pagination }) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
<PaginationURLQuery pagination={pagination} />
|
|
13
|
-
</Flex>
|
|
14
|
-
</Box>
|
|
15
|
-
);
|
|
12
|
+
return (react_1.default.createElement(Box_1.Box, { paddingTop: 4 },
|
|
13
|
+
react_1.default.createElement(Flex_1.Flex, { alignItems: "flex-end", justifyContent: "space-between" },
|
|
14
|
+
react_1.default.createElement(helper_plugin_1.PageSizeURLQuery, { trackedEvent: "willChangeNumberOfEntriesPerPage" }),
|
|
15
|
+
react_1.default.createElement(helper_plugin_1.PaginationURLQuery, { pagination: pagination }))));
|
|
16
16
|
};
|
|
17
|
-
|
|
18
17
|
TablePagination.defaultProps = {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
pagination: {
|
|
19
|
+
pageCount: 0,
|
|
20
|
+
pageSize: 10,
|
|
21
|
+
total: 0,
|
|
22
|
+
},
|
|
24
23
|
};
|
|
25
|
-
|
|
26
24
|
TablePagination.propTypes = {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
pagination: prop_types_1.default.shape({
|
|
26
|
+
page: prop_types_1.default.number,
|
|
27
|
+
pageCount: prop_types_1.default.number,
|
|
28
|
+
pageSize: prop_types_1.default.number,
|
|
29
|
+
total: prop_types_1.default.number,
|
|
30
|
+
}),
|
|
33
31
|
};
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
exports.default = TablePagination;
|
|
33
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
4
7
|
const initSize = 576;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
const CommentsIcon = ({ width = 24, height = 24 }) => (react_1.default.createElement("svg", { viewBox: `0 0 ${width} ${height}`, xmlns: "http://www.w3.org/2000/svg" },
|
|
9
|
+
react_1.default.createElement("g", { style: { transform: `scale(${width / initSize})` } },
|
|
10
|
+
react_1.default.createElement("path", { d: "M416 192c0-88.4-93.1-160-208-160S0 103.6 0 192c0 34.3 14.1 65.9 38 92-13.4 30.2-35.5 54.2-35.8 54.5-2.2 2.3-2.8 5.7-1.5 8.7S4.8 352 8 352c36.6 0 66.9-12.3 88.7-25 32.2 15.7 70.3 25 111.3 25 114.9 0 208-71.6 208-160zm122 220c23.9-26 38-57.7 38-92 0-66.9-53.5-124.2-129.3-148.1.9 6.6 1.3 13.3 1.3 20.1 0 105.9-107.7 192-240 192-10.8 0-21.3-.8-31.7-1.9C207.8 439.6 281.8 480 368 480c41 0 79.1-9.2 111.3-25 21.8 12.7 52.1 25 88.7 25 3.2 0 6.1-1.9 7.3-4.8 1.3-2.9.7-6.3-1.5-8.7-.3-.3-22.4-24.2-35.8-54.5z" }))));
|
|
11
|
+
exports.default = CommentsIcon;
|
|
12
|
+
//# sourceMappingURL=comments.js.map
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.UnlockIcon = exports.LockIcon = exports.ReviewIcon = exports.CommentsIcon = void 0;
|
|
7
|
+
const comments_1 = __importDefault(require("./comments"));
|
|
8
|
+
exports.CommentsIcon = comments_1.default;
|
|
9
|
+
const review_1 = __importDefault(require("./review"));
|
|
10
|
+
exports.ReviewIcon = review_1.default;
|
|
11
|
+
const lock_1 = __importDefault(require("./lock"));
|
|
12
|
+
exports.LockIcon = lock_1.default;
|
|
13
|
+
const unlock_1 = __importDefault(require("./unlock"));
|
|
14
|
+
exports.UnlockIcon = unlock_1.default;
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,22 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
4
7
|
const initSize = 330;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
viewBox={`0 0 ${width || size} ${height || size}`}
|
|
11
|
-
style={{ width: `${width || size}px`, height: `${height || size}px`, }}
|
|
12
|
-
xmlns="http://www.w3.org/2000/svg">
|
|
13
|
-
<g style={ { transform: `scale(${(width || size)/initSize})` } }>
|
|
14
|
-
<path d="M165,330c63.411,0,115-51.589,115-115c0-29.771-11.373-56.936-30-77.379V85c0-46.869-38.131-85-85-85
|
|
15
|
-
S80.001,38.131,80.001,85v52.619C61.373,158.064,50,185.229,50,215C50,278.411,101.589,330,165,330z M180,219.986V240
|
|
16
|
-
c0,8.284-6.716,15-15,15s-15-6.716-15-15v-20.014c-6.068-4.565-10-11.824-10-19.986c0-13.785,11.215-25,25-25s25,11.215,25,25
|
|
17
|
-
C190,208.162,186.068,215.421,180,219.986z M110.001,85c0-30.327,24.673-55,54.999-55c30.327,0,55,24.673,55,55v29.029
|
|
18
|
-
C203.652,105.088,184.91,100,165,100c-19.909,0-38.651,5.088-54.999,14.028V85z"/>
|
|
19
|
-
</g>
|
|
20
|
-
</svg>
|
|
21
|
-
|
|
22
|
-
export default LockIcon;
|
|
8
|
+
const LockIcon = ({ width, height, size = 16 }) => (react_1.default.createElement("svg", { width: width || size, height: height || size, viewBox: `0 0 ${width || size} ${height || size}`, style: { width: `${width || size}px`, height: `${height || size}px` }, xmlns: "http://www.w3.org/2000/svg" },
|
|
9
|
+
react_1.default.createElement("g", { style: { transform: `scale(${(width || size) / initSize})` } },
|
|
10
|
+
react_1.default.createElement("path", { d: "M165,330c63.411,0,115-51.589,115-115c0-29.771-11.373-56.936-30-77.379V85c0-46.869-38.131-85-85-85\n S80.001,38.131,80.001,85v52.619C61.373,158.064,50,185.229,50,215C50,278.411,101.589,330,165,330z M180,219.986V240\n c0,8.284-6.716,15-15,15s-15-6.716-15-15v-20.014c-6.068-4.565-10-11.824-10-19.986c0-13.785,11.215-25,25-25s25,11.215,25,25\n C190,208.162,186.068,215.421,180,219.986z M110.001,85c0-30.327,24.673-55,54.999-55c30.327,0,55,24.673,55,55v29.029\n C203.652,105.088,184.91,100,165,100c-19.909,0-38.651,5.088-54.999,14.028V85z" }))));
|
|
11
|
+
exports.default = LockIcon;
|
|
12
|
+
//# sourceMappingURL=lock.js.map
|
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
4
7
|
const initSize = 16;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
viewBox={`0 0 ${width || size} ${height || size}`}
|
|
11
|
-
style={{ width: `${width || size}px`, height: `${height || size}px`, }}
|
|
12
|
-
xmlns="http://www.w3.org/2000/svg">
|
|
13
|
-
<g style={ {transform: `scale(${(width || size)/initSize})` } }>
|
|
14
|
-
<path fillRule="evenodd" clipRule="evenodd" 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" />
|
|
15
|
-
</g>
|
|
16
|
-
</svg>
|
|
17
|
-
|
|
18
|
-
export default ReviewIcon;
|
|
8
|
+
const ReviewIcon = ({ width, height, size = 16 }) => (react_1.default.createElement("svg", { width: width || size, height: height || size, viewBox: `0 0 ${width || size} ${height || size}`, style: { width: `${width || size}px`, height: `${height || size}px` }, xmlns: "http://www.w3.org/2000/svg" },
|
|
9
|
+
react_1.default.createElement("g", { style: { transform: `scale(${(width || size) / initSize})` } },
|
|
10
|
+
react_1.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", 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" }))));
|
|
11
|
+
exports.default = ReviewIcon;
|
|
12
|
+
//# sourceMappingURL=review.js.map
|
|
@@ -1,20 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
4
7
|
const initSize = 330;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
viewBox={`0 0 ${width || size} ${height || size}`}
|
|
11
|
-
style={{ width: `${width || size}px`, height: `${height || size}px`, }}
|
|
12
|
-
xmlns="http://www.w3.org/2000/svg">
|
|
13
|
-
<g style={ { transform: `scale(${(width || size)/initSize})` } }>
|
|
14
|
-
<path 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
|
|
15
|
-
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
|
|
16
|
-
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"/>
|
|
17
|
-
</g>
|
|
18
|
-
</svg>
|
|
19
|
-
|
|
20
|
-
export default UnlockIcon;
|
|
8
|
+
const UnlockIcon = ({ width, height, size = 16 }) => (react_1.default.createElement("svg", { width: width || size, height: height || size, viewBox: `0 0 ${width || size} ${height || size}`, style: { width: `${width || size}px`, height: `${height || size}px` }, xmlns: "http://www.w3.org/2000/svg" },
|
|
9
|
+
react_1.default.createElement("g", { style: { transform: `scale(${(width || size) / initSize})` } },
|
|
10
|
+
react_1.default.createElement("path", { 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" }))));
|
|
11
|
+
exports.default = UnlockIcon;
|
|
12
|
+
//# sourceMappingURL=unlock.js.map
|
|
@@ -1,49 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const react_query_1 = require("react-query");
|
|
7
|
+
const api_1 = require("../pages/Settings/utils/api");
|
|
8
|
+
const pluginId_1 = __importDefault(require("../pluginId"));
|
|
5
9
|
const useConfig = (toggleNotification) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
10
|
+
const queryClient = (0, react_query_1.useQueryClient)();
|
|
11
|
+
const fetch = (0, react_query_1.useQuery)("get-config", () => (0, api_1.fetchConfig)(toggleNotification));
|
|
12
|
+
const handleError = (type, callback = () => { }) => {
|
|
13
|
+
toggleNotification({
|
|
14
|
+
type: "warning",
|
|
15
|
+
message: `${pluginId_1.default}.page.settings.notification.${type}.error`,
|
|
16
|
+
});
|
|
17
|
+
callback();
|
|
18
|
+
};
|
|
19
|
+
const handleSuccess = (type, callback = () => { }, invalidateQueries = true) => {
|
|
20
|
+
if (invalidateQueries) {
|
|
21
|
+
queryClient.invalidateQueries("get-config");
|
|
22
|
+
}
|
|
23
|
+
toggleNotification({
|
|
24
|
+
type: "success",
|
|
25
|
+
message: `${pluginId_1.default}.page.settings.notification.${type}.success`,
|
|
26
|
+
});
|
|
27
|
+
callback();
|
|
23
28
|
};
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
29
|
+
const submitMutation = (0, react_query_1.useMutation)(api_1.updateConfig, {
|
|
30
|
+
onSuccess: () => handleSuccess("submit"),
|
|
31
|
+
onError: () => handleError("submit"),
|
|
32
|
+
});
|
|
33
|
+
const restoreMutation = (0, react_query_1.useMutation)(api_1.restoreConfig, {
|
|
34
|
+
onSuccess: () => handleSuccess("restore"),
|
|
35
|
+
onError: () => handleError("restore"),
|
|
36
|
+
});
|
|
37
|
+
const restartMutation = (0, react_query_1.useMutation)(api_1.restartStrapi, {
|
|
38
|
+
onSuccess: () => handleSuccess("restart", () => { }, false),
|
|
39
|
+
onError: () => handleError("restart"),
|
|
27
40
|
});
|
|
28
|
-
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
const submitMutation = useMutation(updateConfig, {
|
|
32
|
-
onSuccess: () => handleSuccess('submit'),
|
|
33
|
-
onError: () => handleError('submit'),
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
const restoreMutation = useMutation(restoreConfig, {
|
|
37
|
-
onSuccess: () => handleSuccess('restore'),
|
|
38
|
-
onError: () => handleError('restore'),
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
const restartMutation = useMutation(restartStrapi, {
|
|
42
|
-
onSuccess: () => handleSuccess('restart', () => {}, false),
|
|
43
|
-
onError: () => handleError('restart'),
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
return { fetch, restartMutation, submitMutation, restoreMutation };
|
|
41
|
+
return { fetch, restartMutation, submitMutation, restoreMutation };
|
|
47
42
|
};
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
exports.default = useConfig;
|
|
44
|
+
//# sourceMappingURL=useConfig.js.map
|