@conduction/nextcloud-vue 2.178.0 → 2.179.0

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 (106) hide show
  1. package/dist/esm/components/CnBuildiqEditButton/CnBuildiqEditButton.vue.js +1 -1
  2. package/dist/esm/components/CnBuildiqEditButton/CnBuildiqEditButton.vue2.js +12 -1
  3. package/dist/esm/components/CnBuildiqEditButton/CnBuildiqEditButton.vue2.js.map +1 -1
  4. package/dist/esm/components/CnBuildiqEditButton/CnBuildiqEditButton.vue3.js.map +1 -1
  5. package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue.js +1 -1
  6. package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue2.js +10 -8
  7. package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue2.js.map +1 -1
  8. package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue3.js +95 -88
  9. package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue3.js.map +1 -1
  10. package/dist/esm/components/CnFlowDetail/CnFlowDetail.vue.js +1 -1
  11. package/dist/esm/components/CnFlowDetail/CnFlowDetail.vue2.js +86 -8
  12. package/dist/esm/components/CnFlowDetail/CnFlowDetail.vue2.js.map +1 -1
  13. package/dist/esm/components/CnFlowDetail/CnFlowDetail.vue3.js +137 -121
  14. package/dist/esm/components/CnFlowDetail/CnFlowDetail.vue3.js.map +1 -1
  15. package/dist/esm/components/CnFlowDetail/CnFlowDryRunResult.vue.js +1 -1
  16. package/dist/esm/components/CnFlowDetail/CnFlowDryRunResult.vue2.js +56 -4
  17. package/dist/esm/components/CnFlowDetail/CnFlowDryRunResult.vue2.js.map +1 -1
  18. package/dist/esm/components/CnFlowDetail/CnFlowDryRunResult.vue3.js +166 -70
  19. package/dist/esm/components/CnFlowDetail/CnFlowDryRunResult.vue3.js.map +1 -1
  20. package/dist/esm/components/CnFlowDetail/CnFlowStepList.vue.js +9 -0
  21. package/dist/esm/components/CnFlowDetail/CnFlowStepList.vue.js.map +1 -0
  22. package/dist/esm/components/CnFlowDetail/CnFlowStepList.vue2.js +123 -0
  23. package/dist/esm/components/CnFlowDetail/CnFlowStepList.vue2.js.map +1 -0
  24. package/dist/esm/components/CnFlowDetail/CnFlowStepList.vue3.js +268 -0
  25. package/dist/esm/components/CnFlowDetail/CnFlowStepList.vue3.js.map +1 -0
  26. package/dist/esm/components/CnFlowDetail/CnFlowViewSwitch.vue.js +9 -0
  27. package/dist/esm/components/CnFlowDetail/CnFlowViewSwitch.vue.js.map +1 -0
  28. package/dist/esm/components/CnFlowDetail/CnFlowViewSwitch.vue2.js +49 -0
  29. package/dist/esm/components/CnFlowDetail/CnFlowViewSwitch.vue2.js.map +1 -0
  30. package/dist/esm/components/CnFlowDetail/CnFlowViewSwitch.vue3.js +41 -0
  31. package/dist/esm/components/CnFlowDetail/CnFlowViewSwitch.vue3.js.map +1 -0
  32. package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue.js +1 -1
  33. package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue2.js +116 -8
  34. package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue2.js.map +1 -1
  35. package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue3.js +110 -58
  36. package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue3.js.map +1 -1
  37. package/dist/esm/components/CnFlowsPage/CnFlowEditorPage.vue2.js +78 -1
  38. package/dist/esm/components/CnFlowsPage/CnFlowEditorPage.vue2.js.map +1 -1
  39. package/dist/esm/components/CnFlowsPage/CnFlowEditorPage.vue3.js +44 -3
  40. package/dist/esm/components/CnFlowsPage/CnFlowEditorPage.vue3.js.map +1 -1
  41. package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js +90 -75
  42. package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js.map +1 -1
  43. package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js +46 -22
  44. package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js.map +1 -1
  45. package/dist/esm/composables/indexSources.js +24 -4
  46. package/dist/esm/composables/indexSources.js.map +1 -1
  47. package/dist/esm/composables/useFlowStore.js +75 -4
  48. package/dist/esm/composables/useFlowStore.js.map +1 -1
  49. package/dist/esm/dialogs/CnFlowEdgeEditModal.vue.js +1 -1
  50. package/dist/esm/dialogs/CnFlowEdgeEditModal.vue2.js +17 -0
  51. package/dist/esm/dialogs/CnFlowEdgeEditModal.vue2.js.map +1 -1
  52. package/dist/esm/dialogs/CnFlowEdgeEditModal.vue3.js +9 -1
  53. package/dist/esm/dialogs/CnFlowEdgeEditModal.vue3.js.map +1 -1
  54. package/dist/esm/dialogs/CnFlowEditModal.vue.js +1 -1
  55. package/dist/esm/dialogs/CnFlowEditModal.vue2.js +15 -0
  56. package/dist/esm/dialogs/CnFlowEditModal.vue2.js.map +1 -1
  57. package/dist/esm/dialogs/CnFlowEditModal.vue3.js +13 -3
  58. package/dist/esm/dialogs/CnFlowEditModal.vue3.js.map +1 -1
  59. package/dist/esm/dialogs/CnFlowStepPickerModal.vue.js +1 -1
  60. package/dist/esm/dialogs/CnFlowStepPickerModal.vue2.js +13 -1
  61. package/dist/esm/dialogs/CnFlowStepPickerModal.vue2.js.map +1 -1
  62. package/dist/esm/dialogs/CnFlowStepPickerModal.vue3.js.map +1 -1
  63. package/dist/esm/index.js +2 -0
  64. package/dist/esm/index.js.map +1 -1
  65. package/dist/esm/l10n/en.json.js +40 -1
  66. package/dist/esm/l10n/en.json.js.map +1 -1
  67. package/dist/esm/l10n/nl.json.js +39 -1
  68. package/dist/esm/l10n/nl.json.js.map +1 -1
  69. package/dist/esm/library-style.js +1 -1
  70. package/dist/esm/nextcloud-vue.css +566 -337
  71. package/dist/esm/utils/dialogWidths.js +6 -4
  72. package/dist/esm/utils/dialogWidths.js.map +1 -1
  73. package/dist/esm/utils/flowCondition.js +177 -0
  74. package/dist/esm/utils/flowCondition.js.map +1 -0
  75. package/dist/esm/utils/flowRunStatus.js +64 -1
  76. package/dist/esm/utils/flowRunStatus.js.map +1 -1
  77. package/dist/esm/utils/flowStepList.js +385 -0
  78. package/dist/esm/utils/flowStepList.js.map +1 -0
  79. package/dist/nextcloud-vue.cjs.js +12543 -10668
  80. package/dist/nextcloud-vue.cjs.js.map +2 -2
  81. package/dist/nextcloud-vue.css +566 -337
  82. package/l10n/en.json +40 -1
  83. package/l10n/nl.json +39 -1
  84. package/package.json +1 -1
  85. package/src/components/CnBuildiqEditButton/CnBuildiqEditButton.vue +12 -1
  86. package/src/components/CnCellRenderer/CnCellRenderer.vue +8 -0
  87. package/src/components/CnFlowDetail/CnFlowDetail.vue +110 -12
  88. package/src/components/CnFlowDetail/CnFlowDryRunResult.vue +163 -5
  89. package/src/components/CnFlowDetail/CnFlowStepList.vue +408 -0
  90. package/src/components/CnFlowDetail/CnFlowViewSwitch.vue +117 -0
  91. package/src/components/CnFlowDetail/index.js +2 -0
  92. package/src/components/CnFlowsPage/CnFlowBoard.vue +182 -25
  93. package/src/components/CnFlowsPage/CnFlowEditorPage.vue +101 -3
  94. package/src/components/CnIndexPage/CnIndexPage.vue +29 -0
  95. package/src/components/index.js +1 -1
  96. package/src/composables/indexSources.js +24 -4
  97. package/src/composables/useFlowStore.js +75 -4
  98. package/src/css/index-page.css +4 -0
  99. package/src/dialogs/CnFlowEdgeEditModal.vue +28 -0
  100. package/src/dialogs/CnFlowEditModal.vue +26 -6
  101. package/src/dialogs/CnFlowStepPickerModal.vue +13 -1
  102. package/src/index.js +2 -0
  103. package/src/utils/dialogWidths.js +6 -4
  104. package/src/utils/flowCondition.js +173 -0
  105. package/src/utils/flowRunStatus.js +63 -0
  106. package/src/utils/flowStepList.js +381 -0
