strapi-plugin-comments 2.0.8 → 2.1.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +171 -127
- package/admin/src/components/ActionButton/styles.d.ts +2 -0
- package/admin/src/components/ActionButton/styles.js +13 -8
- 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 +35 -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 -130
- package/admin/src/translations/fr.json +1 -1
- package/admin/src/translations/pt-BR.json +132 -0
- 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 +104 -115
- 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 +15 -0
- package/server/controllers/utils/parsers.js +17 -17
- 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 +31 -30
- package/server/graphql/queries/findAllInHierarchy.d.ts +18 -0
- package/server/graphql/queries/findAllInHierarchy.js +26 -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 +48 -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 +126 -158
- package/server/services/client.d.ts +5 -0
- package/server/services/client.js +135 -151
- package/server/services/common.d.ts +5 -0
- package/server/services/common.js +165 -194
- 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 +100 -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 +44 -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,21 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
if (isString(input)) {
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const react_intl_1 = require("react-intl");
|
|
4
|
+
const lodash_1 = require("lodash");
|
|
5
|
+
const pluginId_1 = require("../pluginId");
|
|
6
|
+
const getMessage = (input, defaultMessage = "", inPluginScope = true) => {
|
|
7
|
+
const { formatMessage } = (0, react_intl_1.useIntl)();
|
|
8
|
+
let formattedId = "";
|
|
9
|
+
if ((0, lodash_1.isString)(input)) {
|
|
11
10
|
formattedId = input;
|
|
12
|
-
}
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
13
|
formattedId = input?.id;
|
|
14
14
|
}
|
|
15
15
|
return formatMessage({
|
|
16
|
-
id: `${inPluginScope ? pluginId :
|
|
16
|
+
id: `${inPluginScope ? pluginId_1.pluginId : "app.components"}.${formattedId}`,
|
|
17
17
|
defaultMessage,
|
|
18
|
-
}, input?.props || undefined)
|
|
18
|
+
}, input?.props || undefined);
|
|
19
19
|
};
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
exports.default = getMessage;
|
|
21
|
+
//# sourceMappingURL=getMessage.js.map
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const getRelatedGroups = (related, config) => related.split(config.regex.relatedUid).filter((s) => s && s.length > 0);
|
|
4
|
+
exports.default = getRelatedGroups;
|
|
5
|
+
//# sourceMappingURL=getRelatedGroups.js.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const pluginId_1 = require("../pluginId");
|
|
4
|
+
const getUrl = (path = "") => `/plugins/${pluginId_1.pluginId}/${path}`;
|
|
5
|
+
exports.default = getUrl;
|
|
6
|
+
//# sourceMappingURL=getUrl.js.map
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const pluginId_1 = require("../pluginId");
|
|
4
|
+
const handleAPIError = (err = null, toggleNotification = null, message = "app.components.notification.error") => {
|
|
4
5
|
toggleNotification({
|
|
5
|
-
type:
|
|
6
|
-
message: `${pluginId}.${message}`,
|
|
6
|
+
type: "warning",
|
|
7
|
+
message: `${pluginId_1.pluginId}.${message}`,
|
|
7
8
|
});
|
|
8
|
-
|
|
9
9
|
if (err) {
|
|
10
10
|
throw err;
|
|
11
|
-
} else {
|
|
12
|
-
throw new Error('error');
|
|
13
11
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
else {
|
|
13
|
+
throw new Error("error");
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
exports.default = handleAPIError;
|
|
17
|
+
//# sourceMappingURL=handleAPIError.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { default as axiosInstance } from "./axiosInstance";
|
|
2
|
+
export { default as getApiURL } from "./getApiUrl";
|
|
3
|
+
export { default as getUrl } from "./getUrl";
|
|
4
|
+
export { default as getMessage } from "./getMessage";
|
|
5
|
+
export { default as handleAPIError } from "./handleAPIError";
|
|
6
|
+
export { default as getRelatedGroups } from "./getRelatedGroups";
|
|
7
|
+
export { default as renderEntryTitle } from "./renderEntryTitle";
|
|
8
|
+
export { default as renderInitials } from "./renderInitials";
|
|
9
|
+
export { default as resolveCommentStatus } from "./resolveCommentStatus";
|
|
10
|
+
export { default as resolveCommentStatusColor } from "./resolveCommentStatusColor";
|
|
11
|
+
export { default as parseRegExp } from "./parseRegExp";
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
package/admin/src/utils/index.js
CHANGED
|
@@ -1,11 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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.parseRegExp = exports.resolveCommentStatusColor = exports.resolveCommentStatus = exports.renderInitials = exports.renderEntryTitle = exports.getRelatedGroups = exports.handleAPIError = exports.getMessage = exports.getUrl = exports.getApiURL = exports.axiosInstance = void 0;
|
|
7
|
+
var axiosInstance_1 = require("./axiosInstance");
|
|
8
|
+
Object.defineProperty(exports, "axiosInstance", { enumerable: true, get: function () { return __importDefault(axiosInstance_1).default; } });
|
|
9
|
+
var getApiUrl_1 = require("./getApiUrl");
|
|
10
|
+
Object.defineProperty(exports, "getApiURL", { enumerable: true, get: function () { return __importDefault(getApiUrl_1).default; } });
|
|
11
|
+
var getUrl_1 = require("./getUrl");
|
|
12
|
+
Object.defineProperty(exports, "getUrl", { enumerable: true, get: function () { return __importDefault(getUrl_1).default; } });
|
|
13
|
+
var getMessage_1 = require("./getMessage");
|
|
14
|
+
Object.defineProperty(exports, "getMessage", { enumerable: true, get: function () { return __importDefault(getMessage_1).default; } });
|
|
15
|
+
var handleAPIError_1 = require("./handleAPIError");
|
|
16
|
+
Object.defineProperty(exports, "handleAPIError", { enumerable: true, get: function () { return __importDefault(handleAPIError_1).default; } });
|
|
17
|
+
var getRelatedGroups_1 = require("./getRelatedGroups");
|
|
18
|
+
Object.defineProperty(exports, "getRelatedGroups", { enumerable: true, get: function () { return __importDefault(getRelatedGroups_1).default; } });
|
|
19
|
+
var renderEntryTitle_1 = require("./renderEntryTitle");
|
|
20
|
+
Object.defineProperty(exports, "renderEntryTitle", { enumerable: true, get: function () { return __importDefault(renderEntryTitle_1).default; } });
|
|
21
|
+
var renderInitials_1 = require("./renderInitials");
|
|
22
|
+
Object.defineProperty(exports, "renderInitials", { enumerable: true, get: function () { return __importDefault(renderInitials_1).default; } });
|
|
23
|
+
var resolveCommentStatus_1 = require("./resolveCommentStatus");
|
|
24
|
+
Object.defineProperty(exports, "resolveCommentStatus", { enumerable: true, get: function () { return __importDefault(resolveCommentStatus_1).default; } });
|
|
25
|
+
var resolveCommentStatusColor_1 = require("./resolveCommentStatusColor");
|
|
26
|
+
Object.defineProperty(exports, "resolveCommentStatusColor", { enumerable: true, get: function () { return __importDefault(resolveCommentStatusColor_1).default; } });
|
|
27
|
+
var parseRegExp_1 = require("./parseRegExp");
|
|
28
|
+
Object.defineProperty(exports, "parseRegExp", { enumerable: true, get: function () { return __importDefault(parseRegExp_1).default; } });
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
3
|
const parseRegExp = (regexpString) => {
|
|
3
|
-
const [value, flags] = regexpString.split(
|
|
4
|
+
const [value, flags] = regexpString.split("/").filter((_) => _.length > 0);
|
|
4
5
|
return {
|
|
5
6
|
value,
|
|
6
7
|
flags,
|
|
7
8
|
};
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
};
|
|
10
|
+
exports.default = parseRegExp;
|
|
11
|
+
//# sourceMappingURL=parseRegExp.js.map
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const lodash_1 = require("lodash");
|
|
3
4
|
const renderEntryTitle = (entry, config = {}) => {
|
|
4
5
|
const { entryLabel } = config;
|
|
5
|
-
const rule = entry.uid in entryLabel ? entryLabel[entry.uid] : entryLabel[
|
|
6
|
-
return first(
|
|
7
|
-
|
|
8
|
-
.
|
|
9
|
-
.
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export default renderEntryTitle;
|
|
6
|
+
const rule = entry.uid in entryLabel ? entryLabel[entry.uid] : entryLabel["*"];
|
|
7
|
+
return (0, lodash_1.first)(Object.keys(entry)
|
|
8
|
+
.filter((_) => rule === _ || rule.includes(_))
|
|
9
|
+
.map((_) => entry[_])
|
|
10
|
+
.filter((_) => _));
|
|
11
|
+
};
|
|
12
|
+
exports.default = renderEntryTitle;
|
|
13
|
+
//# sourceMappingURL=renderEntryTitle.js.map
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const lodash_1 = require("lodash");
|
|
4
|
+
const renderInitials = (value = "") => value
|
|
5
|
+
.split(" ")
|
|
6
|
+
.map((_) => (0, lodash_1.first)(_))
|
|
7
|
+
.join("")
|
|
8
|
+
.toUpperCase();
|
|
9
|
+
exports.default = renderInitials;
|
|
10
|
+
//# sourceMappingURL=renderInitials.js.map
|
|
@@ -1,30 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const lodash_1 = require("lodash");
|
|
4
|
+
const constants_1 = require("./constants");
|
|
5
|
+
const resolveCommentStatus = ({ removed, blocked, blockedThread, approvalStatus, reviewFlowEnabled, }) => {
|
|
6
|
+
const gotApprovalFlow = !(0, lodash_1.isNil)(approvalStatus);
|
|
7
7
|
if (removed) {
|
|
8
|
-
return COMMENT_STATUS.REMOVED;
|
|
9
|
-
}
|
|
10
|
-
|
|
8
|
+
return constants_1.COMMENT_STATUS.REMOVED;
|
|
9
|
+
}
|
|
11
10
|
if (blocked || blockedThread) {
|
|
12
|
-
return COMMENT_STATUS.BLOCKED;
|
|
13
|
-
}
|
|
14
|
-
|
|
11
|
+
return constants_1.COMMENT_STATUS.BLOCKED;
|
|
12
|
+
}
|
|
15
13
|
if (reviewFlowEnabled) {
|
|
16
|
-
return COMMENT_STATUS.TO_REVIEW;
|
|
14
|
+
return constants_1.COMMENT_STATUS.TO_REVIEW;
|
|
17
15
|
}
|
|
18
|
-
|
|
19
16
|
if (gotApprovalFlow) {
|
|
20
17
|
const status = approvalStatus.toUpperCase();
|
|
21
|
-
if (Object.keys(COMMENT_STATUS).includes(status)) {
|
|
18
|
+
if (Object.keys(constants_1.COMMENT_STATUS).includes(status)) {
|
|
22
19
|
return status;
|
|
23
20
|
}
|
|
24
|
-
return COMMENT_STATUS.UNKNOWN;
|
|
21
|
+
return constants_1.COMMENT_STATUS.UNKNOWN;
|
|
25
22
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
export default resolveCommentStatus;
|
|
23
|
+
return constants_1.COMMENT_STATUS.OPEN;
|
|
24
|
+
};
|
|
25
|
+
exports.default = resolveCommentStatus;
|
|
26
|
+
//# sourceMappingURL=resolveCommentStatus.js.map
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const constants_1 = require("./constants");
|
|
4
4
|
const resolveCommentStatusColor = (status) => {
|
|
5
|
-
if (Object.keys(COMMENT_STATUS).includes(status)) {
|
|
5
|
+
if (Object.keys(constants_1.COMMENT_STATUS).includes(status)) {
|
|
6
6
|
switch (status) {
|
|
7
|
-
case COMMENT_STATUS.REMOVED:
|
|
8
|
-
return
|
|
9
|
-
case COMMENT_STATUS.TO_REVIEW:
|
|
10
|
-
case COMMENT_STATUS.REJECTED:
|
|
11
|
-
return
|
|
12
|
-
case COMMENT_STATUS.BLOCKED:
|
|
13
|
-
return
|
|
14
|
-
case COMMENT_STATUS.OPEN:
|
|
15
|
-
case COMMENT_STATUS.APPROVED:
|
|
16
|
-
return
|
|
17
|
-
}
|
|
7
|
+
case constants_1.COMMENT_STATUS.REMOVED:
|
|
8
|
+
return "secondary";
|
|
9
|
+
case constants_1.COMMENT_STATUS.TO_REVIEW:
|
|
10
|
+
case constants_1.COMMENT_STATUS.REJECTED:
|
|
11
|
+
return "warning";
|
|
12
|
+
case constants_1.COMMENT_STATUS.BLOCKED:
|
|
13
|
+
return "danger";
|
|
14
|
+
case constants_1.COMMENT_STATUS.OPEN:
|
|
15
|
+
case constants_1.COMMENT_STATUS.APPROVED:
|
|
16
|
+
return "success";
|
|
17
|
+
}
|
|
18
18
|
}
|
|
19
|
-
return
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
return "secondary";
|
|
20
|
+
};
|
|
21
|
+
exports.default = resolveCommentStatusColor;
|
|
22
|
+
//# sourceMappingURL=resolveCommentStatusColor.js.map
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
info: {
|
|
3
|
+
tableName: string;
|
|
4
|
+
singularName: string;
|
|
5
|
+
pluralName: string;
|
|
6
|
+
displayName: string;
|
|
7
|
+
description: string;
|
|
8
|
+
kind: string;
|
|
9
|
+
};
|
|
10
|
+
options: {
|
|
11
|
+
draftAndPublish: boolean;
|
|
12
|
+
};
|
|
13
|
+
pluginOptions: {
|
|
14
|
+
"content-manager": {
|
|
15
|
+
visible: boolean;
|
|
16
|
+
};
|
|
17
|
+
"content-type-builder": {
|
|
18
|
+
visible: boolean;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
attributes: {
|
|
22
|
+
content: {
|
|
23
|
+
type: string;
|
|
24
|
+
configurable: boolean;
|
|
25
|
+
required: boolean;
|
|
26
|
+
};
|
|
27
|
+
blocked: {
|
|
28
|
+
type: string;
|
|
29
|
+
default: boolean;
|
|
30
|
+
configurable: boolean;
|
|
31
|
+
};
|
|
32
|
+
blockedThread: {
|
|
33
|
+
type: string;
|
|
34
|
+
default: boolean;
|
|
35
|
+
configurable: boolean;
|
|
36
|
+
};
|
|
37
|
+
blockReason: {
|
|
38
|
+
type: string;
|
|
39
|
+
configurable: boolean;
|
|
40
|
+
};
|
|
41
|
+
authorUser: {
|
|
42
|
+
type: string;
|
|
43
|
+
relation: string;
|
|
44
|
+
target: string;
|
|
45
|
+
configurable: boolean;
|
|
46
|
+
};
|
|
47
|
+
authorId: {
|
|
48
|
+
type: string;
|
|
49
|
+
configurable: boolean;
|
|
50
|
+
};
|
|
51
|
+
authorName: {
|
|
52
|
+
type: string;
|
|
53
|
+
configurable: boolean;
|
|
54
|
+
};
|
|
55
|
+
authorEmail: {
|
|
56
|
+
type: string;
|
|
57
|
+
configurable: boolean;
|
|
58
|
+
};
|
|
59
|
+
authorAvatar: {
|
|
60
|
+
type: string;
|
|
61
|
+
configurable: boolean;
|
|
62
|
+
};
|
|
63
|
+
removed: {
|
|
64
|
+
type: string;
|
|
65
|
+
configurable: boolean;
|
|
66
|
+
};
|
|
67
|
+
approvalStatus: {
|
|
68
|
+
type: string;
|
|
69
|
+
configurable: boolean;
|
|
70
|
+
};
|
|
71
|
+
related: {
|
|
72
|
+
type: string;
|
|
73
|
+
configurable: boolean;
|
|
74
|
+
};
|
|
75
|
+
reports: {
|
|
76
|
+
type: string;
|
|
77
|
+
relation: string;
|
|
78
|
+
target: string;
|
|
79
|
+
mappedBy: string;
|
|
80
|
+
configurable: boolean;
|
|
81
|
+
};
|
|
82
|
+
threadOf: {
|
|
83
|
+
type: string;
|
|
84
|
+
relation: string;
|
|
85
|
+
target: string;
|
|
86
|
+
configurable: boolean;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
export default _default;
|
|
91
|
+
//# sourceMappingURL=comment.d.ts.map
|
package/content-types/comment.js
CHANGED
|
@@ -1,93 +1,92 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
description: 'Comment content type',
|
|
12
|
-
kind: 'collectionType',
|
|
13
|
-
},
|
|
14
|
-
options: {
|
|
15
|
-
draftAndPublish: false,
|
|
16
|
-
},
|
|
17
|
-
pluginOptions: {
|
|
18
|
-
'content-manager': {
|
|
19
|
-
visible: false
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = {
|
|
4
|
+
info: {
|
|
5
|
+
tableName: "plugin-comments-comments",
|
|
6
|
+
singularName: "comment",
|
|
7
|
+
pluralName: "comments",
|
|
8
|
+
displayName: "Comment",
|
|
9
|
+
description: "Comment content type",
|
|
10
|
+
kind: "collectionType",
|
|
20
11
|
},
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
attributes: {
|
|
26
|
-
content: {
|
|
27
|
-
type: 'text',
|
|
28
|
-
configurable: false,
|
|
29
|
-
required: true
|
|
12
|
+
options: {
|
|
13
|
+
draftAndPublish: false,
|
|
30
14
|
},
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
15
|
+
pluginOptions: {
|
|
16
|
+
"content-manager": {
|
|
17
|
+
visible: false,
|
|
18
|
+
},
|
|
19
|
+
"content-type-builder": {
|
|
20
|
+
visible: false,
|
|
21
|
+
},
|
|
35
22
|
},
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
23
|
+
attributes: {
|
|
24
|
+
content: {
|
|
25
|
+
type: "text",
|
|
26
|
+
configurable: false,
|
|
27
|
+
required: true,
|
|
28
|
+
},
|
|
29
|
+
blocked: {
|
|
30
|
+
type: "boolean",
|
|
31
|
+
default: false,
|
|
32
|
+
configurable: false,
|
|
33
|
+
},
|
|
34
|
+
blockedThread: {
|
|
35
|
+
type: "boolean",
|
|
36
|
+
default: false,
|
|
37
|
+
configurable: false,
|
|
38
|
+
},
|
|
39
|
+
blockReason: {
|
|
40
|
+
type: "string",
|
|
41
|
+
configurable: false,
|
|
42
|
+
},
|
|
43
|
+
authorUser: {
|
|
44
|
+
type: "relation",
|
|
45
|
+
relation: "oneToOne",
|
|
46
|
+
target: "plugin::users-permissions.user",
|
|
47
|
+
configurable: false,
|
|
48
|
+
},
|
|
49
|
+
authorId: {
|
|
50
|
+
type: "string",
|
|
51
|
+
configurable: false,
|
|
52
|
+
},
|
|
53
|
+
authorName: {
|
|
54
|
+
type: "string",
|
|
55
|
+
configurable: false,
|
|
56
|
+
},
|
|
57
|
+
authorEmail: {
|
|
58
|
+
type: "email",
|
|
59
|
+
configurable: false,
|
|
60
|
+
},
|
|
61
|
+
authorAvatar: {
|
|
62
|
+
type: "string",
|
|
63
|
+
configurable: false,
|
|
64
|
+
},
|
|
65
|
+
removed: {
|
|
66
|
+
type: "boolean",
|
|
67
|
+
configurable: false,
|
|
68
|
+
},
|
|
69
|
+
approvalStatus: {
|
|
70
|
+
type: "string",
|
|
71
|
+
configurable: false,
|
|
72
|
+
},
|
|
73
|
+
related: {
|
|
74
|
+
type: "string",
|
|
75
|
+
configurable: false,
|
|
76
|
+
},
|
|
77
|
+
reports: {
|
|
78
|
+
type: "relation",
|
|
79
|
+
relation: "oneToMany",
|
|
80
|
+
target: "plugin::comments.comment-report",
|
|
81
|
+
mappedBy: "related",
|
|
82
|
+
configurable: false,
|
|
83
|
+
},
|
|
84
|
+
threadOf: {
|
|
85
|
+
type: "relation",
|
|
86
|
+
relation: "oneToOne",
|
|
87
|
+
target: "plugin::comments.comment",
|
|
88
|
+
configurable: false,
|
|
89
|
+
},
|
|
40
90
|
},
|
|
41
|
-
blockReason: {
|
|
42
|
-
type: 'string',
|
|
43
|
-
configurable: false
|
|
44
|
-
},
|
|
45
|
-
authorUser: {
|
|
46
|
-
type: 'relation',
|
|
47
|
-
relation: 'oneToOne',
|
|
48
|
-
target: 'plugin::users-permissions.user',
|
|
49
|
-
configurable: false,
|
|
50
|
-
},
|
|
51
|
-
authorId: {
|
|
52
|
-
type: 'string',
|
|
53
|
-
configurable: false
|
|
54
|
-
},
|
|
55
|
-
authorName: {
|
|
56
|
-
type: 'string',
|
|
57
|
-
configurable: false
|
|
58
|
-
},
|
|
59
|
-
authorEmail: {
|
|
60
|
-
type: 'email',
|
|
61
|
-
configurable: false
|
|
62
|
-
},
|
|
63
|
-
authorAvatar: {
|
|
64
|
-
type: 'string',
|
|
65
|
-
configurable: false
|
|
66
|
-
},
|
|
67
|
-
removed: {
|
|
68
|
-
type: 'boolean',
|
|
69
|
-
configurable: false
|
|
70
|
-
},
|
|
71
|
-
approvalStatus: {
|
|
72
|
-
type: 'string',
|
|
73
|
-
configurable: false
|
|
74
|
-
},
|
|
75
|
-
related: {
|
|
76
|
-
type: 'string',
|
|
77
|
-
configurable: false
|
|
78
|
-
},
|
|
79
|
-
reports: {
|
|
80
|
-
type: 'relation',
|
|
81
|
-
relation: 'oneToMany',
|
|
82
|
-
target: 'plugin::comments.comment-report',
|
|
83
|
-
mappedBy: 'related',
|
|
84
|
-
configurable: false,
|
|
85
|
-
},
|
|
86
|
-
threadOf: {
|
|
87
|
-
type: 'relation',
|
|
88
|
-
relation: 'oneToOne',
|
|
89
|
-
target: 'plugin::comments.comment',
|
|
90
|
-
configurable: false,
|
|
91
|
-
},
|
|
92
|
-
},
|
|
93
91
|
};
|
|
92
|
+
//# sourceMappingURL=comment.js.map
|