@piveau/dpi 0.2.0-alpha.20 → 0.2.0-alpha.22

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.
Files changed (23) hide show
  1. package/dist/assets/dpi.css +1 -1
  2. package/dist/packages/dpi/src/data-provider-interface/DataProviderInterface.vue.js +22 -16
  3. package/dist/packages/dpi/src/data-provider-interface/DataProviderInterface.vue2.js +34 -32
  4. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/HomeTable.vue.js +87 -71
  5. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ProjectTable.vue.js +2 -2
  6. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ProjectTable.vue2.js +88 -73
  7. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/Autocomplete/Autocomplete.vue.js +2 -2
  8. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/Autocomplete/Autocomplete.vue2.js +70 -55
  9. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/Autocomplete/AutocompleteVocab.vue.js +2 -2
  10. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/Autocomplete/AutocompleteVocab.vue2.js +50 -49
  11. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/ButtonV3.vue.js +115 -83
  12. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/ProcessSteps/HardwareForm.vue.js +2 -2
  13. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/ProcessSteps/HardwareForm.vue2.js +108 -105
  14. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/ReviewStep/ReviewStep.vue.js +1 -1
  15. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/ReviewStep/ReviewStep.vue2.js +111 -107
  16. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/TableRowV3.vue.js +127 -122
  17. package/dist/packages/dpi/src/data-provider-interface/components/StepActionsSection.vue.js +2 -2
  18. package/dist/packages/dpi/src/data-provider-interface/components/StepActionsSection.vue2.js +72 -68
  19. package/dist/packages/dpi/src/data-provider-interface/composables/project-transformer/encodeProject.js +38 -38
  20. package/dist/packages/dpi/src/data-provider-interface/composables/useDebouncedLoading.js +11 -0
  21. package/dist/packages/dpi/src/data-provider-interface/composables/useProjectActions.js +37 -37
  22. package/dist/packages/dpi/src/data-provider-interface/views/InputPageProject.vue.js +218 -216
  23. package/package.json +1 -1
@@ -11,7 +11,7 @@ function H(e, r) {
11
11
  "@type": r
12
12
  };
13
13
  }