@@ -1,3 +1,4 @@
1
+ import { getCurrentUser } from '@nextcloud/auth';
1
2
  import { translate } from '@nextcloud/l10n';
2
3
  import { NcActionButton, NcActions, NcButton, NcCheckboxRadioSwitch, NcNoteCard, NcSelect, NcTextArea, NcTextField } from '@nextcloud/vue';
3
4
  import ArrowLeft from 'vue-material-design-icons/ArrowLeft.vue';
@@ -19,6 +20,7 @@ import __sfc_main$3 from '../CnFlowDetail/CnFlowDryRunResult.vue.js';
19
20
  import __sfc_main$5 from '../CnFlowDetail/CnFlowRunSummary.vue.js';
20
21
  import __sfc_main$6 from '../CnFlowDetail/CnFlowSidebar.vue.js';
21
22
  import __sfc_main$7 from '../CnFlowDetail/CnFlowStepLog.vue.js';
23
+ import __sfc_main$9 from '../CnFlowDetail/CnFlowViewSwitch.vue.js';
22
24
  import __sfc_main$4 from '../CnResourceSelect/CnResourceSelect.vue.js';
23
25
  import { useFlowStore, FLOW_RUN_ACTIVE_STATUSES } from '../../composables/useFlowStore.js';
24
26
  import { formatRelativeDate } from '../../utils/boardDate.js';
