@edifice.io/react 2.4.1-develop.20251014152830 → 2.4.1-feat-wikiia.20251112121739
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/dist/hooks/useHttpErrorToast/useHttpErrorToast.d.ts +1 -3
- package/dist/hooks/useHttpErrorToast/useHttpErrorToast.js +19 -25
- package/dist/index.js +82 -82
- package/dist/modules/comments/components/Comment.js +1 -1
- package/dist/modules/comments/constants.d.ts +1 -0
- package/dist/modules/comments/constants.js +2 -1
- package/dist/modules/comments/provider/CommentProvider.js +2 -1
- package/dist/modules/comments/types.d.ts +4 -0
- package/dist/modules/modals/ResourceModal/ResourceModal.d.ts +1 -0
- package/dist/modules/modals/ResourceModal/ResourceModal.js +10 -3
- package/dist/modules/multimedia/MediaLibrary/MediaLibrary.js +5 -8
- package/package.json +6 -6
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
import { CustomToastOptions } from '../../hooks/useToast/useToast';
|
|
2
|
-
|
|
3
|
-
active?: boolean;
|
|
4
|
-
} & CustomToastOptions) => string | undefined;
|
|
2
|
+
declare const useHttpErrorToast: (options?: CustomToastOptions) => string | undefined;
|
|
5
3
|
export default useHttpErrorToast;
|
|
@@ -2,35 +2,29 @@ import React, { useRef, useEffect } from "react";
|
|
|
2
2
|
import { odeServices, LAYER_NAME } from "@edifice.io/client";
|
|
3
3
|
import { useTranslation } from "react-i18next";
|
|
4
4
|
import useToast from "../useToast/useToast.js";
|
|
5
|
-
const useHttpErrorToast = ({
|
|
6
|
-
active = !0,
|
|
7
|
-
...options
|
|
8
|
-
}) => {
|
|
5
|
+
const useHttpErrorToast = (options) => {
|
|
9
6
|
const message = useRef(), toast = useToast(), {
|
|
10
7
|
t
|
|
11
8
|
} = useTranslation();
|
|
12
9
|
return useEffect(() => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
}, [t, toast, active]), message.current;
|
|
10
|
+
const subscription = odeServices.notify().events().subscribe(LAYER_NAME.TRANSPORT, (event) => {
|
|
11
|
+
var _a;
|
|
12
|
+
if (!(event != null && event.data)) return;
|
|
13
|
+
const {
|
|
14
|
+
response
|
|
15
|
+
} = event.data, i18nKey = (
|
|
16
|
+
// The payload may include the i18n key of the error message to show,
|
|
17
|
+
((_a = event.data.payload) == null ? void 0 : _a.error) || // otherwise, try showing the translation of some known HTTP error code.
|
|
18
|
+
([400, 401, 403, 404, 408, 413, 500, 504].includes(response == null ? void 0 : response.status) ? `e${event.data.response.status}` : void 0) || // otherwise try showing the statusText (may be technical, in english),
|
|
19
|
+
(response == null ? void 0 : response.statusText)
|
|
20
|
+
);
|
|
21
|
+
typeof i18nKey == "string" && (message.current = t(i18nKey), toast.error(/* @__PURE__ */ React.createElement("div", {
|
|
22
|
+
children: [message.current]
|
|
23
|
+
}), options));
|
|
24
|
+
});
|
|
25
|
+
return () => subscription.revoke();
|
|
26
|
+
}, [t, toast]), message.current;
|
|
32
27
|
};
|
|
33
28
|
export {
|
|
34
|
-
useHttpErrorToast as default
|
|
35
|
-
useHttpErrorToast
|
|
29
|
+
useHttpErrorToast as default
|
|
36
30
|
};
|
package/dist/index.js
CHANGED
|
@@ -60,47 +60,47 @@ import { default as default59 } from "./hooks/useDropzone/useDropzone.js";
|
|
|
60
60
|
import { default as default60 } from "./hooks/useEdificeIcons/useEdificeIcons.js";
|
|
61
61
|
import { default as default61 } from "./hooks/useHasWorkflow/useHasWorkflow.js";
|
|
62
62
|
import { default as default62 } from "./hooks/useHover/useHover.js";
|
|
63
|
-
import {
|
|
64
|
-
import { default as
|
|
65
|
-
import { default as
|
|
66
|
-
import { default as
|
|
67
|
-
import { default as
|
|
68
|
-
import { default as
|
|
69
|
-
import { default as
|
|
70
|
-
import { default as
|
|
71
|
-
import { default as
|
|
72
|
-
import { default as
|
|
73
|
-
import { default as
|
|
74
|
-
import { default as
|
|
75
|
-
import { default as
|
|
76
|
-
import { default as
|
|
77
|
-
import { default as
|
|
78
|
-
import { default as
|
|
79
|
-
import { default as
|
|
80
|
-
import { default as
|
|
81
|
-
import { default as
|
|
82
|
-
import { WORKSPACE_SHARED_FOLDER_ID, WORKSPACE_USER_FOLDER_ID, default as
|
|
83
|
-
import { default as
|
|
84
|
-
import { default as
|
|
85
|
-
import { default as
|
|
86
|
-
import { default as
|
|
87
|
-
import { default as
|
|
88
|
-
import { default as
|
|
89
|
-
import { default as
|
|
90
|
-
import { default as
|
|
91
|
-
import { default as
|
|
92
|
-
import { default as
|
|
93
|
-
import { default as
|
|
94
|
-
import { default as
|
|
95
|
-
import { default as
|
|
96
|
-
import { default as
|
|
97
|
-
import { default as
|
|
98
|
-
import { default as
|
|
99
|
-
import { default as
|
|
100
|
-
import { default as
|
|
101
|
-
import { default as
|
|
102
|
-
import { default as
|
|
103
|
-
import { default as
|
|
63
|
+
import { default as default63 } from "./hooks/useHttpErrorToast/useHttpErrorToast.js";
|
|
64
|
+
import { default as default64 } from "./hooks/useImage/useImage.js";
|
|
65
|
+
import { default as default65 } from "./hooks/useIsAdml/useIsAdml.js";
|
|
66
|
+
import { default as default66 } from "./hooks/useIsAdmc/useIsAdmc.js";
|
|
67
|
+
import { default as default67 } from "./hooks/useIsAdmlcOrAdmc/useIsAdmlcOrAdmc.js";
|
|
68
|
+
import { default as default68 } from "./hooks/useKeyPress/useKeyPress.js";
|
|
69
|
+
import { default as default69 } from "./hooks/useLibraryUrl/useLibraryUrl.js";
|
|
70
|
+
import { default as default70 } from "./hooks/useMediaLibrary/useMediaLibrary.js";
|
|
71
|
+
import { default as default71 } from "./hooks/useScrollToTop/useScrollToTop.js";
|
|
72
|
+
import { default as default72 } from "./hooks/useTitle/useTitle.js";
|
|
73
|
+
import { default as default73 } from "./hooks/useToast/useToast.js";
|
|
74
|
+
import { default as default74 } from "./hooks/useToggle/useToggle.js";
|
|
75
|
+
import { default as default75 } from "./hooks/useTrapFocus/useTrapFocus.js";
|
|
76
|
+
import { default as default76 } from "./hooks/useTrashedResource/useTrashedResource.js";
|
|
77
|
+
import { default as default77 } from "./hooks/useUpload/useUpload.js";
|
|
78
|
+
import { default as default78 } from "./hooks/useUploadFiles/useUploadFiles.js";
|
|
79
|
+
import { default as default79 } from "./hooks/useUser/useUser.js";
|
|
80
|
+
import { default as default80 } from "./hooks/useWorkspaceFile/useWorkspaceFile.js";
|
|
81
|
+
import { default as default81 } from "./hooks/useWorkspaceFolders/useWorkspaceFolders.js";
|
|
82
|
+
import { WORKSPACE_SHARED_FOLDER_ID, WORKSPACE_USER_FOLDER_ID, default as default82 } from "./hooks/useWorkspaceFolders/useWorkspaceFoldersTree.js";
|
|
83
|
+
import { default as default83 } from "./hooks/useWorkspaceSearch/useWorkspaceSearch.js";
|
|
84
|
+
import { default as default84 } from "./hooks/useXitiTrackPageLoad/useXitiTrackPageLoad.js";
|
|
85
|
+
import { default as default85 } from "./hooks/useZendeskGuide/useZendeskGuide.js";
|
|
86
|
+
import { default as default86 } from "./modules/modals/ConfirmModal/ConfirmModal.js";
|
|
87
|
+
import { default as default87 } from "./modules/modals/OnboardingModal/OnboardingModal.js";
|
|
88
|
+
import { default as default88 } from "./modules/modals/PublishModal/PublishModal.js";
|
|
89
|
+
import { default as default89 } from "./modules/modals/ResourceModal/apps/BlogPublic.js";
|
|
90
|
+
import { default as default90 } from "./modules/modals/ResourceModal/hooks/useUpdateMutation.js";
|
|
91
|
+
import { default as default91 } from "./modules/modals/ShareModal/ShareModal.js";
|
|
92
|
+
import { default as default92 } from "./modules/modals/ShareModal/apps/ShareBlog.js";
|
|
93
|
+
import { default as default93 } from "./modules/modals/ShareModal/hooks/useShareMutation.js";
|
|
94
|
+
import { default as default94 } from "./modules/multimedia/AudioRecorder/AudioRecorder.js";
|
|
95
|
+
import { default as default95 } from "./modules/multimedia/Embed/Embed.js";
|
|
96
|
+
import { default as default96 } from "./modules/multimedia/ImageEditor/components/ImageEditor.js";
|
|
97
|
+
import { default as default97 } from "./modules/multimedia/ImagePicker/ImagePicker.js";
|
|
98
|
+
import { default as default98 } from "./modules/multimedia/FileCard/FileCard.js";
|
|
99
|
+
import { default as default99 } from "./modules/multimedia/MediaLibrary/MediaLibrary.js";
|
|
100
|
+
import { default as default100 } from "./modules/multimedia/VideoEmbed/VideoEmbed.js";
|
|
101
|
+
import { default as default101 } from "./modules/multimedia/VideoRecorder/VideoRecorder.js";
|
|
102
|
+
import { default as default102 } from "./modules/multimedia/Workspace/Workspace.js";
|
|
103
|
+
import { default as default103 } from "./modules/multimedia/WorkspaceFolders/WorkspaceFolders.js";
|
|
104
104
|
import { AccessiblePalette, DefaultPalette } from "./components/ColorPicker/ColorPalette.js";
|
|
105
105
|
import { DropzoneContext, useDropzoneContext } from "./components/Dropzone/DropzoneContext.js";
|
|
106
106
|
import { Column, Grid } from "./components/Grid/Grid.js";
|
|
@@ -136,11 +136,11 @@ export {
|
|
|
136
136
|
default4 as AppHeader,
|
|
137
137
|
default5 as AppIcon,
|
|
138
138
|
default6 as Attachment,
|
|
139
|
-
|
|
139
|
+
default94 as AudioRecorder,
|
|
140
140
|
default7 as Avatar,
|
|
141
141
|
default8 as AvatarGroup,
|
|
142
142
|
default9 as Badge,
|
|
143
|
-
|
|
143
|
+
default89 as BlogPublic,
|
|
144
144
|
default10 as Breadcrumb,
|
|
145
145
|
default11 as Button,
|
|
146
146
|
default37 as ButtonSkeleton,
|
|
@@ -150,7 +150,7 @@ export {
|
|
|
150
150
|
default17 as ColorPickerItem,
|
|
151
151
|
Column,
|
|
152
152
|
default18 as Combobox,
|
|
153
|
-
|
|
153
|
+
default86 as ConfirmModal,
|
|
154
154
|
DefaultPalette,
|
|
155
155
|
DndTree,
|
|
156
156
|
default19 as Dropdown,
|
|
@@ -160,10 +160,10 @@ export {
|
|
|
160
160
|
EdificeClientProvider,
|
|
161
161
|
EdificeThemeContext,
|
|
162
162
|
EdificeThemeProvider,
|
|
163
|
-
|
|
163
|
+
default95 as Embed,
|
|
164
164
|
default21 as EmptyScreen,
|
|
165
165
|
ExternalLinker,
|
|
166
|
-
|
|
166
|
+
default98 as FileCard,
|
|
167
167
|
default22 as Flex,
|
|
168
168
|
default24 as FormControl,
|
|
169
169
|
default23 as FormText,
|
|
@@ -171,8 +171,8 @@ export {
|
|
|
171
171
|
default25 as Heading,
|
|
172
172
|
default12 as IconButton,
|
|
173
173
|
default26 as Image,
|
|
174
|
-
|
|
175
|
-
|
|
174
|
+
default96 as ImageEditor,
|
|
175
|
+
default97 as ImagePicker,
|
|
176
176
|
default27 as Input,
|
|
177
177
|
InternalLinker,
|
|
178
178
|
default28 as Label,
|
|
@@ -181,24 +181,24 @@ export {
|
|
|
181
181
|
default29 as Loading,
|
|
182
182
|
default30 as LoadingScreen,
|
|
183
183
|
default31 as Logo,
|
|
184
|
-
|
|
184
|
+
default99 as MediaLibrary,
|
|
185
185
|
Menu,
|
|
186
186
|
MockedProvider,
|
|
187
187
|
default32 as Modal,
|
|
188
|
-
|
|
188
|
+
default87 as OnboardingModal,
|
|
189
189
|
Popover,
|
|
190
190
|
PopoverBody,
|
|
191
191
|
PopoverFooter,
|
|
192
192
|
PopoverHeader,
|
|
193
193
|
default33 as PreventPropagation,
|
|
194
|
-
|
|
194
|
+
default88 as PublishModal,
|
|
195
195
|
default34 as Radio,
|
|
196
196
|
ResourceModal,
|
|
197
197
|
default35 as SearchBar,
|
|
198
198
|
default13 as SearchButton,
|
|
199
199
|
default36 as Select,
|
|
200
|
-
|
|
201
|
-
|
|
200
|
+
default92 as ShareBlog,
|
|
201
|
+
default91 as ShareModal,
|
|
202
202
|
default45 as SortableTree,
|
|
203
203
|
default39 as StackedGroup,
|
|
204
204
|
default40 as Stepper,
|
|
@@ -213,13 +213,13 @@ export {
|
|
|
213
213
|
TreeNode,
|
|
214
214
|
TreeNodeFolderWrapper,
|
|
215
215
|
default47 as TreeView,
|
|
216
|
-
|
|
217
|
-
|
|
216
|
+
default100 as VideoEmbed,
|
|
217
|
+
default101 as VideoRecorder,
|
|
218
218
|
default48 as VisuallyHidden,
|
|
219
219
|
WORKSPACE_SHARED_FOLDER_ID,
|
|
220
220
|
WORKSPACE_USER_FOLDER_ID,
|
|
221
|
-
|
|
222
|
-
|
|
221
|
+
default102 as Workspace,
|
|
222
|
+
default103 as WorkspaceFolders,
|
|
223
223
|
addNode,
|
|
224
224
|
arrayUnique,
|
|
225
225
|
buildTree,
|
|
@@ -265,32 +265,32 @@ export {
|
|
|
265
265
|
useEdificeTheme,
|
|
266
266
|
default61 as useHasWorkflow,
|
|
267
267
|
default62 as useHover,
|
|
268
|
-
useHttpErrorToast,
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
268
|
+
default63 as useHttpErrorToast,
|
|
269
|
+
default64 as useImage,
|
|
270
|
+
default66 as useIsAdmc,
|
|
271
|
+
default65 as useIsAdml,
|
|
272
|
+
default67 as useIsAdmlcOrAdmc,
|
|
273
|
+
default68 as useKeyPress,
|
|
274
|
+
default69 as useLibraryUrl,
|
|
275
|
+
default70 as useMediaLibrary,
|
|
276
|
+
default71 as useScrollToTop,
|
|
277
|
+
default93 as useShareMutation,
|
|
278
|
+
default72 as useTitle,
|
|
279
|
+
default73 as useToast,
|
|
280
|
+
default74 as useToggle,
|
|
281
|
+
default75 as useTrapFocus,
|
|
282
|
+
default76 as useTrashedResource,
|
|
283
283
|
useTreeSortable,
|
|
284
284
|
useTreeView,
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
285
|
+
default90 as useUpdateMutation,
|
|
286
|
+
default77 as useUpload,
|
|
287
|
+
default78 as useUploadFiles,
|
|
288
|
+
default79 as useUser,
|
|
289
|
+
default80 as useWorkspaceFile,
|
|
290
|
+
default81 as useWorkspaceFolders,
|
|
291
|
+
default82 as useWorkspaceFoldersTree,
|
|
292
|
+
default83 as useWorkspaceSearch,
|
|
293
|
+
default84 as useXitiTrackPageLoad,
|
|
294
|
+
default85 as useZendeskGuide,
|
|
295
295
|
wrapTreeNode
|
|
296
296
|
};
|
|
@@ -71,7 +71,7 @@ const DeleteModal = /* @__PURE__ */ lazy(() => import("./DeleteModal.js")), Comm
|
|
|
71
71
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
72
72
|
/* @__PURE__ */ jsx("div", { className: "mt-8 mb-4", children: content }),
|
|
73
73
|
type === "edit" && /* @__PURE__ */ jsxs("div", { className: "ms-n8", children: [
|
|
74
|
-
!replyTo && /* @__PURE__ */ jsx(Button, { variant: "ghost", color: "tertiary", size: "sm", onClick: () => handleReplyToComment(comment.id), children: t("comment.reply") }),
|
|
74
|
+
!replyTo && options.allowReplies && /* @__PURE__ */ jsx(Button, { variant: "ghost", color: "tertiary", size: "sm", onClick: () => handleReplyToComment(comment.id), children: t("comment.reply") }),
|
|
75
75
|
userId === authorId && /* @__PURE__ */ jsx(Button, { variant: "ghost", color: "tertiary", size: "sm", onClick: () => {
|
|
76
76
|
handleModifyComment(comment.id), setValue(content);
|
|
77
77
|
}, children: t("comment.edit") }),
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
const DEFAULT_MAX_COMMENT_LENGTH = 200, DEFAULT_MAX_REPLY_LENGTH = 200, DEFAULT_MAX_COMMENTS = 4, DEFAULT_ADD_COMMENTS = 5, DEFAULT_MAX_REPLIES = 5, DEFAULT_ADD_REPLIES = 5;
|
|
1
|
+
const DEFAULT_MAX_COMMENT_LENGTH = 200, DEFAULT_MAX_REPLY_LENGTH = 200, DEFAULT_MAX_COMMENTS = 4, DEFAULT_ADD_COMMENTS = 5, DEFAULT_MAX_REPLIES = 5, DEFAULT_ADD_REPLIES = 5, DEFAULT_ALLOW_REPLIES = !0;
|
|
2
2
|
export {
|
|
3
3
|
DEFAULT_ADD_COMMENTS,
|
|
4
4
|
DEFAULT_ADD_REPLIES,
|
|
5
|
+
DEFAULT_ALLOW_REPLIES,
|
|
5
6
|
DEFAULT_MAX_COMMENTS,
|
|
6
7
|
DEFAULT_MAX_COMMENT_LENGTH,
|
|
7
8
|
DEFAULT_MAX_REPLIES,
|
|
@@ -3,7 +3,7 @@ import { useMemo } from "react";
|
|
|
3
3
|
import { CommentForm } from "../components/CommentForm.js";
|
|
4
4
|
import { CommentHeader } from "../components/CommentHeader.js";
|
|
5
5
|
import { CommentList } from "../components/CommentList.js";
|
|
6
|
-
import { DEFAULT_ADD_REPLIES, DEFAULT_MAX_REPLIES, DEFAULT_ADD_COMMENTS, DEFAULT_MAX_COMMENTS, DEFAULT_MAX_REPLY_LENGTH, DEFAULT_MAX_COMMENT_LENGTH } from "../constants.js";
|
|
6
|
+
import { DEFAULT_ALLOW_REPLIES, DEFAULT_ADD_REPLIES, DEFAULT_MAX_REPLIES, DEFAULT_ADD_COMMENTS, DEFAULT_MAX_COMMENTS, DEFAULT_MAX_REPLY_LENGTH, DEFAULT_MAX_COMMENT_LENGTH } from "../constants.js";
|
|
7
7
|
import { CommentContext } from "../context/Context.js";
|
|
8
8
|
import { useComments } from "../hooks/useComments.js";
|
|
9
9
|
import Button from "../../../components/Button/Button.js";
|
|
@@ -20,6 +20,7 @@ const CommentProvider = ({
|
|
|
20
20
|
additionalComments: DEFAULT_ADD_COMMENTS,
|
|
21
21
|
maxReplies: DEFAULT_MAX_REPLIES,
|
|
22
22
|
additionalReplies: DEFAULT_ADD_REPLIES,
|
|
23
|
+
allowReplies: DEFAULT_ALLOW_REPLIES,
|
|
23
24
|
...commentOptions
|
|
24
25
|
}, {
|
|
25
26
|
type
|
|
@@ -104,6 +104,10 @@ export type CommentOptions = {
|
|
|
104
104
|
* Number of replies to load additionally in the limited list
|
|
105
105
|
*/
|
|
106
106
|
additionalReplies: number;
|
|
107
|
+
/**
|
|
108
|
+
* Allow replying to comments
|
|
109
|
+
*/
|
|
110
|
+
allowReplies: boolean;
|
|
107
111
|
};
|
|
108
112
|
export interface UserProfileResult {
|
|
109
113
|
/**
|
|
@@ -8,6 +8,7 @@ import { TextareaCounter } from "../../../components/TextArea/TextareaCounter.js
|
|
|
8
8
|
import ImagePicker from "../../multimedia/ImagePicker/ImagePicker.js";
|
|
9
9
|
import { useThumb } from "./hooks/useThumb.js";
|
|
10
10
|
import { useEdificeClient } from "../../../providers/EdificeClientProvider/EdificeClientProvider.hook.js";
|
|
11
|
+
import useHasWorkflow from "../../../hooks/useHasWorkflow/useHasWorkflow.js";
|
|
11
12
|
import useToast from "../../../hooks/useToast/useToast.js";
|
|
12
13
|
import useResource from "../../../hooks/useResource/useResource.js";
|
|
13
14
|
import useMediaLibrary from "../../../hooks/useMediaLibrary/useMediaLibrary.js";
|
|
@@ -35,7 +36,7 @@ const DEFAULT_INPUT_MAX_LENGTH = 60, DEFAULT_TEXTAREA_MAX_LENGTH = 400, Resource
|
|
|
35
36
|
const {
|
|
36
37
|
appCode: contextAppCode,
|
|
37
38
|
currentApp
|
|
38
|
-
} = useEdificeClient(), application = customAppCode || contextAppCode, {
|
|
39
|
+
} = useEdificeClient(), application = customAppCode || contextAppCode, hasOptionalCommentRepliesWorkflow = useHasWorkflow("org.entcore.blog.controllers.BlogController|optionalCommentReplies"), {
|
|
39
40
|
t
|
|
40
41
|
} = useTranslation(), {
|
|
41
42
|
mode
|
|
@@ -54,7 +55,8 @@ const DEFAULT_INPUT_MAX_LENGTH = 60, DEFAULT_TEXTAREA_MAX_LENGTH = 400, Resource
|
|
|
54
55
|
description: isUpdating ? resource == null ? void 0 : resource.description : "",
|
|
55
56
|
enablePublic: isUpdating ? resource == null ? void 0 : resource.public : !1,
|
|
56
57
|
title: isUpdating ? resource == null ? void 0 : resource.name : "",
|
|
57
|
-
formSlug: isUpdating ? resource == null ? void 0 : resource.slug : ""
|
|
58
|
+
formSlug: isUpdating ? resource == null ? void 0 : resource.slug : "",
|
|
59
|
+
allowReplies: isUpdating ? resource == null ? void 0 : resource.allowReplies : !0
|
|
58
60
|
}
|
|
59
61
|
}), {
|
|
60
62
|
ref: mediaLibraryRef,
|
|
@@ -75,7 +77,8 @@ const DEFAULT_INPUT_MAX_LENGTH = 60, DEFAULT_TEXTAREA_MAX_LENGTH = 400, Resource
|
|
|
75
77
|
name: formData.title,
|
|
76
78
|
public: formData.enablePublic,
|
|
77
79
|
slug: formData.enablePublic && formData.formSlug || "",
|
|
78
|
-
thumbnail
|
|
80
|
+
thumbnail,
|
|
81
|
+
allowReplies: formData.allowReplies
|
|
79
82
|
};
|
|
80
83
|
let result, param;
|
|
81
84
|
if (isCreating) {
|
|
@@ -141,6 +144,10 @@ const DEFAULT_INPUT_MAX_LENGTH = 60, DEFAULT_TEXTAREA_MAX_LENGTH = 400, Resource
|
|
|
141
144
|
maxLength: textareaMaxLength
|
|
142
145
|
}), placeholder: ((_f = customT.placeholder) == null ? void 0 : _f.description) ?? t("explorer.resource.editModal.description.placeholder"), size: "md", maxLength: textareaMaxLength }),
|
|
143
146
|
watchedDescription && /* @__PURE__ */ jsx(TextareaCounter, { content: watchedDescription, maxLength: textareaMaxLength })
|
|
147
|
+
] }),
|
|
148
|
+
application === "blog" && hasOptionalCommentRepliesWorkflow === !0 && /* @__PURE__ */ jsxs(FormControl, { id: "allowReplies", className: "d-flex gap-8 mt-16 mb-8", children: [
|
|
149
|
+
/* @__PURE__ */ jsx(FormControl.Input, { type: "checkbox", defaultChecked: isUpdating ? resource.allowReplies : !0, ...register("allowReplies"), className: "form-check-input mt-0", size: "sm" }),
|
|
150
|
+
/* @__PURE__ */ jsx(FormControl.Label, { className: "form-check-label mb-0", children: t("explorer.comments.allowReplies") })
|
|
144
151
|
] })
|
|
145
152
|
] })
|
|
146
153
|
] }),
|
|
@@ -11,8 +11,8 @@ import SvgIconRecordVideo from "../../icons/components/IconRecordVideo.js";
|
|
|
11
11
|
import SvgIconSmartphone from "../../icons/components/IconSmartphone.js";
|
|
12
12
|
import { InnerTabs } from "./innertabs/index.js";
|
|
13
13
|
import { MediaLibraryContext } from "./MediaLibraryContext.js";
|
|
14
|
+
import useHttpErrorToast from "../../../hooks/useHttpErrorToast/useHttpErrorToast.js";
|
|
14
15
|
import useHasWorkflow from "../../../hooks/useHasWorkflow/useHasWorkflow.js";
|
|
15
|
-
import { useHttpErrorToast } from "../../../hooks/useHttpErrorToast/useHttpErrorToast.js";
|
|
16
16
|
import Modal from "../../../components/Modal/Modal.js";
|
|
17
17
|
import { Tabs } from "../../../components/Tabs/components/Tabs.js";
|
|
18
18
|
import Button from "../../../components/Button/Button.js";
|
|
@@ -78,16 +78,13 @@ const orderedTabs = [
|
|
|
78
78
|
showLink,
|
|
79
79
|
type,
|
|
80
80
|
...refModal.current
|
|
81
|
-
}))
|
|
82
|
-
const {
|
|
83
|
-
t
|
|
84
|
-
} = useTranslation(), workspaceCreateWorkflow = useHasWorkflow("org.entcore.workspace.controllers.WorkspaceController|addDocument"), videoCaptureWorkflow = useHasWorkflow("com.opendigitaleducation.video.controllers.VideoController|capture"), [type, setType] = useState(null);
|
|
85
|
-
useHttpErrorToast({
|
|
86
|
-
active: !!type,
|
|
81
|
+
})), useHttpErrorToast({
|
|
87
82
|
isDismissible: !0,
|
|
88
83
|
duration: 1 / 0
|
|
89
84
|
});
|
|
90
|
-
const
|
|
85
|
+
const {
|
|
86
|
+
t
|
|
87
|
+
} = useTranslation(), workspaceCreateWorkflow = useHasWorkflow("org.entcore.workspace.controllers.WorkspaceController|addDocument"), videoCaptureWorkflow = useHasWorkflow("com.opendigitaleducation.video.controllers.VideoController|capture"), [type, setType] = useState(null), availableTabs = {
|
|
91
88
|
workspace: {
|
|
92
89
|
id: "workspace",
|
|
93
90
|
icon: /* @__PURE__ */ jsx(SvgIconFolder, {}),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edifice.io/react",
|
|
3
|
-
"version": "2.4.1-
|
|
3
|
+
"version": "2.4.1-feat-wikiia.20251112121739",
|
|
4
4
|
"description": "Edifice React Library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -131,9 +131,9 @@
|
|
|
131
131
|
"react-slugify": "^3.0.3",
|
|
132
132
|
"swiper": "^10.1.0",
|
|
133
133
|
"ua-parser-js": "^1.0.36",
|
|
134
|
-
"@edifice.io/bootstrap": "2.4.1-
|
|
135
|
-
"@edifice.io/tiptap-extensions": "2.4.1-
|
|
136
|
-
"@edifice.io/utilities": "2.4.1-
|
|
134
|
+
"@edifice.io/bootstrap": "2.4.1-feat-wikiia.20251112121739",
|
|
135
|
+
"@edifice.io/tiptap-extensions": "2.4.1-feat-wikiia.20251112121739",
|
|
136
|
+
"@edifice.io/utilities": "2.4.1-feat-wikiia.20251112121739"
|
|
137
137
|
},
|
|
138
138
|
"devDependencies": {
|
|
139
139
|
"@babel/plugin-transform-react-pure-annotations": "^7.23.3",
|
|
@@ -164,8 +164,8 @@
|
|
|
164
164
|
"vite": "^5.4.11",
|
|
165
165
|
"vite-plugin-dts": "^4.1.0",
|
|
166
166
|
"vite-tsconfig-paths": "^5.0.1",
|
|
167
|
-
"@edifice.io/
|
|
168
|
-
"@edifice.io/
|
|
167
|
+
"@edifice.io/client": "2.4.1-feat-wikiia.20251112121739",
|
|
168
|
+
"@edifice.io/config": "2.4.1-feat-wikiia.20251112121739"
|
|
169
169
|
},
|
|
170
170
|
"peerDependencies": {
|
|
171
171
|
"@react-spring/web": "^9.7.5",
|