@edifice.io/collect-frontend 0.2.0-develop-pedago.0 → 0.2.2-develop-pedago.2

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/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export {}
package/lib/index.js ADDED
@@ -0,0 +1,45 @@
1
+ import { bE as s, bF as o, bG as e, bH as i, C as n, aa as b, bI as S, ax as c, bJ as l, bK as r, bL as D, bM as C, bN as u, ap as m, aH as h, bO as p, bP as d, bQ as g, bR as R, bS as P, bT as T, bU as U, bV as y, bW as F, bX as M, bY as W, bZ as A, b_ as H, b$ as I, o as L, aI as O, c0 as x, c1 as G, ab as K, c2 as Q, c3 as V, c4 as _, c5 as f, W as q, c6 as v, c7 as w, c8 as E } from "./index-Dt9ykSDF.js";
2
+ export {
3
+ s as AttachmentDto,
4
+ o as CollectApp,
5
+ e as CollectionClient,
6
+ i as CollectionDto,
7
+ n as CollectionSortField,
8
+ b as CollectionStatus,
9
+ S as CollectionSubmissionDto,
10
+ c as ContribSubmissionStatus,
11
+ l as CreateAttachmentDto,
12
+ r as CreateCollectionDto,
13
+ D as CreateSharingDto,
14
+ C as CreateSubmissionDto,
15
+ u as DeleteSharingDto,
16
+ m as ManagerSubmissionStatus,
17
+ h as MediaType,
18
+ p as PageMetadataDto,
19
+ d as PaginatedListDto,
20
+ g as PaginationQueryDto,
21
+ R as Providers,
22
+ P as RecipientDto,
23
+ T as RecipientType,
24
+ U as SearchCollectionDto,
25
+ y as SearchCollectionResponseDto,
26
+ F as SearchCollectionStudentViewDto,
27
+ M as SearchCollectionToSubmitDto,
28
+ W as SearchSubmissionDto,
29
+ A as SearchSubmissionResponseDto,
30
+ H as SharingDto,
31
+ I as SharingPermission,
32
+ L as SortDirection,
33
+ O as SubmissionClient,
34
+ x as SubmissionDto,
35
+ G as SubmissionSortField,
36
+ K as SubmissionStatus,
37
+ Q as UpdateCollectionDto,
38
+ V as UpdateCollectionSharingDto,
39
+ _ as UpdateSubmissionStatusDto,
40
+ f as UserDto,
41
+ q as WORKFLOW_RIGHTS,
42
+ v as basename,
43
+ w as queryClient,
44
+ E as router
45
+ };
package/lib/style.css ADDED
@@ -0,0 +1 @@
1
+ .table-collections table,.table-submissions table{border-radius:0}.btn.icon-button-hover-no-transition,.btn.icon-button-hover-no-transition span{transition:none}.separator-dashed{height:1px;--color: var(--edifice-gray-400);--dash: 8px;--gap: 6px;background:repeating-linear-gradient(90deg,var(--color) 0 var(--dash),transparent var(--dash) calc(var(--dash) + var(--gap)))}.cancel-gap{margin-left:calc(var(--edifice-gap) * -1);margin-right:-2.4rem}.collectionDescription .tiptap{min-height:150px}#submissionEdit .tiptap{min-height:350px}.wrapper{display:grid;grid-template-rows:0fr;transition:grid-template-rows .25s ease,margin-top .25s ease}.wrapper.open{grid-template-rows:1fr;margin-top:12px}.inner{overflow:hidden}.user-rights-list .table-responsive{max-height:70vh}.user-rights-list .table-responsive table{overflow:visible}.user-rights-list .table-responsive table thead{z-index:1}
@@ -0,0 +1,83 @@
1
+ import { aI as S, aJ as b, aK as c, aL as y, aM as o, aN as m, aO as p } from "./index-Dt9ykSDF.js";
2
+ const d = "/collect/api", n = new S({
3
+ httpService: b.http(),
4
+ baseUrl: d
5
+ }), u = {
6
+ getSubmissions: (e, s) => n.getSubmissions(e, s),
7
+ getSubmission: (e, s) => n.getSubmission(e, s),
8
+ updateSubmission: (e, s, i) => n.updateSubmission(e, s, i),
9
+ updateSubmissionStatus: (e, s, i) => n.updateSubmissionStatus(e, s, i)
10
+ }, a = {
11
+ base: ["submissions"]
12
+ }, l = (e, s) => ({
13
+ queryKey: [...a.base, e, s],
14
+ queryFn: ({ pageParam: i = 1 }) => u.getSubmissions(e, {
15
+ ...s,
16
+ size: c,
17
+ page: i
18
+ }),
19
+ staleTime: 5e3,
20
+ initialPageParam: 1,
21
+ refetchOnMount: !0,
22
+ getNextPageParam: (i) => {
23
+ const { currentPage: t, totalPages: r } = i.meta || {};
24
+ return t < r ? t + 1 : void 0;
25
+ }
26
+ }), q = (e, s) => p(l(e, s)), g = (e, s) => ({
27
+ queryKey: ["submission", s, e],
28
+ queryFn: () => u.getSubmission(e, s),
29
+ staleTime: 0
30
+ }), O = (e, s) => y({
31
+ ...g(e, s),
32
+ enabled: !!s
33
+ }), P = () => {
34
+ const e = o();
35
+ return m({
36
+ mutationFn: ({
37
+ collectionId: s,
38
+ submissionId: i,
39
+ data: t
40
+ }) => u.updateSubmission(s, i, t),
41
+ onSuccess: () => {
42
+ e.invalidateQueries({
43
+ queryKey: [
44
+ ...a.base,
45
+ "submission",
46
+ "collectionsToSubmit"
47
+ ]
48
+ });
49
+ }
50
+ });
51
+ }, f = () => {
52
+ const e = o();
53
+ return m({
54
+ mutationFn: ({
55
+ collectionId: s,
56
+ submissionId: i,
57
+ data: t
58
+ }) => u.updateSubmissionStatus(
59
+ s,
60
+ i,
61
+ t
62
+ ),
63
+ onSuccess: (s, i) => {
64
+ e.invalidateQueries({
65
+ queryKey: a.base
66
+ }), i && e.invalidateQueries({
67
+ queryKey: [
68
+ "submission",
69
+ i.submissionId,
70
+ i.collectionId
71
+ ]
72
+ });
73
+ }
74
+ });
75
+ };
76
+ export {
77
+ f as a,
78
+ P as b,
79
+ O as c,
80
+ g as d,
81
+ l as s,
82
+ q as u
83
+ };
@@ -0,0 +1,55 @@
1
+ import { u as a, d as r, ab as i } from "./index-Dt9ykSDF.js";
2
+ function l() {
3
+ const { appCode: o } = a(), { t } = r(o), s = (e) => ({
4
+ background: !0,
5
+ level: e,
6
+ type: "content"
7
+ }), c = () => ({
8
+ level: "success",
9
+ type: "notification"
10
+ });
11
+ return {
12
+ getSubmissionStatus: ({
13
+ status: e,
14
+ isPastDeadline: n,
15
+ isSubmissionCard: u = !1
16
+ }) => {
17
+ switch (e) {
18
+ case i.SUBMITTED:
19
+ return {
20
+ text: t("collection.submission.status.submitted"),
21
+ variant: s("success")
22
+ };
23
+ case i.EMPTY:
24
+ return {
25
+ text: t(
26
+ n ? "Non rendu" : "collection.submission.status.toSubmit"
27
+ ),
28
+ variant: s(n ? "danger" : "warning")
29
+ };
30
+ case i.DRAFT:
31
+ return {
32
+ text: t(
33
+ n ? "collection.submission.status.submitted" : "collection.submission.status.toSubmit"
34
+ ),
35
+ variant: s(n ? "success" : "warning")
36
+ };
37
+ case i.VERIFIED:
38
+ return {
39
+ text: t(
40
+ u ? "collection.submission.status.submitted" : "collection.submission.status.verified"
41
+ ),
42
+ variant: u ? s("success") : c()
43
+ };
44
+ default:
45
+ return {
46
+ text: t("collection.submissionsList.status.toSubmit"),
47
+ variant: s("warning")
48
+ };
49
+ }
50
+ }
51
+ };
52
+ }
53
+ export {
54
+ l as u
55
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edifice.io/collect-frontend",
3
- "version": "0.2.0-develop-pedago.0",
3
+ "version": "0.2.2-develop-pedago.2",
4
4
  "private": false,
5
5
  "license": "GPL-3.0",
6
6
  "author": "Edifice",
@@ -17,7 +17,7 @@
17
17
  "prebuild": "pnpm install",
18
18
  "pre-commit": "lint-staged",
19
19
  "preview": "vite preview",
20
- "prune:prod": "CI=true NPM_CONFIG_IGNORE_SCRIPTS=true pnpm prune --prod --production --loglevel verbose",
20
+ "prune:prod": "CI=true NPM_CONFIG_IGNORE_SCRIPTS=true pnpm prune --prod --production --loglevel verbose || true",
21
21
  "test": "vitest",
22
22
  "test:coverage": "vitest run --coverage",
23
23
  "test:ui": "vitest --ui",
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@edifice.io/bootstrap": "develop-pedago",
30
- "@edifice.io/collect-client-rest": "workspace:*",
30
+ "@edifice.io/collect-client-rest": "develop-pedago",
31
31
  "@edifice.io/client": "develop-pedago",
32
32
  "@edifice.io/react": "develop-pedago",
33
33
  "@react-spring/web": "9.7.5",
@@ -72,6 +72,7 @@
72
72
  "msw": "2.11.2",
73
73
  "nx": "19.6.0",
74
74
  "vite": "5.4.20",
75
+ "vite-plugin-dts": "4.5.4",
75
76
  "vite-tsconfig-paths": "5.1.4"
76
77
  },
77
78
  "packageManager": "pnpm@9.12.2",