@@ -27,7 +29,7 @@ import { flowRunStatuses } from '../../utils/flowRunStatus.js';
27
29
  import { appDisplayNames } from '../../utils/nextcloudApps.js';
28
30
  import { overlayInset } from '../../utils/overlayInset.js';
29
31
  import { normaliseSelectOptions } from '../../utils/selectOptions.js';
30
- import __sfc_main$9 from '../CnStatusBadge/CnStatusBadge.vue.js';
32
+ import __sfc_main$a from '../CnStatusBadge/CnStatusBadge.vue.js';
31
33
 
32
34
  /**
33
35
  * The board-look flow editor and run view. CnFlowEditorPage renders it when
@@ -37,7 +39,7 @@ import __sfc_main$9 from '../CnStatusBadge/CnStatusBadge.vue.js';
37
39
  var script = {
38
40
  name: 'CnFlowBoard',
39
41
 
40
- components: { ArrowLeft, Autorenew, Check, CheckCircleOutline, ChevronDown, Close, DockRight, History, InformationOutline, Play, Replay, NcActionButton, NcActions, CnBuildiqEditButton: __sfc_main, CnDialog: __sfc_main$1, CnFlowDetail: __sfc_main$2, CnFlowDryRunResult: __sfc_main$3, CnResourceSelect: __sfc_main$4, CnFlowRunSummary: __sfc_main$5, CnFlowSidebar: __sfc_main$6, CnFlowStepLog: __sfc_main$7, CnFlowStepPickerModal: __sfc_main$8, CnStatusBadge: __sfc_main$9, NcButton, NcCheckboxRadioSwitch, NcNoteCard, NcSelect, NcTextArea, NcTextField },
42
+ components: { ArrowLeft, Autorenew, Check, CheckCircleOutline, ChevronDown, Close, DockRight, History, InformationOutline, Play, Replay, NcActionButton, NcActions, CnBuildiqEditButton: __sfc_main, CnDialog: __sfc_main$1, CnFlowDetail: __sfc_main$2, CnFlowDryRunResult: __sfc_main$3, CnResourceSelect: __sfc_main$4, CnFlowRunSummary: __sfc_main$5, CnFlowSidebar: __sfc_main$6, CnFlowStepLog: __sfc_main$7, CnFlowStepPickerModal: __sfc_main$8, CnFlowViewSwitch: __sfc_main$9, CnStatusBadge: __sfc_main$a, NcButton, NcCheckboxRadioSwitch, NcNoteCard, NcSelect, NcTextArea, NcTextField },
41
43
 
42
44
  props: {
43
45
  /** The flow uuid, or `new`. */
