ode-explorer 1.3.3-develop-pedago.202402141508 → 1.3.3-develop-pedago.202402161612
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/index.html +16 -20
- package/dist/index.js +92 -1
- package/dist/version.txt +1 -1
- package/lib/ActionBarContainer.js +190 -182
- package/lib/DeleteModal.js +3 -3
- package/lib/FolderModal.js +16 -16
- package/lib/MoveModal.js +6 -6
- package/lib/index2.js +643 -588
- package/lib/services/api/index.d.ts +7 -0
- package/package.json +1 -1
package/dist/index.html
CHANGED
|
@@ -16,19 +16,21 @@
|
|
|
16
16
|
<!-- SET INITIALISATION CONFIG -->
|
|
17
17
|
<script>
|
|
18
18
|
var WORFLOW_ACCESS =
|
|
19
|
-
"
|
|
19
|
+
"net.atos.entng.mindmap.controllers.MindmapController|view";
|
|
20
20
|
var WORKFLOW_CREATE =
|
|
21
|
-
"
|
|
22
|
-
var WORKFLOW_PUBLISH =
|
|
23
|
-
"fr.wseduc.scrapbook.controllers.ScrapbookController|publish";
|
|
21
|
+
"net.atos.entng.mindmap.controllers.MindmapController|create";
|
|
24
22
|
var WORKFLOW_PRINT =
|
|
25
|
-
"
|
|
26
|
-
var
|
|
27
|
-
"
|
|
28
|
-
|
|
23
|
+
"net.atos.entng.mindmap.controllers.MindmapController|printView";
|
|
24
|
+
var WORKFLOW_EXPORT_PNG =
|
|
25
|
+
"net.atos.entng.mindmap.controllers.MindmapController|exportPngMindmap";
|
|
26
|
+
var WORKFLOW_EXPORT_SVG =
|
|
27
|
+
"net.atos.entng.mindmap.controllers.MindmapController|exportSvgMindmap";
|
|
28
|
+
var WORKFLOW_PUBLISH =
|
|
29
|
+
"net.atos.entng.mindmap.controllers.MindmapController|publish";
|
|
29
30
|
var explorerConfig = {
|
|
30
|
-
app: "
|
|
31
|
-
types: ["
|
|
31
|
+
app: "mindmap",
|
|
32
|
+
types: ["mindmap"],
|
|
33
|
+
libraryAppFilter: "MindMap",
|
|
32
34
|
filters: [
|
|
33
35
|
{ id: "owner", defaultValue: true },
|
|
34
36
|
{ id: "public", defaultValue: false },
|
|
@@ -62,12 +64,12 @@
|
|
|
62
64
|
workflow: WORKFLOW_CREATE,
|
|
63
65
|
target: "tree",
|
|
64
66
|
},
|
|
65
|
-
|
|
66
|
-
id: "
|
|
67
|
+
{
|
|
68
|
+
id: "copy",
|
|
67
69
|
workflow: WORFLOW_ACCESS,
|
|
68
70
|
target: "actionbar",
|
|
69
|
-
right: "
|
|
70
|
-
}
|
|
71
|
+
right: "read",
|
|
72
|
+
},
|
|
71
73
|
{
|
|
72
74
|
id: "move",
|
|
73
75
|
workflow: WORFLOW_ACCESS,
|
|
@@ -80,12 +82,6 @@
|
|
|
80
82
|
target: "actionbar",
|
|
81
83
|
right: "creator",
|
|
82
84
|
},
|
|
83
|
-
{
|
|
84
|
-
id: "export",
|
|
85
|
-
workflow: WORKFLOW_EXPORT_HTML,
|
|
86
|
-
target: "actionbar",
|
|
87
|
-
right: "read",
|
|
88
|
-
},
|
|
89
85
|
{
|
|
90
86
|
id: "print",
|
|
91
87
|
workflow: WORKFLOW_PRINT,
|
package/dist/index.js
CHANGED
|
@@ -62726,22 +62726,28 @@ const useDropdown = (placement, extraTriggerKeyDownHandler) => {
|
|
|
62726
62726
|
function useToast() {
|
|
62727
62727
|
return {
|
|
62728
62728
|
success: (message, options) => _t.custom(/* @__PURE__ */ jsxRuntimeExports.jsx(Alert$1, { type: "success", isToast: true, isDismissible: options == null ? void 0 : options.isDismissible, className: "mb-12", children: message }), {
|
|
62729
|
+
id: options == null ? void 0 : options.id,
|
|
62729
62730
|
duration: options == null ? void 0 : options.duration,
|
|
62730
62731
|
position: (options == null ? void 0 : options.position) ?? DEFAULT_POSITION
|
|
62731
62732
|
}),
|
|
62732
62733
|
error: (message, options) => _t.custom(/* @__PURE__ */ jsxRuntimeExports.jsx(Alert$1, { type: "danger", isToast: true, isDismissible: options == null ? void 0 : options.isDismissible, className: "mb-12", children: message }), {
|
|
62734
|
+
id: options == null ? void 0 : options.id,
|
|
62733
62735
|
duration: options == null ? void 0 : options.duration,
|
|
62734
62736
|
position: (options == null ? void 0 : options.position) ?? DEFAULT_POSITION
|
|
62735
62737
|
}),
|
|
62736
62738
|
info: (message, options) => _t.custom(/* @__PURE__ */ jsxRuntimeExports.jsx(Alert$1, { type: "info", isToast: true, isDismissible: options == null ? void 0 : options.isDismissible, className: "mb-12", children: message }), {
|
|
62739
|
+
id: options == null ? void 0 : options.id,
|
|
62737
62740
|
duration: options == null ? void 0 : options.duration,
|
|
62738
62741
|
position: (options == null ? void 0 : options.position) ?? DEFAULT_POSITION
|
|
62739
62742
|
}),
|
|
62740
62743
|
warning: (message, options) => _t.custom(/* @__PURE__ */ jsxRuntimeExports.jsx(Alert$1, { type: "warning", isToast: true, isDismissible: options == null ? void 0 : options.isDismissible, className: "mb-12", children: message }), {
|
|
62744
|
+
id: options == null ? void 0 : options.id,
|
|
62741
62745
|
duration: options == null ? void 0 : options.duration,
|
|
62742
62746
|
position: (options == null ? void 0 : options.position) ?? DEFAULT_POSITION
|
|
62743
62747
|
}),
|
|
62744
|
-
loading: _t.loading
|
|
62748
|
+
loading: _t.loading,
|
|
62749
|
+
dismiss: (id2) => _t.dismiss(id2),
|
|
62750
|
+
remove: (id2) => _t.remove(id2)
|
|
62745
62751
|
};
|
|
62746
62752
|
}
|
|
62747
62753
|
function useHover() {
|
|
@@ -66502,6 +66508,12 @@ const restoreAll = async ({
|
|
|
66502
66508
|
};
|
|
66503
66509
|
return await odeServices.resource(searchParams.application).restoreAll(trashParameters, useAssetIds);
|
|
66504
66510
|
};
|
|
66511
|
+
const copyResource = async (searchParams, resourceId) => {
|
|
66512
|
+
return await odeServices.resource(searchParams.application).copy({
|
|
66513
|
+
application: searchParams.application,
|
|
66514
|
+
resourceId
|
|
66515
|
+
});
|
|
66516
|
+
};
|
|
66505
66517
|
const moveToFolder = async ({
|
|
66506
66518
|
searchParams,
|
|
66507
66519
|
resourceIds,
|
|
@@ -67371,6 +67383,74 @@ const useDelete = () => {
|
|
|
67371
67383
|
}
|
|
67372
67384
|
});
|
|
67373
67385
|
};
|
|
67386
|
+
const useCopyResource = () => {
|
|
67387
|
+
const toast = useToast();
|
|
67388
|
+
const searchParams = useSearchParams();
|
|
67389
|
+
const queryClient2 = useQueryClient();
|
|
67390
|
+
const { user } = useUser();
|
|
67391
|
+
const { filters: filters2, trashed } = searchParams;
|
|
67392
|
+
const TOAST_INFO_ID = "duplicate_start";
|
|
67393
|
+
const queryKey = [
|
|
67394
|
+
"context",
|
|
67395
|
+
{
|
|
67396
|
+
folderId: filters2.folder,
|
|
67397
|
+
filters: filters2,
|
|
67398
|
+
trashed
|
|
67399
|
+
}
|
|
67400
|
+
];
|
|
67401
|
+
return useMutation({
|
|
67402
|
+
mutationFn: async (resource) => {
|
|
67403
|
+
toast.info(t$4("duplicate.start"), {
|
|
67404
|
+
id: TOAST_INFO_ID
|
|
67405
|
+
});
|
|
67406
|
+
return await copyResource(searchParams, resource.assetId);
|
|
67407
|
+
},
|
|
67408
|
+
onSuccess: async (data, variables) => {
|
|
67409
|
+
toast.remove(TOAST_INFO_ID);
|
|
67410
|
+
toast.success(t$4("duplicate.done"));
|
|
67411
|
+
await queryClient2.cancelQueries({ queryKey });
|
|
67412
|
+
const previousData = queryClient2.getQueryData(queryKey);
|
|
67413
|
+
const newResource = {
|
|
67414
|
+
...variables,
|
|
67415
|
+
name: `${variables.name}${t$4("duplicate.suffix")}`,
|
|
67416
|
+
assetId: data.duplicateId,
|
|
67417
|
+
id: data.duplicateId,
|
|
67418
|
+
creatorId: user == null ? void 0 : user.userId,
|
|
67419
|
+
creatorName: user == null ? void 0 : user.username,
|
|
67420
|
+
createdAt: Date.now(),
|
|
67421
|
+
slug: variables.slug || "",
|
|
67422
|
+
modifiedAt: Date.now(),
|
|
67423
|
+
modifierId: (user == null ? void 0 : user.userId) || "",
|
|
67424
|
+
modifierName: (user == null ? void 0 : user.username) || "",
|
|
67425
|
+
updatedAt: Date.now(),
|
|
67426
|
+
trashed: false,
|
|
67427
|
+
rights: [`creator:${user == null ? void 0 : user.userId}`]
|
|
67428
|
+
};
|
|
67429
|
+
if (previousData) {
|
|
67430
|
+
return queryClient2.setQueryData(queryKey, (prev) => {
|
|
67431
|
+
if (prev) {
|
|
67432
|
+
return {
|
|
67433
|
+
...prev,
|
|
67434
|
+
pages: prev == null ? void 0 : prev.pages.map((page) => {
|
|
67435
|
+
return {
|
|
67436
|
+
...page,
|
|
67437
|
+
resources: [newResource, ...page.resources]
|
|
67438
|
+
};
|
|
67439
|
+
})
|
|
67440
|
+
};
|
|
67441
|
+
}
|
|
67442
|
+
return void 0;
|
|
67443
|
+
});
|
|
67444
|
+
}
|
|
67445
|
+
},
|
|
67446
|
+
onError: (error) => {
|
|
67447
|
+
toast.remove(TOAST_INFO_ID);
|
|
67448
|
+
if (typeof error === "string") {
|
|
67449
|
+
toast.error(`${t$4("duplicate.error")}: ${error}`);
|
|
67450
|
+
}
|
|
67451
|
+
}
|
|
67452
|
+
});
|
|
67453
|
+
};
|
|
67374
67454
|
const useMoveItem = () => {
|
|
67375
67455
|
const toast = useToast();
|
|
67376
67456
|
const queryClient2 = useQueryClient();
|
|
@@ -68942,6 +69022,7 @@ function useActionBar() {
|
|
|
68942
69022
|
const restoreItem = useRestore();
|
|
68943
69023
|
const isTrashResource = useResourceIsTrash();
|
|
68944
69024
|
const searchParams = useSearchParams();
|
|
69025
|
+
const copyResource2 = useCopyResource();
|
|
68945
69026
|
const {
|
|
68946
69027
|
openResource,
|
|
68947
69028
|
printSelectedResource,
|
|
@@ -68975,6 +69056,8 @@ function useActionBar() {
|
|
|
68975
69056
|
folderId: selectedFolders[0].id
|
|
68976
69057
|
});
|
|
68977
69058
|
}
|
|
69059
|
+
case ACTION.COPY:
|
|
69060
|
+
return onCopy();
|
|
68978
69061
|
case ACTION.MOVE:
|
|
68979
69062
|
return setOpenedModalName("move");
|
|
68980
69063
|
case ACTION.PRINT:
|
|
@@ -69065,6 +69148,14 @@ function useActionBar() {
|
|
|
69065
69148
|
const onEditResourceCancel = onFinish("edit_resource");
|
|
69066
69149
|
const onShareResourceSuccess = onFinish("share");
|
|
69067
69150
|
const onShareResourceCancel = onFinish("share");
|
|
69151
|
+
async function onCopy() {
|
|
69152
|
+
if (selectedResources && selectedResources.length > 0) {
|
|
69153
|
+
const selectedResource = selectedResources[0];
|
|
69154
|
+
await copyResource2.mutate(selectedResource);
|
|
69155
|
+
clearSelectedItems();
|
|
69156
|
+
clearSelectedIds();
|
|
69157
|
+
}
|
|
69158
|
+
}
|
|
69068
69159
|
function onEdit() {
|
|
69069
69160
|
if (resourceIds && resourceIds.length > 0) {
|
|
69070
69161
|
const selectedResource = selectedResources[0].assetId;
|
package/dist/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
ode-explorer=1.0-b2school-SNAPSHOT
|
|
1
|
+
ode-explorer=1.0-b2school-SNAPSHOT 16/02/2024 16:13:32
|