14
- function z(e, r, t) {
14
+ function P(e, r, t) {
15
15
  const i = (e ?? "https://twin.bydata.de/api/hub/repo").trim(), o = i.endsWith("/") ? i : `${i}/`, c = r.trim().replace(/^\/+/, ""), a = t ? `${t}/${c}` : c;
16
16
  try {
17
17
  return new URL(a, o).toString();
@@ -34,13 +34,13 @@ function Y(e, r) {
34
34
  function J(e) {
35
35
  return (r) => Y(r, e);
36
36
  }
37
- function W(e) {
37
+ function M(e) {
38
38
  if (e)
39
39
  return {
40
40
  "@id": e
41
41
  };
42
42
  }
43
- function U(e) {
43
+ function N(e) {
44
44
  return e != null;
45
45
  }
46
46
  function ee(e, r = "http://www.w3.org/2001/XMLSchema#string") {
@@ -70,7 +70,7 @@ function ne(e) {
70
70
  function te(e) {
71
71
  return s(
72
72
  n.fromNullable(e),
73
- n.map((r) => r.map((t) => W(t)).filter(U)),
73
+ n.map((r) => r.map((t) => M(t)).filter(N)),
74
74
  n.filter((r) => r.length > 0),
75
75
  n.map((r) => [...r])
76
76
  );
@@ -82,34 +82,34 @@ function $(e, r) {
82
82
  );
83
83
  }
84
84
  function re(e) {
85
- return A(e).flatMap((r) => [...r]);
85
+ return z(e).flatMap((r) => [...r]);
86
86
  }
87
87
  function C(e, r, t) {
88
88
  return s(
89
89
  n.fromNullable(e),
90
- n.map((i) => i.map(r).filter(U)),
90
+ n.map((i) => i.map(r).filter(N)),
91
91
  n.filter((i) => i.length > 0),
92
92
  n.map((i) => T(i, t)),
93
93
  n.filter((i) => i.length > 0),
94
94
  n.map((i) => [...i])
95
95
  );
96
96
  }
97
- function M(e) {
97
+ function A(e) {
98
98
  if (e == null || typeof e != "object")
99
99
  return e;
100
100
  if (Array.isArray(e))
101
- return e.map((i) => M(i)).filter((i) => i != null);
101
+ return e.map((i) => A(i)).filter((i) => i != null);
102
102
  const r = {};
103
103
  for (const [t, i] of Object.entries(e)) {
104
104
  if (i == null)
105
105
  continue;
106
- const o = M(i);
106
+ const o = A(i);
107
107
  o != null && (r[t] = o);
108
108
  }
109
109
  return r;
110
110
  }
111
- function A(e) {
112
- return e.map(n.getOrUndefined).filter(U);
111
+ function z(e) {
112
+ return e.map(n.getOrUndefined).filter(N);
113
113
  }
114
114
  function f(e) {
115
115
  const r = e ? [...e] : [];
@@ -178,14 +178,14 @@ function T(e, r) {
178
178
  function oe(e, r) {
179
179
  return (e ?? []).map((i) => ({
180
180
  "@type": "schema:SoftwareApplication",
181
- "dct:identifier": z(r.baseRepoUrl, i.id, "resources/software"),
181
+ "dct:identifier": P(r.baseRepoUrl, i.id, "resources/software"),
182
182
  "schema:featureList": f((i.functionalities ?? []).map((o) => o == null ? void 0 : o.trim()).filter((o) => !!o && o.length > 0))
183
183
  }));
184
184
  }
185
185
  function se(e, r) {
186
186
  return (e ?? []).map((i) => ({
187
187
  "@type": "dcat:Dataset",
188
- "dct:identifier": z(r.baseRepoUrl, i.id, "datasets")
188
+ "dct:identifier": P(r.baseRepoUrl, i.id, "datasets")
189
189
  }));
190
190
  }
191
191
  function le(e, r, t) {
@@ -193,7 +193,7 @@ function le(e, r, t) {
193
193
  var c;
194
194
  return {
195
195
  "@type": "ssn:System",
196
- "dct:identifier": z(t.baseRepoUrl, o.id, "resources/hardware"),
196
+ "dct:identifier": P(t.baseRepoUrl, o.id, "resources/hardware"),
197
197
  "dct:description": s(
198
198
  n.fromNullable(o.description),
199
199
  n.map((a) => a.trim()),
@@ -201,14 +201,14 @@ function le(e, r, t) {
201
201
  n.flatMap((a) => n.fromNullable(r(a))),
202
202
  n.getOrUndefined
203
203
  ),
204
- "ssn:deployedSystem": W(o.id),
204
+ "ssn:deployedSystem": M(P(t.baseRepoUrl, o.id, "resources/hardware")),
205
205
  "ssn:forProperty": f((o.forProperty ?? []).map((a) => a == null ? void 0 : a.trim()).filter((a) => !!a && a.length > 0)),
206
206
  "sosa:hasLocation": f((o.locations ?? []).map((a) => ({
207
207
  "@type": "dct:Location",
208
208
  "geo:lat": a.lat,
209
209
  "geo:long": a.lng
210
210
  }))),
211
- "foaf:depiction": f((o.depictions ?? []).map((a) => W(a)).filter(U)),
211
+ "foaf:depiction": f((o.depictions ?? []).map((a) => M(a)).filter(N)),
212
212
  // Corresponds to functionalities of hardware;
213
213
  // not to be confused with functionalities of software (schema:featureList)
214
214
  "ssn-system:hasSystemCapability": f((o.functionalities ?? []).map((a) => a == null ? void 0 : a.trim()).filter((a) => !!a && a.length > 0)),
@@ -220,14 +220,14 @@ function le(e, r, t) {
220
220
  };
221
221
  });
222
222
  }
223
- function P(e) {
223
+ function U(e) {
224
224
  var w, y, O;
225
- const { prefixKey: r, activityLabel: t, input: i, toLanged: o, context: c } = e, a = `${r}/Grundlegende Informationen`, p = `${r}/Software`, u = `${r}/Datensätze`, x = `${r}/Hardware`, d = i[a], N = d == null ? void 0 : d.description, j = s(
226
- n.fromNullable(N),
225
+ const { prefixKey: r, activityLabel: t, input: i, toLanged: o, context: c } = e, a = `${r}/Grundlegende Informationen`, p = `${r}/Software`, u = `${r}/Datensätze`, x = `${r}/Hardware`, d = i[a], j = d == null ? void 0 : d.description, I = s(
226
+ n.fromNullable(j),
227
227
  n.map((h) => h.trim()),
228
228
  n.filter((h) => h.length > 0),
229
229
  n.getOrUndefined
230
- ), I = d == null ? void 0 : d.methods, L = d == null ? void 0 : d.links, R = (w = i[p]) == null ? void 0 : w.selected, v = (y = i[u]) == null ? void 0 : y.selected, S = (O = i[x]) == null ? void 0 : O.selected, b = [
230
+ ), L = d == null ? void 0 : d.methods, W = d == null ? void 0 : d.links, R = (w = i[p]) == null ? void 0 : w.selected, v = (y = i[u]) == null ? void 0 : y.selected, S = (O = i[x]) == null ? void 0 : O.selected, b = [
231
231
  ...oe(R, c),
232
232
  ...se(v, c),
233
233
  ...le(S, o, c)
@@ -235,10 +235,10 @@ function P(e) {
235
235
  "@type": "p-plan:Step",
236
236
  "dct:identifier": "__TODO__",
237
237
  "p-plan:Activity": t,
238
- "dct:description": o(j ?? "__EMPTY__"),
238
+ "dct:description": o(I ?? "__EMPTY__"),
239
239
  "p-plan:isPrecededBy": null,
240
- "prov:used": f(ae(I)),
241
- "dct:references": f(T(L, "documentation")),
240
+ "prov:used": f(ae(L)),
241
+ "dct:references": f(T(W, "documentation")),
242
242
  "p-plan:hasInputVar": b.length > 0 ? b : void 0
243
243
  };
244
244
  return n.some(k);
@@ -325,41 +325,41 @@ function ue(e, r = {}) {
325
325
  tenderFormat: "Welche Ausschreibungsform haben Sie gewaehlt und warum? Gab es eine Vorlage oder Muster-Leistungsbeschreibung, die hilfreich war?",
326
326
  tenderTips: "Welche Tipps haben Sie fuer eine erfolgreiche Ausschreibung?",
327
327
  resourcePlanning: "Wie haben Sie die Ressourcenplanung fuer die Entwicklung und den Betrieb Ihres Digitalen Zwillings gestaltet und gesichert?"
328
- }, N = {
328
+ }, j = {
329
329
  projectTriggers: "Wie haben Sie die Zusammenarbeit mit den Dienstleistern organisiert und wie wurden relevante Stakeholder in Entscheidungsprozesse eingebunden?",
330
330
  involvedStakeholders: "Gab es Verzoegerungen und wenn ja, was waren die Gruende?",
331
331
  dataCollectionMethod: "Welche Schnittstellen wurden genutzt und traten technische Herausforderungen auf?",
332
332
  budgetPlanning: "Welche Ueberlegungen sind in Ihre Entscheidung fuer eine Open-Source-Loesung eingeflossen und welche Erfahrungen haben Sie gemacht?"
333
- }, j = {
333
+ }, I = {
334
334
  projectTriggers: "Was sind Ihre wichtigsten Learnings aus dem Projekt? Was wuerden Sie beim naechsten Use Case anders machen?",
335
335
  involvedStakeholders: "Wird die Wirksamkeit Ihres Projekts ueberwacht und wenn ja, wie? Ist der erwartete Nutzen eingetreten?",
336
336
  dataCollectionMethod: "Gibt es Plaene fuer eine Skalierung oder Weiterentwicklung? Wenn ja, wie sichern Sie die Finanzierung dafuer?",
337
337
  budgetPlanning: "Welche externen Unterstuetzungsangebote haben Ihnen geholfen oder auch gefehlt?"
338
- }, I = A([
338
+ }, L = z([
339
339
  D(e["Projektphasen (optional)/Initiieren"], "Initiieren", x, 1),
340
340
  D(e["Projektphasen (optional)/Planen"], "Planen", d, 2),
341
- D(e["Projektphasen (optional)/Umsetzen"], "Umsetzen", N, 3),
342
- D(e["Projektphasen (optional)/Weiterdenken"], "Weiterdenken", j, 4)
341
+ D(e["Projektphasen (optional)/Umsetzen"], "Umsetzen", j, 3),
342
+ D(e["Projektphasen (optional)/Weiterdenken"], "Weiterdenken", I, 4)
343
343
  ]);
344
- t["schema:hasPart"] = f(I);
345
- const L = A([
346
- P({ prefixKey: "1. Datenerfassung", activityLabel: "Datenerfassung", input: e, toLanged: a, context: r }),
347
- P({ prefixKey: "2. Datenverarbeitung", activityLabel: "Datenverarbeitung", input: e, toLanged: a, context: r }),
348
- P({ prefixKey: "3. Datensimulation", activityLabel: "Datensimulation", input: e, toLanged: a, context: r }),
349
- P({ prefixKey: "4. Datenvisualisierung", activityLabel: "Datenvisualisierung", input: e, toLanged: a, context: r })
344
+ t["schema:hasPart"] = f(L);
345
+ const W = z([
346
+ U({ prefixKey: "1. Datenerfassung", activityLabel: "Datenerfassung", input: e, toLanged: a, context: r }),
347
+ U({ prefixKey: "2. Datenverarbeitung", activityLabel: "Datenverarbeitung", input: e, toLanged: a, context: r }),
348
+ U({ prefixKey: "3. Datensimulation", activityLabel: "Datensimulation", input: e, toLanged: a, context: r }),
349
+ U({ prefixKey: "4. Datenvisualisierung", activityLabel: "Datenvisualisierung", input: e, toLanged: a, context: r })
350
350
  ]);
351
- return t["p-plan:hasStep"] = f(L), {
351
+ return t["p-plan:hasStep"] = f(W), {
352
352
  "@context": {
353
353
  ...F
354
354
  },
355
- "@graph": M(t)
355
+ "@graph": A(t)
356
356
  };
357
357
  }
358
358
  export {
359
359
  ue as encodeProject,
360
- U as isNonNullable,
360
+ N as isNonNullable,
361
361
  Q as slugify,
362
362
  Y as toLangedValue,
363
- W as toNodeReference,
363
+ M as toNodeReference,
364
364
  H as toTypedValue
365
365
  };
@@ -0,0 +1,11 @@
1
+ import { useDebounce as i } from "@vueuse/core";
2
+ import { computed as e, toValue as r } from "vue";
3
+ function c(n, d = 500) {
4
+ const o = e(() => r(n)), u = i(o, d, {});
5
+ return {
6
+ isLoading: e(() => !!o.value || !!u.value)
7
+ };
8
+ }
9
+ export {
10
+ c as useDebouncedLoading
11
+ };
@@ -1,93 +1,93 @@
1
1
  import { putResource as y } from "@piveau/sdk-core/hubRepo";
2
2
  import { useAsyncState as E } from "@vueuse/core";
3
3
  import { computed as I } from "vue";
4
- import { useStore as $ } from "vuex";
5
- import { useRuntimeEnv as j } from "../../composables/useRuntimeEnv.js";
6
- import { slugify as S, encodeProject as U } from "./project-transformer/encodeProject.js";
7
- import { useEditModeInfo as w } from "./useDpiEditMode.js";
4
+ import { useStore as w } from "vuex";
5
+ import { useRuntimeEnv as $ } from "../../composables/useRuntimeEnv.js";
6
+ import { slugify as j, encodeProject as S } from "./project-transformer/encodeProject.js";
7
+ import { useEditModeInfo as U } from "./useDpiEditMode.js";
8
8
  import { useFormValues as P } from "./useDpiFormValues.js";
9
9
  import { useErrorDialog as T } from "./useErrorDialog.js";
10
10
  import { useTwinbyUser as D } from "./useTwinbyUser.js";
11
11
  async function M(d) {
12
- var r, t, i, f;
12
+ var i, t, u, f;
13
13
  const {
14
- baseUrl: u,
14
+ baseUrl: s,
15
15
  formValues: e,
16
16
  isEditMode: m,
17
17
  editIdQuery: p,
18
18
  authToken: v,
19
- catalogId: s
20
- } = d, n = m ? p : S((t = (r = e.value) == null ? void 0 : r["Grundlegende Informationen/Name"]) == null ? void 0 : t.projectName), a = U(e.value, { language: "de" });
21
- let o = (f = (i = e.value) == null ? void 0 : i["Auffindbarkeit/Sichtbarkeit"]) == null ? void 0 : f.visibility;
22
- o || (o = "public"), await y({
23
- id: n,
19
+ catalogId: n
20
+ } = d, c = m ? p : j((t = (i = e.value) == null ? void 0 : i["Grundlegende Informationen/Name"]) == null ? void 0 : t.projectName), o = S(e.value, { language: "de" });
21
+ let r = (f = (u = e.value) == null ? void 0 : u["Auffindbarkeit/Sichtbarkeit"]) == null ? void 0 : f.visibility;
22
+ r || (r = "public"), await y({
23
+ id: c,
24
24
  // todo
25
25
  // publicationStatus: editFromDraft.value ? 'draft' : 'published',
26
26
  publicationStatus: "draft",
27
- baseUrl: u || "https://twin.bydata.de/api/hub/repo",
27
+ baseUrl: s || "https://twin.bydata.de/api/hub/repo",
28
28
  type: "project",
29
- data: a,
30
- accessLevel: o,
31
- catalogId: s || "catalog-1",
29
+ data: o,
30
+ accessLevel: r,
31
+ catalogId: n || "catalog-1",
32
32
  authToken: v
33
33
  });
34
34
  }
35
35
  function L(d) {
36
36
  var b, g, h, k;
37
- const u = $(), e = j(), { openErrorDialog: m } = T(), {
37
+ const s = w(), e = $(), { openErrorDialog: m } = T(), {
38
38
  onSuccess: p = () => {
39
- u.dispatch("snackbar/showSnackbar", {
39
+ s.dispatch("snackbar/showSnackbar", {
40
40
  message: "Projekt erfolgreich gespeichert",
41
41
  variant: "success"
42
42
  });
43
43
  },
44
44
  onError: v
45
- } = d || {}, { formValues: s } = P(), { organization: n, catalogProject: a } = D({
45
+ } = d || {}, { formValues: n } = P(), { organization: c, catalogProject: o } = D({
46
46
  keycloak: ((g = (b = e.authentication) == null ? void 0 : b.keycloak) == null ? void 0 : g.url) || "https://keycloak.twin.bydata.de",
47
47
  realm: ((k = (h = e.authentication) == null ? void 0 : h.keycloak) == null ? void 0 : k.realm) || "piveau",
48
48
  audience: "piveau-hub-repo"
49
- }), o = I(() => {
50
- var c, l;
51
- return (l = (c = u.getters) == null ? void 0 : c["auth/getUserData"]) == null ? void 0 : l.authToken;
52
- }), { editIdQuery: r, isEditMode: t, catalogId: i } = w();
49
+ }), r = I(() => {
50
+ var a, l;
51
+ return (l = (a = s.getters) == null ? void 0 : a["auth/getUserData"]) == null ? void 0 : l.authToken;
52
+ }), { editIdQuery: i, isEditMode: t, catalogId: u } = U();
53
53
  return {
54
54
  submitDraft: E(async () => {
55
55
  await M({
56
- formValues: s,
56
+ formValues: n,
57
57
  isEditMode: t.value,
58
- editIdQuery: r.value,
59
- authToken: o.value,
58
+ editIdQuery: i.value,
59
+ authToken: r.value,
60
60
  baseUrl: e.api.hubUrl,
61
- catalogId: t.value ? i.value : a.value
62
- });
61
+ catalogId: t.value ? u.value : o.value
62
+ }), await new Promise((a) => setTimeout(a, 700));
63
63
  }, null, {
64
64
  immediate: !1,
65
65
  onSuccess: p,
66
- onError: (c) => {
66
+ onError: (a) => {
67
67
  const l = new Error(
68
- `Fehler beim Speichern des Projekts: ${c}
68
+ `Fehler beim Speichern des Projekts: ${a}
69
69
 
70
- ${JSON.stringify(s.value)}
70
+ ${JSON.stringify(n.value)}
71
71
 
72
- authToken: ${o.value}
72
+ authToken: ${r.value}
73
73
 
74
- catalogId: ${i.value}
74
+ catalogId: ${u.value}
75
75
 
76
76
  isEditMode: ${t.value}
77
77
 
78
- editIdQuery: ${r.value}
78
+ editIdQuery: ${i.value}
79
79
 
80
80
  baseUrl: ${e.api.hubUrl}
81
81
 
82
- catalogProject: ${a.value}
82
+ catalogProject: ${o.value}
83
83
 
84
- organization: ${n.value}`
84
+ organization: ${c.value}`
85
85
  );
86
86
  m(l);
87
87
  }
88
88
  }),
89
- organization: n,
90
- catalogProject: a
89
+ organization: c,
90
+ catalogProject: o
91
91
  };
92
92
  }
93
93
  export {