@@ -75,6 +77,26 @@ var script = {
75
77
  flowDirection: { type: String, default: 'right' },
76
78
  /** An info notice under the path. */
77
79
  notice: { type: String, default: '' },
80
+ /** The look of `notice`: `info`, `warning` or `error`. */
81
+ noticeLevel: { type: String, default: 'info' },
82
+ /**
83
+ * Steps only an admin may change, by node id or step type. Anyone else
84
+ * reads them: the list view offers no buttons on them and the step
85
+ * panel says why. This is the screen's side; the server decides.
86
+ */
87
+ adminSteps: { type: Array, default: () => [] },
88
+ /** Write a line's condition on the line when it has no name of its own. */
89
+ edgeConditions: { type: Boolean, default: false },
90
+ /** Offer the list view beside the canvas, with the Canvas / List switch. */
91
+ listMode: { type: Boolean, default: false },
92
+ /** The view on arrival when `listMode` is on: `canvas` or `list`. */
93
+ view: { type: String, default: 'canvas' },
94
+ /**
95
+ * Test the flow on an example payload (OrFlowTestrun): `true` opens an
96
+ * empty field, text opens it with that JSON. The result shows as the
97
+ * test run card. Without it only `testSubject` offers a test.
98
+ */
99
+ testPayload: { type: [Boolean, String], default: false },
78
100
  /**
79
101
  * Edit a published flow in place; Save publishes the edits as the next
80
102
  * version, and runs already started keep theirs (DqFlow).
@@ -130,7 +152,7 @@ var script = {
130
152
  },
131
153
 
132
154
  data() {
133
- return { nameDraft: null, legendTitleId: `cn-flow-board-legend-${Math.random().toString(36).slice(2)}`, panelOpen: false, runPanelClosed: false, runTab: 'step', testOpen: false, testRecord: null, appNames: {}, showRuns: false, stepPickerOpen: false, drafts: {}, loadedOptions: {}, toggleLabelId: `cn-flow-board-toggle-${Math.random().toString(36).slice(2)}` }
155
+ return { payloadText: typeof this.testPayload === 'string' ? this.testPayload : '', activeView: this.listMode && this.view === 'list' ? 'list' : 'canvas', nameDraft: null, legendTitleId: `cn-flow-board-legend-${Math.random().toString(36).slice(2)}`, panelOpen: false, runPanelClosed: false, runTab: 'step', testOpen: false, testRecord: null, appNames: {}, showRuns: false, stepPickerOpen: false, drafts: {}, loadedOptions: {}, toggleLabelId: `cn-flow-board-toggle-${Math.random().toString(36).slice(2)}` }
134
156
  },
135
157
 
136
158
  computed: {
@@ -197,14 +219,77 @@ var script = {
197
219
  return Boolean(this.testSubject && this.testSubject.register && this.testSubject.schema)
198
220
  },
199
221
 
222
+ /** @return {boolean} Whether the page tests on an example payload. */
223
+ payloadTest() {
224
+ return this.testPayload !== false
225
+ },
226
+
227
+ /** @return {boolean} Whether the test button is drawn. */
228
+ testReady() {
229
+ return this.testSubjectReady || this.payloadTest
230
+ },
231
+
232
+ /** @return {object|null} The example payload as data, null when the field holds no JSON object. */
233
+ payloadValue() {
234
+ try {
235
+ const value = JSON.parse(this.payloadText);
236
+ return value !== null && typeof value === 'object' && !Array.isArray(value) ? value : null
237
+ } catch {
238
+ return null
239
+ }
240
+ },
241
+
242
+ /** @return {boolean} Whether the field holds text that is no JSON object. */
243
+ payloadInvalid() {
244
+ return this.payloadText.trim() !== '' && this.payloadValue === null
245
+ },
246
+
247
+ /** @return {boolean} Whether the dialog has something to try the flow on. */
248
+ testCanRun() {
249
+ return Boolean(this.testRecord) || this.payloadValue !== null
250
+ },
251
+
252
+ /** @return {string} The line at the top of the test dialog. */
253
+ testIntro() {
254
+ return this.testSubjectReady
255
+ ? translate('nextcloud-vue', 'The saved flow is tried with the record you pick. Nothing is changed or sent.')
256
+ : translate('nextcloud-vue', 'The saved flow is tried with the example you enter. Nothing is changed or sent.')
257
+ },
258
+
200
259
  /** @return {string} The test button's label: the page's own, else the library's. */
201
260
  testLabel() {
202
- return (this.testSubject && this.testSubject.label) || translate('nextcloud-vue', 'Test with a record')
261
+ const fallback = this.testSubjectReady ? translate('nextcloud-vue', 'Test with a record') : translate('nextcloud-vue', 'Test');
262
+
263
+ return (this.testSubject && this.testSubject.label) || fallback
203
264
  },
204
265
 
205
266
  /** @return {boolean} Whether the palette card is drawn. */
206
267
  showPalette() {
207
- return this.palette === 'column' && !this.store.inRunView
268
+ return this.palette === 'column' && !this.store.inRunView && !this.inList
269
+ },
270
+
271
+ /** @return {Array<string>} The ids of the steps this viewer can only read. */
272
+ readonlyStepIds() {
273
+ if (this.adminSteps.length === 0 || getCurrentUser()?.isAdmin === true) {
274
+ return []
275
+ }
276
+
277
+ return this.store.nodes.filter((node) => this.adminSteps.includes(node.id) || this.adminSteps.includes(node.type)).map((node) => node.id)
278
+ },
279
+
280
+ /** @return {boolean} Whether the selected step is one this viewer can only read. */
281
+ selectedAdminStep() {
282
+ return this.readonlyStepIds.includes(this.store.selectedNodeId)
283
+ },
284
+
285
+ /** @return {boolean} Whether the selected step cannot be changed here. */
286
+ stepLocked() {
287
+ return this.store.graphLocked || this.selectedAdminStep
288
+ },
289
+
290
+ /** @return {boolean} Whether the list view is on screen. */
291
+ inList() {
292
+ return this.activeView === 'list'
208
293
  },
209
294
 
210
295
  /** @return {string} The page title. */
@@ -881,15 +966,38 @@ var script = {
881
966
  * @spec openspec/changes/flow-test-with-a-record/specs/flow-test-with-a-record/spec.md#requirement-testing-a-flow-with-a-record-changes-nothing
882
967
  */
883
968
  async runTest() {
884
- const uuid = Array.isArray(this.testRecord) ? this.testRecord[0] : this.testRecord;
885
- if (!uuid) {
969
+ const subject = this.testRunSubject();
970
+ if (subject === null) {
886
971
  return
887
972
  }
888
- await this.store.dryRun({ uuid, register: this.testSubject.register, schema: this.testSubject.schema });
973
+ await this.store.dryRun(subject);
889
974
  this.testOpen = false;
890
975
  this.testRecord = null;
891
976
  },
892
977
 
978
+ /**
979
+ * What the dialog tries the flow on: the picked record, else the payload.
980
+ *
981
+ * @return {object|null} The subject for `store.dryRun`, or null.
982
+ */
983
+ testRunSubject() {
984
+ const uuid = Array.isArray(this.testRecord) ? this.testRecord[0] : this.testRecord;
985
+ if (uuid) {
986
+ return { uuid, register: this.testSubject.register, schema: this.testSubject.schema }
987
+ }
988
+
989
+ return this.payloadValue === null ? null : { payload: this.payloadValue }
990
+ },
991
+
992
+ /**
993
+ * Try the flow again on what the last test used.
994
+ *
995
+ * @return {Promise<void>}
996
+ */
997
+ async testAgain() {
998
+ await this.store.dryRun(this.store.dryRunResult.subject);
999
+ },
1000
+
893
1001
  t: translate,
894
1002
 
895
1003
  /**