strapi-plugin-comments 2.1.8 → 2.2.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 +11 -3
- package/admin/src/components/Avatar/index.d.ts +3 -2
- package/admin/src/components/CommentReviewModal/index.d.ts +11 -0
- package/admin/src/components/CommentReviewModal/index.js +19 -0
- package/admin/src/components/ConfirmationDialog/index.d.ts +12 -10
- package/admin/src/components/ConfirmationDialog/index.js +3 -3
- package/admin/src/components/DiscussionStatus/index.d.ts +2 -1
- package/admin/src/components/DiscussionThread/index.d.ts +11 -5
- package/admin/src/components/DiscussionThread/index.js +3 -3
- package/admin/src/components/DiscussionThreadItem/index.d.ts +2 -7
- package/admin/src/components/DiscussionThreadItem/index.js +3 -12
- package/admin/src/components/DiscussionThreadItemActions/index.d.ts +10 -6
- package/admin/src/components/DiscussionThreadItemActions/index.js +75 -53
- package/admin/src/components/DiscussionThreadItemApprovalFlowActions/index.d.ts +9 -6
- package/admin/src/components/DiscussionThreadItemApprovalFlowActions/index.js +6 -9
- package/admin/src/components/DiscussionThreadItemFooter/index.d.ts +14 -7
- package/admin/src/components/DiscussionThreadItemFooter/index.js +3 -3
- package/admin/src/components/DiscussionThreadItemReviewAction/index.d.ts +14 -18
- package/admin/src/components/DiscussionThreadItemReviewAction/index.js +71 -52
- package/admin/src/components/FormSwitch/index.d.ts +2 -1
- package/admin/src/components/Hint/index.d.ts +14 -0
- package/admin/src/components/Hint/index.js +22 -0
- package/admin/src/components/LoadingIndicatorOverlay/index.d.ts +2 -1
- package/admin/src/components/ModeratorResponse/index.d.ts +8 -0
- package/admin/src/components/ModeratorResponse/index.js +108 -0
- package/admin/src/components/ModeratorResponse/styles.d.ts +2 -0
- package/admin/src/components/ModeratorResponse/styles.js +12 -0
- package/admin/src/components/ModeratorResponseModal/ModeratorResponseModal.d.ts +11 -0
- package/admin/src/components/ModeratorResponseModal/ModeratorResponseModal.js +98 -0
- package/admin/src/components/Nav/index.d.ts +2 -1
- package/admin/src/components/Nav/index.js +6 -9
- package/admin/src/components/PluginIcon/index.d.ts +2 -1
- package/admin/src/components/PluginIcon/index.js +2 -6
- package/admin/src/components/PreviewWysiwyg/Wrapper.d.ts +3 -0
- package/admin/src/components/PreviewWysiwyg/Wrapper.js +162 -0
- package/admin/src/components/PreviewWysiwyg/index.d.ts +7 -0
- package/admin/src/components/PreviewWysiwyg/index.js +39 -0
- package/admin/src/components/PreviewWysiwyg/utils/mdRenderer.d.ts +3 -0
- package/admin/src/components/PreviewWysiwyg/utils/mdRenderer.js +88 -0
- package/admin/src/components/PreviewWysiwyg/utils/satinizeHtml.d.ts +3 -0
- package/admin/src/components/PreviewWysiwyg/utils/satinizeHtml.js +18 -0
- package/admin/src/components/ReportsActions/components/BlockMenu/index.d.ts +16 -0
- package/admin/src/components/ReportsActions/components/BlockMenu/index.js +51 -0
- package/admin/src/components/ReportsActions/index.d.ts +12 -0
- package/admin/src/components/ReportsActions/index.js +31 -0
- package/admin/src/components/ReportsReviewModal/index.d.ts +14 -8
- package/admin/src/components/ReportsReviewTable/index.d.ts +13 -24
- package/admin/src/components/ReportsReviewTable/index.js +11 -24
- package/admin/src/components/StatusBadge/index.d.ts +2 -1
- package/admin/src/components/TableFilters/index.d.ts +12 -2
- package/admin/src/components/TableFilters/index.js +2 -2
- package/admin/src/components/TablePagination/index.d.ts +9 -2
- package/admin/src/components/Wysiwyg/Editor.d.ts +17 -0
- package/admin/src/components/Wysiwyg/Editor.js +84 -0
- package/admin/src/components/Wysiwyg/EditorLayout.d.ts +12 -0
- package/admin/src/components/Wysiwyg/EditorLayout.js +99 -0
- package/admin/src/components/Wysiwyg/EditorStylesContainer.d.ts +2 -0
- package/admin/src/components/Wysiwyg/EditorStylesContainer.js +348 -0
- package/admin/src/components/Wysiwyg/WysiwygFooter.d.ts +7 -0
- package/admin/src/components/Wysiwyg/WysiwygFooter.js +25 -0
- package/admin/src/components/Wysiwyg/WysiwygNav.d.ts +13 -0
- package/admin/src/components/Wysiwyg/WysiwygNav.js +118 -0
- package/admin/src/components/Wysiwyg/WysiwygStyles.d.ts +8 -0
- package/admin/src/components/Wysiwyg/WysiwygStyles.js +59 -0
- package/admin/src/components/Wysiwyg/index.d.ts +28 -0
- package/admin/src/components/Wysiwyg/index.js +136 -0
- package/admin/src/components/Wysiwyg/tests/index.test.d.ts +2 -0
- package/admin/src/components/Wysiwyg/tests/index.test.js +1633 -0
- package/admin/src/components/Wysiwyg/utils/continueList.d.ts +3 -0
- package/admin/src/components/Wysiwyg/utils/continueList.js +83 -0
- package/admin/src/components/Wysiwyg/utils/utils.d.ts +15 -0
- package/admin/src/components/Wysiwyg/utils/utils.js +249 -0
- package/admin/src/components/icons/comments.d.ts +2 -1
- package/admin/src/components/icons/index.d.ts +2 -5
- package/admin/src/components/icons/index.js +24 -12
- package/admin/src/components/icons/lock.d.ts +2 -1
- package/admin/src/components/icons/review.d.ts +2 -1
- package/admin/src/components/icons/strapiIcons.d.ts +24 -0
- package/admin/src/components/icons/strapiIcons.js +35 -0
- package/admin/src/components/icons/unlock.d.ts +2 -1
- package/admin/src/custom-fields/comments/components/icon.d.ts +3 -0
- package/admin/src/custom-fields/comments/components/icon.js +14 -0
- package/admin/src/custom-fields/comments/components/index.d.ts +3 -0
- package/admin/src/custom-fields/comments/components/index.js +19 -0
- package/admin/src/custom-fields/comments/components/input/index.d.ts +3 -0
- package/admin/src/custom-fields/comments/components/input/index.js +5 -0
- package/admin/src/custom-fields/comments/components/input/input.d.ts +4 -0
- package/admin/src/custom-fields/comments/components/input/input.js +102 -0
- package/admin/src/custom-fields/comments/components/input/types.d.ts +10 -0
- package/admin/src/custom-fields/comments/components/input/types.js +3 -0
- package/admin/src/custom-fields/comments/components/input/utils.d.ts +35 -0
- package/admin/src/custom-fields/comments/components/input/utils.js +146 -0
- package/admin/src/custom-fields/comments/index.d.ts +3 -0
- package/admin/src/custom-fields/comments/index.js +53 -0
- package/admin/src/custom-fields/index.d.ts +3 -0
- package/admin/src/custom-fields/index.js +13 -0
- package/admin/src/hooks/useConfig.d.ts +4 -4
- package/admin/src/hooks/useConfig.js +3 -6
- package/admin/src/hooks/useReportsActionsHandlers.d.ts +19 -0
- package/admin/src/hooks/useReportsActionsHandlers.js +70 -0
- package/admin/src/index.d.ts +2 -1
- package/admin/src/index.js +4 -2
- package/admin/src/pages/App/index.js +8 -7
- package/admin/src/pages/App/reducer/index.d.ts +1 -1
- package/admin/src/pages/ComingSoonPage/index.d.ts +2 -1
- package/admin/src/pages/ComingSoonPage/index.js +2 -2
- package/admin/src/pages/Details/components/DetailsEntity/index.d.ts +8 -6
- package/admin/src/pages/Details/components/DetailsFilters/index.d.ts +5 -3
- package/admin/src/pages/Details/index.js +10 -7
- package/admin/src/pages/Discover/components/DiscoverTableRow/index.d.ts +11 -5
- package/admin/src/pages/Discover/components/DiscoverTableRow/index.js +7 -81
- package/admin/src/pages/Discover/index.js +14 -13
- package/admin/src/pages/NoAccessPage/index.d.ts +4 -0
- package/admin/src/pages/NoAccessPage/index.js +31 -0
- package/admin/src/pages/Reports/components/ReportsTableRow/index.d.ts +16 -0
- package/admin/src/pages/Reports/components/ReportsTableRow/index.js +91 -0
- package/admin/src/pages/Reports/components/ReportsTableRow/styles.d.ts +2 -0
- package/admin/src/pages/Reports/components/ReportsTableRow/styles.js +14 -0
- package/admin/src/pages/Reports/index.d.ts +4 -0
- package/admin/src/pages/Reports/index.js +196 -0
- package/admin/src/pages/Reports/utils/api.d.ts +2 -0
- package/admin/src/pages/Reports/utils/api.js +16 -0
- package/admin/src/pages/Reports/utils/filtersSchema.d.ts +11 -0
- package/admin/src/pages/Reports/utils/filtersSchema.js +11 -0
- package/admin/src/pages/Settings/index.d.ts +2 -1
- package/admin/src/pages/Settings/index.js +6 -7
- package/admin/src/pages/utils/api.d.ts +17 -10
- package/admin/src/pages/utils/api.js +25 -2
- package/admin/src/reducers.d.ts +1 -1
- package/admin/src/translations/en.json +49 -1
- package/admin/src/utils/axiosInstance.d.ts +1 -1
- package/admin/src/utils/constants.d.ts +9 -5
- package/admin/src/utils/constants.js +5 -3
- package/admin/src/utils/errors.d.ts +5 -0
- package/admin/src/utils/errors.js +10 -0
- package/admin/src/utils/functions.d.ts +2 -0
- package/admin/src/utils/functions.js +11 -0
- package/admin/src/utils/getMessage.d.ts +1 -1
- package/admin/src/utils/getMessage.js +1 -1
- package/admin/src/utils/getRelatedGroups.d.ts +6 -2
- package/admin/src/utils/handleAPIError.d.ts +1 -1
- package/admin/src/utils/index.d.ts +16 -11
- package/admin/src/utils/index.js +12 -1
- package/admin/src/utils/resolveCommentStatus.d.ts +8 -2
- package/admin/src/utils/resolveReportStatus.d.ts +4 -0
- package/admin/src/utils/resolveReportStatus.js +23 -0
- package/admin/src/utils/resolveReportStatusColor.d.ts +4 -0
- package/admin/src/utils/resolveReportStatusColor.js +17 -0
- package/package.json +6 -3
- package/server/controllers/admin.js +67 -2
- package/server/index.d.ts +1 -1
- package/server/register/custom-fields/comments.d.ts +6 -0
- package/server/register/custom-fields/comments.js +9 -0
- package/server/register/custom-fields/index.d.ts +3 -0
- package/server/register/custom-fields/index.js +14 -0
- package/server/register/index.d.ts +4 -0
- package/server/register/index.js +8 -0
- package/server/routes/admin.js +56 -0
- package/server/services/admin.d.ts +1 -1
- package/server/services/admin.js +196 -10
- package/server/utils/error.js +1 -1
- package/strapi-server.d.ts +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/types/utils.d.ts +5 -0
- package/types/utils.js +10 -0
- package/server/register.d.ts +0 -3
- package/server/register.js +0 -4
|
@@ -0,0 +1,196 @@
|
|
|
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
|
+
exports.mapDispatchToProps = void 0;
|
|
30
|
+
const BaseCheckbox_1 = require("@strapi/design-system/BaseCheckbox");
|
|
31
|
+
const Box_1 = require("@strapi/design-system/Box");
|
|
32
|
+
const Button_1 = require("@strapi/design-system/Button");
|
|
33
|
+
const Layout_1 = require("@strapi/design-system/Layout");
|
|
34
|
+
const LiveRegions_1 = require("@strapi/design-system/LiveRegions");
|
|
35
|
+
const Table_1 = require("@strapi/design-system/Table");
|
|
36
|
+
const Typography_1 = require("@strapi/design-system/Typography");
|
|
37
|
+
const helper_plugin_1 = require("@strapi/helper-plugin");
|
|
38
|
+
const icons_1 = require("../../components/icons");
|
|
39
|
+
const lodash_1 = require("lodash");
|
|
40
|
+
const react_1 = __importStar(require("react"));
|
|
41
|
+
const react_fast_compare_1 = __importDefault(require("react-fast-compare"));
|
|
42
|
+
const react_query_1 = require("react-query");
|
|
43
|
+
const react_redux_1 = require("react-redux");
|
|
44
|
+
const react_router_dom_1 = require("react-router-dom");
|
|
45
|
+
const redux_1 = require("redux");
|
|
46
|
+
const Nav_1 = __importDefault(require("../../components/Nav"));
|
|
47
|
+
const TableFilters_1 = __importDefault(require("../../components/TableFilters"));
|
|
48
|
+
const TablePagination_1 = __importDefault(require("../../components/TablePagination"));
|
|
49
|
+
const permissions_1 = __importDefault(require("../../permissions"));
|
|
50
|
+
const utils_1 = require("../../utils");
|
|
51
|
+
const getUrl_1 = __importDefault(require("../../utils/getUrl"));
|
|
52
|
+
const selectors_1 = __importDefault(require("../App/reducer/selectors"));
|
|
53
|
+
const api_1 = require("../utils/api");
|
|
54
|
+
const ReportsTableRow_1 = __importDefault(require("./components/ReportsTableRow"));
|
|
55
|
+
const api_2 = require("./utils/api");
|
|
56
|
+
const filtersSchema_1 = __importDefault(require("./utils/filtersSchema"));
|
|
57
|
+
const NoAccessPage_1 = __importDefault(require("../NoAccessPage"));
|
|
58
|
+
const tableHeaders = [
|
|
59
|
+
"page.reports.table.header.id",
|
|
60
|
+
"page.reports.table.header.reason",
|
|
61
|
+
"page.reports.table.header.content",
|
|
62
|
+
"page.reports.table.header.status",
|
|
63
|
+
"page.reports.table.header.issueDate",
|
|
64
|
+
"page.reports.table.header.relatedComment",
|
|
65
|
+
"page.reports.table.header.actions",
|
|
66
|
+
];
|
|
67
|
+
const COL_COUNT = 8;
|
|
68
|
+
const Reports = ({ config }) => {
|
|
69
|
+
const [storedReports, setStoredReports] = (0, react_1.useState)([]);
|
|
70
|
+
const [selectedReports, setSelectedReports] = (0, react_1.useState)([]);
|
|
71
|
+
(0, helper_plugin_1.useFocusWhenNavigate)();
|
|
72
|
+
const { push } = (0, react_router_dom_1.useHistory)();
|
|
73
|
+
const { notifyStatus } = (0, LiveRegions_1.useNotifyAT)();
|
|
74
|
+
const { trackUsage } = (0, helper_plugin_1.useTracking)();
|
|
75
|
+
const trackUsageRef = (0, react_1.useRef)(trackUsage);
|
|
76
|
+
const toggleNotification = (0, helper_plugin_1.useNotification)();
|
|
77
|
+
const [{ query: queryParams }] = (0, helper_plugin_1.useQueryParams)();
|
|
78
|
+
const _q = queryParams?._q || "";
|
|
79
|
+
const queryClient = (0, react_query_1.useQueryClient)();
|
|
80
|
+
const { lockApp, unlockApp } = (0, helper_plugin_1.useOverlayBlocker)();
|
|
81
|
+
const viewPermissions = (0, react_1.useMemo)(() => ({
|
|
82
|
+
access: permissions_1.default.access,
|
|
83
|
+
moderate: permissions_1.default.moderate,
|
|
84
|
+
accessReports: permissions_1.default.reports,
|
|
85
|
+
reviewReports: permissions_1.default.reportsReview,
|
|
86
|
+
}), []);
|
|
87
|
+
const { isLoading: isLoadingForPermissions, allowedActions: { canAccess, canModerate, canAccessReports, canReviewReports, }, } = (0, helper_plugin_1.useRBAC)(viewPermissions);
|
|
88
|
+
const { isLoading: isLoadingForData, data: { result, pagination = {} }, isFetching, } = (0, react_query_1.useQuery)(["get-data", queryParams, canAccess], () => (0, api_2.fetchReportsData)(queryParams, toggleNotification), {
|
|
89
|
+
initialData: {},
|
|
90
|
+
});
|
|
91
|
+
(0, react_1.useEffect)(() => {
|
|
92
|
+
setStoredReports(result);
|
|
93
|
+
}, [result, storedReports]);
|
|
94
|
+
const handleClickDisplay = (id) => {
|
|
95
|
+
push((0, getUrl_1.default)(`discover/${id}`));
|
|
96
|
+
};
|
|
97
|
+
const onSuccess = () => async () => {
|
|
98
|
+
await queryClient.invalidateQueries("get-data");
|
|
99
|
+
unlockApp();
|
|
100
|
+
};
|
|
101
|
+
const onError = (err) => {
|
|
102
|
+
(0, utils_1.handleAPIError)(err, toggleNotification);
|
|
103
|
+
};
|
|
104
|
+
const onSelectionChange = (selection) => setSelectedReports(selection);
|
|
105
|
+
const handleItemSelectionChange = (selection, value) => {
|
|
106
|
+
if ((0, lodash_1.isArray)(selection)) {
|
|
107
|
+
onSelectionChange(value ? selection : []);
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
onSelectionChange([...selectedReports, selection].filter((item) => value || selection !== item));
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
const areAllItemsSelected = () => !(0, lodash_1.isEmpty)(selectedReports)
|
|
114
|
+
? selectedReports.length === storedReports.length
|
|
115
|
+
: false;
|
|
116
|
+
const isItemSelected = (id) => selectedReports.includes(id);
|
|
117
|
+
const hasAnySelectedReports = selectedReports.length > 0;
|
|
118
|
+
const onValueChange = (0, react_1.useCallback)((value) => {
|
|
119
|
+
handleItemSelectionChange(storedReports.map((_) => _.id), value);
|
|
120
|
+
}, [storedReports]);
|
|
121
|
+
const resolveReportMutation = (0, react_query_1.useMutation)(api_1.resolveReport, {
|
|
122
|
+
onSuccess: onSuccess(),
|
|
123
|
+
onError,
|
|
124
|
+
refetchActive: false,
|
|
125
|
+
});
|
|
126
|
+
const resolveMultipleReportsMutation = (0, react_query_1.useMutation)(api_1.resolveMultipleReports, {
|
|
127
|
+
onSuccess: onSuccess(),
|
|
128
|
+
onError,
|
|
129
|
+
refetchActive: false,
|
|
130
|
+
});
|
|
131
|
+
const handleClickResolveSelected = async () => {
|
|
132
|
+
if (canReviewReports) {
|
|
133
|
+
lockApp();
|
|
134
|
+
const items = await resolveMultipleReportsMutation.mutateAsync(selectedReports);
|
|
135
|
+
if (!(0, lodash_1.isEmpty)(items)) {
|
|
136
|
+
const updatedReports = storedReports.map((_) => ({
|
|
137
|
+
..._,
|
|
138
|
+
resolved: selectedReports.includes(_.id) ? true : _.resolved,
|
|
139
|
+
}));
|
|
140
|
+
setStoredReports(updatedReports);
|
|
141
|
+
setSelectedReports([], false);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
const isLoading = isLoadingForData || isFetching;
|
|
146
|
+
const { total } = pagination;
|
|
147
|
+
const emptyLayout = {
|
|
148
|
+
comments: {
|
|
149
|
+
id: (0, utils_1.getMessage)("page.reports.table.empty"),
|
|
150
|
+
defaultMessage: "You don't have any reports yet.",
|
|
151
|
+
},
|
|
152
|
+
search: {
|
|
153
|
+
id: (0, utils_1.getMessage)("page.reports.table.empty.search"),
|
|
154
|
+
defaultMessage: "No reports match the search.",
|
|
155
|
+
},
|
|
156
|
+
};
|
|
157
|
+
const emptyContent = _q ? "search" : "comments";
|
|
158
|
+
return canAccess ? (react_1.default.createElement(Box_1.Box, { background: "neutral100" },
|
|
159
|
+
react_1.default.createElement(Layout_1.Layout, null, isLoading || isLoadingForPermissions ? (react_1.default.createElement(helper_plugin_1.LoadingIndicatorPage, null)) : (react_1.default.createElement(Layout_1.Layout, { sideNav: react_1.default.createElement(Nav_1.default, { visible: true }) },
|
|
160
|
+
react_1.default.createElement(react_1.default.Fragment, null,
|
|
161
|
+
react_1.default.createElement(Layout_1.HeaderLayout, { title: (0, utils_1.getMessage)("page.reports.header"), subtitle: `${total} ${(0, utils_1.getMessage)("page.discover.header.count")}`, as: "h2" }),
|
|
162
|
+
react_1.default.createElement(Layout_1.ActionLayout, { startActions: react_1.default.createElement(react_1.default.Fragment, null,
|
|
163
|
+
react_1.default.createElement(helper_plugin_1.SearchURLQuery, { label: (0, utils_1.getMessage)("search.label", "Search", false) }),
|
|
164
|
+
react_1.default.createElement(TableFilters_1.default, { displayedFilters: filtersSchema_1.default }),
|
|
165
|
+
hasAnySelectedReports && (react_1.default.createElement(Button_1.Button, { variant: "success", onClick: handleClickResolveSelected, startIcon: icons_1.check }, (0, utils_1.getMessage)({
|
|
166
|
+
id: `page.details.panel.discussion.warnings.reports.dialog.actions.resolve.selected`,
|
|
167
|
+
props: {
|
|
168
|
+
count: selectedReports.length,
|
|
169
|
+
},
|
|
170
|
+
}, "Resolve selected")))) }),
|
|
171
|
+
react_1.default.createElement(Layout_1.ContentLayout, null, !(0, lodash_1.isEmpty)(result) ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
172
|
+
react_1.default.createElement(Table_1.Table, { colCount: COL_COUNT, rowCount: result.length },
|
|
173
|
+
react_1.default.createElement(Table_1.Thead, null,
|
|
174
|
+
react_1.default.createElement(Table_1.Tr, null,
|
|
175
|
+
react_1.default.createElement(Table_1.Th, null,
|
|
176
|
+
react_1.default.createElement(BaseCheckbox_1.BaseCheckbox, { "aria-label": (0, utils_1.getMessage)("page.details.panel.discussion.warnings.reports.dialog.selectAll"), value: areAllItemsSelected(), disabled: (0, lodash_1.isEmpty)(storedReports), onValueChange: onValueChange })),
|
|
177
|
+
tableHeaders.map((title) => (react_1.default.createElement(Table_1.Th, null,
|
|
178
|
+
react_1.default.createElement(Typography_1.Typography, { variant: "sigma" }, (0, utils_1.getMessage)(title))))))),
|
|
179
|
+
react_1.default.createElement(Table_1.Tbody, null, result.map((entry) => {
|
|
180
|
+
return (react_1.default.createElement(ReportsTableRow_1.default, { key: `comment-${entry.id}`, config: config, item: entry, allowedActions: {
|
|
181
|
+
canModerate,
|
|
182
|
+
canAccessReports,
|
|
183
|
+
canReviewReports,
|
|
184
|
+
}, onClick: () => handleClickDisplay(entry.related.id), mutation: resolveReportMutation, reports: storedReports, updateReports: setStoredReports, selectedReports: selectedReports, onSelectionChange: onSelectionChange, isChecked: isItemSelected, handleItemSelectionChange: handleItemSelectionChange }));
|
|
185
|
+
}))),
|
|
186
|
+
react_1.default.createElement(TablePagination_1.default, { pagination: { pageCount: pagination?.pageCount || 1 } }))) : (react_1.default.createElement(helper_plugin_1.EmptyStateLayout, { content: emptyLayout[emptyContent] }))))))))) :
|
|
187
|
+
react_1.default.createElement(NoAccessPage_1.default, null);
|
|
188
|
+
};
|
|
189
|
+
const mapStateToProps = (0, selectors_1.default)();
|
|
190
|
+
const mapDispatchToProps = (dispatch) => {
|
|
191
|
+
return (0, redux_1.bindActionCreators)({}, dispatch);
|
|
192
|
+
};
|
|
193
|
+
exports.mapDispatchToProps = mapDispatchToProps;
|
|
194
|
+
const withConnect = (0, react_redux_1.connect)(mapStateToProps, exports.mapDispatchToProps);
|
|
195
|
+
exports.default = (0, redux_1.compose)(withConnect)((0, react_1.memo)(Reports, react_fast_compare_1.default));
|
|
196
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchReportsData = void 0;
|
|
4
|
+
const qs_1 = require("qs");
|
|
5
|
+
const utils_1 = require("../../../utils");
|
|
6
|
+
const fetchReportsData = async (queryParams, toggleNotification) => {
|
|
7
|
+
try {
|
|
8
|
+
const { data } = await utils_1.axiosInstance.get((0, utils_1.getApiURL)(`moderate/reports${queryParams ? `?${(0, qs_1.stringify)(queryParams, { encode: false })}` : ""}`));
|
|
9
|
+
return data;
|
|
10
|
+
}
|
|
11
|
+
catch (err) {
|
|
12
|
+
(0, utils_1.handleAPIError)(err, toggleNotification);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
exports.fetchReportsData = fetchReportsData;
|
|
16
|
+
//# sourceMappingURL=api.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const filtersSchema = [
|
|
4
|
+
{
|
|
5
|
+
name: 'content',
|
|
6
|
+
metadatas: { label: 'Message' },
|
|
7
|
+
fieldSchema: { type: 'string' },
|
|
8
|
+
},
|
|
9
|
+
];
|
|
10
|
+
exports.default = filtersSchema;
|
|
11
|
+
//# sourceMappingURL=filtersSchema.js.map
|
|
@@ -44,7 +44,7 @@ const ToggleInput_1 = require("@strapi/design-system/ToggleInput");
|
|
|
44
44
|
const Select_1 = require("@strapi/design-system/Select");
|
|
45
45
|
const LiveRegions_1 = require("@strapi/design-system/LiveRegions");
|
|
46
46
|
const Tooltip_1 = require("@strapi/design-system/Tooltip");
|
|
47
|
-
const icons_1 = require("
|
|
47
|
+
const icons_1 = require("../../components/icons");
|
|
48
48
|
const permissions_1 = __importDefault(require("../../permissions"));
|
|
49
49
|
const useConfig_1 = __importDefault(require("../../hooks/useConfig"));
|
|
50
50
|
const api_1 = require("./utils/api");
|
|
@@ -182,11 +182,11 @@ const Settings = () => {
|
|
|
182
182
|
gqlAuthEnabled,
|
|
183
183
|
}, enableReinitialize: true, onSubmit: handleUpdateConfiguration }, ({ handleSubmit, setFieldValue, values }) => (react_1.default.createElement(helper_plugin_1.Form, { noValidate: true, onSubmit: handleSubmit },
|
|
184
184
|
react_1.default.createElement(Layout_1.HeaderLayout, { title: (0, utils_1.getMessage)("page.settings.header.title"), subtitle: (0, utils_1.getMessage)("page.settings.header.description"), primaryAction: react_1.default.createElement(helper_plugin_1.CheckPermissions, { permissions: permissions_1.default.settingsChange },
|
|
185
|
-
react_1.default.createElement(Button_1.Button, { type: "submit", startIcon:
|
|
185
|
+
react_1.default.createElement(Button_1.Button, { type: "submit", startIcon: icons_1.check, disabled: restartRequired }, (0, utils_1.getMessage)("page.settings.actions.submit"))) }),
|
|
186
186
|
react_1.default.createElement(Layout_1.ContentLayout, null,
|
|
187
187
|
react_1.default.createElement(Stack_1.Stack, { size: 4 },
|
|
188
188
|
restartRequired && (react_1.default.createElement(styles_1.RestartAlert, { closeLabel: (0, utils_1.getMessage)("page.settings.actions.restart.alert.cancel"), title: (0, utils_1.getMessage)("page.settings.actions.restart.alert.title"), action: react_1.default.createElement(Box_1.Box, null,
|
|
189
|
-
react_1.default.createElement(Button_1.Button, { onClick: handleRestart, startIcon:
|
|
189
|
+
react_1.default.createElement(Button_1.Button, { onClick: handleRestart, startIcon: icons_1.play }, (0, utils_1.getMessage)("page.settings.actions.restart"))), onClose: handleRestartDiscard }, (0, utils_1.getMessage)("page.settings.actions.restart.alert.description"))),
|
|
190
190
|
react_1.default.createElement(Box_1.Box, { ...boxDefaultProps },
|
|
191
191
|
react_1.default.createElement(Stack_1.Stack, { size: 4 },
|
|
192
192
|
react_1.default.createElement(Typography_1.Typography, { variant: "delta", as: "h2" }, (0, utils_1.getMessage)("page.settings.section.general")),
|
|
@@ -194,8 +194,7 @@ const Settings = () => {
|
|
|
194
194
|
react_1.default.createElement(Grid_1.GridItem, { col: 12 },
|
|
195
195
|
react_1.default.createElement(Select_1.Select, { name: "enabledCollections", label: (0, utils_1.getMessage)("page.settings.form.enabledCollections.label"), placeholder: (0, utils_1.getMessage)("page.settings.form.enabledCollections.placeholder"), hint: (0, utils_1.getMessage)("page.settings.form.enabledCollections.hint"), onClear: () => setFieldValue("enabledCollections", [], false), value: values.enabledCollections, onChange: (value) => setFieldValue("enabledCollections", value, false), disabled: restartRequired, multi: true, withTags: true }, allCollections.map(({ uid, schema: { displayName } }) => (react_1.default.createElement(Select_1.Option, { key: uid, value: uid }, displayName))))),
|
|
196
196
|
!(0, lodash_1.isEmpty)(values.enabledCollections) && (react_1.default.createElement(Grid_1.GridItem, { col: 12 },
|
|
197
|
-
react_1.default.createElement(Accordion_1.AccordionGroup, { label: (0, utils_1.getMessage)("page.settings.form.contentTypesSettings.label"), labelAction: react_1.default.createElement(Tooltip_1.Tooltip, { description: (0, utils_1.getMessage)("page.settings.form.contentTypesSettings.tooltip") },
|
|
198
|
-
react_1.default.createElement(icons_1.Information, { "aria-hidden": true })) }, (0, lodash_1.orderBy)(values.enabledCollections).map((uid) => {
|
|
197
|
+
react_1.default.createElement(Accordion_1.AccordionGroup, { label: (0, utils_1.getMessage)("page.settings.form.contentTypesSettings.label"), labelAction: react_1.default.createElement(Tooltip_1.Tooltip, { description: (0, utils_1.getMessage)("page.settings.form.contentTypesSettings.tooltip") }, icons_1.information) }, (0, lodash_1.orderBy)(values.enabledCollections).map((uid) => {
|
|
199
198
|
const { schema: { displayName, attributes = {} }, } = allCollections.find((_) => _.uid === uid);
|
|
200
199
|
const stringAttributes = Object.keys(attributes).filter((_) => attributes[_].type === "string");
|
|
201
200
|
const key = `collectionSettings-${uid}`;
|
|
@@ -236,8 +235,8 @@ const Settings = () => {
|
|
|
236
235
|
react_1.default.createElement(Typography_1.Typography, { variant: "pi", as: "h4" }, (0, utils_1.getMessage)("page.settings.section.restore.subtitle"))),
|
|
237
236
|
react_1.default.createElement(Grid_1.Grid, { gap: 4 },
|
|
238
237
|
react_1.default.createElement(Grid_1.GridItem, { col: 6 },
|
|
239
|
-
react_1.default.createElement(Button_1.Button, { variant: "danger-light", startIcon:
|
|
240
|
-
react_1.default.createElement(ConfirmationDialog_1.default, { isVisible: restoreConfigmationVisible, isActionAsync: restoreMutation.isLoading, header: (0, utils_1.getMessage)("page.settings.actions.restore.confirmation.header"), labelConfirm: (0, utils_1.getMessage)("page.settings.actions.restore.confirmation.button.confirm"), iconConfirm:
|
|
238
|
+
react_1.default.createElement(Button_1.Button, { variant: "danger-light", startIcon: icons_1.refresh, onClick: handleRestoreConfirmation }, (0, utils_1.getMessage)("page.settings.actions.restore")),
|
|
239
|
+
react_1.default.createElement(ConfirmationDialog_1.default, { isVisible: restoreConfigmationVisible, isActionAsync: restoreMutation.isLoading, header: (0, utils_1.getMessage)("page.settings.actions.restore.confirmation.header"), labelConfirm: (0, utils_1.getMessage)("page.settings.actions.restore.confirmation.button.confirm"), iconConfirm: icons_1.refresh, onConfirm: handleRestoreConfiguration, onCancel: handleRestoreCancel }, (0, utils_1.getMessage)("page.settings.actions.restore.confirmation.description"))))))))))))));
|
|
241
240
|
};
|
|
242
241
|
exports.default = Settings;
|
|
243
242
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
import { Id } from "strapi-typed";
|
|
2
|
+
import { CommentDetails, CommentUpdateDetails } from "../../../../types/api";
|
|
2
3
|
import { ToBeFixed } from "../../../../types";
|
|
3
|
-
export declare const fetchDetailsData: (id: Id, queryParams: ToBeFixed, toggleNotification: Function) => Promise<
|
|
4
|
+
export declare const fetchDetailsData: (id: Id, queryParams: ToBeFixed, toggleNotification: Function) => Promise<ToBeFixed>;
|
|
4
5
|
export declare const fetchContentTypeData: (uid: string, toggleNotification: Function) => Promise<any>;
|
|
5
|
-
export declare const blockItem: (id: Id) => any
|
|
6
|
-
export declare const unblockItem: (id: Id) => any
|
|
7
|
-
export declare const approveItem: (id: Id) => any
|
|
8
|
-
export declare const rejectItem: (id: Id) => any
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const
|
|
12
|
-
export declare const
|
|
6
|
+
export declare const blockItem: (id: Id) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
7
|
+
export declare const unblockItem: (id: Id) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
8
|
+
export declare const approveItem: (id: Id) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
9
|
+
export declare const rejectItem: (id: Id) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
10
|
+
export declare const deleteItem: (id: Id) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
11
|
+
export declare const blockItemThread: (id: Id) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
12
|
+
export declare const unblockItemThread: (id: Id) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
13
|
+
export declare const resolveReport: ({ id, reportId }: ToBeFixed) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
14
|
+
export declare const resolveCommentMultipleReports: ({ id, reportIds, }: {
|
|
13
15
|
id: Id;
|
|
14
16
|
reportIds: Array<Id>;
|
|
15
|
-
}) => any
|
|
17
|
+
}) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
18
|
+
export declare const resolveMultipleReports: (reportsIds: Array<Id>) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
19
|
+
export declare const resolveAllAbuseReportsForComment: (commentId: Id) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
20
|
+
export declare const resolveAllAbuseReportsForThread: (commentId: Id) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
21
|
+
export declare const postComment: ({ threadId, body, author }: CommentDetails) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
22
|
+
export declare const updateComment: ({ id, body }: CommentUpdateDetails) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
16
23
|
//# sourceMappingURL=api.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resolveMultipleReports = exports.resolveReport = exports.unblockItemThread = exports.blockItemThread = exports.rejectItem = exports.approveItem = exports.unblockItem = exports.blockItem = exports.fetchContentTypeData = exports.fetchDetailsData = void 0;
|
|
3
|
+
exports.updateComment = exports.postComment = exports.resolveAllAbuseReportsForThread = exports.resolveAllAbuseReportsForComment = exports.resolveMultipleReports = exports.resolveCommentMultipleReports = exports.resolveReport = exports.unblockItemThread = exports.blockItemThread = exports.deleteItem = exports.rejectItem = exports.approveItem = exports.unblockItem = exports.blockItem = exports.fetchContentTypeData = exports.fetchDetailsData = void 0;
|
|
4
4
|
const qs_1 = require("qs");
|
|
5
5
|
const lodash_1 = require("lodash");
|
|
6
6
|
const utils_1 = require("../../utils");
|
|
@@ -43,6 +43,10 @@ const rejectItem = (id) => {
|
|
|
43
43
|
return utils_1.axiosInstance.patch((0, utils_1.getApiURL)(`moderate/single/${id}/reject`));
|
|
44
44
|
};
|
|
45
45
|
exports.rejectItem = rejectItem;
|
|
46
|
+
const deleteItem = (id) => {
|
|
47
|
+
return utils_1.axiosInstance.delete((0, utils_1.getApiURL)(`moderate/single/${id}/delete`));
|
|
48
|
+
};
|
|
49
|
+
exports.deleteItem = deleteItem;
|
|
46
50
|
const blockItemThread = (id) => {
|
|
47
51
|
return utils_1.axiosInstance.patch((0, utils_1.getApiURL)(`moderate/thread/${id}/block`));
|
|
48
52
|
};
|
|
@@ -55,8 +59,27 @@ const resolveReport = ({ id, reportId }) => {
|
|
|
55
59
|
return utils_1.axiosInstance.patch((0, utils_1.getApiURL)(`moderate/single/${id}/report/${reportId}/resolve`));
|
|
56
60
|
};
|
|
57
61
|
exports.resolveReport = resolveReport;
|
|
58
|
-
const
|
|
62
|
+
const resolveCommentMultipleReports = ({ id, reportIds, }) => {
|
|
59
63
|
return utils_1.axiosInstance.put((0, utils_1.getApiURL)(`moderate/single/${id}/report/resolve`), reportIds);
|
|
60
64
|
};
|
|
65
|
+
exports.resolveCommentMultipleReports = resolveCommentMultipleReports;
|
|
66
|
+
const resolveMultipleReports = (reportsIds) => utils_1.axiosInstance.put((0, utils_1.getApiURL)(`moderate/multiple/report/resolve`), reportsIds);
|
|
61
67
|
exports.resolveMultipleReports = resolveMultipleReports;
|
|
68
|
+
const resolveAllAbuseReportsForComment = (commentId) => utils_1.axiosInstance.put((0, utils_1.getApiURL)(`moderate/all/${commentId}/report/resolve`));
|
|
69
|
+
exports.resolveAllAbuseReportsForComment = resolveAllAbuseReportsForComment;
|
|
70
|
+
const resolveAllAbuseReportsForThread = (commentId) => utils_1.axiosInstance.put((0, utils_1.getApiURL)(`moderate/all/${commentId}/report/resolve-thread`));
|
|
71
|
+
exports.resolveAllAbuseReportsForThread = resolveAllAbuseReportsForThread;
|
|
72
|
+
const postComment = ({ threadId, body, author }) => {
|
|
73
|
+
return utils_1.axiosInstance.post((0, utils_1.getApiURL)(`moderate/thread/${threadId}/postComment`), {
|
|
74
|
+
content: body,
|
|
75
|
+
author: author
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
exports.postComment = postComment;
|
|
79
|
+
const updateComment = ({ id, body }) => {
|
|
80
|
+
return utils_1.axiosInstance.put((0, utils_1.getApiURL)(`moderate/single/${id}/update`), {
|
|
81
|
+
content: body,
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
exports.updateComment = updateComment;
|
|
62
85
|
//# sourceMappingURL=api.js.map
|
package/admin/src/reducers.d.ts
CHANGED
|
@@ -9,10 +9,13 @@
|
|
|
9
9
|
"nav.item.discover": "Discover",
|
|
10
10
|
"nav.item.reports": "Reports",
|
|
11
11
|
"nav.item.settings": "Settings",
|
|
12
|
+
"page.auth.noAccess": "No access",
|
|
13
|
+
"page.auth.not.allowed": "Oops! It seems like You do not have access to this page...",
|
|
12
14
|
"page.common.item.status.OPEN": "Open",
|
|
13
15
|
"page.common.item.status.PENDING": "Pending",
|
|
14
16
|
"page.common.item.status.BLOCKED": "Blocked",
|
|
15
17
|
"page.common.item.status.APPROVED": "Approved",
|
|
18
|
+
"page.common.item.status.RESOLVED": "Resolved",
|
|
16
19
|
"page.common.item.status.TO_REVIEW": "To review ({count, number})",
|
|
17
20
|
"page.common.item.status.REJECTED": "Rejected",
|
|
18
21
|
"page.common.item.status.REMOVED": "Removed by author",
|
|
@@ -34,6 +37,18 @@
|
|
|
34
37
|
"page.discover.table.empty.search": "No comments match the search.",
|
|
35
38
|
"page.discover.table.filters": "Filtering",
|
|
36
39
|
"page.discover.table.reports.review": "Review reports",
|
|
40
|
+
"page.reports.header": "Resolve reports",
|
|
41
|
+
"page.reports.table.empty": "You don't have any reports yet.",
|
|
42
|
+
"page.reports.table.empty.search": "No reports match the search.",
|
|
43
|
+
"page.reports.table.header.id": "ID",
|
|
44
|
+
"page.reports.table.header.reason": "Reason",
|
|
45
|
+
"page.reports.table.header.content": "Content",
|
|
46
|
+
"page.reports.table.header.status": "Status",
|
|
47
|
+
"page.reports.table.header.issueDate": "Issue date",
|
|
48
|
+
"page.reports.table.header.relatedComment": "Related comment",
|
|
49
|
+
"page.reports.table.header.actions": "Actions",
|
|
50
|
+
"page.reports.table.cell.action.resolve": "resolved",
|
|
51
|
+
"page.reports.table.cell.action.block": "Block",
|
|
37
52
|
"page.details.header": "Discussion panel",
|
|
38
53
|
"page.details.header.description": "Drilldown and manage discussion related to the entity",
|
|
39
54
|
"page.details.panel.discussion": "Discussion",
|
|
@@ -59,7 +74,13 @@
|
|
|
59
74
|
"page.details.panel.discussion.warnings.reports.dialog.actions.resolve.selected": "Resolve reports ({count})",
|
|
60
75
|
"page.details.panel.discussion.warnings.reports.dialog.confirmation.success": "Open report has been resolved",
|
|
61
76
|
"page.details.panel.discussion.warnings.reports.selected.dialog.confirmation.success": "Open reports has been resolved",
|
|
77
|
+
"page.details.panel.discussion.warnings.comments.header": "Moderation: Review reported comment",
|
|
62
78
|
"page.details.panel.discussion.status.blocked": "Blocked",
|
|
79
|
+
"page.details.panel.discussion.reply":"Reply",
|
|
80
|
+
"page.details.panel.discussion.reopen":"Re-open",
|
|
81
|
+
"page.details.panel.discussion.send":"Send",
|
|
82
|
+
"page.details.actions.comment.post.confirmation": "Comment has been posted",
|
|
83
|
+
"page.details.actions.comment.update.confirmation": "Comment has been updated",
|
|
63
84
|
"page.details.panel.entity": "Entity details",
|
|
64
85
|
"page.details.panel.status": "Discussion is",
|
|
65
86
|
"page.details.panel.status.open": "Open",
|
|
@@ -73,6 +94,8 @@
|
|
|
73
94
|
"page.details.actions.comment.block.confirmation.success": "Comment has been blocked",
|
|
74
95
|
"page.details.actions.comment.unblock": "Unblock comment",
|
|
75
96
|
"page.details.actions.comment.unblock.confirmation.success": "Comment has been unblocked",
|
|
97
|
+
"page.details.actions.comment.delete": "Delete comment",
|
|
98
|
+
"page.details.actions.comment.delete.confirmation.success": "Comment has been deleted",
|
|
76
99
|
"page.details.actions.comment.reports.review": "Review",
|
|
77
100
|
"page.details.actions.thread.block": "Block thread",
|
|
78
101
|
"page.details.actions.thread.block.confirmation.header": "Moderation: Block thread",
|
|
@@ -81,6 +104,8 @@
|
|
|
81
104
|
"page.details.actions.thread.block.confirmation.success": "Thread has been blocked",
|
|
82
105
|
"page.details.actions.thread.unblock": "Unblock thread",
|
|
83
106
|
"page.details.actions.thread.unblock.confirmation.success": "Thread has been unblocked",
|
|
107
|
+
"page.details.actions.thread.modal.start.thread": "Start thread",
|
|
108
|
+
"page.details.actions.thread.modal.update.comment": "Update comment",
|
|
84
109
|
"page.details.actions.comment.approve.confirmation.success": "Comment has been approved",
|
|
85
110
|
"page.details.actions.comment.reject.confirmation.success": "Comment has been rejected",
|
|
86
111
|
"page.details.filters.label": "View",
|
|
@@ -138,5 +163,28 @@
|
|
|
138
163
|
"compontents.confirmation.dialog.button.cancel": "Cancel",
|
|
139
164
|
"compontents.toogle.enabled": "Enabled",
|
|
140
165
|
"compontents.toogle.disabled": "Disabled",
|
|
141
|
-
"compontents.author.unknown": "Author removed"
|
|
166
|
+
"compontents.author.unknown": "Author removed",
|
|
167
|
+
"components.reason.unknown": "Reason not provided",
|
|
168
|
+
"components.content.unknown": "Content not provided",
|
|
169
|
+
"components.notAccessPage.back": "Back to homepage",
|
|
170
|
+
"customField.comments.label": "Comments",
|
|
171
|
+
"customField.comments.description": "Specify comments query params",
|
|
172
|
+
"customField.comments.input.commentsNumber.label": "Number of comments",
|
|
173
|
+
"customField.comments.input.renderType.label": "Render comments as",
|
|
174
|
+
"customField.comments.input.renderType.option.tree.label": "Tree",
|
|
175
|
+
"customField.comments.input.renderType.option.flat.label": "Flat list",
|
|
176
|
+
"customField.comments.input.sortByDate.label": "Sort by creation date",
|
|
177
|
+
"customField.comments.input.sortByDate.option.asc.label": "Ascending",
|
|
178
|
+
"customField.comments.input.sortByDate.option.desc.label": "Descending",
|
|
179
|
+
"customField.comments.input.filterBy.label": "Filter by",
|
|
180
|
+
"customField.comments.input.filterBy.option.dateCreated.label": "Creation date",
|
|
181
|
+
"customField.comments.input.filterBy.option.dateCreated.label.details.label": "Specify date",
|
|
182
|
+
"customField.comments.input.filterBy.option.approvalStatus.label": "Approval Status",
|
|
183
|
+
"customField.comments.input.filterBy.option.approvalStatus.label.details.label": "Specify status",
|
|
184
|
+
"customField.comments.input.filterBy.option.approvalStatus.option.pending.label": "Pending",
|
|
185
|
+
"customField.comments.input.filterBy.option.approvalStatus.option.approved.label": "Approved",
|
|
186
|
+
"customField.comments.input.filterBy.option.approvalStatus.option.rejected.label": "Rejected",
|
|
187
|
+
"customField.comments.input.populate.label": "Populate",
|
|
188
|
+
"customField.comments.input.populate.author.label": "Populate author field",
|
|
189
|
+
"customField.comments.input.populate.avatar.label": "Populate avatar field"
|
|
142
190
|
}
|
|
@@ -4,8 +4,12 @@ export declare const APPROVAL_STATUS: {
|
|
|
4
4
|
REJECTED: string;
|
|
5
5
|
};
|
|
6
6
|
export declare const REPORT_STATUS: {
|
|
7
|
-
|
|
7
|
+
BLOCKED: string;
|
|
8
8
|
OPEN: string;
|
|
9
|
+
RESOLVED: string;
|
|
10
|
+
PENDING: string;
|
|
11
|
+
APPROVED: string;
|
|
12
|
+
REJECTED: string;
|
|
9
13
|
};
|
|
10
14
|
export declare const REPORT_REASON: {
|
|
11
15
|
BAD_LANGUAGE: string;
|
|
@@ -13,13 +17,13 @@ export declare const REPORT_REASON: {
|
|
|
13
17
|
OTHER: string;
|
|
14
18
|
};
|
|
15
19
|
export declare const COMMENT_STATUS: {
|
|
16
|
-
PENDING: string;
|
|
17
|
-
APPROVED: string;
|
|
18
|
-
REJECTED: string;
|
|
19
|
-
UNKNOWN: string;
|
|
20
20
|
BLOCKED: string;
|
|
21
21
|
OPEN: string;
|
|
22
22
|
REMOVED: string;
|
|
23
23
|
TO_REVIEW: string;
|
|
24
|
+
UNKNOWN: string;
|
|
25
|
+
PENDING: string;
|
|
26
|
+
APPROVED: string;
|
|
27
|
+
REJECTED: string;
|
|
24
28
|
};
|
|
25
29
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -7,8 +7,10 @@ exports.APPROVAL_STATUS = {
|
|
|
7
7
|
REJECTED: "REJECTED",
|
|
8
8
|
};
|
|
9
9
|
exports.REPORT_STATUS = {
|
|
10
|
-
|
|
10
|
+
...exports.APPROVAL_STATUS,
|
|
11
|
+
BLOCKED: "BLOCKED",
|
|
11
12
|
OPEN: "OPEN",
|
|
13
|
+
RESOLVED: "RESOLVED",
|
|
12
14
|
};
|
|
13
15
|
exports.REPORT_REASON = {
|
|
14
16
|
BAD_LANGUAGE: "BAD_LANGUAGE",
|
|
@@ -16,11 +18,11 @@ exports.REPORT_REASON = {
|
|
|
16
18
|
OTHER: "OTHER",
|
|
17
19
|
};
|
|
18
20
|
exports.COMMENT_STATUS = {
|
|
19
|
-
|
|
21
|
+
...exports.APPROVAL_STATUS,
|
|
20
22
|
BLOCKED: "BLOCKED",
|
|
21
23
|
OPEN: "OPEN",
|
|
22
24
|
REMOVED: "REMOVED",
|
|
23
25
|
TO_REVIEW: "TO_REVIEW",
|
|
24
|
-
|
|
26
|
+
UNKNOWN: "UNKNOWN",
|
|
25
27
|
};
|
|
26
28
|
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ValidationError = exports.UIError = void 0;
|
|
4
|
+
class UIError extends Error {
|
|
5
|
+
}
|
|
6
|
+
exports.UIError = UIError;
|
|
7
|
+
class ValidationError extends UIError {
|
|
8
|
+
}
|
|
9
|
+
exports.ValidationError = ValidationError;
|
|
10
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.assertString = void 0;
|
|
4
|
+
const errors_1 = require("./errors");
|
|
5
|
+
function assertString(value) {
|
|
6
|
+
if (typeof value !== "string") {
|
|
7
|
+
throw new errors_1.ValidationError(`String expected, but "${typeof value}" given`);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.assertString = assertString;
|
|
11
|
+
//# sourceMappingURL=functions.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ToBeFixed } from "../../../types";
|
|
2
|
-
declare const getMessage: (input: ToBeFixed, defaultMessage?: string, inPluginScope?: boolean) =>
|
|
2
|
+
declare const getMessage: (input: ToBeFixed, defaultMessage?: string, inPluginScope?: boolean) => string;
|
|
3
3
|
export default getMessage;
|
|
4
4
|
//# sourceMappingURL=getMessage.d.ts.map
|
|
@@ -15,7 +15,7 @@ const getMessage = (input, defaultMessage = "", inPluginScope = true) => {
|
|
|
15
15
|
return formatMessage({
|
|
16
16
|
id: `${inPluginScope ? pluginId_1.pluginId : "app.components"}.${formattedId}`,
|
|
17
17
|
defaultMessage,
|
|
18
|
-
}, input?.props
|
|
18
|
+
}, input?.props);
|
|
19
19
|
};
|
|
20
20
|
exports.default = getMessage;
|
|
21
21
|
//# sourceMappingURL=getMessage.js.map
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
declare type Config = {
|
|
2
|
+
regex: {
|
|
3
|
+
relatedUid: string;
|
|
4
|
+
};
|
|
5
|
+
};
|
|
6
|
+
declare const getRelatedGroups: (related: string, config: Config) => string[];
|
|
3
7
|
export default getRelatedGroups;
|
|
4
8
|
//# sourceMappingURL=getRelatedGroups.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ToBeFixed } from "../../../types";
|
|
2
|
-
declare const handleAPIError: (err?: null, toggleNotification?: ToBeFixed, message?: string) => never;
|
|
2
|
+
declare const handleAPIError: (err?: Error | null, toggleNotification?: ToBeFixed, message?: string) => never;
|
|
3
3
|
export default handleAPIError;
|
|
4
4
|
//# sourceMappingURL=handleAPIError.d.ts.map
|