strapi-plugin-comments 2.2.1 → 2.2.3
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 +1 -1
- package/admin/src/components/ActionButton/styles.d.ts +1 -1
- package/admin/src/components/AdminAvatar/index.d.ts +4 -0
- package/admin/src/components/AdminAvatar/index.js +17 -0
- package/admin/src/components/AdminAvatar/styles.d.ts +3 -0
- package/admin/src/components/AdminAvatar/styles.js +17 -0
- package/admin/src/components/Avatar/index.d.ts +8 -11
- package/admin/src/components/Avatar/index.js +7 -8
- package/admin/src/components/DiscussionThreadItem/styles.d.ts +3 -3
- package/admin/src/components/DiscussionThreadItemActions/styles.d.ts +1 -1
- package/admin/src/components/DiscussionThreadItemApprovalFlowActions/styles.d.ts +1 -1
- package/admin/src/components/DiscussionThreadItemFooter/styles.d.ts +2 -2
- package/admin/src/components/FormSwitch/styles.d.ts +1 -1
- package/admin/src/components/Hint/index.d.ts +1 -1
- package/admin/src/components/IconButton/styles.d.ts +1 -1
- package/admin/src/components/LoadingIndicatorOverlay/styles.d.ts +2 -2
- package/admin/src/components/ModeratorResponse/index.d.ts +1 -1
- package/admin/src/components/ModeratorResponse/styles.d.ts +1 -1
- package/admin/src/components/ModeratorResponseModal/ModeratorResponseModal.d.ts +1 -1
- package/admin/src/components/PreviewWysiwyg/Wrapper.d.ts +1 -1
- package/admin/src/components/PreviewWysiwyg/index.d.ts +1 -1
- package/admin/src/components/StatusBadge/styles.d.ts +1 -1
- package/admin/src/components/Wysiwyg/Editor.d.ts +1 -1
- package/admin/src/components/Wysiwyg/EditorLayout.d.ts +2 -2
- package/admin/src/components/Wysiwyg/EditorStylesContainer.d.ts +1 -1
- package/admin/src/components/Wysiwyg/WysiwygFooter.d.ts +1 -1
- package/admin/src/components/Wysiwyg/WysiwygNav.d.ts +1 -1
- package/admin/src/components/Wysiwyg/WysiwygStyles.d.ts +7 -7
- package/admin/src/components/Wysiwyg/index.d.ts +1 -1
- package/admin/src/components/icons/strapiIcons.d.ts +1 -0
- package/admin/src/components/icons/strapiIcons.js +2 -1
- package/admin/src/custom-fields/comments/components/input/consts.d.ts +3 -0
- package/admin/src/custom-fields/comments/components/input/consts.js +9 -0
- package/admin/src/custom-fields/comments/components/input/input.js +2 -6
- package/admin/src/custom-fields/comments/components/input/types.d.ts +2 -2
- package/admin/src/custom-fields/comments/components/input/utils.js +8 -1
- package/admin/src/index.js +2 -1
- package/admin/src/pages/Details/components/DetailsFilters/styles.d.ts +1 -1
- package/admin/src/pages/Discover/components/DiscoverTableRow/index.js +12 -11
- package/admin/src/pages/Discover/components/DiscoverTableRow/styles.d.ts +1 -1
- package/admin/src/pages/Discover/utils/filtersSchema.d.ts +17 -2
- package/admin/src/pages/Discover/utils/filtersSchema.js +28 -0
- package/admin/src/pages/Reports/components/ReportsTableRow/styles.d.ts +1 -1
- package/admin/src/pages/Reports/utils/filtersSchema.d.ts +17 -2
- package/admin/src/pages/Reports/utils/filtersSchema.js +21 -0
- package/admin/src/pages/Settings/components/RestartAlert/styles.d.ts +1 -1
- package/admin/src/utils/getRelatedGroups.d.ts +1 -1
- package/admin/src/utils/resolveCommentStatus.d.ts +1 -1
- package/content-types/comment.d.ts +4 -0
- package/content-types/comment.js +4 -0
- package/content-types/index.d.ts +4 -0
- package/package.json +6 -4
- package/server/controllers/index.d.ts +1 -1
- package/server/controllers/utils/functions.d.ts +1 -1
- package/server/graphql/mutations/createComment.d.ts +1 -1
- package/server/graphql/queries/findAllFlat.d.ts +1 -1
- package/server/graphql/queries/findAllInHierarchy.d.ts +1 -1
- package/server/routes/index.d.ts +2 -2
- package/server/services/admin.js +33 -14
- package/server/services/client.js +4 -1
- package/server/services/utils/functions.d.ts +2 -1
- package/server/services/utils/functions.js +9 -1
- package/server/utils/error.d.ts +1 -1
- package/strapi-server.d.ts +4 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/types/contentTypes.d.ts +10 -9
- package/types/utils.d.ts +2 -2
package/README.md
CHANGED
|
@@ -134,7 +134,7 @@ In our minimum support we're following [official Node.js releases timelines](htt
|
|
|
134
134
|
|
|
135
135
|
**Supported Strapi versions**:
|
|
136
136
|
|
|
137
|
-
- Strapi v4.4
|
|
137
|
+
- Strapi v4.5.4 (recently tested)
|
|
138
138
|
- Strapi v4.x
|
|
139
139
|
|
|
140
140
|
> This plugin is designed for **Strapi v4** and is not working with v3.x. To get version for **Strapi v3** install version [v1.x](https://github.com/VirtusLab-Open-Source/strapi-plugin-comments/tree/strapi-v3).
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const ActionButton: any
|
|
1
|
+
export declare const ActionButton: import("styled-components").StyledComponent<any, any, object, string | number | symbol>;
|
|
2
2
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const styles_1 = require("./styles");
|
|
8
|
+
const icons_1 = require("@strapi/icons");
|
|
9
|
+
const Icon_1 = require("@strapi/design-system/Icon");
|
|
10
|
+
const AdminAvatar = ({ children }) => {
|
|
11
|
+
return (react_1.default.createElement(styles_1.AdminAvatarWrapper, null,
|
|
12
|
+
react_1.default.createElement(styles_1.AdminShield, null,
|
|
13
|
+
react_1.default.createElement(Icon_1.Icon, { as: icons_1.Shield, color: "neutral800" })),
|
|
14
|
+
children));
|
|
15
|
+
};
|
|
16
|
+
exports.default = AdminAvatar;
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const AdminAvatarWrapper: import("styled-components").StyledComponent<any, any, object, string | number | symbol>;
|
|
2
|
+
export declare const AdminShield: import("styled-components").StyledComponent<any, any, object, string | number | symbol>;
|
|
3
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
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.AdminShield = exports.AdminAvatarWrapper = void 0;
|
|
7
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
8
|
+
const Box_1 = require("@strapi/design-system/Box");
|
|
9
|
+
exports.AdminAvatarWrapper = (0, styled_components_1.default)(Box_1.Box) `
|
|
10
|
+
position: relative;
|
|
11
|
+
`;
|
|
12
|
+
exports.AdminShield = (0, styled_components_1.default)(Box_1.Box) `
|
|
13
|
+
position: absolute;
|
|
14
|
+
right: -30%;
|
|
15
|
+
top: -30%;
|
|
16
|
+
`;
|
|
17
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
name: PropTypes.Requireable<string>;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ToBeFixed } from "../../../../types";
|
|
3
|
+
interface IProps {
|
|
4
|
+
avatar: string | ToBeFixed;
|
|
5
|
+
name: string;
|
|
6
|
+
isAdminComment?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare const UserAvatar: React.FC<IProps>;
|
|
12
9
|
export default UserAvatar;
|
|
13
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -4,23 +4,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const react_1 = __importDefault(require("react"));
|
|
7
|
-
const prop_types_1 = __importDefault(require("prop-types"));
|
|
8
7
|
const lodash_1 = require("lodash");
|
|
9
8
|
const Avatar_1 = require("@strapi/design-system/Avatar");
|
|
10
9
|
const utils_1 = require("../../utils");
|
|
11
|
-
const
|
|
10
|
+
const AdminAvatar_1 = __importDefault(require("../AdminAvatar"));
|
|
11
|
+
;
|
|
12
|
+
const UserAvatar = ({ avatar, name, isAdminComment = false }) => {
|
|
12
13
|
if (avatar) {
|
|
13
14
|
let image = avatar;
|
|
14
15
|
if ((0, lodash_1.isObject)(avatar)) {
|
|
15
16
|
image = avatar?.formats?.thumbnail.url || avatar.url;
|
|
16
17
|
}
|
|
17
|
-
return image && (react_1.default.createElement(Avatar_1.Avatar, { src: image, alt: name }))
|
|
18
|
+
return (isAdminComment ? react_1.default.createElement(AdminAvatar_1.default, null, image && (react_1.default.createElement(Avatar_1.Avatar, { src: image, alt: name })))
|
|
19
|
+
: image && (react_1.default.createElement(Avatar_1.Avatar, { src: image, alt: name })));
|
|
18
20
|
}
|
|
19
|
-
return name && (react_1.default.createElement(Avatar_1.Initials, null, (0, utils_1.renderInitials)(name)))
|
|
20
|
-
|
|
21
|
-
UserAvatar.propTypes = {
|
|
22
|
-
avatar: prop_types_1.default.oneOfType(prop_types_1.default.string, prop_types_1.default.object).isRequired,
|
|
23
|
-
name: prop_types_1.default.string,
|
|
21
|
+
return (isAdminComment ? react_1.default.createElement(AdminAvatar_1.default, null, name && (react_1.default.createElement(Avatar_1.Initials, null, (0, utils_1.renderInitials)(name))))
|
|
22
|
+
: name && (react_1.default.createElement(Avatar_1.Initials, null, (0, utils_1.renderInitials)(name))));
|
|
24
23
|
};
|
|
25
24
|
exports.default = UserAvatar;
|
|
26
25
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const DiscussionThreadFullsize: any
|
|
2
|
-
export declare const DiscussionThreadItemContent: any
|
|
3
|
-
export declare const DiscussionThreadItemContainer: any
|
|
1
|
+
export declare const DiscussionThreadFullsize: import("styled-components").StyledComponent<any, any, object, string | number | symbol>;
|
|
2
|
+
export declare const DiscussionThreadItemContent: import("styled-components").StyledComponent<any, any, object, string | number | symbol>;
|
|
3
|
+
export declare const DiscussionThreadItemContainer: import("styled-components").StyledComponent<any, any, object, string | number | symbol>;
|
|
4
4
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const DiscussionThreadItemActionsWrapper: any
|
|
1
|
+
export declare const DiscussionThreadItemActionsWrapper: import("styled-components").StyledComponent<any, any, object, string | number | symbol>;
|
|
2
2
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const DiscussionThreadItemActionsGroupWrapper: any
|
|
1
|
+
export declare const DiscussionThreadItemActionsGroupWrapper: import("styled-components").StyledComponent<any, any, object, string | number | symbol>;
|
|
2
2
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const DiscussionThreadItemFooterStyled: any
|
|
2
|
-
export declare const DiscussionThreadItemFooterMeta: any
|
|
1
|
+
export declare const DiscussionThreadItemFooterStyled: import("styled-components").StyledComponent<any, any, object, string | number | symbol>;
|
|
2
|
+
export declare const DiscussionThreadItemFooterMeta: import("styled-components").StyledComponent<any, any, object, string | number | symbol>;
|
|
3
3
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const StyledSwitch: any
|
|
1
|
+
export declare const StyledSwitch: import("styled-components").StyledComponent<any, any, object, string | number | symbol>;
|
|
2
2
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const IconButtonGroupStyled: any
|
|
1
|
+
export declare const IconButtonGroupStyled: import("styled-components").StyledComponent<any, any, object, string | number | symbol>;
|
|
2
2
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const LoadingIndicatorOverlayWrapper: any
|
|
2
|
-
export declare const LoadingIndicatorContainer: any
|
|
1
|
+
export declare const LoadingIndicatorOverlayWrapper: import("styled-components").StyledComponent<any, any, object, string | number | symbol>;
|
|
2
|
+
export declare const LoadingIndicatorContainer: import("styled-components").StyledComponent<(props: any) => any, any, {}, never>;
|
|
3
3
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const ModeratorResponseStyled: any
|
|
1
|
+
export declare const ModeratorResponseStyled: import("styled-components").StyledComponent<any, any, object, string | number | symbol>;
|
|
2
2
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const StatusBadge: any
|
|
1
|
+
export declare const StatusBadge: import("styled-components").StyledComponent<any, any, object, string | number | symbol>;
|
|
2
2
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const ExpandButton: any
|
|
3
|
-
|
|
2
|
+
export declare const ExpandButton: import("styled-components").StyledComponent<any, any, object, string | number | symbol>;
|
|
3
|
+
type EditorLayoutProps = {
|
|
4
4
|
children: React.ReactNode;
|
|
5
5
|
error: string | undefined;
|
|
6
6
|
isExpandMode: boolean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const EditorStylesContainer: any
|
|
1
|
+
export declare const EditorStylesContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
2
|
//# sourceMappingURL=EditorStylesContainer.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export declare const CustomIconButton: any
|
|
2
|
-
export declare const CustomLinkIconButton: any
|
|
3
|
-
export declare const MainButtons: any
|
|
4
|
-
export declare const MoreButton: any
|
|
5
|
-
export declare const IconButtonGroupMargin: any
|
|
6
|
-
export declare const EditorAndPreviewWrapper: any
|
|
7
|
-
export declare const ExpandButton: any
|
|
1
|
+
export declare const CustomIconButton: import("styled-components").StyledComponent<any, any, object, string | number | symbol>;
|
|
2
|
+
export declare const CustomLinkIconButton: import("styled-components").StyledComponent<any, any, object, string | number | symbol>;
|
|
3
|
+
export declare const MainButtons: import("styled-components").StyledComponent<any, any, object, string | number | symbol>;
|
|
4
|
+
export declare const MoreButton: import("styled-components").StyledComponent<any, any, object, string | number | symbol>;
|
|
5
|
+
export declare const IconButtonGroupMargin: import("styled-components").StyledComponent<any, any, object, string | number | symbol>;
|
|
6
|
+
export declare const EditorAndPreviewWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
7
|
+
export declare const ExpandButton: import("styled-components").StyledComponent<any, any, object, string | number | symbol>;
|
|
8
8
|
//# sourceMappingURL=WysiwygStyles.d.ts.map
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.plus = exports.pencil = exports.trash = exports.comments = exports.unlock = exports.lock = exports.review = exports.refresh = exports.play = exports.information = exports.illo = exports.filter = exports.eye = exports.exclamationMarkCircle = exports.emptyPictures = exports.cross = exports.check = exports.carretDown = exports.arrowUp = exports.arrowRight = exports.arrowLeft = exports.apps = void 0;
|
|
6
|
+
exports.shield = exports.plus = exports.pencil = exports.trash = exports.comments = exports.unlock = exports.lock = exports.review = exports.refresh = exports.play = exports.information = exports.illo = exports.filter = exports.eye = exports.exclamationMarkCircle = exports.emptyPictures = exports.cross = exports.check = exports.carretDown = exports.arrowUp = exports.arrowRight = exports.arrowLeft = exports.apps = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const icons_1 = require("@strapi/icons");
|
|
9
9
|
const review_1 = __importDefault(require("./review"));
|
|
@@ -32,4 +32,5 @@ exports.comments = react_1.default.createElement(comments_1.default, null);
|
|
|
32
32
|
exports.trash = react_1.default.createElement(icons_1.Trash, null);
|
|
33
33
|
exports.pencil = react_1.default.createElement(icons_1.Pencil, null);
|
|
34
34
|
exports.plus = react_1.default.createElement(icons_1.Plus, null);
|
|
35
|
+
exports.shield = react_1.default.createElement(icons_1.Shield, null);
|
|
35
36
|
//# sourceMappingURL=strapiIcons.js.map
|
|
@@ -37,14 +37,10 @@ const Grid_1 = require("@strapi/design-system/Grid");
|
|
|
37
37
|
const utils_1 = require("./utils");
|
|
38
38
|
const utils_2 = require("../../../../utils");
|
|
39
39
|
const react_intl_1 = require("react-intl");
|
|
40
|
-
const
|
|
41
|
-
commentsNumber: 30,
|
|
42
|
-
populate: [],
|
|
43
|
-
renderType: "FLAT",
|
|
44
|
-
};
|
|
40
|
+
const consts_1 = require("./consts");
|
|
45
41
|
const CustomFieldInput = ({ attribute, description, disabled, error, intlLabel, labelAction, name, onChange, required, value, }) => {
|
|
46
42
|
const { formatMessage } = (0, react_intl_1.useIntl)();
|
|
47
|
-
const [currentState, setCurrentState] = (0, react_1.useState)(value ? (0, utils_1.fromInput)(value) : DEFAULTS);
|
|
43
|
+
const [currentState, setCurrentState] = (0, react_1.useState)(value ? (0, utils_1.fromInput)(value) : consts_1.DEFAULTS);
|
|
48
44
|
const onCommentsNumberChange = (0, react_1.useCallback)((0, utils_1.handleStateSliceChange)("commentsNumber", setCurrentState), [setCurrentState]);
|
|
49
45
|
const onRenderTypeChange = (0, react_1.useCallback)((0, utils_1.handleStateSliceChange)("renderType", setCurrentState), [setCurrentState]);
|
|
50
46
|
const onSortByDateChange = (0, react_1.useCallback)((0, utils_1.handleStateSliceChange)("sortByDate", setCurrentState), [setCurrentState]);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export type PopulateField = "avatar" | "author";
|
|
2
|
+
export type CommentsFieldValue = {
|
|
3
3
|
commentsNumber: number;
|
|
4
4
|
renderType?: "FLAT" | "TREE";
|
|
5
5
|
sortByDate?: "ASC" | "DESC";
|
|
@@ -3,11 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getApprovalStatusOptions = exports.getFilterByOptions = exports.getSortByDateOptions = exports.getRenderTypeOptions = exports.handlePopulateChange = exports.handleStateSliceChange = exports.assertCorrectState = exports.toOutput = exports.fromInput = exports.asString = void 0;
|
|
4
4
|
const lodash_1 = require("lodash");
|
|
5
5
|
const utils_1 = require("../../../../utils");
|
|
6
|
+
const consts_1 = require("./consts");
|
|
6
7
|
const asString = () => "";
|
|
7
8
|
exports.asString = asString;
|
|
8
9
|
const fromInput = (value) => {
|
|
9
10
|
(0, utils_1.assertString)(value);
|
|
10
|
-
|
|
11
|
+
let state = JSON.parse(value);
|
|
12
|
+
if (!state) {
|
|
13
|
+
console.group("[Comments]");
|
|
14
|
+
console.warn("Empty state provided from the back-end");
|
|
15
|
+
console.groupEnd();
|
|
16
|
+
state = consts_1.DEFAULTS;
|
|
17
|
+
}
|
|
11
18
|
assertCorrectState(state);
|
|
12
19
|
if (state.filterBy === "DATE_CREATED" && state.filterByValue) {
|
|
13
20
|
state.filterByValue = new Date(state.filterByValue);
|
package/admin/src/index.js
CHANGED
|
@@ -83,7 +83,8 @@ exports.default = {
|
|
|
83
83
|
},
|
|
84
84
|
async registerTrads({ locales }) {
|
|
85
85
|
const importedTrads = await Promise.all(locales.map((locale) => {
|
|
86
|
-
|
|
86
|
+
var _a;
|
|
87
|
+
return (_a = `./translations/${locale}.json`, Promise.resolve().then(() => __importStar(require(_a)))).then(({ default: data }) => {
|
|
87
88
|
return {
|
|
88
89
|
data: (0, helper_plugin_1.prefixPluginTranslations)(data, pluginId_1.pluginId),
|
|
89
90
|
locale,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const TableLink: any
|
|
1
|
+
export declare const TableLink: import("styled-components").StyledComponent<any, any, object, string | number | symbol>;
|
|
2
2
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -47,24 +47,25 @@ const DiscoverTableRow = ({ config, item, allowedActions: { canModerate, canAcce
|
|
|
47
47
|
if (reviewFlowEnabled || needsApproval) {
|
|
48
48
|
actionItemsCount = 2;
|
|
49
49
|
}
|
|
50
|
-
|
|
50
|
+
const { author, isAdminComment, id, content, threadOf, related, createdAt, updatedAt } = item;
|
|
51
|
+
return (react_1.default.createElement(Table_1.Tr, { key: id },
|
|
51
52
|
react_1.default.createElement(Table_1.Td, null,
|
|
52
53
|
react_1.default.createElement(Typography_1.Typography, { textColor: "neutral800", fontWeight: "bold" },
|
|
53
54
|
"#",
|
|
54
|
-
|
|
55
|
+
id)),
|
|
55
56
|
react_1.default.createElement(Table_1.Td, null,
|
|
56
57
|
react_1.default.createElement(Stack_1.Stack, { size: 2, horizontal: true },
|
|
57
|
-
|
|
58
|
-
react_1.default.createElement(Typography_1.Typography, { textColor: "neutral800", variant: "pi" },
|
|
58
|
+
author && (react_1.default.createElement(Avatar_1.default, { avatar: author.avatar, name: author.name, isAdminComment: isAdminComment })),
|
|
59
|
+
react_1.default.createElement(Typography_1.Typography, { textColor: "neutral800", variant: "pi" }, author?.name || (0, utils_1.getMessage)('compontents.author.unknown')))),
|
|
59
60
|
react_1.default.createElement(Table_1.Td, { style: { maxWidth: "30vw" } },
|
|
60
|
-
react_1.default.createElement(Typography_1.Typography, { textColor: "neutral800", ellipsis: true },
|
|
61
|
-
react_1.default.createElement(Table_1.Td, null,
|
|
61
|
+
react_1.default.createElement(Typography_1.Typography, { textColor: "neutral800", ellipsis: true }, content)),
|
|
62
|
+
react_1.default.createElement(Table_1.Td, null, threadOf?.id ? (react_1.default.createElement(Link_1.Link, { to: renderDetailsUrl(threadOf) }, (0, utils_1.getMessage)({
|
|
62
63
|
id: "page.discover.table.cell.thread",
|
|
63
|
-
props: { id:
|
|
64
|
-
}, "#" +
|
|
65
|
-
react_1.default.createElement(Table_1.Td, { style: { maxWidth: "15vw" } },
|
|
64
|
+
props: { id: threadOf.id },
|
|
65
|
+
}, "#" + threadOf.id))) : ("-")),
|
|
66
|
+
react_1.default.createElement(Table_1.Td, { style: { maxWidth: "15vw" } }, related ? (react_1.default.createElement(styles_1.TableLink, { to: renderEntryUrl(related) }, (0, renderEntryTitle_1.default)(related, config))) : ("-")),
|
|
66
67
|
react_1.default.createElement(Table_1.Td, null,
|
|
67
|
-
react_1.default.createElement(Typography_1.Typography, { textColor: "neutral800" }, formatDate(
|
|
68
|
+
react_1.default.createElement(Typography_1.Typography, { textColor: "neutral800" }, formatDate(updatedAt || createdAt, {
|
|
68
69
|
dateStyle: "long",
|
|
69
70
|
timeStyle: "short",
|
|
70
71
|
}))),
|
|
@@ -73,7 +74,7 @@ const DiscoverTableRow = ({ config, item, allowedActions: { canModerate, canAcce
|
|
|
73
74
|
react_1.default.createElement(Table_1.Td, null,
|
|
74
75
|
react_1.default.createElement(Flex_1.Flex, { direction: "column", alignItems: "flex-end" },
|
|
75
76
|
react_1.default.createElement(styles_2.IconButtonGroupStyled, { isSingle: !(reviewFlowEnabled || (canModerate && needsApproval)) },
|
|
76
|
-
canModerate && needsApproval && (react_1.default.createElement(DiscussionThreadItemApprovalFlowActions_1.default, { id:
|
|
77
|
+
canModerate && needsApproval && (react_1.default.createElement(DiscussionThreadItemApprovalFlowActions_1.default, { id: id, allowedActions: { canModerate } })),
|
|
77
78
|
react_1.default.createElement(DiscussionThreadItemReviewAction_1.default, { item: item, queryToInvalidate: "get-data", allowedActions: {
|
|
78
79
|
canModerate,
|
|
79
80
|
canAccessReports,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const TableLink: any
|
|
1
|
+
export declare const TableLink: import("styled-components").StyledComponent<any, any, object, string | number | symbol>;
|
|
2
2
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1,11 +1,26 @@
|
|
|
1
|
-
declare const filtersSchema: {
|
|
1
|
+
declare const filtersSchema: ({
|
|
2
2
|
name: string;
|
|
3
3
|
metadatas: {
|
|
4
4
|
label: string;
|
|
5
5
|
};
|
|
6
6
|
fieldSchema: {
|
|
7
7
|
type: string;
|
|
8
|
+
mainField?: undefined;
|
|
8
9
|
};
|
|
9
|
-
}
|
|
10
|
+
} | {
|
|
11
|
+
name: string;
|
|
12
|
+
metadatas: {
|
|
13
|
+
label: string;
|
|
14
|
+
};
|
|
15
|
+
fieldSchema: {
|
|
16
|
+
type: string;
|
|
17
|
+
mainField: {
|
|
18
|
+
name: string;
|
|
19
|
+
schema: {
|
|
20
|
+
type: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
})[];
|
|
10
25
|
export default filtersSchema;
|
|
11
26
|
//# sourceMappingURL=filtersSchema.d.ts.map
|
|
@@ -6,6 +6,34 @@ const filtersSchema = [
|
|
|
6
6
|
metadatas: { label: "Message" },
|
|
7
7
|
fieldSchema: { type: "string" },
|
|
8
8
|
},
|
|
9
|
+
{
|
|
10
|
+
name: "createdAt",
|
|
11
|
+
metadatas: { label: "CreatedAt" },
|
|
12
|
+
fieldSchema: { type: "datetime" },
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: "updatedAt",
|
|
16
|
+
metadatas: { label: "UpdatedAt" },
|
|
17
|
+
fieldSchema: { type: "datetime" },
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: "authorName",
|
|
21
|
+
metadatas: { label: "Author" },
|
|
22
|
+
fieldSchema: { type: "string" },
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: "threadOf",
|
|
26
|
+
metadatas: { label: "threadOf" },
|
|
27
|
+
fieldSchema: {
|
|
28
|
+
type: "relation",
|
|
29
|
+
mainField: {
|
|
30
|
+
name: "id",
|
|
31
|
+
schema: {
|
|
32
|
+
type: "number"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
9
37
|
];
|
|
10
38
|
exports.default = filtersSchema;
|
|
11
39
|
//# sourceMappingURL=filtersSchema.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const TableLink: any
|
|
1
|
+
export declare const TableLink: import("styled-components").StyledComponent<any, any, object, string | number | symbol>;
|
|
2
2
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1,11 +1,26 @@
|
|
|
1
|
-
declare const filtersSchema: {
|
|
1
|
+
declare const filtersSchema: ({
|
|
2
2
|
name: string;
|
|
3
3
|
metadatas: {
|
|
4
4
|
label: string;
|
|
5
5
|
};
|
|
6
6
|
fieldSchema: {
|
|
7
7
|
type: string;
|
|
8
|
+
mainField?: undefined;
|
|
8
9
|
};
|
|
9
|
-
}
|
|
10
|
+
} | {
|
|
11
|
+
name: string;
|
|
12
|
+
metadatas: {
|
|
13
|
+
label: string;
|
|
14
|
+
};
|
|
15
|
+
fieldSchema: {
|
|
16
|
+
type: string;
|
|
17
|
+
mainField: {
|
|
18
|
+
name: string;
|
|
19
|
+
schema: {
|
|
20
|
+
type: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
})[];
|
|
10
25
|
export default filtersSchema;
|
|
11
26
|
//# sourceMappingURL=filtersSchema.d.ts.map
|
|
@@ -6,6 +6,27 @@ const filtersSchema = [
|
|
|
6
6
|
metadatas: { label: 'Message' },
|
|
7
7
|
fieldSchema: { type: 'string' },
|
|
8
8
|
},
|
|
9
|
+
{
|
|
10
|
+
name: 'reason',
|
|
11
|
+
metadatas: { label: 'Reason' },
|
|
12
|
+
fieldSchema: { type: 'enum' },
|
|
13
|
+
}, {
|
|
14
|
+
name: 'resolved',
|
|
15
|
+
metadatas: { label: 'Resolved' },
|
|
16
|
+
fieldSchema: { type: 'boolean' },
|
|
17
|
+
}, {
|
|
18
|
+
name: 'related',
|
|
19
|
+
metadatas: { label: 'Comment author' },
|
|
20
|
+
fieldSchema: {
|
|
21
|
+
type: "relation",
|
|
22
|
+
mainField: {
|
|
23
|
+
name: "authorName",
|
|
24
|
+
schema: {
|
|
25
|
+
type: "string"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
},
|
|
9
30
|
];
|
|
10
31
|
exports.default = filtersSchema;
|
|
11
32
|
//# sourceMappingURL=filtersSchema.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const RestartAlert: any
|
|
1
|
+
export declare const RestartAlert: import("styled-components").StyledComponent<any, any, object, string | number | symbol>;
|
|
2
2
|
//# sourceMappingURL=styles.d.ts.map
|
package/content-types/comment.js
CHANGED