@edifice.io/collect-frontend 0.2.0 → 0.2.2-develop-pedago.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/lib/AppHeaderCollection-CdMZTmC6.js +170 -0
- package/lib/CXEL7IU7-BLUeaFt5.js +42 -0
- package/lib/Collection-CUCjNGrr.js +472 -0
- package/lib/CollectionsLayout-DVYmui3o.js +187 -0
- package/lib/CollectionsList-Ba1LoCCN.js +310 -0
- package/lib/DeleteCollectionModal-CtmfiR2H.js +71 -0
- package/lib/DropdownActionTable-BhSk2sde.js +84 -0
- package/lib/FormEdit-DZFkw7z9.js +102 -0
- package/lib/HASRA6WW-BPaxT9L-.js +9093 -0
- package/lib/I3HPI4QX-BuVHGkjY.js +33 -0
- package/lib/MembersEdit-CblCChDS.js +77 -0
- package/lib/Root--z47Brfh.js +17 -0
- package/lib/SearchBarCollect-DBKaVVDV.js +23 -0
- package/lib/Submission-AzDGz_dM.js +257 -0
- package/lib/SubmissionList-Db_nRSqg.js +197 -0
- package/lib/emptyscreen-list-collection-CWGxO4Ss.js +4 -0
- package/lib/index-HU8ua_Ev.js +3297 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +9 -0
- package/lib/style.css +1 -0
- package/lib/submission.queries-Cr0bP5uv.js +86 -0
- package/lib/useGetStatusSubmission-DxHmLPxr.js +57 -0
- package/package.json +4 -3
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { jsx as t, jsxs as g, Fragment as N } from "react/jsx-runtime";
|
|
2
|
+
import { WORKFLOW_RIGHTS as v, MediaType as x } from "@edifice.io/collect-client-rest";
|
|
3
|
+
import { useEdificeClient as I, useBreakpoint as w, useToast as E, useHasWorkflow as F, LoadingScreen as L, Grid as h, Flex as y, Button as C } from "@edifice.io/react";
|
|
4
|
+
import { useState as O } from "react";
|
|
5
|
+
import { useTranslation as k } from "react-i18next";
|
|
6
|
+
import { useParams as P, useNavigate as A } from "react-router-dom";
|
|
7
|
+
import { k as Q, e as R, P as W, F as j, f as H } from "./index-HU8ua_Ev.js";
|
|
8
|
+
import { s as S } from "./submission.queries-Cr0bP5uv.js";
|
|
9
|
+
const J = (s) => async ({ params: i }) => {
|
|
10
|
+
const a = Number(i.collectionId);
|
|
11
|
+
return await s.ensureQueryData(H(a)), await s.prefetchInfiniteQuery(
|
|
12
|
+
S(a)
|
|
13
|
+
), null;
|
|
14
|
+
}, V = () => {
|
|
15
|
+
const { appCode: s } = I(), { t: i } = k(s), { lg: a } = w(), d = P(), u = A(), m = E(), f = F(v.COLLECTION_CREATE), p = Q(), [e, T] = O(void 0), { data: o, isLoading: l } = R(
|
|
16
|
+
Number(d.collectionId)
|
|
17
|
+
);
|
|
18
|
+
if (l)
|
|
19
|
+
return /* @__PURE__ */ t(L, {});
|
|
20
|
+
if (!f || !o) return /* @__PURE__ */ t(W, {});
|
|
21
|
+
const b = async () => {
|
|
22
|
+
const r = Number(d.collectionId);
|
|
23
|
+
if (!r) return;
|
|
24
|
+
const c = {
|
|
25
|
+
title: (e == null ? void 0 : e.title) ?? o.name ?? "",
|
|
26
|
+
description: (e == null ? void 0 : e.description) ?? o.content ?? "",
|
|
27
|
+
deadline: (e == null ? void 0 : e.deadline) ?? (o.deadline ? new Date(o.deadline) : void 0),
|
|
28
|
+
attachments: (e == null ? void 0 : e.attachments) ?? [],
|
|
29
|
+
sharings: (e == null ? void 0 : e.sharings) ?? []
|
|
30
|
+
};
|
|
31
|
+
try {
|
|
32
|
+
await p.mutateAsync({
|
|
33
|
+
id: r,
|
|
34
|
+
data: {
|
|
35
|
+
name: c.title,
|
|
36
|
+
content: c.description,
|
|
37
|
+
deadline: c.deadline ?? /* @__PURE__ */ new Date(),
|
|
38
|
+
attachments: c.attachments.map((n) => ({
|
|
39
|
+
name: n.name,
|
|
40
|
+
type: x.ATTACHMENT,
|
|
41
|
+
uri: n.filename,
|
|
42
|
+
mimeType: n.contentType
|
|
43
|
+
}))
|
|
44
|
+
}
|
|
45
|
+
}), m.success(i("collection.toast.success.collection.update"), {
|
|
46
|
+
duration: 1e4,
|
|
47
|
+
isDismissible: !0
|
|
48
|
+
}), u(`/list-collections/id/${r}`);
|
|
49
|
+
} catch (n) {
|
|
50
|
+
m.error(i("collection.toast.error.collection.update"), {
|
|
51
|
+
duration: 1e4,
|
|
52
|
+
isDismissible: !0
|
|
53
|
+
}), console.log(n);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
return /* @__PURE__ */ g(N, { children: [
|
|
57
|
+
/* @__PURE__ */ t(h, { className: "flex-grow-1 gap-64 px-md-8 px-lg-48 position-relative", children: /* @__PURE__ */ t(h.Col, { sm: "4", md: "8", xl: "12", className: `${a && "ms-64"}`, children: /* @__PURE__ */ t(
|
|
58
|
+
y,
|
|
59
|
+
{
|
|
60
|
+
direction: "column",
|
|
61
|
+
gap: "16",
|
|
62
|
+
className: "h-100 py-24 pb-lg-48 pt-lg-32",
|
|
63
|
+
children: /* @__PURE__ */ t(
|
|
64
|
+
j,
|
|
65
|
+
{
|
|
66
|
+
collection: o,
|
|
67
|
+
updateWizardData: T
|
|
68
|
+
}
|
|
69
|
+
)
|
|
70
|
+
}
|
|
71
|
+
) }) }),
|
|
72
|
+
/* @__PURE__ */ g(y, { justify: "end", className: "mt-auto px-48 pb-64 gap-16", children: [
|
|
73
|
+
/* @__PURE__ */ t(
|
|
74
|
+
C,
|
|
75
|
+
{
|
|
76
|
+
variant: "outline",
|
|
77
|
+
color: "primary",
|
|
78
|
+
isLoading: l,
|
|
79
|
+
onClick: () => u(-1),
|
|
80
|
+
"data-testid": "collect-cancel-sharings-button",
|
|
81
|
+
children: i("collection.cancel")
|
|
82
|
+
}
|
|
83
|
+
),
|
|
84
|
+
/* @__PURE__ */ t(
|
|
85
|
+
C,
|
|
86
|
+
{
|
|
87
|
+
variant: "filled",
|
|
88
|
+
color: "primary",
|
|
89
|
+
isLoading: l || p.isPending,
|
|
90
|
+
loadingPosition: "right",
|
|
91
|
+
onClick: b,
|
|
92
|
+
"data-testid": "collect-save-sharings-button",
|
|
93
|
+
children: i("collection.form.edit.save")
|
|
94
|
+
}
|
|
95
|
+
)
|
|
96
|
+
] })
|
|
97
|
+
] });
|
|
98
|
+
};
|
|
99
|
+
export {
|
|
100
|
+
V as FormEdit,
|
|
101
|
+
J as loader
|
|
102
|
+
};
|