@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.
- package/dist/esm/components/CnBuildiqEditButton/CnBuildiqEditButton.vue.js +1 -1
- package/dist/esm/components/CnBuildiqEditButton/CnBuildiqEditButton.vue2.js +12 -1
- package/dist/esm/components/CnBuildiqEditButton/CnBuildiqEditButton.vue2.js.map +1 -1
- package/dist/esm/components/CnBuildiqEditButton/CnBuildiqEditButton.vue3.js.map +1 -1
- package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue.js +1 -1
- package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue2.js +10 -8
- package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue2.js.map +1 -1
- package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue3.js +95 -88
- package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue3.js.map +1 -1
- package/dist/esm/components/CnFlowDetail/CnFlowDetail.vue.js +1 -1
- package/dist/esm/components/CnFlowDetail/CnFlowDetail.vue2.js +86 -8
- package/dist/esm/components/CnFlowDetail/CnFlowDetail.vue2.js.map +1 -1
- package/dist/esm/components/CnFlowDetail/CnFlowDetail.vue3.js +137 -121
- package/dist/esm/components/CnFlowDetail/CnFlowDetail.vue3.js.map +1 -1
- package/dist/esm/components/CnFlowDetail/CnFlowDryRunResult.vue.js +1 -1
- package/dist/esm/components/CnFlowDetail/CnFlowDryRunResult.vue2.js +56 -4
- package/dist/esm/components/CnFlowDetail/CnFlowDryRunResult.vue2.js.map +1 -1
- package/dist/esm/components/CnFlowDetail/CnFlowDryRunResult.vue3.js +166 -70
- package/dist/esm/components/CnFlowDetail/CnFlowDryRunResult.vue3.js.map +1 -1
- package/dist/esm/components/CnFlowDetail/CnFlowStepList.vue.js +9 -0
- package/dist/esm/components/CnFlowDetail/CnFlowStepList.vue.js.map +1 -0
- package/dist/esm/components/CnFlowDetail/CnFlowStepList.vue2.js +123 -0
- package/dist/esm/components/CnFlowDetail/CnFlowStepList.vue2.js.map +1 -0
- package/dist/esm/components/CnFlowDetail/CnFlowStepList.vue3.js +268 -0
- package/dist/esm/components/CnFlowDetail/CnFlowStepList.vue3.js.map +1 -0
- package/dist/esm/components/CnFlowDetail/CnFlowViewSwitch.vue.js +9 -0
- package/dist/esm/components/CnFlowDetail/CnFlowViewSwitch.vue.js.map +1 -0
- package/dist/esm/components/CnFlowDetail/CnFlowViewSwitch.vue2.js +49 -0
- package/dist/esm/components/CnFlowDetail/CnFlowViewSwitch.vue2.js.map +1 -0
- package/dist/esm/components/CnFlowDetail/CnFlowViewSwitch.vue3.js +41 -0
- package/dist/esm/components/CnFlowDetail/CnFlowViewSwitch.vue3.js.map +1 -0
- package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue.js +1 -1
- package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue2.js +116 -8
- package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue2.js.map +1 -1
- package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue3.js +110 -58
- package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue3.js.map +1 -1
- package/dist/esm/components/CnFlowsPage/CnFlowEditorPage.vue2.js +78 -1
- package/dist/esm/components/CnFlowsPage/CnFlowEditorPage.vue2.js.map +1 -1
- package/dist/esm/components/CnFlowsPage/CnFlowEditorPage.vue3.js +44 -3
- package/dist/esm/components/CnFlowsPage/CnFlowEditorPage.vue3.js.map +1 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js +90 -75
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js.map +1 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js +46 -22
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js.map +1 -1
- package/dist/esm/composables/indexSources.js +24 -4
- package/dist/esm/composables/indexSources.js.map +1 -1
- package/dist/esm/composables/useFlowStore.js +75 -4
- package/dist/esm/composables/useFlowStore.js.map +1 -1
- package/dist/esm/dialogs/CnFlowEdgeEditModal.vue.js +1 -1
- package/dist/esm/dialogs/CnFlowEdgeEditModal.vue2.js +17 -0
- package/dist/esm/dialogs/CnFlowEdgeEditModal.vue2.js.map +1 -1
- package/dist/esm/dialogs/CnFlowEdgeEditModal.vue3.js +9 -1
- package/dist/esm/dialogs/CnFlowEdgeEditModal.vue3.js.map +1 -1
- package/dist/esm/dialogs/CnFlowEditModal.vue.js +1 -1
- package/dist/esm/dialogs/CnFlowEditModal.vue2.js +15 -0
- package/dist/esm/dialogs/CnFlowEditModal.vue2.js.map +1 -1
- package/dist/esm/dialogs/CnFlowEditModal.vue3.js +13 -3
- package/dist/esm/dialogs/CnFlowEditModal.vue3.js.map +1 -1
- package/dist/esm/dialogs/CnFlowStepPickerModal.vue.js +1 -1
- package/dist/esm/dialogs/CnFlowStepPickerModal.vue2.js +13 -1
- package/dist/esm/dialogs/CnFlowStepPickerModal.vue2.js.map +1 -1
- package/dist/esm/dialogs/CnFlowStepPickerModal.vue3.js.map +1 -1
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/l10n/en.json.js +40 -1
- package/dist/esm/l10n/en.json.js.map +1 -1
- package/dist/esm/l10n/nl.json.js +39 -1
- package/dist/esm/l10n/nl.json.js.map +1 -1
- package/dist/esm/library-style.js +1 -1
- package/dist/esm/nextcloud-vue.css +566 -337
- package/dist/esm/utils/dialogWidths.js +6 -4
- package/dist/esm/utils/dialogWidths.js.map +1 -1
- package/dist/esm/utils/flowCondition.js +177 -0
- package/dist/esm/utils/flowCondition.js.map +1 -0
- package/dist/esm/utils/flowRunStatus.js +64 -1
- package/dist/esm/utils/flowRunStatus.js.map +1 -1
- package/dist/esm/utils/flowStepList.js +385 -0
- package/dist/esm/utils/flowStepList.js.map +1 -0
- package/dist/nextcloud-vue.cjs.js +12543 -10668
- package/dist/nextcloud-vue.cjs.js.map +2 -2
- package/dist/nextcloud-vue.css +566 -337
- package/l10n/en.json +40 -1
- package/l10n/nl.json +39 -1
- package/package.json +1 -1
- package/src/components/CnBuildiqEditButton/CnBuildiqEditButton.vue +12 -1
- package/src/components/CnCellRenderer/CnCellRenderer.vue +8 -0
- package/src/components/CnFlowDetail/CnFlowDetail.vue +110 -12
- package/src/components/CnFlowDetail/CnFlowDryRunResult.vue +163 -5
- package/src/components/CnFlowDetail/CnFlowStepList.vue +408 -0
- package/src/components/CnFlowDetail/CnFlowViewSwitch.vue +117 -0
- package/src/components/CnFlowDetail/index.js +2 -0
- package/src/components/CnFlowsPage/CnFlowBoard.vue +182 -25
- package/src/components/CnFlowsPage/CnFlowEditorPage.vue +101 -3
- package/src/components/CnIndexPage/CnIndexPage.vue +29 -0
- package/src/components/index.js +1 -1
- package/src/composables/indexSources.js +24 -4
- package/src/composables/useFlowStore.js +75 -4
- package/src/css/index-page.css +4 -0
- package/src/dialogs/CnFlowEdgeEditModal.vue +28 -0
- package/src/dialogs/CnFlowEditModal.vue +26 -6
- package/src/dialogs/CnFlowStepPickerModal.vue +13 -1
- package/src/index.js +2 -0
- package/src/utils/dialogWidths.js +6 -4
- package/src/utils/flowCondition.js +173 -0
- package/src/utils/flowRunStatus.js +63 -0
- package/src/utils/flowStepList.js +381 -0
|
@@ -0,0 +1,408 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
CnFlowStepList — a flow as a list: the trigger, then the steps in run order.
|
|
3
|
+
|
|
4
|
+
The list view of the same flow the canvas draws (board OrFlowStappenlijst).
|
|
5
|
+
It keeps no state of its own: the rows are read from the flow store and every
|
|
6
|
+
button goes through a store action, so both views always show one document
|
|
7
|
+
and Ctrl+Z undoes a change made here as well.
|
|
8
|
+
|
|
9
|
+
SPDX-FileCopyrightText: 2026 Conduction B.V. <info@conduction.nl>
|
|
10
|
+
SPDX-License-Identifier: EUPL-1.2
|
|
11
|
+
-->
|
|
12
|
+
<template>
|
|
13
|
+
<div class="cn-flow-step-list" data-testid="flow-step-list">
|
|
14
|
+
<section :aria-labelledby="`${uid}-when`" class="cn-flow-step-list__section">
|
|
15
|
+
<h2 :id="`${uid}-when`" class="cn-flow-step-list__title">
|
|
16
|
+
{{ t('nextcloud-vue', 'When') }}
|
|
17
|
+
</h2>
|
|
18
|
+
<div v-for="row in list.triggers"
|
|
19
|
+
:key="row.id"
|
|
20
|
+
class="cn-flow-step-list__row"
|
|
21
|
+
:class="{ 'cn-flow-step-list__row--selected': isSelected(row) }"
|
|
22
|
+
data-testid="flow-step-trigger">
|
|
23
|
+
<span class="cn-flow-step-list__badge cn-flow-step-list__badge--trigger" aria-hidden="true">
|
|
24
|
+
<LightningBolt :size="16" />
|
|
25
|
+
</span>
|
|
26
|
+
<div class="cn-flow-step-list__body">
|
|
27
|
+
<span class="cn-flow-step-list__head">
|
|
28
|
+
<strong>{{ titleOf(row.node) }}</strong>
|
|
29
|
+
<CnStatusBadge :label="kindOf(row.node)" variant="success" size="small" />
|
|
30
|
+
</span>
|
|
31
|
+
</div>
|
|
32
|
+
<CnStatusBadge v-if="stateOf(row)" :label="stateOf(row).label" :variant="stateOf(row).variant" />
|
|
33
|
+
<NcButton v-if="editable"
|
|
34
|
+
:aria-label="t('nextcloud-vue', 'Change trigger')"
|
|
35
|
+
:title="t('nextcloud-vue', 'Change trigger')"
|
|
36
|
+
data-testid="flow-step-edit"
|
|
37
|
+
@click="$emit('edit', row.id)">
|
|
38
|
+
<template #icon>
|
|
39
|
+
<Pencil :size="18" />
|
|
40
|
+
</template>
|
|
41
|
+
</NcButton>
|
|
42
|
+
</div>
|
|
43
|
+
<p v-if="list.triggers.length === 0" class="cn-flow-step-list__empty" data-testid="flow-step-no-trigger">
|
|
44
|
+
{{ t('nextcloud-vue', 'This flow has no trigger yet.') }}
|
|
45
|
+
</p>
|
|
46
|
+
</section>
|
|
47
|
+
|
|
48
|
+
<section :aria-labelledby="`${uid}-then`" class="cn-flow-step-list__section">
|
|
49
|
+
<h2 :id="`${uid}-then`" class="cn-flow-step-list__title">
|
|
50
|
+
{{ t('nextcloud-vue', 'Then, in this order') }}
|
|
51
|
+
</h2>
|
|
52
|
+
<ol class="cn-flow-step-list__steps">
|
|
53
|
+
<li v-for="row in list.steps"
|
|
54
|
+
:key="row.id"
|
|
55
|
+
class="cn-flow-step-list__row"
|
|
56
|
+
:class="{ 'cn-flow-step-list__row--selected': isSelected(row), 'cn-flow-step-list__row--end': row.role === 'end' }"
|
|
57
|
+
data-testid="flow-step-row">
|
|
58
|
+
<span class="cn-flow-step-list__badge" aria-hidden="true">{{ row.n }}</span>
|
|
59
|
+
<div class="cn-flow-step-list__body">
|
|
60
|
+
<span v-if="row.when" class="cn-flow-step-list__when" data-testid="flow-step-when">
|
|
61
|
+
<CallSplit :size="14" />
|
|
62
|
+
{{ row.when }}
|
|
63
|
+
</span>
|
|
64
|
+
<span class="cn-flow-step-list__head">
|
|
65
|
+
<strong>{{ titleOf(row.node) }}</strong>
|
|
66
|
+
<CnStatusBadge :label="kindOf(row.node)" size="small" />
|
|
67
|
+
<CnStatusBadge v-if="row.loose"
|
|
68
|
+
:label="t('nextcloud-vue', 'Not connected')"
|
|
69
|
+
variant="warning"
|
|
70
|
+
size="small"
|
|
71
|
+
data-testid="flow-step-loose" />
|
|
72
|
+
</span>
|
|
73
|
+
<span v-if="row.routes.length > 0" class="cn-flow-step-list__routes" data-testid="flow-step-routes">
|
|
74
|
+
{{ t('nextcloud-vue', 'Routes:') }}
|
|
75
|
+
<span v-for="route in row.routes" :key="route.id" class="cn-flow-step-list__route">
|
|
76
|
+
{{ route.label }}
|
|
77
|
+
<ArrowRight :size="14" />
|
|
78
|
+
{{ route.to }}
|
|
79
|
+
</span>
|
|
80
|
+
</span>
|
|
81
|
+
</div>
|
|
82
|
+
<CnStatusBadge v-if="stateOf(row)" :label="stateOf(row).label" :variant="stateOf(row).variant" />
|
|
83
|
+
<CnStatusBadge v-if="isReadonly(row)"
|
|
84
|
+
:label="t('nextcloud-vue', 'Admins only')"
|
|
85
|
+
variant="warning"
|
|
86
|
+
data-testid="flow-step-admin" />
|
|
87
|
+
<span v-if="editable && !isReadonly(row)"
|
|
88
|
+
role="group"
|
|
89
|
+
class="cn-flow-step-list__actions"
|
|
90
|
+
:aria-label="t('nextcloud-vue', 'Actions for step {n}', { n: row.n })">
|
|
91
|
+
<NcButton variant="tertiary"
|
|
92
|
+
:aria-label="t('nextcloud-vue', 'Up')"
|
|
93
|
+
:title="moveTitle(row.canMoveUp, t('nextcloud-vue', 'Up'))"
|
|
94
|
+
:disabled="!row.canMoveUp"
|
|
95
|
+
data-testid="flow-step-up"
|
|
96
|
+
@click="store.moveStep({ id: row.id, by: -1 })">
|
|
97
|
+
<template #icon>
|
|
98
|
+
<ChevronUp :size="18" />
|
|
99
|
+
</template>
|
|
100
|
+
</NcButton>
|
|
101
|
+
<NcButton variant="tertiary"
|
|
102
|
+
:aria-label="t('nextcloud-vue', 'Down')"
|
|
103
|
+
:title="moveTitle(row.canMoveDown, t('nextcloud-vue', 'Down'))"
|
|
104
|
+
:disabled="!row.canMoveDown"
|
|
105
|
+
data-testid="flow-step-down"
|
|
106
|
+
@click="store.moveStep({ id: row.id, by: 1 })">
|
|
107
|
+
<template #icon>
|
|
108
|
+
<ChevronDown :size="18" />
|
|
109
|
+
</template>
|
|
110
|
+
</NcButton>
|
|
111
|
+
<NcButton variant="tertiary"
|
|
112
|
+
:aria-label="t('nextcloud-vue', 'Edit')"
|
|
113
|
+
:title="t('nextcloud-vue', 'Edit')"
|
|
114
|
+
:aria-pressed="isSelected(row) ? 'true' : 'false'"
|
|
115
|
+
data-testid="flow-step-edit"
|
|
116
|
+
@click="$emit('edit', row.id)">
|
|
117
|
+
<template #icon>
|
|
118
|
+
<Pencil :size="18" />
|
|
119
|
+
</template>
|
|
120
|
+
</NcButton>
|
|
121
|
+
<NcButton variant="tertiary"
|
|
122
|
+
:aria-label="t('nextcloud-vue', 'Delete')"
|
|
123
|
+
:title="t('nextcloud-vue', 'Delete')"
|
|
124
|
+
data-testid="flow-step-delete"
|
|
125
|
+
@click="store.removeStep(row.id)">
|
|
126
|
+
<template #icon>
|
|
127
|
+
<Delete :size="18" />
|
|
128
|
+
</template>
|
|
129
|
+
</NcButton>
|
|
130
|
+
</span>
|
|
131
|
+
</li>
|
|
132
|
+
</ol>
|
|
133
|
+
<div v-if="editable" class="cn-flow-step-list__add">
|
|
134
|
+
<NcButton data-testid="flow-step-add" @click="$emit('add')">
|
|
135
|
+
<template #icon>
|
|
136
|
+
<Plus :size="18" />
|
|
137
|
+
</template>
|
|
138
|
+
{{ t('nextcloud-vue', 'Add step') }}
|
|
139
|
+
</NcButton>
|
|
140
|
+
<span class="cn-flow-step-list__note">{{ t('nextcloud-vue', 'A new step goes at the bottom; use the arrows to put it in place.') }}</span>
|
|
141
|
+
</div>
|
|
142
|
+
</section>
|
|
143
|
+
</div>
|
|
144
|
+
</template>
|
|
145
|
+
|
|
146
|
+
<script>
|
|
147
|
+
import { translate as t } from '@nextcloud/l10n'
|
|
148
|
+
import { NcButton } from '@nextcloud/vue'
|
|
149
|
+
import ArrowRight from 'vue-material-design-icons/ArrowRight.vue'
|
|
150
|
+
import CallSplit from 'vue-material-design-icons/CallSplit.vue'
|
|
151
|
+
import ChevronDown from 'vue-material-design-icons/ChevronDown.vue'
|
|
152
|
+
import ChevronUp from 'vue-material-design-icons/ChevronUp.vue'
|
|
153
|
+
import Delete from 'vue-material-design-icons/Delete.vue'
|
|
154
|
+
import LightningBolt from 'vue-material-design-icons/LightningBolt.vue'
|
|
155
|
+
import Pencil from 'vue-material-design-icons/Pencil.vue'
|
|
156
|
+
import Plus from 'vue-material-design-icons/Plus.vue'
|
|
157
|
+
import { useFlowStore } from '../../composables/useFlowStore.js'
|
|
158
|
+
import { flowStepRows } from '../../utils/flowStepList.js'
|
|
159
|
+
import { CnStatusBadge } from '../CnStatusBadge/index.js'
|
|
160
|
+
|
|
161
|
+
let uidCounter = 0
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* The list view of a flow. CnFlowDetail renders it in place of the canvas when
|
|
165
|
+
* its `view` is `list`, so the toolbar, messages and dialogs stay the same.
|
|
166
|
+
*/
|
|
167
|
+
export default {
|
|
168
|
+
name: 'CnFlowStepList',
|
|
169
|
+
|
|
170
|
+
components: { ArrowRight, CallSplit, ChevronDown, ChevronUp, CnStatusBadge, Delete, LightningBolt, NcButton, Pencil, Plus },
|
|
171
|
+
|
|
172
|
+
props: {
|
|
173
|
+
/**
|
|
174
|
+
* A step's outcome in the open run, `(id) => { label, variant } | null`.
|
|
175
|
+
*/
|
|
176
|
+
stepState: {
|
|
177
|
+
type: Function,
|
|
178
|
+
default: () => null,
|
|
179
|
+
},
|
|
180
|
+
|
|
181
|
+
/** The ids of the steps the viewer can only read. */
|
|
182
|
+
readonlySteps: {
|
|
183
|
+
type: Array,
|
|
184
|
+
default: () => [],
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
|
|
188
|
+
emits: ['add', 'edit'],
|
|
189
|
+
|
|
190
|
+
setup() {
|
|
191
|
+
return { store: useFlowStore() }
|
|
192
|
+
},
|
|
193
|
+
|
|
194
|
+
data() {
|
|
195
|
+
uidCounter += 1
|
|
196
|
+
|
|
197
|
+
return { uid: `cn-flow-step-list-${uidCounter}` }
|
|
198
|
+
},
|
|
199
|
+
|
|
200
|
+
computed: {
|
|
201
|
+
/** @return {{triggers: Array<object>, steps: Array<object>}} The rows. */
|
|
202
|
+
list() {
|
|
203
|
+
return flowStepRows(this.store.stepGraph, this.titleOf)
|
|
204
|
+
},
|
|
205
|
+
|
|
206
|
+
/** @return {boolean} Whether the flow can be changed from here. */
|
|
207
|
+
editable() {
|
|
208
|
+
return !this.store.graphLocked && !this.store.inRunView
|
|
209
|
+
},
|
|
210
|
+
},
|
|
211
|
+
|
|
212
|
+
methods: {
|
|
213
|
+
t,
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* @param {object} node A flow node.
|
|
217
|
+
* @return {string} The name it goes by.
|
|
218
|
+
*/
|
|
219
|
+
titleOf(node) {
|
|
220
|
+
return node.name || node.label || this.kindOf(node)
|
|
221
|
+
},
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* @param {object} node A flow node.
|
|
225
|
+
* @return {string} What kind of step it is, from the catalogue.
|
|
226
|
+
*/
|
|
227
|
+
kindOf(node) {
|
|
228
|
+
const entry = this.store.catalogEntry(node.type)
|
|
229
|
+
|
|
230
|
+
return entry?.displayName || node.type || node.id
|
|
231
|
+
},
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* @param {object} row A list row.
|
|
235
|
+
* @return {boolean} Whether it is the selected step.
|
|
236
|
+
*/
|
|
237
|
+
isSelected(row) {
|
|
238
|
+
return this.store.selectedNodeId === row.id
|
|
239
|
+
},
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* @param {object} row A list row.
|
|
243
|
+
* @return {boolean} Whether the viewer can only read this step.
|
|
244
|
+
*/
|
|
245
|
+
isReadonly(row) {
|
|
246
|
+
return this.readonlySteps.includes(row.id)
|
|
247
|
+
},
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* @param {object} row A list row.
|
|
251
|
+
* @return {{label: string, variant: string}|null} Its outcome in the open run.
|
|
252
|
+
*/
|
|
253
|
+
stateOf(row) {
|
|
254
|
+
return this.stepState(row.id)
|
|
255
|
+
},
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* @param {boolean} possible Whether the move can be made.
|
|
259
|
+
* @param {string} label The arrow's name.
|
|
260
|
+
* @return {string} The arrow's tooltip.
|
|
261
|
+
*/
|
|
262
|
+
moveTitle(possible, label) {
|
|
263
|
+
return possible ? label : t('nextcloud-vue', 'Steps on a branch are moved on the canvas.')
|
|
264
|
+
},
|
|
265
|
+
},
|
|
266
|
+
}
|
|
267
|
+
</script>
|
|
268
|
+
|
|
269
|
+
<style scoped>
|
|
270
|
+
.cn-flow-step-list {
|
|
271
|
+
display: flex;
|
|
272
|
+
flex-direction: column;
|
|
273
|
+
flex: 1 1 auto;
|
|
274
|
+
gap: 14px;
|
|
275
|
+
box-sizing: border-box;
|
|
276
|
+
min-block-size: 0;
|
|
277
|
+
padding: 12px;
|
|
278
|
+
overflow-y: auto;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.cn-flow-step-list__section {
|
|
282
|
+
display: flex;
|
|
283
|
+
flex-direction: column;
|
|
284
|
+
gap: 8px;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.cn-flow-step-list__title {
|
|
288
|
+
margin: 0;
|
|
289
|
+
color: var(--color-text-maxcontrast);
|
|
290
|
+
font-size: 12px;
|
|
291
|
+
font-weight: 700;
|
|
292
|
+
letter-spacing: 0.06em;
|
|
293
|
+
text-transform: uppercase;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
.cn-flow-step-list__steps {
|
|
297
|
+
display: flex;
|
|
298
|
+
flex-direction: column;
|
|
299
|
+
gap: 8px;
|
|
300
|
+
margin: 0;
|
|
301
|
+
padding: 0;
|
|
302
|
+
list-style: none;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.cn-flow-step-list__row {
|
|
306
|
+
display: flex;
|
|
307
|
+
align-items: center;
|
|
308
|
+
gap: 14px;
|
|
309
|
+
padding: 12px 14px;
|
|
310
|
+
border: 1px solid var(--color-border);
|
|
311
|
+
border-radius: 10px;
|
|
312
|
+
background: var(--color-main-background);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
.cn-flow-step-list__row--selected {
|
|
316
|
+
border-color: var(--color-primary-element);
|
|
317
|
+
box-shadow: 0 0 0 2px var(--color-primary-element);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
.cn-flow-step-list__row--end {
|
|
321
|
+
background: var(--color-background-hover);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.cn-flow-step-list__badge {
|
|
325
|
+
display: inline-flex;
|
|
326
|
+
flex: none;
|
|
327
|
+
align-items: center;
|
|
328
|
+
justify-content: center;
|
|
329
|
+
inline-size: 34px;
|
|
330
|
+
block-size: 34px;
|
|
331
|
+
border-radius: 50%;
|
|
332
|
+
background: var(--color-primary-element-light);
|
|
333
|
+
color: var(--color-primary-element-light-text);
|
|
334
|
+
font-weight: 700;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
.cn-flow-step-list__badge--trigger {
|
|
338
|
+
background: var(--color-success);
|
|
339
|
+
color: var(--color-success-text-on-success, var(--color-primary-element-text));
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
.cn-flow-step-list__body {
|
|
343
|
+
display: flex;
|
|
344
|
+
flex: 1 1 auto;
|
|
345
|
+
flex-direction: column;
|
|
346
|
+
gap: 5px;
|
|
347
|
+
min-inline-size: 0;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
.cn-flow-step-list__head {
|
|
351
|
+
display: flex;
|
|
352
|
+
flex-wrap: wrap;
|
|
353
|
+
align-items: center;
|
|
354
|
+
gap: 8px;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
.cn-flow-step-list__when {
|
|
358
|
+
display: inline-flex;
|
|
359
|
+
align-items: center;
|
|
360
|
+
align-self: flex-start;
|
|
361
|
+
gap: 6px;
|
|
362
|
+
padding: 2px 10px 2px 8px;
|
|
363
|
+
border: 1px dashed currentcolor;
|
|
364
|
+
border-radius: 10px;
|
|
365
|
+
color: var(--color-text-maxcontrast);
|
|
366
|
+
font-size: 12px;
|
|
367
|
+
font-weight: 600;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
.cn-flow-step-list__routes {
|
|
371
|
+
display: flex;
|
|
372
|
+
flex-wrap: wrap;
|
|
373
|
+
align-items: center;
|
|
374
|
+
gap: 6px;
|
|
375
|
+
font-size: 13px;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
.cn-flow-step-list__route {
|
|
379
|
+
display: inline-flex;
|
|
380
|
+
align-items: center;
|
|
381
|
+
gap: 4px;
|
|
382
|
+
padding: 1px 8px;
|
|
383
|
+
border-radius: 10px;
|
|
384
|
+
background: var(--color-background-dark);
|
|
385
|
+
font-weight: 600;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
.cn-flow-step-list__actions {
|
|
389
|
+
display: inline-flex;
|
|
390
|
+
flex: none;
|
|
391
|
+
gap: 4px;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
.cn-flow-step-list__add {
|
|
395
|
+
display: flex;
|
|
396
|
+
flex-wrap: wrap;
|
|
397
|
+
align-items: center;
|
|
398
|
+
gap: 12px;
|
|
399
|
+
padding-block-start: 4px;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
.cn-flow-step-list__note,
|
|
403
|
+
.cn-flow-step-list__empty {
|
|
404
|
+
margin: 0;
|
|
405
|
+
color: var(--color-text-maxcontrast);
|
|
406
|
+
font-size: 13px;
|
|
407
|
+
}
|
|
408
|
+
</style>
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
CnFlowViewSwitch — Canvas or List: the two views of one flow.
|
|
3
|
+
|
|
4
|
+
SPDX-FileCopyrightText: 2026 Conduction B.V. <info@conduction.nl>
|
|
5
|
+
SPDX-License-Identifier: EUPL-1.2
|
|
6
|
+
-->
|
|
7
|
+
<template>
|
|
8
|
+
<div class="cn-flow-view-switch">
|
|
9
|
+
<div class="cn-flow-view-switch__group"
|
|
10
|
+
role="group"
|
|
11
|
+
:aria-label="t('nextcloud-vue', 'View of the flow')"
|
|
12
|
+
data-testid="flow-view-switch">
|
|
13
|
+
<button v-for="view in views"
|
|
14
|
+
:key="view.id"
|
|
15
|
+
type="button"
|
|
16
|
+
class="cn-flow-view-switch__option"
|
|
17
|
+
:class="{ 'cn-flow-view-switch__option--active': view.id === modelValue }"
|
|
18
|
+
:aria-pressed="view.id === modelValue ? 'true' : 'false'"
|
|
19
|
+
:data-testid="`flow-view-${view.id}`"
|
|
20
|
+
@click="$emit('update:modelValue', view.id)">
|
|
21
|
+
<component :is="view.icon" :size="16" />
|
|
22
|
+
{{ view.label }}
|
|
23
|
+
</button>
|
|
24
|
+
</div>
|
|
25
|
+
<span v-if="note" class="cn-flow-view-switch__note" data-testid="flow-view-note">{{ noteText }}</span>
|
|
26
|
+
</div>
|
|
27
|
+
</template>
|
|
28
|
+
|
|
29
|
+
<script>
|
|
30
|
+
import { translate as t } from '@nextcloud/l10n'
|
|
31
|
+
import FormatListBulleted from 'vue-material-design-icons/FormatListBulleted.vue'
|
|
32
|
+
import VectorPolyline from 'vue-material-design-icons/VectorPolyline.vue'
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Switches a flow editor between its canvas and its list. Both edit the same
|
|
36
|
+
* flow, so the switch only says which one is on screen (board OrFlowKop).
|
|
37
|
+
*/
|
|
38
|
+
export default {
|
|
39
|
+
name: 'CnFlowViewSwitch',
|
|
40
|
+
|
|
41
|
+
props: {
|
|
42
|
+
/** The view on screen: `canvas` or `list`. */
|
|
43
|
+
modelValue: {
|
|
44
|
+
type: String,
|
|
45
|
+
default: 'canvas',
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
/** Say beside the switch that both views are the same flow. */
|
|
49
|
+
note: {
|
|
50
|
+
type: Boolean,
|
|
51
|
+
default: false,
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
emits: ['update:modelValue'],
|
|
56
|
+
|
|
57
|
+
computed: {
|
|
58
|
+
/** @return {Array<object>} The two views. */
|
|
59
|
+
views() {
|
|
60
|
+
return [
|
|
61
|
+
{ id: 'canvas', label: t('nextcloud-vue', 'Canvas'), icon: VectorPolyline },
|
|
62
|
+
{ id: 'list', label: t('nextcloud-vue', 'List'), icon: FormatListBulleted },
|
|
63
|
+
]
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
/** @return {string} The line beside the switch. */
|
|
67
|
+
noteText() {
|
|
68
|
+
return this.modelValue === 'list'
|
|
69
|
+
? t('nextcloud-vue', 'The same flow and the same steps as on the canvas; what you change here changes there too.')
|
|
70
|
+
: t('nextcloud-vue', 'The same flow as a list: the trigger and the steps in order, for anyone who prefers no canvas.')
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
methods: { t },
|
|
75
|
+
}
|
|
76
|
+
</script>
|
|
77
|
+
|
|
78
|
+
<style scoped>
|
|
79
|
+
.cn-flow-view-switch {
|
|
80
|
+
display: flex;
|
|
81
|
+
flex-wrap: wrap;
|
|
82
|
+
align-items: center;
|
|
83
|
+
gap: 12px;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.cn-flow-view-switch__group {
|
|
87
|
+
display: inline-flex;
|
|
88
|
+
padding: 3px;
|
|
89
|
+
border-radius: 10px;
|
|
90
|
+
background: var(--color-background-dark);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.cn-flow-view-switch__option {
|
|
94
|
+
display: inline-flex;
|
|
95
|
+
align-items: center;
|
|
96
|
+
gap: 6px;
|
|
97
|
+
min-block-size: 34px;
|
|
98
|
+
margin: 0;
|
|
99
|
+
padding: 0 12px;
|
|
100
|
+
border: 0;
|
|
101
|
+
border-radius: 8px;
|
|
102
|
+
background: transparent;
|
|
103
|
+
color: var(--color-main-text);
|
|
104
|
+
font-weight: 600;
|
|
105
|
+
cursor: pointer;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.cn-flow-view-switch__option--active {
|
|
109
|
+
background: var(--color-main-background);
|
|
110
|
+
box-shadow: 0 1px 3px var(--color-box-shadow);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.cn-flow-view-switch__note {
|
|
114
|
+
color: var(--color-text-maxcontrast);
|
|
115
|
+
font-size: 13px;
|
|
116
|
+
}
|
|
117
|
+
</style>
|
|
@@ -4,3 +4,5 @@
|
|
|
4
4
|
export { default as CnFlowDetail } from './CnFlowDetail.vue'
|
|
5
5
|
export { default as CnFlowSidebar } from './CnFlowSidebar.vue'
|
|
6
6
|
export { default as CnFlowIndexPage } from './CnFlowIndexPage.vue'
|
|
7
|
+
export { default as CnFlowStepList } from './CnFlowStepList.vue'
|
|
8
|
+
export { default as CnFlowViewSwitch } from './CnFlowViewSwitch.vue'
|