strapi-plugin-comments 2.1.8 → 2.2.0-beta.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 -2
- 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
|
@@ -1,29 +1,25 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import PropTypes from "prop-types";
|
|
1
3
|
declare const DiscussionThreadItemReviewAction: {
|
|
2
|
-
({
|
|
3
|
-
item: any;
|
|
4
|
-
isAnyActionLoading: any;
|
|
5
|
-
queryToInvalidate: any;
|
|
6
|
-
areBlockButtonsDisabled: any;
|
|
4
|
+
({ allowedActions: { canModerate, canAccessReports, canReviewReports }, isAnyActionLoading, item, queryToInvalidate }: {
|
|
7
5
|
allowedActions: {
|
|
8
6
|
canModerate: any;
|
|
9
7
|
canAccessReports: any;
|
|
10
8
|
canReviewReports: any;
|
|
11
9
|
};
|
|
12
|
-
|
|
13
|
-
blockItemThreadMutation: any;
|
|
14
|
-
onBlockButtonsStateChange: any;
|
|
15
|
-
onBlockActionClick: any;
|
|
16
|
-
}): any;
|
|
17
|
-
propTypes: {
|
|
10
|
+
isAnyActionLoading: any;
|
|
18
11
|
item: any;
|
|
19
|
-
isLoading: any;
|
|
20
12
|
queryToInvalidate: any;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
13
|
+
}): JSX.Element | null;
|
|
14
|
+
propTypes: {
|
|
15
|
+
item: PropTypes.Validator<object>;
|
|
16
|
+
isAnyActionLoading: PropTypes.Requireable<boolean>;
|
|
17
|
+
allowedActions: PropTypes.Requireable<PropTypes.InferProps<{
|
|
18
|
+
canModerate: PropTypes.Requireable<boolean>;
|
|
19
|
+
canAccessReports: PropTypes.Requireable<boolean>;
|
|
20
|
+
canReviewReports: PropTypes.Requireable<boolean>;
|
|
21
|
+
}>>;
|
|
22
|
+
queryToInvalidate: PropTypes.Requireable<string>;
|
|
27
23
|
};
|
|
28
24
|
};
|
|
29
25
|
export default DiscussionThreadItemReviewAction;
|
|
@@ -26,76 +26,82 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
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 react_query_1 = require("react-query");
|
|
32
|
-
const lodash_1 = require("lodash");
|
|
33
29
|
const Button_1 = require("@strapi/design-system/Button");
|
|
34
30
|
const IconButton_1 = require("@strapi/design-system/IconButton");
|
|
35
31
|
const helper_plugin_1 = require("@strapi/helper-plugin");
|
|
36
|
-
const
|
|
37
|
-
const
|
|
32
|
+
const lodash_1 = require("lodash");
|
|
33
|
+
const prop_types_1 = __importDefault(require("prop-types"));
|
|
34
|
+
const react_1 = __importStar(require("react"));
|
|
35
|
+
const react_query_1 = require("react-query");
|
|
38
36
|
const api_1 = require("../../pages/utils/api");
|
|
37
|
+
const pluginId_1 = require("../../pluginId");
|
|
39
38
|
const utils_1 = require("../../utils");
|
|
40
|
-
const ReportsReviewTable_1 = __importDefault(require("../ReportsReviewTable"));
|
|
41
39
|
const ReportsReviewModal_1 = __importDefault(require("../ReportsReviewModal"));
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
|
|
40
|
+
const ReportsReviewTable_1 = __importDefault(require("../ReportsReviewTable"));
|
|
41
|
+
const icons_1 = require("../icons");
|
|
42
|
+
const DiscussionThreadItemReviewAction = ({ allowedActions: { canModerate, canAccessReports, canReviewReports }, isAnyActionLoading, item, queryToInvalidate }) => {
|
|
43
|
+
const { blockedThread, reports } = item;
|
|
45
44
|
const [reportsReviewVisible, setReportsReviewVisible] = (0, react_1.useState)(false);
|
|
46
45
|
const [storedItems, setStoredItems] = (0, react_1.useState)([]);
|
|
47
46
|
const [selectedItems, setSelectedItems] = (0, react_1.useState)([]);
|
|
47
|
+
const [blockButtonsDisabled, setBlockButtonsDisabled] = (0, react_1.useState)(blockedThread);
|
|
48
|
+
const handleBlockButtonsStateChange = (disabled) => setBlockButtonsDisabled(disabled);
|
|
48
49
|
const toggleNotification = (0, helper_plugin_1.useNotification)();
|
|
49
50
|
const queryClient = (0, react_query_1.useQueryClient)();
|
|
50
51
|
const { lockApp, unlockApp } = (0, helper_plugin_1.useOverlayBlocker)();
|
|
51
52
|
(0, react_1.useEffect)(() => {
|
|
52
53
|
setStoredItems((0, lodash_1.orderBy)(reports, ["resolved", "createdAt"], ["DESC", "DESC"]));
|
|
53
|
-
}, [reportsReviewVisible]);
|
|
54
|
-
const onSuccess = (message
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
}, [reportsReviewVisible, reports]);
|
|
55
|
+
const onSuccess = (message = "") => () => {
|
|
56
|
+
queryClient.invalidateQueries(queryToInvalidate);
|
|
57
|
+
if (message) {
|
|
58
|
+
toggleNotification({
|
|
59
|
+
type: "success",
|
|
60
|
+
message: `${pluginId_1.pluginId}.${message}`,
|
|
61
|
+
});
|
|
57
62
|
}
|
|
58
|
-
toggleNotification({
|
|
59
|
-
type: "success",
|
|
60
|
-
message: `${pluginId_1.pluginId}.${message}`,
|
|
61
|
-
});
|
|
62
|
-
stateAction(false);
|
|
63
63
|
unlockApp();
|
|
64
64
|
};
|
|
65
|
-
const onError = (err) => {
|
|
65
|
+
const onError = (err) => () => {
|
|
66
66
|
(0, utils_1.handleAPIError)(err, toggleNotification);
|
|
67
67
|
};
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
const
|
|
68
|
+
const mutationConfig = (message) => {
|
|
69
|
+
return {
|
|
70
|
+
onSuccess: onSuccess(message),
|
|
71
|
+
onError
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
const onBlockActionClick = async (mutation, onCallback) => {
|
|
75
|
+
lockApp();
|
|
76
|
+
await mutation.mutateAsync(item.id);
|
|
77
|
+
setReportsReviewVisible(false);
|
|
78
|
+
};
|
|
79
|
+
const isNotResolved = (entry) => !entry.resolved;
|
|
80
|
+
const resolveReportMutation = (0, react_query_1.useMutation)(api_1.resolveReport, mutationConfig("page.details.panel.discussion.warnings.reports.dialog.confirmation.success"));
|
|
81
|
+
const resolveCommentMultipleReportsMutation = (0, react_query_1.useMutation)(api_1.resolveCommentMultipleReports, mutationConfig("page.details.panel.discussion.warnings.reports.selected.dialog.confirmation.success"));
|
|
82
|
+
const resolveAllAbuseReportsForCommentMutation = (0, react_query_1.useMutation)(api_1.resolveAllAbuseReportsForComment, mutationConfig());
|
|
83
|
+
const resolveAllAbuseReportsForThreadMutation = (0, react_query_1.useMutation)(api_1.resolveAllAbuseReportsForThread, mutationConfig());
|
|
84
|
+
const blockItemMutation = (0, react_query_1.useMutation)(api_1.blockItem, mutationConfig("page.details.actions.comment.block.confirmation.success"));
|
|
85
|
+
const blockItemThreadMutation = (0, react_query_1.useMutation)(api_1.blockItemThread, mutationConfig("page.details.actions.thread.block.confirmation.success"));
|
|
80
86
|
const handleReportsReviewClick = () => {
|
|
81
87
|
if (canAccessReports) {
|
|
82
88
|
setReportsReviewVisible(true);
|
|
83
89
|
}
|
|
84
90
|
};
|
|
85
|
-
const handleBlockItemClick =
|
|
91
|
+
const handleBlockItemClick = () => {
|
|
86
92
|
if (canModerate) {
|
|
87
|
-
|
|
93
|
+
onBlockActionClick(blockItemMutation);
|
|
88
94
|
}
|
|
89
95
|
};
|
|
90
|
-
const handleBlockItemThreadClick =
|
|
96
|
+
const handleBlockItemThreadClick = () => {
|
|
91
97
|
if (canModerate) {
|
|
92
|
-
|
|
98
|
+
onBlockActionClick(blockItemThreadMutation);
|
|
93
99
|
}
|
|
94
100
|
};
|
|
95
101
|
const handleClickResolveSelected = async () => {
|
|
96
102
|
if (canReviewReports) {
|
|
97
103
|
lockApp();
|
|
98
|
-
const items = await
|
|
104
|
+
const items = await resolveCommentMultipleReportsMutation.mutateAsync({
|
|
99
105
|
id: item.id,
|
|
100
106
|
reportIds: selectedItems,
|
|
101
107
|
});
|
|
@@ -106,15 +112,33 @@ const DiscussionThreadItemReviewAction = ({ item, isAnyActionLoading: isAnyActio
|
|
|
106
112
|
}));
|
|
107
113
|
setStoredItems(updatedItems);
|
|
108
114
|
setSelectedItems([], false);
|
|
109
|
-
|
|
115
|
+
handleBlockButtonsStateChange(updatedItems.filter(isNotResolved).length === 0);
|
|
110
116
|
}
|
|
111
117
|
}
|
|
112
118
|
};
|
|
119
|
+
const handleResolveAllAbuseReportsForComment = async () => {
|
|
120
|
+
if (canModerate) {
|
|
121
|
+
await onBlockActionClick(resolveAllAbuseReportsForCommentMutation);
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
const handleResolveAllAbuseReportsForThread = async () => {
|
|
125
|
+
if (canModerate) {
|
|
126
|
+
await onBlockActionClick(resolveAllAbuseReportsForThreadMutation);
|
|
127
|
+
}
|
|
128
|
+
};
|
|
113
129
|
const handleReportsReviewClose = async () => {
|
|
114
130
|
await queryClient.invalidateQueries(queryToInvalidate);
|
|
115
131
|
setReportsReviewVisible(false);
|
|
116
132
|
};
|
|
117
|
-
const
|
|
133
|
+
const handleOnClikcBlockComment = (0, react_1.useCallback)(() => {
|
|
134
|
+
handleResolveAllAbuseReportsForComment();
|
|
135
|
+
handleBlockItemClick();
|
|
136
|
+
}, [handleResolveAllAbuseReportsForComment, handleBlockItemClick]);
|
|
137
|
+
const handleOnClikcBlockThread = (0, react_1.useCallback)(() => {
|
|
138
|
+
handleBlockItemThreadClick();
|
|
139
|
+
handleResolveAllAbuseReportsForThread();
|
|
140
|
+
}, [handleBlockItemThreadClick, handleResolveAllAbuseReportsForThread]);
|
|
141
|
+
const onSelectionChange = (selection) => setSelectedItems(selection);
|
|
118
142
|
const isLoading = isAnyActionLoading && resolveReportMutation.isLoading;
|
|
119
143
|
const openReports = reports?.filter(isNotResolved);
|
|
120
144
|
const hasReports = !(0, lodash_1.isEmpty)(openReports);
|
|
@@ -122,34 +146,29 @@ const DiscussionThreadItemReviewAction = ({ item, isAnyActionLoading: isAnyActio
|
|
|
122
146
|
const hasAnySelectedItems = selectedItems.length > 0;
|
|
123
147
|
if (reviewFlowEnabled) {
|
|
124
148
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
125
|
-
react_1.default.createElement(IconButton_1.IconButton, { onClick: handleReportsReviewClick, label: (0, utils_1.getMessage)("page.discover.table.reports.review"), icon:
|
|
149
|
+
react_1.default.createElement(IconButton_1.IconButton, { onClick: handleReportsReviewClick, label: (0, utils_1.getMessage)("page.discover.table.reports.review"), icon: icons_1.review }),
|
|
126
150
|
react_1.default.createElement(ReportsReviewModal_1.default, { isVisible: reportsReviewVisible, isActionAsync: isLoading, allowedActions: { canModerate, canAccessReports, canReviewReports }, onClose: handleReportsReviewClose, startActions: react_1.default.createElement(Button_1.Button, { onClick: handleReportsReviewClose, variant: "tertiary" }, (0, utils_1.getMessage)("compontents.confirmation.dialog.button.cancel", "Cancel")), endActions: canModerate && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
127
|
-
react_1.default.createElement(Button_1.Button, { onClick:
|
|
128
|
-
item.gotThread && (react_1.default.createElement(Button_1.Button, { onClick:
|
|
129
|
-
hasAnySelectedItems && (react_1.default.createElement(Button_1.Button, { onClick: handleClickResolveSelected, variant: "success", startIcon:
|
|
151
|
+
react_1.default.createElement(Button_1.Button, { onClick: handleOnClikcBlockComment, variant: "danger-light", startIcon: icons_1.lock, disabled: blockButtonsDisabled }, (0, utils_1.getMessage)(`page.details.actions.comment.block`, "Block comment")),
|
|
152
|
+
item.gotThread && (react_1.default.createElement(Button_1.Button, { onClick: handleOnClikcBlockThread, variant: "danger", startIcon: icons_1.lock, disabled: blockButtonsDisabled }, (0, utils_1.getMessage)(`page.details.actions.thread.block`, "Block thread"))),
|
|
153
|
+
hasAnySelectedItems && (react_1.default.createElement(Button_1.Button, { onClick: handleClickResolveSelected, variant: "success", startIcon: icons_1.check }, (0, utils_1.getMessage)({
|
|
130
154
|
id: `page.details.panel.discussion.warnings.reports.dialog.actions.resolve.selected`,
|
|
131
155
|
props: {
|
|
132
156
|
count: selectedItems.length,
|
|
133
|
-
}
|
|
157
|
+
},
|
|
134
158
|
}, "Resolve selected"))))), item: item },
|
|
135
|
-
react_1.default.createElement(ReportsReviewTable_1.default, { commentId: item.id, items: storedItems, selectedItems: selectedItems, mutation: resolveReportMutation, updateItems: setStoredItems, allowedActions: { canAccessReports, canReviewReports }, onBlockButtonsStateChange:
|
|
159
|
+
react_1.default.createElement(ReportsReviewTable_1.default, { commentId: item.id, items: storedItems, selectedItems: selectedItems, mutation: resolveReportMutation, updateItems: setStoredItems, allowedActions: { canAccessReports, canReviewReports }, onBlockButtonsStateChange: handleBlockButtonsStateChange, onSelectionChange: onSelectionChange }))));
|
|
136
160
|
}
|
|
137
161
|
return null;
|
|
138
162
|
};
|
|
139
163
|
DiscussionThreadItemReviewAction.propTypes = {
|
|
140
164
|
item: prop_types_1.default.object.isRequired,
|
|
141
|
-
|
|
142
|
-
queryToInvalidate: prop_types_1.default.string.isRequired,
|
|
143
|
-
areBlockButtonsDisabled: prop_types_1.default.bool,
|
|
165
|
+
isAnyActionLoading: prop_types_1.default.bool,
|
|
144
166
|
allowedActions: prop_types_1.default.shape({
|
|
145
167
|
canModerate: prop_types_1.default.bool,
|
|
146
168
|
canAccessReports: prop_types_1.default.bool,
|
|
147
169
|
canReviewReports: prop_types_1.default.bool,
|
|
148
170
|
}),
|
|
149
|
-
|
|
150
|
-
blockItemThreadMutation: prop_types_1.default.func.isRequired,
|
|
151
|
-
onBlockButtonsStateChange: prop_types_1.default.func.isRequired,
|
|
152
|
-
onBlockActionClick: prop_types_1.default.func.isRequired,
|
|
171
|
+
queryToInvalidate: prop_types_1.default.string
|
|
153
172
|
};
|
|
154
173
|
exports.default = DiscussionThreadItemReviewAction;
|
|
155
174
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare type HintProps = {
|
|
3
|
+
description: {
|
|
4
|
+
id: string;
|
|
5
|
+
defaultMessage: string;
|
|
6
|
+
values: {};
|
|
7
|
+
} | undefined;
|
|
8
|
+
error: string | undefined;
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const Hint: React.FC<HintProps>;
|
|
13
|
+
export default Hint;
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
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.Hint = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const react_intl_1 = require("react-intl");
|
|
9
|
+
const Typography_1 = require("@strapi/design-system/Typography");
|
|
10
|
+
const Hint = ({ id, error, name, description }) => {
|
|
11
|
+
const { formatMessage } = (0, react_intl_1.useIntl)();
|
|
12
|
+
const hint = description
|
|
13
|
+
? formatMessage({ id: description.id, defaultMessage: description.defaultMessage }, { ...description.values })
|
|
14
|
+
: '';
|
|
15
|
+
if (!hint || error) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
return (react_1.default.createElement(Typography_1.Typography, { as: "p", variant: "pi", id: `${id || name}-hint`, textColor: "neutral600" }, hint));
|
|
19
|
+
};
|
|
20
|
+
exports.Hint = Hint;
|
|
21
|
+
exports.default = exports.Hint;
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Comment } from "../../../../types/contentTypes";
|
|
3
|
+
declare type ModeratorResponseProps = {
|
|
4
|
+
rootThread: Comment;
|
|
5
|
+
};
|
|
6
|
+
declare const ModeratorResponse: React.FC<ModeratorResponseProps>;
|
|
7
|
+
export default ModeratorResponse;
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,108 @@
|
|
|
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 react_query_1 = require("react-query");
|
|
31
|
+
const api_1 = require("../../pages/utils/api");
|
|
32
|
+
const styles_1 = require("./styles");
|
|
33
|
+
const api_2 = require("../../pages/utils/api");
|
|
34
|
+
const Box_1 = require("@strapi/design-system/Box");
|
|
35
|
+
const Typography_1 = require("@strapi/design-system/Typography");
|
|
36
|
+
const Flex_1 = require("@strapi/design-system/Flex");
|
|
37
|
+
const Button_1 = require("@strapi/design-system/Button");
|
|
38
|
+
const Divider_1 = require("@strapi/design-system/Divider");
|
|
39
|
+
const utils_1 = require("../../utils");
|
|
40
|
+
const Wysiwyg_1 = __importDefault(require("../Wysiwyg"));
|
|
41
|
+
const helper_plugin_1 = require("@strapi/helper-plugin");
|
|
42
|
+
const pluginId_1 = require("../../pluginId");
|
|
43
|
+
const ModeratorResponse = ({ rootThread, }) => {
|
|
44
|
+
const { id: threadId, blockedThread } = rootThread;
|
|
45
|
+
const [commentField, setCommentField] = (0, react_1.useState)("");
|
|
46
|
+
const [isFieldEmpty, setIsFieldEmpty] = (0, react_1.useState)(true);
|
|
47
|
+
const handleCommentChange = (e) => {
|
|
48
|
+
setCommentField(e.target.value);
|
|
49
|
+
};
|
|
50
|
+
const user = helper_plugin_1.auth.get("userInfo");
|
|
51
|
+
(0, react_1.useEffect)(() => {
|
|
52
|
+
setIsFieldEmpty(!commentField);
|
|
53
|
+
}, [commentField]);
|
|
54
|
+
const toggleNotification = (0, helper_plugin_1.useNotification)();
|
|
55
|
+
const queryClient = (0, react_query_1.useQueryClient)();
|
|
56
|
+
const { lockApp, unlockApp } = (0, helper_plugin_1.useOverlayBlocker)();
|
|
57
|
+
const onSuccess = (message, stateAction = (_func) => { }) => async () => {
|
|
58
|
+
await queryClient.invalidateQueries("get-details-data");
|
|
59
|
+
toggleNotification({
|
|
60
|
+
type: "success",
|
|
61
|
+
message: `${pluginId_1.pluginId}.${message}`,
|
|
62
|
+
});
|
|
63
|
+
stateAction(false);
|
|
64
|
+
unlockApp();
|
|
65
|
+
};
|
|
66
|
+
const onError = (err) => {
|
|
67
|
+
(0, utils_1.handleAPIError)(err, toggleNotification);
|
|
68
|
+
};
|
|
69
|
+
const unblockItemThreadMutation = (0, react_query_1.useMutation)(api_1.unblockItemThread);
|
|
70
|
+
const postCommentMutation = (0, react_query_1.useMutation)(api_2.postComment, {
|
|
71
|
+
onSuccess: onSuccess("page.details.actions.comment.post.confirmation"),
|
|
72
|
+
onError,
|
|
73
|
+
});
|
|
74
|
+
const handleSave = async () => {
|
|
75
|
+
lockApp();
|
|
76
|
+
await postCommentMutation.mutate({
|
|
77
|
+
threadId,
|
|
78
|
+
body: commentField,
|
|
79
|
+
author: user,
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
const handleReopen = async () => {
|
|
83
|
+
lockApp();
|
|
84
|
+
await unblockItemThreadMutation.mutate(threadId);
|
|
85
|
+
await postCommentMutation.mutate({
|
|
86
|
+
threadId,
|
|
87
|
+
body: commentField,
|
|
88
|
+
author: user,
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
const intlLabel = {
|
|
92
|
+
id: "",
|
|
93
|
+
defaultMessage: "",
|
|
94
|
+
values: {},
|
|
95
|
+
};
|
|
96
|
+
return (react_1.default.createElement(styles_1.ModeratorResponseStyled, null,
|
|
97
|
+
react_1.default.createElement(Divider_1.Divider, null),
|
|
98
|
+
react_1.default.createElement(Box_1.Box, { hasRadius: true, padding: 4 },
|
|
99
|
+
react_1.default.createElement(Box_1.Box, null,
|
|
100
|
+
react_1.default.createElement(Typography_1.Typography, { variant: "delta", textColor: "neutral800", id: "moderator-reply" }, (0, utils_1.getMessage)("page.details.panel.discussion.reply", "Reply"))),
|
|
101
|
+
react_1.default.createElement(Box_1.Box, { paddingTop: 2, paddingBottom: 4 },
|
|
102
|
+
react_1.default.createElement(Wysiwyg_1.default, { name: "", value: commentField, onChange: handleCommentChange, intlLabel: intlLabel })),
|
|
103
|
+
react_1.default.createElement(Flex_1.Flex, { direction: "row", justifyContent: "flex-end", gap: 2 },
|
|
104
|
+
blockedThread && (react_1.default.createElement(Button_1.Button, { variant: "secondary", onClick: handleReopen, disabled: isFieldEmpty }, (0, utils_1.getMessage)("page.details.panel.discussion.reopen", "Re-open"))),
|
|
105
|
+
react_1.default.createElement(Button_1.Button, { variant: "tertiary", onClick: handleSave, disabled: isFieldEmpty }, (0, utils_1.getMessage)("page.details.panel.discussion.send", "Send"))))));
|
|
106
|
+
};
|
|
107
|
+
exports.default = ModeratorResponse;
|
|
108
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
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.ModeratorResponseStyled = void 0;
|
|
7
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
8
|
+
const Stack_1 = require("@strapi/design-system/Stack");
|
|
9
|
+
exports.ModeratorResponseStyled = (0, styled_components_1.default)(Stack_1.Stack) `
|
|
10
|
+
width: 100%;
|
|
11
|
+
`;
|
|
12
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Id } from "strapi-typed";
|
|
3
|
+
declare type ModeratorResponseModalProps = {
|
|
4
|
+
content: string;
|
|
5
|
+
id: Id;
|
|
6
|
+
title: string;
|
|
7
|
+
onClose: () => void;
|
|
8
|
+
};
|
|
9
|
+
declare const ModeratorResponseModal: React.FC<ModeratorResponseModalProps>;
|
|
10
|
+
export default ModeratorResponseModal;
|
|
11
|
+
//# sourceMappingURL=ModeratorResponseModal.d.ts.map
|
|
@@ -0,0 +1,98 @@
|
|
|
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 react_query_1 = require("react-query");
|
|
31
|
+
const api_1 = require("../../pages/utils/api");
|
|
32
|
+
const ModalLayout_1 = require("@strapi/design-system/ModalLayout");
|
|
33
|
+
const Typography_1 = require("@strapi/design-system/Typography");
|
|
34
|
+
const Button_1 = require("@strapi/design-system/Button");
|
|
35
|
+
const utils_1 = require("../../utils");
|
|
36
|
+
const Wysiwyg_1 = __importDefault(require("../Wysiwyg"));
|
|
37
|
+
const helper_plugin_1 = require("@strapi/helper-plugin");
|
|
38
|
+
const pluginId_1 = require("../../pluginId");
|
|
39
|
+
const ModeratorResponseModal = ({ content, id, title, onClose, }) => {
|
|
40
|
+
const [commentField, setCommentField] = (0, react_1.useState)(content);
|
|
41
|
+
const handleCommentChange = (e) => {
|
|
42
|
+
setCommentField(e.target.value);
|
|
43
|
+
};
|
|
44
|
+
const user = helper_plugin_1.auth.get("userInfo");
|
|
45
|
+
const handleClose = onClose;
|
|
46
|
+
const toggleNotification = (0, helper_plugin_1.useNotification)();
|
|
47
|
+
const queryClient = (0, react_query_1.useQueryClient)();
|
|
48
|
+
const { lockApp, unlockApp } = (0, helper_plugin_1.useOverlayBlocker)();
|
|
49
|
+
const onSuccess = (message, stateAction = (_func) => { }) => async () => {
|
|
50
|
+
await queryClient.invalidateQueries("get-details-data");
|
|
51
|
+
onClose();
|
|
52
|
+
toggleNotification({
|
|
53
|
+
type: "success",
|
|
54
|
+
message: `${pluginId_1.pluginId}.${message}`,
|
|
55
|
+
});
|
|
56
|
+
stateAction(false);
|
|
57
|
+
unlockApp();
|
|
58
|
+
};
|
|
59
|
+
const onError = (err) => {
|
|
60
|
+
(0, utils_1.handleAPIError)(err, toggleNotification);
|
|
61
|
+
};
|
|
62
|
+
const postCommentMutation = (0, react_query_1.useMutation)(api_1.postComment, {
|
|
63
|
+
onSuccess: onSuccess("page.details.actions.comment.post.confirmation"),
|
|
64
|
+
onError,
|
|
65
|
+
});
|
|
66
|
+
const updateCommentMutation = (0, react_query_1.useMutation)(api_1.updateComment, {
|
|
67
|
+
onSuccess: onSuccess("page.details.actions.comment.update.confirmation"),
|
|
68
|
+
onError,
|
|
69
|
+
});
|
|
70
|
+
const handlePostComment = async () => {
|
|
71
|
+
lockApp();
|
|
72
|
+
await postCommentMutation.mutate({
|
|
73
|
+
threadId: id,
|
|
74
|
+
body: commentField,
|
|
75
|
+
author: user,
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
const handleUpdateComment = async () => {
|
|
79
|
+
lockApp();
|
|
80
|
+
await updateCommentMutation.mutate({
|
|
81
|
+
id,
|
|
82
|
+
body: commentField,
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
const intlLabel = {
|
|
86
|
+
id: "",
|
|
87
|
+
defaultMessage: "",
|
|
88
|
+
values: {},
|
|
89
|
+
};
|
|
90
|
+
return (react_1.default.createElement(ModalLayout_1.ModalLayout, { onClose: handleClose, labelledBy: title },
|
|
91
|
+
react_1.default.createElement(ModalLayout_1.ModalHeader, null,
|
|
92
|
+
react_1.default.createElement(Typography_1.Typography, { fontWeight: "bold", textColor: "neutral800", as: "h2", id: "title" }, title)),
|
|
93
|
+
react_1.default.createElement(ModalLayout_1.ModalBody, null,
|
|
94
|
+
react_1.default.createElement(Wysiwyg_1.default, { name: "", value: commentField, onChange: handleCommentChange, intlLabel: intlLabel })),
|
|
95
|
+
react_1.default.createElement(ModalLayout_1.ModalFooter, { startActions: react_1.default.createElement(Button_1.Button, { onClick: handleClose, variant: "tertiary" }, (0, utils_1.getMessage)("compontents.confirmation.dialog.button.cancel")), endActions: content.length ? (react_1.default.createElement(Button_1.Button, { onClick: handleUpdateComment }, (0, utils_1.getMessage)("page.details.actions.thread.modal.update.comment"))) : (react_1.default.createElement(Button_1.Button, { onClick: handlePostComment }, (0, utils_1.getMessage)("page.details.actions.thread.modal.start.thread"))) })));
|
|
96
|
+
};
|
|
97
|
+
exports.default = ModeratorResponseModal;
|
|
98
|
+
//# sourceMappingURL=ModeratorResponseModal.js.map
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
declare const Nav: ({ visible, hasNewComments, hasNewReports }: {
|
|
2
3
|
visible?: boolean | undefined;
|
|
3
4
|
hasNewComments: any;
|
|
4
5
|
hasNewReports: any;
|
|
5
|
-
}) =>
|
|
6
|
+
}) => JSX.Element | null;
|
|
6
7
|
export default Nav;
|
|
7
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -5,22 +5,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const react_1 = __importDefault(require("react"));
|
|
7
7
|
const SubNav_1 = require("@strapi/design-system/SubNav");
|
|
8
|
-
const icons_1 = require("
|
|
8
|
+
const icons_1 = require("../icons");
|
|
9
9
|
const getMessage_1 = __importDefault(require("../../utils/getMessage"));
|
|
10
10
|
const getUrl_1 = __importDefault(require("../../utils/getUrl"));
|
|
11
11
|
const Nav = ({ visible = false, hasNewComments, hasNewReports }) => {
|
|
12
12
|
if (!visible) {
|
|
13
13
|
return null;
|
|
14
14
|
}
|
|
15
|
-
return (react_1.default.createElement(SubNav_1.SubNav, { ariaLabel:
|
|
16
|
-
react_1.default.createElement(SubNav_1.SubNavHeader, { label: (0, getMessage_1.default)(
|
|
15
|
+
return (react_1.default.createElement(SubNav_1.SubNav, { ariaLabel: 'Comments sub nav' },
|
|
16
|
+
react_1.default.createElement(SubNav_1.SubNavHeader, { label: (0, getMessage_1.default)('plugin.name') }),
|
|
17
17
|
react_1.default.createElement(SubNav_1.SubNavSections, null,
|
|
18
|
-
react_1.default.createElement(SubNav_1.
|
|
19
|
-
|
|
20
|
-
react_1.default.createElement(SubNav_1.SubNavLink, { to: (0, getUrl_1.default)(
|
|
21
|
-
react_1.default.createElement(SubNav_1.SubNavLink, { to: (0, getUrl_1.default)("reports"), withBullet: hasNewReports, icon: react_1.default.createElement(icons_1.Apps, null) }, (0, getMessage_1.default)("nav.item.reports"))),
|
|
22
|
-
react_1.default.createElement(SubNav_1.SubNavSection, { label: (0, getMessage_1.default)("nav.header.settings") },
|
|
23
|
-
react_1.default.createElement(SubNav_1.SubNavLink, { to: (0, getUrl_1.default)("settings"), icon: react_1.default.createElement(icons_1.Apps, null) }, (0, getMessage_1.default)("nav.item.settings"))))));
|
|
18
|
+
react_1.default.createElement(SubNav_1.SubNavSection, { label: (0, getMessage_1.default)('nav.header.moderation') },
|
|
19
|
+
react_1.default.createElement(SubNav_1.SubNavLink, { to: (0, getUrl_1.default)('discover'), icon: icons_1.apps }, (0, getMessage_1.default)('nav.item.discover')),
|
|
20
|
+
react_1.default.createElement(SubNav_1.SubNavLink, { to: (0, getUrl_1.default)('reports'), withBullet: hasNewReports, icon: icons_1.apps }, (0, getMessage_1.default)('nav.item.reports'))))));
|
|
24
21
|
};
|
|
25
22
|
exports.default = Nav;
|
|
26
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const PluginIcon = () => react_1.default.createElement(comments_1.default, null);
|
|
3
|
+
const icons_1 = require("../icons");
|
|
4
|
+
const PluginIcon = () => icons_1.comments;
|
|
9
5
|
exports.default = PluginIcon;
|
|
10
6
|
//# sourceMappingURL=index.js.map
|