@conduction/nextcloud-vue 2.56.0-beta.20 → 2.56.0-beta.21
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/CnFlowDetail/CnRunDetailSidebar.vue2.js +2 -0
- package/dist/esm/components/CnFlowDetail/CnRunDetailSidebar.vue2.js.map +1 -1
- package/dist/esm/components/CnFlowDetail/CnRunDetailSidebar.vue3.js +7 -0
- package/dist/esm/components/CnFlowDetail/CnRunDetailSidebar.vue3.js.map +1 -1
- package/dist/esm/components/CnFlowStepOutcomes/CnFlowStepOutcomes.vue.js +10 -0
- package/dist/esm/components/CnFlowStepOutcomes/CnFlowStepOutcomes.vue.js.map +1 -0
- package/dist/esm/components/CnFlowStepOutcomes/CnFlowStepOutcomes.vue2.js +150 -0
- package/dist/esm/components/CnFlowStepOutcomes/CnFlowStepOutcomes.vue2.js.map +1 -0
- package/dist/esm/components/CnFlowStepOutcomes/CnFlowStepOutcomes.vue3.js +54 -0
- package/dist/esm/components/CnFlowStepOutcomes/CnFlowStepOutcomes.vue3.js.map +1 -0
- package/dist/esm/dialogs/CnFlowNodeEditModal.vue2.js +7 -10
- package/dist/esm/dialogs/CnFlowNodeEditModal.vue2.js.map +1 -1
- package/dist/esm/dialogs/CnFlowNodeEditModal.vue3.js +23 -13
- package/dist/esm/dialogs/CnFlowNodeEditModal.vue3.js.map +1 -1
- package/dist/esm/dialogs/CnRunNodeDialog.vue2.js +8 -6
- package/dist/esm/dialogs/CnRunNodeDialog.vue2.js.map +1 -1
- package/dist/esm/dialogs/CnRunNodeDialog.vue3.js.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/l10n/en.json.js +15 -1
- package/dist/esm/l10n/en.json.js.map +1 -1
- package/dist/esm/l10n/nl.json.js +15 -1
- package/dist/esm/l10n/nl.json.js.map +1 -1
- package/dist/esm/nextcloud-vue.css +64 -0
- package/dist/esm/utils/selectOptions.js +57 -0
- package/dist/esm/utils/selectOptions.js.map +1 -0
- package/dist/nextcloud-vue.cjs.js +5945 -5645
- package/dist/nextcloud-vue.cjs.js.map +2 -2
- package/dist/nextcloud-vue.css +64 -0
- package/l10n/en.json +15 -1
- package/l10n/nl.json +15 -1
- package/package.json +1 -1
- package/src/components/CnFlowDetail/CnRunDetailSidebar.vue +6 -0
- package/src/components/CnFlowStepOutcomes/CnFlowStepOutcomes.vue +250 -0
- package/src/components/CnFlowStepOutcomes/index.js +8 -0
- package/src/components/index.js +1 -0
- package/src/dialogs/CnFlowNodeEditModal.vue +41 -20
- package/src/dialogs/CnRunNodeDialog.vue +8 -6
- package/src/index.js +1 -0
- package/src/utils/selectOptions.js +54 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CnFlowNodeEditModal.vue2.js","sources":["../../../src/dialogs/CnFlowNodeEditModal.vue"],"sourcesContent":["<!--\n SPDX-FileCopyrightText: 2026 Conduction B.V. <info@conduction.nl>\n SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<NcDialog size=\"normal\"\n\t\t:name=\"typeLabel\"\n\t\t@closing=\"cancel\">\n\t\t<div class=\"cn-flow-node-edit\">\n\t\t\t<!-- What this step IS, in the engine's own words. -->\n\t\t\t<p v-if=\"entry && entry.description\" class=\"cn-flow-node-edit__description\">\n\t\t\t\t{{ entry.description }}\n\t\t\t</p>\n\t\t\t<p class=\"cn-flow-node-edit__id\">\n\t\t\t\t{{ node.type }}\n\t\t\t</p>\n\n\t\t\t<NcTextField :modelValue=\"draft.name\"\n\t\t\t\t:label=\"t('nextcloud-vue', 'Step name')\"\n\t\t\t\t:placeholder=\"typeLabel\"\n\t\t\t\t:helperText=\"t('nextcloud-vue', 'Shown on the card. Leave empty to show the step type.')\"\n\t\t\t\t@update:modelValue=\"draft.name = $event\" />\n\n\t\t\t<!-- One field per option the ENGINE declares for this step\n\t\t\t (`configKeys`), plus any key already set on the node. The\n\t\t\t widget follows the value: switches for booleans, a number\n\t\t\t field for numbers, a JSON area for structured values. -->\n\t\t\t<div v-for=\"key in formKeys\" :key=\"key\" class=\"cn-flow-node-edit__field\">\n\t\t\t\t<NcCheckboxRadioSwitch v-if=\"widgetFor(key) === 'switch'\"\n\t\t\t\t\t:modelValue=\"draft.config[key] === true\"\n\t\t\t\t\ttype=\"switch\"\n\t\t\t\t\t@update:modelValue=\"setKey(key, $event)\">\n\t\t\t\t\t{{ labelFor(key) }}\n\t\t\t\t</NcCheckboxRadioSwitch>\n\n\t\t\t\t<NcSelect v-else-if=\"widgetFor(key) === 'method'\"\n\t\t\t\t\t:modelValue=\"draft.config[key] || null\"\n\t\t\t\t\t:options=\"HTTP_METHODS\"\n\t\t\t\t\t:inputLabel=\"labelFor(key)\"\n\t\t\t\t\t:placeholder=\"t('nextcloud-vue', 'GET')\"\n\t\t\t\t\t@update:modelValue=\"setKey(key, $event)\" />\n\n\t\t\t\t<!-- A `select` field with `optionsFrom` renders as a picker fed\n\t\t\t\t by the URL the OWNING APP declared — never a bare uuid\n\t\t\t\t text box. -->\n\t\t\t\t<NcSelect v-else-if=\"widgetFor(key) === 'select'\"\n\t\t\t\t\t:modelValue=\"selectedOption(key)\"\n\t\t\t\t\t:options=\"selectOptions[key] || []\"\n\t\t\t\t\t:inputLabel=\"labelFor(key)\"\n\t\t\t\t\t:loading=\"selectLoading[key] === true\"\n\t\t\t\t\t:placeholder=\"t('nextcloud-vue', 'Pick one…')\"\n\t\t\t\t\t@update:modelValue=\"setKey(key, $event ? $event.id : '')\" />\n\n\t\t\t\t<NcTextArea v-else-if=\"widgetFor(key) === 'textarea'\"\n\t\t\t\t\t:modelValue=\"String(draft.config[key] ?? '')\"\n\t\t\t\t\t:label=\"labelFor(key)\"\n\t\t\t\t\t:helperText=\"hintFor(key)\"\n\t\t\t\t\trows=\"4\"\n\t\t\t\t\t@update:modelValue=\"setKey(key, $event)\" />\n\n\t\t\t\t<NcTextField v-else-if=\"widgetFor(key) === 'number'\"\n\t\t\t\t\t:modelValue=\"String(draft.config[key] ?? '')\"\n\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t:label=\"labelFor(key)\"\n\t\t\t\t\t@update:modelValue=\"setNumberKey(key, $event)\" />\n\n\t\t\t\t<NcTextArea v-else-if=\"widgetFor(key) === 'json'\"\n\t\t\t\t\t:modelValue=\"jsonDraftFor(key)\"\n\t\t\t\t\t:label=\"labelFor(key)\"\n\t\t\t\t\t:error=\"jsonErrors[key] !== undefined\"\n\t\t\t\t\t:helperText=\"jsonErrors[key] || t('nextcloud-vue', 'A structured value, as JSON.')\"\n\t\t\t\t\trows=\"4\"\n\t\t\t\t\t@update:modelValue=\"setJsonKey(key, $event)\" />\n\n\t\t\t\t<CnCronField v-else-if=\"widgetFor(key) === 'cron'\"\n\t\t\t\t\t:modelValue=\"String(draft.config[key] ?? '')\"\n\t\t\t\t\t:label=\"labelFor(key)\"\n\t\t\t\t\t@update:modelValue=\"setKey(key, $event)\" />\n\n\t\t\t\t<!-- `runAs` is a Nextcloud user id, and the SERVER decides\n\t\t\t\t whether this saver may act as that user — see\n\t\t\t\t FlowTriggerValidator::validateDelegation(). The picker\n\t\t\t\t defaults to the current user, which asserts no delegation\n\t\t\t\t at all; naming anyone else is a request the save may\n\t\t\t\t refuse, and refusing it here would only hide the reason. -->\n\t\t\t\t<!-- WHO the step asks. Users AND groups, because the step has\n\t\t\t\t always been able to ask either and the field could only ever\n\t\t\t\t say one word. Each option carries its own TYPE, so\n\t\t\t\t `{type: 'group', id: 'bezwaar'}` is stored as a group and\n\t\t\t\t nothing has to guess later. -->\n\t\t\t\t<NcSelect v-else-if=\"widgetFor(key) === 'principal'\"\n\t\t\t\t\t:modelValue=\"principalOptions(key)\"\n\t\t\t\t\t:options=\"principalChoices\"\n\t\t\t\t\t:inputLabel=\"labelFor(key)\"\n\t\t\t\t\t:loading=\"principalsLoading\"\n\t\t\t\t\t:multiple=\"true\"\n\t\t\t\t\tkeepOpen\n\t\t\t\t\t:placeholder=\"t('nextcloud-vue', 'Search people and groups…')\"\n\t\t\t\t\t:data-testid=\"`flow-node-principal-${key}`\"\n\t\t\t\t\t@search=\"searchPrincipals\"\n\t\t\t\t\t@update:modelValue=\"setPrincipals(key, $event)\" />\n\n\t\t\t\t<NcSelect v-else-if=\"widgetFor(key) === 'user'\"\n\t\t\t\t\t:modelValue=\"userOption(key)\"\n\t\t\t\t\t:options=\"userOptions\"\n\t\t\t\t\t:inputLabel=\"labelFor(key)\"\n\t\t\t\t\t:loading=\"usersLoading\"\n\t\t\t\t\t:placeholder=\"t('nextcloud-vue', 'Pick a user…')\"\n\t\t\t\t\t@update:modelValue=\"setKey(key, $event ? $event.id : '')\" />\n\n\t\t\t\t<NcTextField v-else\n\t\t\t\t\t:modelValue=\"String(draft.config[key] ?? '')\"\n\t\t\t\t\t:label=\"labelFor(key)\"\n\t\t\t\t\t:helperText=\"hintFor(key)\"\n\t\t\t\t\t@update:modelValue=\"setKey(key, $event)\" />\n\t\t\t</div>\n\n\t\t\t<p v-if=\"!formKeys.length\" class=\"cn-flow-node-edit__hint\">\n\t\t\t\t{{ t('nextcloud-vue', 'This step has no options.') }}\n\t\t\t</p>\n\n\t\t\t<!-- The whole document, for anything the fields above cannot say.\n\t\t\t Collapsed: the fields ARE the interface; this is the escape\n\t\t\t hatch that keeps every present and future key reachable.\n\n\t\t\t HIDDEN when it can reach nothing. A step the engine declares no\n\t\t\t options for, carrying no config, was showing \"This step has no\n\t\t\t options\" and then — as the only thing on the dialog you could\n\t\t\t actually touch — a JSON editor containing `{}`. That reads as\n\t\t\t \"configuring this needs JSON\", which is both wrong and the\n\t\t\t opposite of what the form is for. An escape hatch with nothing\n\t\t\t to escape to is not an advanced feature; it is noise on the\n\t\t\t simplest step in the editor. -->\n\t\t\t<details v-if=\"canEditAsJson\" class=\"cn-flow-node-edit__advanced\">\n\t\t\t\t<summary>{{ t('nextcloud-vue', 'Advanced: edit as JSON') }}</summary>\n\t\t\t\t<NcTextArea :modelValue=\"advancedJson\"\n\t\t\t\t\t:label=\"t('nextcloud-vue', 'Configuration (JSON)')\"\n\t\t\t\t\t:error=\"advancedError !== null\"\n\t\t\t\t\t:helperText=\"advancedError || t('nextcloud-vue', 'The full configuration document. The fields above update along.')\"\n\t\t\t\t\trows=\"8\"\n\t\t\t\t\t@update:modelValue=\"onAdvancedInput\" />\n\t\t\t</details>\n\t\t</div>\n\n\t\t<template #actions>\n\t\t\t<NcButton variant=\"error\" @click=\"removeStep\">\n\t\t\t\t{{ t('nextcloud-vue', 'Remove step') }}\n\t\t\t</NcButton>\n\t\t\t<NcButton @click=\"cancel\">\n\t\t\t\t{{ t('nextcloud-vue', 'Cancel') }}\n\t\t\t</NcButton>\n\t\t\t<NcButton variant=\"primary\" :disabled=\"hasErrors\" @click=\"done\">\n\t\t\t\t{{ t('nextcloud-vue', 'Done') }}\n\t\t\t</NcButton>\n\t\t</template>\n\t</NcDialog>\n</template>\n\n<script>\nimport { getCurrentUser } from '@nextcloud/auth'\nimport axios from '@nextcloud/axios'\nimport { generateUrl } from '@nextcloud/router'\nimport {\n\tNcButton,\n\tNcCheckboxRadioSwitch,\n\tNcDialog,\n\tNcSelect,\n\tNcTextArea,\n\tNcTextField,\n} from '@nextcloud/vue'\nimport CnCronField from '../components/CnCronField/CnCronField.vue'\nimport { useFlowStore } from '../composables/useFlowStore.js'\n\n/** The verbs an HTTP-shaped `method` option can take. */\n/**\n * The config keys that name WHO a step asks.\n *\n * These are the fields that carried a bare name and meant a user OR a group.\n * `runAs` is deliberately NOT here: it names the identity the step runs as,\n * which is a different question with a different answer type.\n */\nconst PRINCIPAL_KEYS = [\n\t'assignee',\n\t'candidates',\n\t'candidateUsers',\n\t'candidateGroups',\n\t'candidateRole',\n\t'routingFallback',\n]\n\nconst HTTP_METHODS = ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS']\n\n/**\n * CnFlowNodeEditModal — edit one flow step through a real form.\n *\n * One field per option the ENGINE declares for the step (the catalogue's\n * `configKeys`), plus any key already present on the node, each rendered with\n * a widget that follows the value: switches for booleans, a number field for\n * numbers, a JSON area for structured values, a method picker for `method`.\n * The catalogue publishes no per-key schema, so the widgets are derived — and\n * an Advanced section keeps the whole document editable, which is what keeps\n * every present and future key reachable without this dialog knowing it.\n *\n * Edits land on a DRAFT: Done commits it to `useFlowStore`, Cancel discards\n * it. Opened by setting `useFlowStore().editingNodeId`; hosted by\n * CnFlowDetail so it exists wherever the canvas does.\n */\nexport default {\n\tname: 'CnFlowNodeEditModal',\n\n\tcomponents: {\n\t\tCnCronField,\n\t\tNcButton,\n\t\tNcCheckboxRadioSwitch,\n\t\tNcDialog,\n\t\tNcSelect,\n\t\tNcTextArea,\n\t\tNcTextField,\n\t},\n\n\tsetup() {\n\t\treturn { store: useFlowStore() }\n\t},\n\n\tdata() {\n\t\tconst node = useFlowStore().editingNode || { config: {} }\n\n\t\treturn {\n\t\t\tHTTP_METHODS,\n\n\t\t\t// Everybody a step could ask, and whether that lookup is in\n\t\t\t// flight. Empty is a legitimate resting state: a stored reference\n\t\t\t// still shows, because it is synthesised rather than looked up.\n\t\t\tprincipals: [],\n\t\t\tprincipalsLoading: false,\n\n\t\t\t// Users for a `runAs`-shaped field, and whether that request is in\n\t\t\t// flight. Empty is a legitimate resting state: the picker still\n\t\t\t// offers the current user, so a schedule is authorable even when\n\t\t\t// the user list cannot be read.\n\t\t\tusers: [],\n\t\t\tusersLoading: false,\n\n\t\t\t// The draft the form edits. Committed on Done, discarded on Cancel.\n\t\t\tdraft: {\n\t\t\t\tname: node.name || '',\n\t\t\t\tconfig: JSON.parse(JSON.stringify(node.config || {})),\n\t\t\t},\n\n\t\t\t// Per-key raw text while a JSON-valued field is mid-edit, so typing\n\t\t\t// is not reformatted under the cursor.\n\t\t\tjsonDrafts: {},\n\t\t\tjsonErrors: {},\n\n\t\t\t// Options per select field, loaded from the `optionsFrom` URL the\n\t\t\t// OWNING APP declares for it in the node's configForm.\n\t\t\tselectOptions: {},\n\t\t\tselectLoading: {},\n\n\t\t\tadvancedDraft: null,\n\t\t\tadvancedError: null,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * @return {object} The node being edited. Falls back to an empty shape\n\t\t * so a dialog outliving its node cannot throw mid-render.\n\t\t */\n\t\tnode() {\n\t\t\treturn this.store.editingNode || { type: '', config: {} }\n\t\t},\n\n\t\t/**\n\t\t * @return {object|null} The catalogue entry for this node's type.\n\t\t */\n\t\tentry() {\n\t\t\treturn this.store.catalogEntry(this.node.type)\n\t\t},\n\n\t\t/**\n\t\t * @return {string} The dialog title: the step's human name.\n\t\t */\n\t\ttypeLabel() {\n\t\t\treturn this.entry ? (this.entry.displayName || this.entry.id) : (this.node.type || '—')\n\t\t},\n\n\t\t/**\n\t\t * The node's per-field declarations from the catalogue's `configForm`\n\t\t * ({key, label, type, help, required, optionsFrom}), keyed by config\n\t\t * key. `configKeys` is the degraded form. Either way the node's OWNER\n\t\t * declares the vocabulary — this dialog never invents fields.\n\t\t *\n\t\t * @return {object} key → field declaration.\n\t\t */\n\t\tfieldSpecs() {\n\t\t\tconst specs = {}\n\t\t\tfor (const field of (this.entry?.configForm || [])) {\n\t\t\t\tif (field && field.key) {\n\t\t\t\t\tspecs[field.key] = field\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn specs\n\t\t},\n\n\t\t/**\n\t\t * The keys the form renders: the declared vocabulary first, in its\n\t\t * order — `configForm` beats `configKeys` where both exist, keys only\n\t\t * one names are still rendered — then any key already set that neither\n\t\t * declares. `$`-prefixed keys are authoring annotations and stay in\n\t\t * Advanced.\n\t\t *\n\t\t * @return {Array<string>} The keys.\n\t\t */\n\t\t/**\n\t\t * Whether the raw-JSON escape hatch has anything to reach.\n\t\t *\n\t\t * True when the step declares options, or when the node already carries\n\t\t * config the form does not render. False for a step with neither, where\n\t\t * the hatch would only ever show an empty document.\n\t\t *\n\t\t * @return {boolean} Whether to offer the JSON editor.\n\t\t */\n\t\tcanEditAsJson() {\n\t\t\tif (this.formKeys.length > 0) {\n\t\t\t\treturn true\n\t\t\t}\n\n\t\t\treturn Object.keys(this.draft.config || {}).length > 0\n\t\t},\n\n\t\t/**\n\t\t * The signed-in user's id, or '' when there is no session.\n\t\t *\n\t\t * @return {string} The uid.\n\t\t */\n\t\tcurrentUid() {\n\t\t\treturn String(getCurrentUser()?.uid || '')\n\t\t},\n\n\t\t/**\n\t\t * The users offered for a `runAs` field.\n\t\t *\n\t\t * The current user is always present, and first. Naming yourself asserts\n\t\t * no delegation at all, so it is the one choice the server can never\n\t\t * refuse — which makes it both the right default and the right fallback\n\t\t * when the user list could not be read.\n\t\t *\n\t\t * @return {Array<object>} The options.\n\t\t */\n\t\tuserOptions() {\n\t\t\tconst me = this.currentUid\n\t\t\tconst mine = me === '' ? [] : [{ id: me, label: t('nextcloud-vue', '{uid} (you)', { uid: me }) }]\n\n\t\t\treturn [...mine, ...this.users.filter((user) => user.id !== me)]\n\t\t},\n\n\t\t/**\n\t\t * Everybody the picker can currently offer, users and groups together.\n\t\t *\n\t\t * @return {Array<object>} The options.\n\t\t */\n\t\tprincipalChoices() {\n\t\t\treturn this.principals\n\t\t},\n\n\t\tformKeys() {\n\t\t\tconst fromForm = (this.entry?.configForm || []).map((f) => f.key).filter(Boolean)\n\t\t\tconst declared = [\n\t\t\t\t...fromForm,\n\t\t\t\t...(this.entry?.configKeys || []).filter((k) => !fromForm.includes(k)),\n\t\t\t]\n\t\t\tconst present = Object.keys(this.draft.config).filter((k) => !k.startsWith('$') && !declared.includes(k))\n\n\t\t\treturn [...declared, ...present]\n\t\t},\n\n\t\t/**\n\t\t * @return {string} The draft config as pretty JSON, for Advanced.\n\t\t */\n\t\tadvancedJson() {\n\t\t\tif (this.advancedDraft !== null) {\n\t\t\t\treturn this.advancedDraft\n\t\t\t}\n\n\t\t\treturn JSON.stringify(this.draft.config, null, 2)\n\t\t},\n\n\t\t/**\n\t\t * @return {boolean} Whether any field holds unparseable JSON.\n\t\t */\n\t\thasErrors() {\n\t\t\treturn this.advancedError !== null || Object.keys(this.jsonErrors).length > 0\n\t\t},\n\t},\n\n\tcreated() {\n\t\t// Select fields need their options; everything else is local.\n\t\tfor (const [key, spec] of Object.entries(this.fieldSpecs)) {\n\t\t\tif (spec?.type === 'select' && spec?.optionsFrom) {\n\t\t\t\tthis.loadSelectOptions(key, spec)\n\t\t\t}\n\t\t}\n\n\t\tif (this.formKeys.some((key) => this.widgetFor(key) === 'principal')) {\n\t\t\t// An empty search returns the first page, so the picker opens with\n\t\t\t// something in it rather than an empty box the author has to guess\n\t\t\t// how to fill.\n\t\t\tthis.searchPrincipals('')\n\t\t}\n\n\t\tif (this.formKeys.some((key) => this.widgetFor(key) === 'user')) {\n\t\t\tthis.loadUsers()\n\t\t}\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Load the users a `runAs` field can name.\n\t\t *\n\t\t * Failure is not surfaced. The picker always offers the current user —\n\t\t * see `userOptions` — so a failed lookup costs the author the ability to\n\t\t * DELEGATE, not the ability to author a schedule at all. Blocking the\n\t\t * dialog on it would be a worse trade.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\t/**\n\t\t * The stored references on a field, as options the select can show.\n\t\t *\n\t\t * 🔴 A REFERENCE THE CURRENT USER CANNOT SEE MUST STILL SHOW. The\n\t\t * autocomplete endpoint answers with what THIS author may look up, and\n\t\t * a delegation is routinely to somebody they cannot. If an unmatched\n\t\t * reference rendered as nothing, opening a step and pressing Done would\n\t\t * silently clear it — a save that deletes the assignment while\n\t\t * appearing to change nothing.\n\t\t *\n\t\t * So every stored reference is synthesised into an option whether or\n\t\t * not the lookup found it, exactly as the single-user picker already\n\t\t * does for an unseen uid.\n\t\t *\n\t\t * @param {string} key The config key.\n\t\t * @return {Array<object>} The selected options.\n\t\t */\n\t\tprincipalOptions(key) {\n\t\t\treturn this.storedPrincipals(key).map((reference) => {\n\t\t\t\tconst id = `${reference.type}:${reference.id}`\n\t\t\t\tconst known = this.principals.find((option) => option.id === id)\n\n\t\t\t\treturn known || {\n\t\t\t\t\tid,\n\t\t\t\t\ttype: reference.type,\n\t\t\t\t\tvalue: reference.id,\n\t\t\t\t\tlabel: reference.id,\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * What a performer field currently holds, as `{type, id}` references.\n\t\t *\n\t\t * Reads both spellings, because both are stored across the fleet: a\n\t\t * bare string (which has always meant a user or a group of that name),\n\t\t * and a typed reference. A bare one is shown under the type the FIELD\n\t\t * NAME implies, so a `candidateGroups` entry does not appear as a\n\t\t * person.\n\t\t *\n\t\t * @param {string} key The config key.\n\t\t * @return {Array<object>} The references.\n\t\t */\n\t\tstoredPrincipals(key) {\n\t\t\tconst raw = this.draft.config[key]\n\t\t\tconst bareType = key === 'candidateGroups' || key === 'candidateRole' ? 'group' : 'user'\n\t\t\tconst list = Array.isArray(raw) ? raw : (raw === null || raw === undefined || raw === '' ? [] : [raw])\n\n\t\t\treturn list\n\t\t\t\t.map((entry) => {\n\t\t\t\t\tif (typeof entry === 'string') {\n\t\t\t\t\t\treturn entry.trim() === '' ? null : { type: bareType, id: entry.trim() }\n\t\t\t\t\t}\n\t\t\t\t\tif (entry && typeof entry === 'object') {\n\t\t\t\t\t\tconst id = String(entry.id ?? entry.value ?? '').trim()\n\n\t\t\t\t\t\treturn id === '' ? null : { type: String(entry.type || bareType), id }\n\t\t\t\t\t}\n\n\t\t\t\t\treturn null\n\t\t\t\t})\n\t\t\t\t.filter(Boolean)\n\t\t},\n\n\t\t/**\n\t\t * Write the picked references back onto the field.\n\t\t *\n\t\t * Always as typed references, never as bare strings: the whole point is\n\t\t * that the document records which kind of thing was meant, so a save\n\t\t * from this picker is never ambiguous again.\n\t\t *\n\t\t * @param {string} key The config key.\n\t\t * @param {Array<object>} picked What the select handed back.\n\t\t * @return {void}\n\t\t */\n\t\tsetPrincipals(key, picked) {\n\t\t\tconst references = (picked || []).map((option) => ({\n\t\t\t\ttype: option.type || 'user',\n\t\t\t\tid: option.value || String(option.id || '').split(':').slice(1).join(':'),\n\t\t\t})).filter((reference) => reference.id !== '')\n\n\t\t\t// A single-valued field keeps its shape: `assignee` is one\n\t\t\t// performer, and turning it into a list would change what the\n\t\t\t// engine reads.\n\t\t\tif (key === 'assignee' || key === 'routingFallback' || key === 'candidateRole') {\n\t\t\t\tthis.setKey(key, references[0] || '')\n\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tthis.setKey(key, references)\n\t\t},\n\n\t\t/**\n\t\t * Look people and groups up as the author types.\n\t\t *\n\t\t * 🔑 THE SAME ENDPOINT THE MENTION PICKER USES, with `shareTypes[]` 0\n\t\t * AND 1 — users and groups. OpenRegister publishes no user list and the\n\t\t * OCS user-listing API is admin-only, so this is the only source a\n\t\t * non-admin author can read.\n\t\t *\n\t\t * ⚠️ IT DOES NOT DECIDE WHAT IS VALID. A type this editor cannot search\n\t\t * — a position, a function, a case role — is still a legal reference,\n\t\t * and the server's resolver registry is what says so. That is why a\n\t\t * stored reference is synthesised rather than filtered against these\n\t\t * results.\n\t\t *\n\t\t * @param {string} query What the author typed.\n\t\t * @return {Promise<void>} When the lookup has settled.\n\t\t */\n\t\tasync searchPrincipals(query) {\n\t\t\tthis.principalsLoading = true\n\t\t\ttry {\n\t\t\t\tconst response = await axios.get(\n\t\t\t\t\tgenerateUrl('/ocs/v2.php/core/autocomplete/get'),\n\t\t\t\t\t{\n\t\t\t\t\t\tparams: {\n\t\t\t\t\t\t\tsearch: String(query || ''),\n\t\t\t\t\t\t\titemType: '',\n\t\t\t\t\t\t\titemId: '',\n\t\t\t\t\t\t\t'shareTypes[]': [0, 1],\n\t\t\t\t\t\t\tlimit: 50,\n\t\t\t\t\t\t},\n\t\t\t\t\t\theaders: { 'OCS-APIRequest': 'true', Accept: 'application/json' },\n\t\t\t\t\t},\n\t\t\t\t)\n\n\t\t\t\tconst rows = response?.data?.ocs?.data || []\n\t\t\t\tthis.principals = (Array.isArray(rows) ? rows : [])\n\t\t\t\t\t.map((row) => {\n\t\t\t\t\t\tconst type = row.source === 'groups' ? 'group' : 'user'\n\t\t\t\t\t\tconst id = String(row.id ?? '')\n\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tid: `${type}:${id}`,\n\t\t\t\t\t\t\ttype,\n\t\t\t\t\t\t\tvalue: id,\n\t\t\t\t\t\t\tlabel: `${String(row.label ?? id)}${type === 'group' ? this.t('nextcloud-vue', ' (group)') : ''}`,\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t.filter((option) => option.value !== '')\n\t\t\t} catch {\n\t\t\t\t// A failed lookup must not clear what is already picked: the\n\t\t\t\t// selected options are synthesised from the document, not from\n\t\t\t\t// this list.\n\t\t\t\tthis.principals = []\n\t\t\t} finally {\n\t\t\t\tthis.principalsLoading = false\n\t\t\t}\n\t\t},\n\n\t\tasync loadUsers() {\n\t\t\tthis.usersLoading = true\n\t\t\ttry {\n\t\t\t\t// Nextcloud's OWN autocomplete endpoint — the one the mention\n\t\t\t\t// picker uses. OpenRegister publishes no user list, and the OCS\n\t\t\t\t// user-listing API is admin-only, so this is the only source a\n\t\t\t\t// non-admin author can read. `shareTypes[]=0` restricts it to\n\t\t\t\t// users, keeping groups and circles out of a field that takes a\n\t\t\t\t// single uid.\n\t\t\t\tconst response = await axios.get(\n\t\t\t\t\tgenerateUrl('/ocs/v2.php/core/autocomplete/get'),\n\t\t\t\t\t{\n\t\t\t\t\t\tparams: { search: '', itemType: '', itemId: '', 'shareTypes[]': 0, limit: 50 },\n\t\t\t\t\t\theaders: { 'OCS-APIRequest': 'true', Accept: 'application/json' },\n\t\t\t\t\t},\n\t\t\t\t)\n\n\t\t\t\tconst rows = response?.data?.ocs?.data || []\n\t\t\t\tthis.users = (Array.isArray(rows) ? rows : [])\n\t\t\t\t\t.filter((row) => row.source === 'users')\n\t\t\t\t\t.map((row) => ({ id: String(row.id ?? ''), label: String(row.label ?? row.id ?? '') }))\n\t\t\t\t\t.filter((row) => row.id !== '')\n\t\t\t} catch {\n\t\t\t\tthis.users = []\n\t\t\t} finally {\n\t\t\t\tthis.usersLoading = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * The selected user for a key, synthesised when it is not in the list.\n\t\t *\n\t\t * A stored uid the current user cannot see must still SHOW. Dropping it\n\t\t * would make the field look empty and a save would then clear a\n\t\t * delegation the author never touched.\n\t\t *\n\t\t * @param {string} key The config key.\n\t\t * @return {object|null} The option.\n\t\t */\n\t\tuserOption(key) {\n\t\t\tconst value = String(this.draft.config[key] ?? '')\n\t\t\tif (value === '') {\n\t\t\t\treturn null\n\t\t\t}\n\n\t\t\treturn this.userOptions.find((option) => option.id === value) || { id: value, label: value }\n\t\t},\n\n\t\t/**\n\t\t * Which widget a key gets: the owner's declaration first, the VALUE\n\t\t * second, the key's name last.\n\t\t *\n\t\t * @param {string} key The config key.\n\t\t * @return {string} 'select' | 'switch' | 'number' | 'textarea' | 'json' | 'method' | 'text'\n\t\t */\n\t\twidgetFor(key) {\n\t\t\tconst spec = this.fieldSpecs[key]\n\t\t\tif (spec?.type === 'select' && spec?.optionsFrom) {\n\t\t\t\treturn 'select'\n\t\t\t}\n\t\t\tif (spec?.type === 'boolean') {\n\t\t\t\treturn 'switch'\n\t\t\t}\n\t\t\tif (spec?.type === 'number') {\n\t\t\t\treturn 'number'\n\t\t\t}\n\t\t\tif (spec?.type === 'textarea') {\n\t\t\t\treturn 'textarea'\n\t\t\t}\n\n\t\t\t// Keyed on the engine's own declaration where it makes one, and on\n\t\t\t// the key name otherwise. `cron` and `runAs` are the schedule\n\t\t\t// trigger's required vocabulary — a bare text box for either is a\n\t\t\t// schedule that fails at 03:00, with nobody watching.\n\t\t\tif (spec?.type === 'cron' || spec?.format === 'cron' || key === 'cron') {\n\t\t\t\treturn 'cron'\n\t\t\t}\n\t\t\t// 🔴 `runAs` KEEPS THE SINGLE-USER PICKER. It is not a performer:\n\t\t\t// it names the identity the step RUNS AS, the server decides\n\t\t\t// whether this author may delegate to it, and a group cannot be\n\t\t\t// one. Checked BEFORE the principal branch so a step that declares\n\t\t\t// `runAs` as a principal cannot widen it.\n\t\t\tif (key === 'runAs') {\n\t\t\t\treturn 'user'\n\t\t\t}\n\n\t\t\t// Who the step ASKS. Keyed on the engine's own declaration where it\n\t\t\t// makes one, and on the performer key names otherwise — those are\n\t\t\t// the fields that carried a bare name and meant a user OR a group.\n\t\t\tif (spec?.type === 'principal' || PRINCIPAL_KEYS.includes(key)) {\n\t\t\t\treturn 'principal'\n\t\t\t}\n\n\t\t\tif (spec?.type === 'user') {\n\t\t\t\treturn 'user'\n\t\t\t}\n\n\t\t\tconst value = this.draft.config[key]\n\t\t\tif (typeof value === 'boolean') {\n\t\t\t\treturn 'switch'\n\t\t\t}\n\t\t\tif (typeof value === 'number') {\n\t\t\t\treturn 'number'\n\t\t\t}\n\t\t\tif (value !== null && value !== undefined && typeof value === 'object') {\n\t\t\t\treturn 'json'\n\t\t\t}\n\t\t\tif (key === 'method') {\n\t\t\t\treturn 'method'\n\t\t\t}\n\n\t\t\treturn 'text'\n\t\t},\n\n\t\t/**\n\t\t * The picker option matching a select field's stored value —\n\t\t * synthesised from the raw value when it is not in the loaded options,\n\t\t * so an existing configuration is never blanked.\n\t\t *\n\t\t * @param {string} key The config key.\n\t\t * @return {object|null} The selected option.\n\t\t */\n\t\tselectedOption(key) {\n\t\t\tconst value = this.draft.config[key]\n\t\t\tif (value === undefined || value === null || value === '') {\n\t\t\t\treturn null\n\t\t\t}\n\n\t\t\tconst options = this.selectOptions[key] || []\n\t\t\treturn options.find((o) => o.id === value) || { id: value, label: String(value) }\n\t\t},\n\n\t\t/**\n\t\t * Load the pickable choices for one select field, from the URL its\n\t\t * owning app declared (`optionsFrom`).\n\t\t *\n\t\t * Accepts `{results: [...]}` or a bare array; items as `{id, label}`,\n\t\t * `{value, label}`, or OpenRegister objects (uuid from `@self`, label\n\t\t * from name/title) — the app owns the endpoint, this dialog only has\n\t\t * to read it.\n\t\t *\n\t\t * @param {string} key The config key.\n\t\t * @param {object} spec The field declaration carrying `optionsFrom`.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync loadSelectOptions(key, spec) {\n\t\t\tthis.selectLoading = { ...this.selectLoading, [key]: true }\n\t\t\ttry {\n\t\t\t\tconst url = String(spec.optionsFrom)\n\t\t\t\tconst response = await axios.get(url.startsWith('/') && !url.startsWith('/apps') && !url.startsWith('/index.php')\n\t\t\t\t\t? generateUrl(url)\n\t\t\t\t\t: url)\n\t\t\t\tconst rows = Array.isArray(response.data) ? response.data : (response.data?.results || [])\n\t\t\t\tconst options = rows.map((row) => {\n\t\t\t\t\tconst id = row.id ?? row.value ?? row['@self']?.uuid ?? row.uuid\n\t\t\t\t\treturn {\n\t\t\t\t\t\tid,\n\t\t\t\t\t\tlabel: row.label || row.name || row.title || String(id),\n\t\t\t\t\t}\n\t\t\t\t}).filter((o) => o.id !== undefined && o.id !== null && o.id !== '')\n\t\t\t\tthis.selectOptions = { ...this.selectOptions, [key]: options }\n\t\t\t} catch (error) {\n\t\t\t\t// A picker that could not load degrades to showing the stored\n\t\t\t\t// value; the Advanced editor still reaches everything.\n\t\t\t\t// eslint-disable-next-line no-console -- diagnostic for a failure this code already degrades from\n\t\t\t\tconsole.error(`cn-flow: could not load options for \"${key}\"`, error)\n\t\t\t} finally {\n\t\t\t\tthis.selectLoading = { ...this.selectLoading, [key]: false }\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * A key as a field label: the owner's translated `label` when the\n\t\t * configForm declares one, else `sourceId` → `Source id`.\n\t\t *\n\t\t * @param {string} key The config key.\n\t\t * @return {string} The label.\n\t\t */\n\t\tlabelFor(key) {\n\t\t\tconst declared = this.fieldSpecs[key]?.label\n\t\t\tif (declared) {\n\t\t\t\treturn declared\n\t\t\t}\n\n\t\t\tconst spaced = key\n\t\t\t\t.replace(/[_-]+/g, ' ')\n\t\t\t\t.replace(/([a-z0-9])([A-Z])/g, '$1 $2')\n\t\t\t\t.toLowerCase()\n\n\t\t\treturn spaced.charAt(0).toUpperCase() + spaced.slice(1)\n\t\t},\n\n\t\t/**\n\t\t * The helper line under a field: the owner's `help` (prefixed when the\n\t\t * field is required), else the built-in hints for keys that earn one.\n\t\t *\n\t\t * @param {string} key The config key.\n\t\t * @return {string|undefined} The helper line.\n\t\t */\n\t\thintFor(key) {\n\t\t\tconst spec = this.fieldSpecs[key]\n\t\t\tif (spec?.help) {\n\t\t\t\treturn spec.required === true\n\t\t\t\t\t? `${this.t('nextcloud-vue', 'Required.')} ${spec.help}`\n\t\t\t\t\t: spec.help\n\t\t\t}\n\t\t\tif (spec?.required === true) {\n\t\t\t\treturn this.t('nextcloud-vue', 'Required.')\n\t\t\t}\n\t\t\tif (key === 'cron') {\n\t\t\t\treturn this.t('nextcloud-vue', 'For example 0 9 * * 1 — 09:00 every Monday.')\n\t\t\t}\n\n\t\t\treturn undefined\n\t\t},\n\n\t\t/**\n\t\t * @param {string} key The config key.\n\t\t * @param {unknown} value The new value.\n\t\t * @return {void}\n\t\t */\n\t\tsetKey(key, value) {\n\t\t\tthis.draft.config = { ...this.draft.config, [key]: value }\n\t\t\tthis.advancedDraft = null\n\t\t\tthis.advancedError = null\n\t\t},\n\n\t\t/**\n\t\t * @param {string} key The config key.\n\t\t * @param {string} text The number field's text.\n\t\t * @return {void}\n\t\t */\n\t\tsetNumberKey(key, text) {\n\t\t\tconst parsed = Number(text)\n\t\t\tthis.setKey(key, Number.isFinite(parsed) ? parsed : text)\n\t\t},\n\n\t\t/**\n\t\t * @param {string} key The config key.\n\t\t * @return {string} The key's value as JSON text, or its mid-edit draft.\n\t\t */\n\t\tjsonDraftFor(key) {\n\t\t\tif (this.jsonDrafts[key] !== undefined) {\n\t\t\t\treturn this.jsonDrafts[key]\n\t\t\t}\n\n\t\t\treturn JSON.stringify(this.draft.config[key], null, 2)\n\t\t},\n\n\t\t/**\n\t\t * Parse one JSON-valued field, keeping the last valid value on error.\n\t\t *\n\t\t * @param {string} key The config key.\n\t\t * @param {string} text The raw JSON text.\n\t\t * @return {void}\n\t\t */\n\t\tsetJsonKey(key, text) {\n\t\t\tthis.jsonDrafts = { ...this.jsonDrafts, [key]: text }\n\t\t\ttry {\n\t\t\t\tconst parsed = JSON.parse(text)\n\t\t\t\tconst rest = { ...this.jsonErrors }\n\t\t\t\tdelete rest[key]\n\t\t\t\tthis.jsonErrors = rest\n\t\t\t\tthis.setKey(key, parsed)\n\t\t\t} catch {\n\t\t\t\tthis.jsonErrors = {\n\t\t\t\t\t...this.jsonErrors,\n\t\t\t\t\t[key]: this.t('nextcloud-vue', 'Not valid JSON, so this option keeps its previous value.'),\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Parse the whole document, keeping the last valid draft on error.\n\t\t *\n\t\t * @param {string} text The raw JSON text.\n\t\t * @return {void}\n\t\t */\n\t\tonAdvancedInput(text) {\n\t\t\tthis.advancedDraft = text\n\t\t\ttry {\n\t\t\t\tconst parsed = JSON.parse(text || '{}')\n\t\t\t\tif (parsed === null || typeof parsed !== 'object' || Array.isArray(parsed)) {\n\t\t\t\t\tthis.advancedError = this.t('nextcloud-vue', 'A step configuration must be a JSON object.')\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tthis.advancedError = null\n\t\t\t\tthis.draft.config = parsed\n\t\t\t\tthis.jsonDrafts = {}\n\t\t\t\tthis.jsonErrors = {}\n\t\t\t} catch {\n\t\t\t\tthis.advancedError = this.t('nextcloud-vue', 'Not valid JSON, so the configuration keeps its previous value.')\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Commit the draft and close.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tdone() {\n\t\t\tconst id = this.store.editingNodeId\n\t\t\tif (id !== null) {\n\t\t\t\tthis.store.setNodeConfigById(id, this.draft.config)\n\t\t\t\tthis.store.setNodeName(id, this.draft.name)\n\t\t\t}\n\t\t\tthis.store.editingNodeId = null\n\t\t},\n\n\t\t/**\n\t\t * Discard the draft and close.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tcancel() {\n\t\t\tthis.store.editingNodeId = null\n\t\t},\n\n\t\t/**\n\t\t * Remove the step entirely and close.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tremoveStep() {\n\t\t\tconst id = this.store.editingNodeId\n\t\t\tthis.store.editingNodeId = null\n\t\t\tif (id !== null) {\n\t\t\t\tthis.store.removeNode(id)\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-flow-node-edit {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 12px;\n\tpadding-block-end: 8px;\n}\n\n.cn-flow-node-edit__description {\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-flow-node-edit__id,\n.cn-flow-node-edit__hint {\n\tfont-size: 0.85em;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-flow-node-edit__advanced summary {\n\tcursor: pointer;\n\tcolor: var(--color-text-maxcontrast);\n\tmargin-block-end: 8px;\n}\n</style>\n"],"names":["CnCronField","axios"],"mappings":";;;;;;;AA6KA;AACA;AACC;AACA;;;;;AAKD,MAAM,iBAAiB;CACtB,UAAU;CACV,YAAY;AACZ,CAAA,gBAAgB;AAChB,CAAA,iBAAiB;AACjB,CAAA,eAAe;AACf,CAAA,iBAAiB;AAClB,EAAA;;AAEA,MAAM,YAAW,GAAI,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAA;;AAEhF;;AAEC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAED,aAAe;CACd,IAAI,EAAE,qBAAqB;;CAE3B,UAAU,EAAE;eACXA,UAAW;AACX,EAAA,QAAQ;AACR,EAAA,qBAAqB;AACrB,EAAA,QAAQ;AACR,EAAA,QAAQ;EACR,UAAU;EACV,WAAW;EACX;;AAED,CAAA,KAAK,GAAG;EACP,OAAO,EAAE,KAAK,EAAE,YAAY,EAAG,EAAA;EAC/B;;AAED,CAAA,IAAI,G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ACP,IAAI,CAAC,gBAAgB,IAAI,CAAC,CAAC,CAAC,eAAe,EAAE,gEAAgE,EAAA;AAC9G,IAAA;GACA;;AAED;;AAEC;;;AAGD,EAAA,IAAI,GAAG;AACN,GAAA,MAAM,EAAC,GAAI,IAAI,CAAC,KAAK,CAAC,cAAY;GAClC,IAAI,EAAG,KAAI,IAAI,EAAE;IAChB,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EAAA;AAClD,IAAA,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,EAAA;AAC3C,IAAA;GACA,IAAI,CAAC,KAAK,CAAC,aAAc,GAAE,KAAG;GAC9B;;AAED;;AAEC;;;AAGD,EAAA,MAAM,GAAG;GACR,IAAI,CAAC,KAAK,CAAC,aAAc,GAAE,KAAG;GAC9B;;AAED;AACC;AACA;;;EAGD,UAAU,GAAG;AACZ,GAAA,MAAM,EAAC,GAAI,IAAI,CAAC,KAAK,CAAC,cAAY;GAClC,IAAI,CAAC,KAAK,CAAC,aAAc,GAAE,KAAG;GAC9B,IAAI,EAAG,KAAI,IAAI,EAAE;IAChB,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,EAAA;AACzB,IAAA;GACA;EACD;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"CnFlowNodeEditModal.vue2.js","sources":["../../../src/dialogs/CnFlowNodeEditModal.vue"],"sourcesContent":["<!--\n SPDX-FileCopyrightText: 2026 Conduction B.V. <info@conduction.nl>\n SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<NcDialog size=\"normal\"\n\t\t:name=\"typeLabel\"\n\t\t@closing=\"cancel\">\n\t\t<div class=\"cn-flow-node-edit\">\n\t\t\t<!-- What this step IS, in the engine's own words. -->\n\t\t\t<p v-if=\"entry && entry.description\" class=\"cn-flow-node-edit__description\">\n\t\t\t\t{{ entry.description }}\n\t\t\t</p>\n\t\t\t<p class=\"cn-flow-node-edit__id\">\n\t\t\t\t{{ node.type }}\n\t\t\t</p>\n\n\t\t\t<NcTextField :modelValue=\"draft.name\"\n\t\t\t\t:label=\"t('nextcloud-vue', 'Step name')\"\n\t\t\t\t:placeholder=\"typeLabel\"\n\t\t\t\t:helperText=\"t('nextcloud-vue', 'Shown on the card. Leave empty to show the step type.')\"\n\t\t\t\t@update:modelValue=\"draft.name = $event\" />\n\n\t\t\t<!-- One field per option the ENGINE declares for this step\n\t\t\t (`configKeys`), plus any key already set on the node. The\n\t\t\t widget follows the value: switches for booleans, a number\n\t\t\t field for numbers, a JSON area for structured values. -->\n\t\t\t<div v-for=\"key in formKeys\" :key=\"key\" class=\"cn-flow-node-edit__field\">\n\t\t\t\t<NcCheckboxRadioSwitch v-if=\"widgetFor(key) === 'switch'\"\n\t\t\t\t\t:modelValue=\"draft.config[key] === true\"\n\t\t\t\t\ttype=\"switch\"\n\t\t\t\t\t@update:modelValue=\"setKey(key, $event)\">\n\t\t\t\t\t{{ labelFor(key) }}\n\t\t\t\t</NcCheckboxRadioSwitch>\n\n\t\t\t\t<NcSelect v-else-if=\"widgetFor(key) === 'method'\"\n\t\t\t\t\t:modelValue=\"draft.config[key] || null\"\n\t\t\t\t\t:options=\"HTTP_METHODS\"\n\t\t\t\t\t:inputLabel=\"labelFor(key)\"\n\t\t\t\t\t:placeholder=\"t('nextcloud-vue', 'GET')\"\n\t\t\t\t\t@update:modelValue=\"setKey(key, $event)\" />\n\n\t\t\t\t<!-- A `select` field renders as a picker, never a bare text box.\n\t\t\t\t Its choices come from the URL the OWNING APP declared\n\t\t\t\t (`optionsFrom`) or from the form itself (`options`), for a\n\t\t\t\t short fixed vocabulary with no endpoint of its own. -->\n\t\t\t\t<template v-else-if=\"widgetFor(key) === 'select'\">\n\t\t\t\t\t<NcSelect :modelValue=\"selectedOption(key)\"\n\t\t\t\t\t\tclass=\"cn-flow-node-edit__select\"\n\t\t\t\t\t\t:options=\"selectOptions[key] || []\"\n\t\t\t\t\t\t:inputLabel=\"labelFor(key)\"\n\t\t\t\t\t\t:loading=\"selectLoading[key] === true\"\n\t\t\t\t\t\t:placeholder=\"t('nextcloud-vue', 'Pick one…')\"\n\t\t\t\t\t\t@update:modelValue=\"setKey(key, $event ? $event.id : '')\" />\n\t\t\t\t\t<!-- NcSelect has no helper text of its own, so the help\n\t\t\t\t\t follows the control, the next thing a screen reader\n\t\t\t\t\t reads after it. -->\n\t\t\t\t\t<p v-if=\"hintFor(key)\"\n\t\t\t\t\t\tclass=\"cn-flow-node-edit__field-help\"\n\t\t\t\t\t\t:data-testid=\"`flow-node-help-${key}`\">\n\t\t\t\t\t\t{{ hintFor(key) }}\n\t\t\t\t\t</p>\n\t\t\t\t</template>\n\n\t\t\t\t<NcTextArea v-else-if=\"widgetFor(key) === 'textarea'\"\n\t\t\t\t\t:modelValue=\"String(draft.config[key] ?? '')\"\n\t\t\t\t\t:label=\"labelFor(key)\"\n\t\t\t\t\t:helperText=\"hintFor(key)\"\n\t\t\t\t\trows=\"4\"\n\t\t\t\t\t@update:modelValue=\"setKey(key, $event)\" />\n\n\t\t\t\t<NcTextField v-else-if=\"widgetFor(key) === 'number'\"\n\t\t\t\t\t:modelValue=\"String(draft.config[key] ?? '')\"\n\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t:label=\"labelFor(key)\"\n\t\t\t\t\t@update:modelValue=\"setNumberKey(key, $event)\" />\n\n\t\t\t\t<NcTextArea v-else-if=\"widgetFor(key) === 'json'\"\n\t\t\t\t\t:modelValue=\"jsonDraftFor(key)\"\n\t\t\t\t\t:label=\"labelFor(key)\"\n\t\t\t\t\t:error=\"jsonErrors[key] !== undefined\"\n\t\t\t\t\t:helperText=\"jsonErrors[key] || t('nextcloud-vue', 'A structured value, as JSON.')\"\n\t\t\t\t\trows=\"4\"\n\t\t\t\t\t@update:modelValue=\"setJsonKey(key, $event)\" />\n\n\t\t\t\t<CnCronField v-else-if=\"widgetFor(key) === 'cron'\"\n\t\t\t\t\t:modelValue=\"String(draft.config[key] ?? '')\"\n\t\t\t\t\t:label=\"labelFor(key)\"\n\t\t\t\t\t@update:modelValue=\"setKey(key, $event)\" />\n\n\t\t\t\t<!-- `runAs` is a Nextcloud user id, and the SERVER decides\n\t\t\t\t whether this saver may act as that user — see\n\t\t\t\t FlowTriggerValidator::validateDelegation(). The picker\n\t\t\t\t defaults to the current user, which asserts no delegation\n\t\t\t\t at all; naming anyone else is a request the save may\n\t\t\t\t refuse, and refusing it here would only hide the reason. -->\n\t\t\t\t<!-- WHO the step asks. Users AND groups, because the step has\n\t\t\t\t always been able to ask either and the field could only ever\n\t\t\t\t say one word. Each option carries its own TYPE, so\n\t\t\t\t `{type: 'group', id: 'bezwaar'}` is stored as a group and\n\t\t\t\t nothing has to guess later. -->\n\t\t\t\t<NcSelect v-else-if=\"widgetFor(key) === 'principal'\"\n\t\t\t\t\t:modelValue=\"principalOptions(key)\"\n\t\t\t\t\t:options=\"principalChoices\"\n\t\t\t\t\t:inputLabel=\"labelFor(key)\"\n\t\t\t\t\t:loading=\"principalsLoading\"\n\t\t\t\t\t:multiple=\"true\"\n\t\t\t\t\tkeepOpen\n\t\t\t\t\t:placeholder=\"t('nextcloud-vue', 'Search people and groups…')\"\n\t\t\t\t\t:data-testid=\"`flow-node-principal-${key}`\"\n\t\t\t\t\t@search=\"searchPrincipals\"\n\t\t\t\t\t@update:modelValue=\"setPrincipals(key, $event)\" />\n\n\t\t\t\t<NcSelect v-else-if=\"widgetFor(key) === 'user'\"\n\t\t\t\t\t:modelValue=\"userOption(key)\"\n\t\t\t\t\t:options=\"userOptions\"\n\t\t\t\t\t:inputLabel=\"labelFor(key)\"\n\t\t\t\t\t:loading=\"usersLoading\"\n\t\t\t\t\t:placeholder=\"t('nextcloud-vue', 'Pick a user…')\"\n\t\t\t\t\t@update:modelValue=\"setKey(key, $event ? $event.id : '')\" />\n\n\t\t\t\t<NcTextField v-else\n\t\t\t\t\t:modelValue=\"String(draft.config[key] ?? '')\"\n\t\t\t\t\t:label=\"labelFor(key)\"\n\t\t\t\t\t:helperText=\"hintFor(key)\"\n\t\t\t\t\t@update:modelValue=\"setKey(key, $event)\" />\n\t\t\t</div>\n\n\t\t\t<p v-if=\"!formKeys.length\" class=\"cn-flow-node-edit__hint\">\n\t\t\t\t{{ t('nextcloud-vue', 'This step has no options.') }}\n\t\t\t</p>\n\n\t\t\t<!-- The whole document, for anything the fields above cannot say.\n\t\t\t Collapsed: the fields ARE the interface; this is the escape\n\t\t\t hatch that keeps every present and future key reachable.\n\n\t\t\t HIDDEN when it can reach nothing. A step the engine declares no\n\t\t\t options for, carrying no config, was showing \"This step has no\n\t\t\t options\" and then — as the only thing on the dialog you could\n\t\t\t actually touch — a JSON editor containing `{}`. That reads as\n\t\t\t \"configuring this needs JSON\", which is both wrong and the\n\t\t\t opposite of what the form is for. An escape hatch with nothing\n\t\t\t to escape to is not an advanced feature; it is noise on the\n\t\t\t simplest step in the editor. -->\n\t\t\t<details v-if=\"canEditAsJson\" class=\"cn-flow-node-edit__advanced\">\n\t\t\t\t<summary>{{ t('nextcloud-vue', 'Advanced: edit as JSON') }}</summary>\n\t\t\t\t<NcTextArea :modelValue=\"advancedJson\"\n\t\t\t\t\t:label=\"t('nextcloud-vue', 'Configuration (JSON)')\"\n\t\t\t\t\t:error=\"advancedError !== null\"\n\t\t\t\t\t:helperText=\"advancedError || t('nextcloud-vue', 'The full configuration document. The fields above update along.')\"\n\t\t\t\t\trows=\"8\"\n\t\t\t\t\t@update:modelValue=\"onAdvancedInput\" />\n\t\t\t</details>\n\t\t</div>\n\n\t\t<template #actions>\n\t\t\t<NcButton variant=\"error\" @click=\"removeStep\">\n\t\t\t\t{{ t('nextcloud-vue', 'Remove step') }}\n\t\t\t</NcButton>\n\t\t\t<NcButton @click=\"cancel\">\n\t\t\t\t{{ t('nextcloud-vue', 'Cancel') }}\n\t\t\t</NcButton>\n\t\t\t<NcButton variant=\"primary\" :disabled=\"hasErrors\" @click=\"done\">\n\t\t\t\t{{ t('nextcloud-vue', 'Done') }}\n\t\t\t</NcButton>\n\t\t</template>\n\t</NcDialog>\n</template>\n\n<script>\nimport { getCurrentUser } from '@nextcloud/auth'\nimport axios from '@nextcloud/axios'\nimport { generateUrl } from '@nextcloud/router'\nimport {\n\tNcButton,\n\tNcCheckboxRadioSwitch,\n\tNcDialog,\n\tNcSelect,\n\tNcTextArea,\n\tNcTextField,\n} from '@nextcloud/vue'\nimport CnCronField from '../components/CnCronField/CnCronField.vue'\nimport { useFlowStore } from '../composables/useFlowStore.js'\nimport { hasStaticOptions, normaliseSelectOptions } from '../utils/selectOptions.js'\n\n/** The verbs an HTTP-shaped `method` option can take. */\n/**\n * The config keys that name WHO a step asks.\n *\n * These are the fields that carried a bare name and meant a user OR a group.\n * `runAs` is deliberately NOT here: it names the identity the step runs as,\n * which is a different question with a different answer type.\n */\nconst PRINCIPAL_KEYS = [\n\t'assignee',\n\t'candidates',\n\t'candidateUsers',\n\t'candidateGroups',\n\t'candidateRole',\n\t'routingFallback',\n]\n\nconst HTTP_METHODS = ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS']\n\n/**\n * CnFlowNodeEditModal — edit one flow step through a real form.\n *\n * One field per option the ENGINE declares for the step (the catalogue's\n * `configKeys`), plus any key already present on the node, each rendered with\n * a widget that follows the value: switches for booleans, a number field for\n * numbers, a JSON area for structured values, a method picker for `method`.\n * The catalogue publishes no per-key schema, so the widgets are derived — and\n * an Advanced section keeps the whole document editable, which is what keeps\n * every present and future key reachable without this dialog knowing it.\n *\n * Edits land on a DRAFT: Done commits it to `useFlowStore`, Cancel discards\n * it. Opened by setting `useFlowStore().editingNodeId`; hosted by\n * CnFlowDetail so it exists wherever the canvas does.\n */\nexport default {\n\tname: 'CnFlowNodeEditModal',\n\n\tcomponents: {\n\t\tCnCronField,\n\t\tNcButton,\n\t\tNcCheckboxRadioSwitch,\n\t\tNcDialog,\n\t\tNcSelect,\n\t\tNcTextArea,\n\t\tNcTextField,\n\t},\n\n\tsetup() {\n\t\treturn { store: useFlowStore() }\n\t},\n\n\tdata() {\n\t\tconst node = useFlowStore().editingNode || { config: {} }\n\n\t\treturn {\n\t\t\tHTTP_METHODS,\n\n\t\t\t// Everybody a step could ask, and whether that lookup is in\n\t\t\t// flight. Empty is a legitimate resting state: a stored reference\n\t\t\t// still shows, because it is synthesised rather than looked up.\n\t\t\tprincipals: [],\n\t\t\tprincipalsLoading: false,\n\n\t\t\t// Users for a `runAs`-shaped field, and whether that request is in\n\t\t\t// flight. Empty is a legitimate resting state: the picker still\n\t\t\t// offers the current user, so a schedule is authorable even when\n\t\t\t// the user list cannot be read.\n\t\t\tusers: [],\n\t\t\tusersLoading: false,\n\n\t\t\t// The draft the form edits. Committed on Done, discarded on Cancel.\n\t\t\tdraft: {\n\t\t\t\tname: node.name || '',\n\t\t\t\tconfig: JSON.parse(JSON.stringify(node.config || {})),\n\t\t\t},\n\n\t\t\t// Per-key raw text while a JSON-valued field is mid-edit, so typing\n\t\t\t// is not reformatted under the cursor.\n\t\t\tjsonDrafts: {},\n\t\t\tjsonErrors: {},\n\n\t\t\t// Options per select field, loaded from the `optionsFrom` URL the\n\t\t\t// OWNING APP declares for it in the node's configForm.\n\t\t\tselectOptions: {},\n\t\t\tselectLoading: {},\n\n\t\t\tadvancedDraft: null,\n\t\t\tadvancedError: null,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * @return {object} The node being edited. Falls back to an empty shape\n\t\t * so a dialog outliving its node cannot throw mid-render.\n\t\t */\n\t\tnode() {\n\t\t\treturn this.store.editingNode || { type: '', config: {} }\n\t\t},\n\n\t\t/**\n\t\t * @return {object|null} The catalogue entry for this node's type.\n\t\t */\n\t\tentry() {\n\t\t\treturn this.store.catalogEntry(this.node.type)\n\t\t},\n\n\t\t/**\n\t\t * @return {string} The dialog title: the step's human name.\n\t\t */\n\t\ttypeLabel() {\n\t\t\treturn this.entry ? (this.entry.displayName || this.entry.id) : (this.node.type || '—')\n\t\t},\n\n\t\t/**\n\t\t * The node's per-field declarations from the catalogue's `configForm`\n\t\t * ({key, label, type, help, required, optionsFrom, options}), keyed by config\n\t\t * key. `configKeys` is the degraded form. Either way the node's OWNER\n\t\t * declares the vocabulary — this dialog never invents fields.\n\t\t *\n\t\t * @return {object} key → field declaration.\n\t\t */\n\t\tfieldSpecs() {\n\t\t\tconst specs = {}\n\t\t\tfor (const field of (this.entry?.configForm || [])) {\n\t\t\t\tif (field && field.key) {\n\t\t\t\t\tspecs[field.key] = field\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn specs\n\t\t},\n\n\t\t/**\n\t\t * The keys the form renders: the declared vocabulary first, in its\n\t\t * order — `configForm` beats `configKeys` where both exist, keys only\n\t\t * one names are still rendered — then any key already set that neither\n\t\t * declares. `$`-prefixed keys are authoring annotations and stay in\n\t\t * Advanced.\n\t\t *\n\t\t * @return {Array<string>} The keys.\n\t\t */\n\t\t/**\n\t\t * Whether the raw-JSON escape hatch has anything to reach.\n\t\t *\n\t\t * True when the step declares options, or when the node already carries\n\t\t * config the form does not render. False for a step with neither, where\n\t\t * the hatch would only ever show an empty document.\n\t\t *\n\t\t * @return {boolean} Whether to offer the JSON editor.\n\t\t */\n\t\tcanEditAsJson() {\n\t\t\tif (this.formKeys.length > 0) {\n\t\t\t\treturn true\n\t\t\t}\n\n\t\t\treturn Object.keys(this.draft.config || {}).length > 0\n\t\t},\n\n\t\t/**\n\t\t * The signed-in user's id, or '' when there is no session.\n\t\t *\n\t\t * @return {string} The uid.\n\t\t */\n\t\tcurrentUid() {\n\t\t\treturn String(getCurrentUser()?.uid || '')\n\t\t},\n\n\t\t/**\n\t\t * The users offered for a `runAs` field.\n\t\t *\n\t\t * The current user is always present, and first. Naming yourself asserts\n\t\t * no delegation at all, so it is the one choice the server can never\n\t\t * refuse — which makes it both the right default and the right fallback\n\t\t * when the user list could not be read.\n\t\t *\n\t\t * @return {Array<object>} The options.\n\t\t */\n\t\tuserOptions() {\n\t\t\tconst me = this.currentUid\n\t\t\tconst mine = me === '' ? [] : [{ id: me, label: t('nextcloud-vue', '{uid} (you)', { uid: me }) }]\n\n\t\t\treturn [...mine, ...this.users.filter((user) => user.id !== me)]\n\t\t},\n\n\t\t/**\n\t\t * Everybody the picker can currently offer, users and groups together.\n\t\t *\n\t\t * @return {Array<object>} The options.\n\t\t */\n\t\tprincipalChoices() {\n\t\t\treturn this.principals\n\t\t},\n\n\t\tformKeys() {\n\t\t\tconst fromForm = (this.entry?.configForm || []).map((f) => f.key).filter(Boolean)\n\t\t\tconst declared = [\n\t\t\t\t...fromForm,\n\t\t\t\t...(this.entry?.configKeys || []).filter((k) => !fromForm.includes(k)),\n\t\t\t]\n\t\t\tconst present = Object.keys(this.draft.config).filter((k) => !k.startsWith('$') && !declared.includes(k))\n\n\t\t\treturn [...declared, ...present]\n\t\t},\n\n\t\t/**\n\t\t * @return {string} The draft config as pretty JSON, for Advanced.\n\t\t */\n\t\tadvancedJson() {\n\t\t\tif (this.advancedDraft !== null) {\n\t\t\t\treturn this.advancedDraft\n\t\t\t}\n\n\t\t\treturn JSON.stringify(this.draft.config, null, 2)\n\t\t},\n\n\t\t/**\n\t\t * @return {boolean} Whether any field holds unparseable JSON.\n\t\t */\n\t\thasErrors() {\n\t\t\treturn this.advancedError !== null || Object.keys(this.jsonErrors).length > 0\n\t\t},\n\t},\n\n\tcreated() {\n\t\t// Select fields need their options; everything else is local.\n\t\tfor (const [key, spec] of Object.entries(this.fieldSpecs)) {\n\t\t\tif (hasStaticOptions(spec)) {\n\t\t\t\tthis.selectOptions = { ...this.selectOptions, [key]: normaliseSelectOptions(spec.options) }\n\t\t\t} else if (spec?.type === 'select' && spec?.optionsFrom) {\n\t\t\t\tthis.loadSelectOptions(key, spec)\n\t\t\t}\n\t\t}\n\n\t\tif (this.formKeys.some((key) => this.widgetFor(key) === 'principal')) {\n\t\t\t// An empty search returns the first page, so the picker opens with\n\t\t\t// something in it rather than an empty box the author has to guess\n\t\t\t// how to fill.\n\t\t\tthis.searchPrincipals('')\n\t\t}\n\n\t\tif (this.formKeys.some((key) => this.widgetFor(key) === 'user')) {\n\t\t\tthis.loadUsers()\n\t\t}\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Load the users a `runAs` field can name.\n\t\t *\n\t\t * Failure is not surfaced. The picker always offers the current user —\n\t\t * see `userOptions` — so a failed lookup costs the author the ability to\n\t\t * DELEGATE, not the ability to author a schedule at all. Blocking the\n\t\t * dialog on it would be a worse trade.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\t/**\n\t\t * The stored references on a field, as options the select can show.\n\t\t *\n\t\t * 🔴 A REFERENCE THE CURRENT USER CANNOT SEE MUST STILL SHOW. The\n\t\t * autocomplete endpoint answers with what THIS author may look up, and\n\t\t * a delegation is routinely to somebody they cannot. If an unmatched\n\t\t * reference rendered as nothing, opening a step and pressing Done would\n\t\t * silently clear it — a save that deletes the assignment while\n\t\t * appearing to change nothing.\n\t\t *\n\t\t * So every stored reference is synthesised into an option whether or\n\t\t * not the lookup found it, exactly as the single-user picker already\n\t\t * does for an unseen uid.\n\t\t *\n\t\t * @param {string} key The config key.\n\t\t * @return {Array<object>} The selected options.\n\t\t */\n\t\tprincipalOptions(key) {\n\t\t\treturn this.storedPrincipals(key).map((reference) => {\n\t\t\t\tconst id = `${reference.type}:${reference.id}`\n\t\t\t\tconst known = this.principals.find((option) => option.id === id)\n\n\t\t\t\treturn known || {\n\t\t\t\t\tid,\n\t\t\t\t\ttype: reference.type,\n\t\t\t\t\tvalue: reference.id,\n\t\t\t\t\tlabel: reference.id,\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * What a performer field currently holds, as `{type, id}` references.\n\t\t *\n\t\t * Reads both spellings, because both are stored across the fleet: a\n\t\t * bare string (which has always meant a user or a group of that name),\n\t\t * and a typed reference. A bare one is shown under the type the FIELD\n\t\t * NAME implies, so a `candidateGroups` entry does not appear as a\n\t\t * person.\n\t\t *\n\t\t * @param {string} key The config key.\n\t\t * @return {Array<object>} The references.\n\t\t */\n\t\tstoredPrincipals(key) {\n\t\t\tconst raw = this.draft.config[key]\n\t\t\tconst bareType = key === 'candidateGroups' || key === 'candidateRole' ? 'group' : 'user'\n\t\t\tconst list = Array.isArray(raw) ? raw : (raw === null || raw === undefined || raw === '' ? [] : [raw])\n\n\t\t\treturn list\n\t\t\t\t.map((entry) => {\n\t\t\t\t\tif (typeof entry === 'string') {\n\t\t\t\t\t\treturn entry.trim() === '' ? null : { type: bareType, id: entry.trim() }\n\t\t\t\t\t}\n\t\t\t\t\tif (entry && typeof entry === 'object') {\n\t\t\t\t\t\tconst id = String(entry.id ?? entry.value ?? '').trim()\n\n\t\t\t\t\t\treturn id === '' ? null : { type: String(entry.type || bareType), id }\n\t\t\t\t\t}\n\n\t\t\t\t\treturn null\n\t\t\t\t})\n\t\t\t\t.filter(Boolean)\n\t\t},\n\n\t\t/**\n\t\t * Write the picked references back onto the field.\n\t\t *\n\t\t * Always as typed references, never as bare strings: the whole point is\n\t\t * that the document records which kind of thing was meant, so a save\n\t\t * from this picker is never ambiguous again.\n\t\t *\n\t\t * @param {string} key The config key.\n\t\t * @param {Array<object>} picked What the select handed back.\n\t\t * @return {void}\n\t\t */\n\t\tsetPrincipals(key, picked) {\n\t\t\tconst references = (picked || []).map((option) => ({\n\t\t\t\ttype: option.type || 'user',\n\t\t\t\tid: option.value || String(option.id || '').split(':').slice(1).join(':'),\n\t\t\t})).filter((reference) => reference.id !== '')\n\n\t\t\t// A single-valued field keeps its shape: `assignee` is one\n\t\t\t// performer, and turning it into a list would change what the\n\t\t\t// engine reads.\n\t\t\tif (key === 'assignee' || key === 'routingFallback' || key === 'candidateRole') {\n\t\t\t\tthis.setKey(key, references[0] || '')\n\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tthis.setKey(key, references)\n\t\t},\n\n\t\t/**\n\t\t * Look people and groups up as the author types.\n\t\t *\n\t\t * 🔑 THE SAME ENDPOINT THE MENTION PICKER USES, with `shareTypes[]` 0\n\t\t * AND 1 — users and groups. OpenRegister publishes no user list and the\n\t\t * OCS user-listing API is admin-only, so this is the only source a\n\t\t * non-admin author can read.\n\t\t *\n\t\t * ⚠️ IT DOES NOT DECIDE WHAT IS VALID. A type this editor cannot search\n\t\t * — a position, a function, a case role — is still a legal reference,\n\t\t * and the server's resolver registry is what says so. That is why a\n\t\t * stored reference is synthesised rather than filtered against these\n\t\t * results.\n\t\t *\n\t\t * @param {string} query What the author typed.\n\t\t * @return {Promise<void>} When the lookup has settled.\n\t\t */\n\t\tasync searchPrincipals(query) {\n\t\t\tthis.principalsLoading = true\n\t\t\ttry {\n\t\t\t\tconst response = await axios.get(\n\t\t\t\t\tgenerateUrl('/ocs/v2.php/core/autocomplete/get'),\n\t\t\t\t\t{\n\t\t\t\t\t\tparams: {\n\t\t\t\t\t\t\tsearch: String(query || ''),\n\t\t\t\t\t\t\titemType: '',\n\t\t\t\t\t\t\titemId: '',\n\t\t\t\t\t\t\t'shareTypes[]': [0, 1],\n\t\t\t\t\t\t\tlimit: 50,\n\t\t\t\t\t\t},\n\t\t\t\t\t\theaders: { 'OCS-APIRequest': 'true', Accept: 'application/json' },\n\t\t\t\t\t},\n\t\t\t\t)\n\n\t\t\t\tconst rows = response?.data?.ocs?.data || []\n\t\t\t\tthis.principals = (Array.isArray(rows) ? rows : [])\n\t\t\t\t\t.map((row) => {\n\t\t\t\t\t\tconst type = row.source === 'groups' ? 'group' : 'user'\n\t\t\t\t\t\tconst id = String(row.id ?? '')\n\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tid: `${type}:${id}`,\n\t\t\t\t\t\t\ttype,\n\t\t\t\t\t\t\tvalue: id,\n\t\t\t\t\t\t\tlabel: `${String(row.label ?? id)}${type === 'group' ? this.t('nextcloud-vue', ' (group)') : ''}`,\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t.filter((option) => option.value !== '')\n\t\t\t} catch {\n\t\t\t\t// A failed lookup must not clear what is already picked: the\n\t\t\t\t// selected options are synthesised from the document, not from\n\t\t\t\t// this list.\n\t\t\t\tthis.principals = []\n\t\t\t} finally {\n\t\t\t\tthis.principalsLoading = false\n\t\t\t}\n\t\t},\n\n\t\tasync loadUsers() {\n\t\t\tthis.usersLoading = true\n\t\t\ttry {\n\t\t\t\t// Nextcloud's OWN autocomplete endpoint — the one the mention\n\t\t\t\t// picker uses. OpenRegister publishes no user list, and the OCS\n\t\t\t\t// user-listing API is admin-only, so this is the only source a\n\t\t\t\t// non-admin author can read. `shareTypes[]=0` restricts it to\n\t\t\t\t// users, keeping groups and circles out of a field that takes a\n\t\t\t\t// single uid.\n\t\t\t\tconst response = await axios.get(\n\t\t\t\t\tgenerateUrl('/ocs/v2.php/core/autocomplete/get'),\n\t\t\t\t\t{\n\t\t\t\t\t\tparams: { search: '', itemType: '', itemId: '', 'shareTypes[]': 0, limit: 50 },\n\t\t\t\t\t\theaders: { 'OCS-APIRequest': 'true', Accept: 'application/json' },\n\t\t\t\t\t},\n\t\t\t\t)\n\n\t\t\t\tconst rows = response?.data?.ocs?.data || []\n\t\t\t\tthis.users = (Array.isArray(rows) ? rows : [])\n\t\t\t\t\t.filter((row) => row.source === 'users')\n\t\t\t\t\t.map((row) => ({ id: String(row.id ?? ''), label: String(row.label ?? row.id ?? '') }))\n\t\t\t\t\t.filter((row) => row.id !== '')\n\t\t\t} catch {\n\t\t\t\tthis.users = []\n\t\t\t} finally {\n\t\t\t\tthis.usersLoading = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * The selected user for a key, synthesised when it is not in the list.\n\t\t *\n\t\t * A stored uid the current user cannot see must still SHOW. Dropping it\n\t\t * would make the field look empty and a save would then clear a\n\t\t * delegation the author never touched.\n\t\t *\n\t\t * @param {string} key The config key.\n\t\t * @return {object|null} The option.\n\t\t */\n\t\tuserOption(key) {\n\t\t\tconst value = String(this.draft.config[key] ?? '')\n\t\t\tif (value === '') {\n\t\t\t\treturn null\n\t\t\t}\n\n\t\t\treturn this.userOptions.find((option) => option.id === value) || { id: value, label: value }\n\t\t},\n\n\t\t/**\n\t\t * Which widget a key gets: the owner's declaration first, the VALUE\n\t\t * second, the key's name last.\n\t\t *\n\t\t * @param {string} key The config key.\n\t\t * @return {string} 'select' | 'switch' | 'number' | 'textarea' | 'json' | 'method' | 'text'\n\t\t */\n\t\twidgetFor(key) {\n\t\t\tconst spec = this.fieldSpecs[key]\n\t\t\tif (spec?.type === 'select' && (spec?.optionsFrom || hasStaticOptions(spec))) {\n\t\t\t\treturn 'select'\n\t\t\t}\n\t\t\tif (spec?.type === 'boolean') {\n\t\t\t\treturn 'switch'\n\t\t\t}\n\t\t\tif (spec?.type === 'number') {\n\t\t\t\treturn 'number'\n\t\t\t}\n\t\t\tif (spec?.type === 'textarea') {\n\t\t\t\treturn 'textarea'\n\t\t\t}\n\n\t\t\t// Keyed on the engine's own declaration where it makes one, and on\n\t\t\t// the key name otherwise. `cron` and `runAs` are the schedule\n\t\t\t// trigger's required vocabulary — a bare text box for either is a\n\t\t\t// schedule that fails at 03:00, with nobody watching.\n\t\t\tif (spec?.type === 'cron' || spec?.format === 'cron' || key === 'cron') {\n\t\t\t\treturn 'cron'\n\t\t\t}\n\t\t\t// 🔴 `runAs` KEEPS THE SINGLE-USER PICKER. It is not a performer:\n\t\t\t// it names the identity the step RUNS AS, the server decides\n\t\t\t// whether this author may delegate to it, and a group cannot be\n\t\t\t// one. Checked BEFORE the principal branch so a step that declares\n\t\t\t// `runAs` as a principal cannot widen it.\n\t\t\tif (key === 'runAs') {\n\t\t\t\treturn 'user'\n\t\t\t}\n\n\t\t\t// Who the step ASKS. Keyed on the engine's own declaration where it\n\t\t\t// makes one, and on the performer key names otherwise — those are\n\t\t\t// the fields that carried a bare name and meant a user OR a group.\n\t\t\tif (spec?.type === 'principal' || PRINCIPAL_KEYS.includes(key)) {\n\t\t\t\treturn 'principal'\n\t\t\t}\n\n\t\t\tif (spec?.type === 'user') {\n\t\t\t\treturn 'user'\n\t\t\t}\n\n\t\t\tconst value = this.draft.config[key]\n\t\t\tif (typeof value === 'boolean') {\n\t\t\t\treturn 'switch'\n\t\t\t}\n\t\t\tif (typeof value === 'number') {\n\t\t\t\treturn 'number'\n\t\t\t}\n\t\t\tif (value !== null && value !== undefined && typeof value === 'object') {\n\t\t\t\treturn 'json'\n\t\t\t}\n\t\t\tif (key === 'method') {\n\t\t\t\treturn 'method'\n\t\t\t}\n\n\t\t\treturn 'text'\n\t\t},\n\n\t\t/**\n\t\t * The picker option matching a select field's stored value —\n\t\t * synthesised from the raw value when it is not in the loaded options,\n\t\t * so an existing configuration is never blanked.\n\t\t *\n\t\t * @param {string} key The config key.\n\t\t * @return {object|null} The selected option.\n\t\t */\n\t\tselectedOption(key) {\n\t\t\tconst value = this.draft.config[key]\n\t\t\tif (value === undefined || value === null || value === '') {\n\t\t\t\treturn null\n\t\t\t}\n\n\t\t\tconst options = this.selectOptions[key] || []\n\t\t\treturn options.find((o) => o.id === value) || { id: value, label: String(value) }\n\t\t},\n\n\t\t/**\n\t\t * Load the pickable choices for one select field, from the URL its\n\t\t * owning app declared (`optionsFrom`).\n\t\t *\n\t\t * Accepts `{results: [...]}` or a bare array; items as `{id, label}`,\n\t\t * `{value, label}`, or OpenRegister objects (uuid from `@self`, label\n\t\t * from name/title) — the app owns the endpoint, this dialog only has\n\t\t * to read it.\n\t\t *\n\t\t * @param {string} key The config key.\n\t\t * @param {object} spec The field declaration carrying `optionsFrom`.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync loadSelectOptions(key, spec) {\n\t\t\tthis.selectLoading = { ...this.selectLoading, [key]: true }\n\t\t\ttry {\n\t\t\t\tconst url = String(spec.optionsFrom)\n\t\t\t\tconst response = await axios.get(url.startsWith('/') && !url.startsWith('/apps') && !url.startsWith('/index.php')\n\t\t\t\t\t? generateUrl(url)\n\t\t\t\t\t: url)\n\t\t\t\tconst rows = Array.isArray(response.data) ? response.data : (response.data?.results || [])\n\t\t\t\tconst options = normaliseSelectOptions(rows)\n\t\t\t\tthis.selectOptions = { ...this.selectOptions, [key]: options }\n\t\t\t} catch (error) {\n\t\t\t\t// A picker that could not load degrades to showing the stored\n\t\t\t\t// value; the Advanced editor still reaches everything.\n\t\t\t\t// eslint-disable-next-line no-console -- diagnostic for a failure this code already degrades from\n\t\t\t\tconsole.error(`cn-flow: could not load options for \"${key}\"`, error)\n\t\t\t} finally {\n\t\t\t\tthis.selectLoading = { ...this.selectLoading, [key]: false }\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * A key as a field label: the owner's translated `label` when the\n\t\t * configForm declares one, else `sourceId` → `Source id`.\n\t\t *\n\t\t * @param {string} key The config key.\n\t\t * @return {string} The label.\n\t\t */\n\t\tlabelFor(key) {\n\t\t\tconst declared = this.fieldSpecs[key]?.label\n\t\t\tif (declared) {\n\t\t\t\treturn declared\n\t\t\t}\n\n\t\t\tconst spaced = key\n\t\t\t\t.replace(/[_-]+/g, ' ')\n\t\t\t\t.replace(/([a-z0-9])([A-Z])/g, '$1 $2')\n\t\t\t\t.toLowerCase()\n\n\t\t\treturn spaced.charAt(0).toUpperCase() + spaced.slice(1)\n\t\t},\n\n\t\t/**\n\t\t * The helper line under a field: the owner's `help` (prefixed when the\n\t\t * field is required), else the built-in hints for keys that earn one.\n\t\t *\n\t\t * @param {string} key The config key.\n\t\t * @return {string|undefined} The helper line.\n\t\t */\n\t\thintFor(key) {\n\t\t\tconst spec = this.fieldSpecs[key]\n\t\t\tif (spec?.help) {\n\t\t\t\treturn spec.required === true\n\t\t\t\t\t? `${this.t('nextcloud-vue', 'Required.')} ${spec.help}`\n\t\t\t\t\t: spec.help\n\t\t\t}\n\t\t\tif (spec?.required === true) {\n\t\t\t\treturn this.t('nextcloud-vue', 'Required.')\n\t\t\t}\n\t\t\tif (key === 'cron') {\n\t\t\t\treturn this.t('nextcloud-vue', 'For example 0 9 * * 1 — 09:00 every Monday.')\n\t\t\t}\n\n\t\t\treturn undefined\n\t\t},\n\n\t\t/**\n\t\t * @param {string} key The config key.\n\t\t * @param {unknown} value The new value.\n\t\t * @return {void}\n\t\t */\n\t\tsetKey(key, value) {\n\t\t\tthis.draft.config = { ...this.draft.config, [key]: value }\n\t\t\tthis.advancedDraft = null\n\t\t\tthis.advancedError = null\n\t\t},\n\n\t\t/**\n\t\t * @param {string} key The config key.\n\t\t * @param {string} text The number field's text.\n\t\t * @return {void}\n\t\t */\n\t\tsetNumberKey(key, text) {\n\t\t\tconst parsed = Number(text)\n\t\t\tthis.setKey(key, Number.isFinite(parsed) ? parsed : text)\n\t\t},\n\n\t\t/**\n\t\t * @param {string} key The config key.\n\t\t * @return {string} The key's value as JSON text, or its mid-edit draft.\n\t\t */\n\t\tjsonDraftFor(key) {\n\t\t\tif (this.jsonDrafts[key] !== undefined) {\n\t\t\t\treturn this.jsonDrafts[key]\n\t\t\t}\n\n\t\t\treturn JSON.stringify(this.draft.config[key], null, 2)\n\t\t},\n\n\t\t/**\n\t\t * Parse one JSON-valued field, keeping the last valid value on error.\n\t\t *\n\t\t * @param {string} key The config key.\n\t\t * @param {string} text The raw JSON text.\n\t\t * @return {void}\n\t\t */\n\t\tsetJsonKey(key, text) {\n\t\t\tthis.jsonDrafts = { ...this.jsonDrafts, [key]: text }\n\t\t\ttry {\n\t\t\t\tconst parsed = JSON.parse(text)\n\t\t\t\tconst rest = { ...this.jsonErrors }\n\t\t\t\tdelete rest[key]\n\t\t\t\tthis.jsonErrors = rest\n\t\t\t\tthis.setKey(key, parsed)\n\t\t\t} catch {\n\t\t\t\tthis.jsonErrors = {\n\t\t\t\t\t...this.jsonErrors,\n\t\t\t\t\t[key]: this.t('nextcloud-vue', 'Not valid JSON, so this option keeps its previous value.'),\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Parse the whole document, keeping the last valid draft on error.\n\t\t *\n\t\t * @param {string} text The raw JSON text.\n\t\t * @return {void}\n\t\t */\n\t\tonAdvancedInput(text) {\n\t\t\tthis.advancedDraft = text\n\t\t\ttry {\n\t\t\t\tconst parsed = JSON.parse(text || '{}')\n\t\t\t\tif (parsed === null || typeof parsed !== 'object' || Array.isArray(parsed)) {\n\t\t\t\t\tthis.advancedError = this.t('nextcloud-vue', 'A step configuration must be a JSON object.')\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tthis.advancedError = null\n\t\t\t\tthis.draft.config = parsed\n\t\t\t\tthis.jsonDrafts = {}\n\t\t\t\tthis.jsonErrors = {}\n\t\t\t} catch {\n\t\t\t\tthis.advancedError = this.t('nextcloud-vue', 'Not valid JSON, so the configuration keeps its previous value.')\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Commit the draft and close.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tdone() {\n\t\t\tconst id = this.store.editingNodeId\n\t\t\tif (id !== null) {\n\t\t\t\tthis.store.setNodeConfigById(id, this.draft.config)\n\t\t\t\tthis.store.setNodeName(id, this.draft.name)\n\t\t\t}\n\t\t\tthis.store.editingNodeId = null\n\t\t},\n\n\t\t/**\n\t\t * Discard the draft and close.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tcancel() {\n\t\t\tthis.store.editingNodeId = null\n\t\t},\n\n\t\t/**\n\t\t * Remove the step entirely and close.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tremoveStep() {\n\t\t\tconst id = this.store.editingNodeId\n\t\t\tthis.store.editingNodeId = null\n\t\t\tif (id !== null) {\n\t\t\t\tthis.store.removeNode(id)\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-flow-node-edit {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 12px;\n\tpadding-block-end: 8px;\n}\n\n.cn-flow-node-edit__description {\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-flow-node-edit__id,\n.cn-flow-node-edit__hint {\n\tfont-size: 0.85em;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n/* Full width, like the text fields around it: at its natural width the\n picker cut every option label in half. */\n.cn-flow-node-edit__select {\n\twidth: 100%;\n}\n\n.cn-flow-node-edit__field-help {\n\tmargin: 4px 0 0;\n\tpadding-inline-start: 8px;\n\tfont-size: 0.85em;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-flow-node-edit__advanced summary {\n\tcursor: pointer;\n\tcolor: var(--color-text-maxcontrast);\n\tmargin-block-end: 8px;\n}\n</style>\n"],"names":["CnCronField","axios"],"mappings":";;;;;;;;AAyLA;AACA;AACC;AACA;;;;;AAKD,MAAM,iBAAiB;CACtB,UAAU;CACV,YAAY;AACZ,CAAA,gBAAgB;AAChB,CAAA,iBAAiB;AACjB,CAAA,eAAe;AACf,CAAA,iBAAiB;AAClB,EAAA;;AAEA,MAAM,YAAW,GAAI,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAA;;AAEhF;;AAEC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAED,aAAe;CACd,IAAI,EAAE,qBAAqB;;CAE3B,UAAU,EAAE;eACXA,UAAW;AACX,EAAA,QAAQ;AACR,EAAA,qBAAqB;AACrB,EAAA,QAAQ;AACR,EAAA,QAAQ;EACR,UAAU;EACV,WAAW;EACX;;AAED,CAAA,KAAK,GAAG;EACP,OAAO,EAAE,KAAK,EAAE,YAAY,EAAG,EAAA;EAC/B;;AAED,CAAA,IAAI,GAAG;EACN,MAAM,OAAO,YAAY,EAAE,CAAC,WAAU,IAAK,EAAE,MAAM,EAAE,EAAG,GAAA;;AAExD,EAAA,OAAO;GACN,YAAY;;;;;GAKZ,UAAU,EAAE,EAAE;GACd,iBAAiB,EAAE,KAAK;;;;;;AAMxB,GAAA,KAAK,EAAE,EAAE;AACT,GAAA,YAAY,EAAE,KAAK;;;AAGnB,GAAA,KAAK,EAAE;AACN,IAAA,IAAI,EAAE,IAAI,CAAC,IAAG,IAAK,EAA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AK,CAAC,aAAc,GAAE,KAAG;GAC9B;;AAED;AACC;AACA;;;EAGD,UAAU,GAAG;AACZ,GAAA,MAAM,EAAC,GAAI,IAAI,CAAC,KAAK,CAAC,cAAY;GAClC,IAAI,CAAC,KAAK,CAAC,aAAc,GAAE,KAAG;GAC9B,IAAI,EAAG,KAAI,IAAI,EAAE;IAChB,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,EAAA;AACzB,IAAA;GACA;EACD;AACF;;;;"}
|
|
@@ -6,11 +6,12 @@ const _hoisted_2 = {
|
|
|
6
6
|
class: "cn-flow-node-edit__description"
|
|
7
7
|
};
|
|
8
8
|
const _hoisted_3 = { class: "cn-flow-node-edit__id" };
|
|
9
|
-
const _hoisted_4 =
|
|
9
|
+
const _hoisted_4 = ["data-testid"];
|
|
10
|
+
const _hoisted_5 = {
|
|
10
11
|
key: 1,
|
|
11
12
|
class: "cn-flow-node-edit__hint"
|
|
12
13
|
};
|
|
13
|
-
const
|
|
14
|
+
const _hoisted_6 = {
|
|
14
15
|
key: 2,
|
|
15
16
|
class: "cn-flow-node-edit__advanced"
|
|
16
17
|
};
|
|
@@ -96,15 +97,24 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
96
97
|
"onUpdate:modelValue": $event => ($options.setKey(key, $event))
|
|
97
98
|
}, null, 8 /* PROPS */, ["modelValue", "options", "inputLabel", "placeholder", "onUpdate:modelValue"]))
|
|
98
99
|
: ($options.widgetFor(key) === 'select')
|
|
99
|
-
? (openBlock(),
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
100
|
+
? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
101
|
+
createVNode(_component_NcSelect, {
|
|
102
|
+
modelValue: $options.selectedOption(key),
|
|
103
|
+
class: "cn-flow-node-edit__select",
|
|
104
|
+
options: $data.selectOptions[key] || [],
|
|
105
|
+
inputLabel: $options.labelFor(key),
|
|
106
|
+
loading: $data.selectLoading[key] === true,
|
|
107
|
+
placeholder: _ctx.t('nextcloud-vue', 'Pick one…'),
|
|
108
|
+
"onUpdate:modelValue": $event => ($options.setKey(key, $event ? $event.id : ''))
|
|
109
|
+
}, null, 8 /* PROPS */, ["modelValue", "options", "inputLabel", "loading", "placeholder", "onUpdate:modelValue"]),
|
|
110
|
+
($options.hintFor(key))
|
|
111
|
+
? (openBlock(), createElementBlock("p", {
|
|
112
|
+
key: 0,
|
|
113
|
+
class: "cn-flow-node-edit__field-help",
|
|
114
|
+
"data-testid": `flow-node-help-${key}`
|
|
115
|
+
}, toDisplayString($options.hintFor(key)), 9 /* TEXT, PROPS */, _hoisted_4))
|
|
116
|
+
: createCommentVNode("v-if", true)
|
|
117
|
+
], 64 /* STABLE_FRAGMENT */))
|
|
108
118
|
: ($options.widgetFor(key) === 'textarea')
|
|
109
119
|
? (openBlock(), createBlock(_component_NcTextArea, {
|
|
110
120
|
key: 3,
|
|
@@ -173,10 +183,10 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
173
183
|
]))
|
|
174
184
|
}), 128 /* KEYED_FRAGMENT */)),
|
|
175
185
|
(!$options.formKeys.length)
|
|
176
|
-
? (openBlock(), createElementBlock("p",
|
|
186
|
+
? (openBlock(), createElementBlock("p", _hoisted_5, toDisplayString(_ctx.t('nextcloud-vue', 'This step has no options.')), 1 /* TEXT */))
|
|
177
187
|
: createCommentVNode("v-if", true),
|
|
178
188
|
($options.canEditAsJson)
|
|
179
|
-
? (openBlock(), createElementBlock("details",
|
|
189
|
+
? (openBlock(), createElementBlock("details", _hoisted_6, [
|
|
180
190
|
createElementVNode("summary", null, toDisplayString(_ctx.t('nextcloud-vue', 'Advanced: edit as JSON')), 1 /* TEXT */),
|
|
181
191
|
createVNode(_component_NcTextArea, {
|
|
182
192
|
modelValue: $options.advancedJson,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CnFlowNodeEditModal.vue3.js","sources":["../../../src/dialogs/CnFlowNodeEditModal.vue?vue&type=template&id=e107484a&lang.js"],"sourcesContent":["<!--\n SPDX-FileCopyrightText: 2026 Conduction B.V. <info@conduction.nl>\n SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<NcDialog size=\"normal\"\n\t\t:name=\"typeLabel\"\n\t\t@closing=\"cancel\">\n\t\t<div class=\"cn-flow-node-edit\">\n\t\t\t<!-- What this step IS, in the engine's own words. -->\n\t\t\t<p v-if=\"entry && entry.description\" class=\"cn-flow-node-edit__description\">\n\t\t\t\t{{ entry.description }}\n\t\t\t</p>\n\t\t\t<p class=\"cn-flow-node-edit__id\">\n\t\t\t\t{{ node.type }}\n\t\t\t</p>\n\n\t\t\t<NcTextField :modelValue=\"draft.name\"\n\t\t\t\t:label=\"t('nextcloud-vue', 'Step name')\"\n\t\t\t\t:placeholder=\"typeLabel\"\n\t\t\t\t:helperText=\"t('nextcloud-vue', 'Shown on the card. Leave empty to show the step type.')\"\n\t\t\t\t@update:modelValue=\"draft.name = $event\" />\n\n\t\t\t<!-- One field per option the ENGINE declares for this step\n\t\t\t (`configKeys`), plus any key already set on the node. The\n\t\t\t widget follows the value: switches for booleans, a number\n\t\t\t field for numbers, a JSON area for structured values. -->\n\t\t\t<div v-for=\"key in formKeys\" :key=\"key\" class=\"cn-flow-node-edit__field\">\n\t\t\t\t<NcCheckboxRadioSwitch v-if=\"widgetFor(key) === 'switch'\"\n\t\t\t\t\t:modelValue=\"draft.config[key] === true\"\n\t\t\t\t\ttype=\"switch\"\n\t\t\t\t\t@update:modelValue=\"setKey(key, $event)\">\n\t\t\t\t\t{{ labelFor(key) }}\n\t\t\t\t</NcCheckboxRadioSwitch>\n\n\t\t\t\t<NcSelect v-else-if=\"widgetFor(key) === 'method'\"\n\t\t\t\t\t:modelValue=\"draft.config[key] || null\"\n\t\t\t\t\t:options=\"HTTP_METHODS\"\n\t\t\t\t\t:inputLabel=\"labelFor(key)\"\n\t\t\t\t\t:placeholder=\"t('nextcloud-vue', 'GET')\"\n\t\t\t\t\t@update:modelValue=\"setKey(key, $event)\" />\n\n\t\t\t\t<!-- A `select` field with `optionsFrom` renders as a picker fed\n\t\t\t\t by the URL the OWNING APP declared — never a bare uuid\n\t\t\t\t text box. -->\n\t\t\t\t<NcSelect v-else-if=\"widgetFor(key) === 'select'\"\n\t\t\t\t\t:modelValue=\"selectedOption(key)\"\n\t\t\t\t\t:options=\"selectOptions[key] || []\"\n\t\t\t\t\t:inputLabel=\"labelFor(key)\"\n\t\t\t\t\t:loading=\"selectLoading[key] === true\"\n\t\t\t\t\t:placeholder=\"t('nextcloud-vue', 'Pick one…')\"\n\t\t\t\t\t@update:modelValue=\"setKey(key, $event ? $event.id : '')\" />\n\n\t\t\t\t<NcTextArea v-else-if=\"widgetFor(key) === 'textarea'\"\n\t\t\t\t\t:modelValue=\"String(draft.config[key] ?? '')\"\n\t\t\t\t\t:label=\"labelFor(key)\"\n\t\t\t\t\t:helperText=\"hintFor(key)\"\n\t\t\t\t\trows=\"4\"\n\t\t\t\t\t@update:modelValue=\"setKey(key, $event)\" />\n\n\t\t\t\t<NcTextField v-else-if=\"widgetFor(key) === 'number'\"\n\t\t\t\t\t:modelValue=\"String(draft.config[key] ?? '')\"\n\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t:label=\"labelFor(key)\"\n\t\t\t\t\t@update:modelValue=\"setNumberKey(key, $event)\" />\n\n\t\t\t\t<NcTextArea v-else-if=\"widgetFor(key) === 'json'\"\n\t\t\t\t\t:modelValue=\"jsonDraftFor(key)\"\n\t\t\t\t\t:label=\"labelFor(key)\"\n\t\t\t\t\t:error=\"jsonErrors[key] !== undefined\"\n\t\t\t\t\t:helperText=\"jsonErrors[key] || t('nextcloud-vue', 'A structured value, as JSON.')\"\n\t\t\t\t\trows=\"4\"\n\t\t\t\t\t@update:modelValue=\"setJsonKey(key, $event)\" />\n\n\t\t\t\t<CnCronField v-else-if=\"widgetFor(key) === 'cron'\"\n\t\t\t\t\t:modelValue=\"String(draft.config[key] ?? '')\"\n\t\t\t\t\t:label=\"labelFor(key)\"\n\t\t\t\t\t@update:modelValue=\"setKey(key, $event)\" />\n\n\t\t\t\t<!-- `runAs` is a Nextcloud user id, and the SERVER decides\n\t\t\t\t whether this saver may act as that user — see\n\t\t\t\t FlowTriggerValidator::validateDelegation(). The picker\n\t\t\t\t defaults to the current user, which asserts no delegation\n\t\t\t\t at all; naming anyone else is a request the save may\n\t\t\t\t refuse, and refusing it here would only hide the reason. -->\n\t\t\t\t<!-- WHO the step asks. Users AND groups, because the step has\n\t\t\t\t always been able to ask either and the field could only ever\n\t\t\t\t say one word. Each option carries its own TYPE, so\n\t\t\t\t `{type: 'group', id: 'bezwaar'}` is stored as a group and\n\t\t\t\t nothing has to guess later. -->\n\t\t\t\t<NcSelect v-else-if=\"widgetFor(key) === 'principal'\"\n\t\t\t\t\t:modelValue=\"principalOptions(key)\"\n\t\t\t\t\t:options=\"principalChoices\"\n\t\t\t\t\t:inputLabel=\"labelFor(key)\"\n\t\t\t\t\t:loading=\"principalsLoading\"\n\t\t\t\t\t:multiple=\"true\"\n\t\t\t\t\tkeepOpen\n\t\t\t\t\t:placeholder=\"t('nextcloud-vue', 'Search people and groups…')\"\n\t\t\t\t\t:data-testid=\"`flow-node-principal-${key}`\"\n\t\t\t\t\t@search=\"searchPrincipals\"\n\t\t\t\t\t@update:modelValue=\"setPrincipals(key, $event)\" />\n\n\t\t\t\t<NcSelect v-else-if=\"widgetFor(key) === 'user'\"\n\t\t\t\t\t:modelValue=\"userOption(key)\"\n\t\t\t\t\t:options=\"userOptions\"\n\t\t\t\t\t:inputLabel=\"labelFor(key)\"\n\t\t\t\t\t:loading=\"usersLoading\"\n\t\t\t\t\t:placeholder=\"t('nextcloud-vue', 'Pick a user…')\"\n\t\t\t\t\t@update:modelValue=\"setKey(key, $event ? $event.id : '')\" />\n\n\t\t\t\t<NcTextField v-else\n\t\t\t\t\t:modelValue=\"String(draft.config[key] ?? '')\"\n\t\t\t\t\t:label=\"labelFor(key)\"\n\t\t\t\t\t:helperText=\"hintFor(key)\"\n\t\t\t\t\t@update:modelValue=\"setKey(key, $event)\" />\n\t\t\t</div>\n\n\t\t\t<p v-if=\"!formKeys.length\" class=\"cn-flow-node-edit__hint\">\n\t\t\t\t{{ t('nextcloud-vue', 'This step has no options.') }}\n\t\t\t</p>\n\n\t\t\t<!-- The whole document, for anything the fields above cannot say.\n\t\t\t Collapsed: the fields ARE the interface; this is the escape\n\t\t\t hatch that keeps every present and future key reachable.\n\n\t\t\t HIDDEN when it can reach nothing. A step the engine declares no\n\t\t\t options for, carrying no config, was showing \"This step has no\n\t\t\t options\" and then — as the only thing on the dialog you could\n\t\t\t actually touch — a JSON editor containing `{}`. That reads as\n\t\t\t \"configuring this needs JSON\", which is both wrong and the\n\t\t\t opposite of what the form is for. An escape hatch with nothing\n\t\t\t to escape to is not an advanced feature; it is noise on the\n\t\t\t simplest step in the editor. -->\n\t\t\t<details v-if=\"canEditAsJson\" class=\"cn-flow-node-edit__advanced\">\n\t\t\t\t<summary>{{ t('nextcloud-vue', 'Advanced: edit as JSON') }}</summary>\n\t\t\t\t<NcTextArea :modelValue=\"advancedJson\"\n\t\t\t\t\t:label=\"t('nextcloud-vue', 'Configuration (JSON)')\"\n\t\t\t\t\t:error=\"advancedError !== null\"\n\t\t\t\t\t:helperText=\"advancedError || t('nextcloud-vue', 'The full configuration document. The fields above update along.')\"\n\t\t\t\t\trows=\"8\"\n\t\t\t\t\t@update:modelValue=\"onAdvancedInput\" />\n\t\t\t</details>\n\t\t</div>\n\n\t\t<template #actions>\n\t\t\t<NcButton variant=\"error\" @click=\"removeStep\">\n\t\t\t\t{{ t('nextcloud-vue', 'Remove step') }}\n\t\t\t</NcButton>\n\t\t\t<NcButton @click=\"cancel\">\n\t\t\t\t{{ t('nextcloud-vue', 'Cancel') }}\n\t\t\t</NcButton>\n\t\t\t<NcButton variant=\"primary\" :disabled=\"hasErrors\" @click=\"done\">\n\t\t\t\t{{ t('nextcloud-vue', 'Done') }}\n\t\t\t</NcButton>\n\t\t</template>\n\t</NcDialog>\n</template>\n\n<script>\nimport { getCurrentUser } from '@nextcloud/auth'\nimport axios from '@nextcloud/axios'\nimport { generateUrl } from '@nextcloud/router'\nimport {\n\tNcButton,\n\tNcCheckboxRadioSwitch,\n\tNcDialog,\n\tNcSelect,\n\tNcTextArea,\n\tNcTextField,\n} from '@nextcloud/vue'\nimport CnCronField from '../components/CnCronField/CnCronField.vue'\nimport { useFlowStore } from '../composables/useFlowStore.js'\n\n/** The verbs an HTTP-shaped `method` option can take. */\n/**\n * The config keys that name WHO a step asks.\n *\n * These are the fields that carried a bare name and meant a user OR a group.\n * `runAs` is deliberately NOT here: it names the identity the step runs as,\n * which is a different question with a different answer type.\n */\nconst PRINCIPAL_KEYS = [\n\t'assignee',\n\t'candidates',\n\t'candidateUsers',\n\t'candidateGroups',\n\t'candidateRole',\n\t'routingFallback',\n]\n\nconst HTTP_METHODS = ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS']\n\n/**\n * CnFlowNodeEditModal — edit one flow step through a real form.\n *\n * One field per option the ENGINE declares for the step (the catalogue's\n * `configKeys`), plus any key already present on the node, each rendered with\n * a widget that follows the value: switches for booleans, a number field for\n * numbers, a JSON area for structured values, a method picker for `method`.\n * The catalogue publishes no per-key schema, so the widgets are derived — and\n * an Advanced section keeps the whole document editable, which is what keeps\n * every present and future key reachable without this dialog knowing it.\n *\n * Edits land on a DRAFT: Done commits it to `useFlowStore`, Cancel discards\n * it. Opened by setting `useFlowStore().editingNodeId`; hosted by\n * CnFlowDetail so it exists wherever the canvas does.\n */\nexport default {\n\tname: 'CnFlowNodeEditModal',\n\n\tcomponents: {\n\t\tCnCronField,\n\t\tNcButton,\n\t\tNcCheckboxRadioSwitch,\n\t\tNcDialog,\n\t\tNcSelect,\n\t\tNcTextArea,\n\t\tNcTextField,\n\t},\n\n\tsetup() {\n\t\treturn { store: useFlowStore() }\n\t},\n\n\tdata() {\n\t\tconst node = useFlowStore().editingNode || { config: {} }\n\n\t\treturn {\n\t\t\tHTTP_METHODS,\n\n\t\t\t// Everybody a step could ask, and whether that lookup is in\n\t\t\t// flight. Empty is a legitimate resting state: a stored reference\n\t\t\t// still shows, because it is synthesised rather than looked up.\n\t\t\tprincipals: [],\n\t\t\tprincipalsLoading: false,\n\n\t\t\t// Users for a `runAs`-shaped field, and whether that request is in\n\t\t\t// flight. Empty is a legitimate resting state: the picker still\n\t\t\t// offers the current user, so a schedule is authorable even when\n\t\t\t// the user list cannot be read.\n\t\t\tusers: [],\n\t\t\tusersLoading: false,\n\n\t\t\t// The draft the form edits. Committed on Done, discarded on Cancel.\n\t\t\tdraft: {\n\t\t\t\tname: node.name || '',\n\t\t\t\tconfig: JSON.parse(JSON.stringify(node.config || {})),\n\t\t\t},\n\n\t\t\t// Per-key raw text while a JSON-valued field is mid-edit, so typing\n\t\t\t// is not reformatted under the cursor.\n\t\t\tjsonDrafts: {},\n\t\t\tjsonErrors: {},\n\n\t\t\t// Options per select field, loaded from the `optionsFrom` URL the\n\t\t\t// OWNING APP declares for it in the node's configForm.\n\t\t\tselectOptions: {},\n\t\t\tselectLoading: {},\n\n\t\t\tadvancedDraft: null,\n\t\t\tadvancedError: null,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * @return {object} The node being edited. Falls back to an empty shape\n\t\t * so a dialog outliving its node cannot throw mid-render.\n\t\t */\n\t\tnode() {\n\t\t\treturn this.store.editingNode || { type: '', config: {} }\n\t\t},\n\n\t\t/**\n\t\t * @return {object|null} The catalogue entry for this node's type.\n\t\t */\n\t\tentry() {\n\t\t\treturn this.store.catalogEntry(this.node.type)\n\t\t},\n\n\t\t/**\n\t\t * @return {string} The dialog title: the step's human name.\n\t\t */\n\t\ttypeLabel() {\n\t\t\treturn this.entry ? (this.entry.displayName || this.entry.id) : (this.node.type || '—')\n\t\t},\n\n\t\t/**\n\t\t * The node's per-field declarations from the catalogue's `configForm`\n\t\t * ({key, label, type, help, required, optionsFrom}), keyed by config\n\t\t * key. `configKeys` is the degraded form. Either way the node's OWNER\n\t\t * declares the vocabulary — this dialog never invents fields.\n\t\t *\n\t\t * @return {object} key → field declaration.\n\t\t */\n\t\tfieldSpecs() {\n\t\t\tconst specs = {}\n\t\t\tfor (const field of (this.entry?.configForm || [])) {\n\t\t\t\tif (field && field.key) {\n\t\t\t\t\tspecs[field.key] = field\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn specs\n\t\t},\n\n\t\t/**\n\t\t * The keys the form renders: the declared vocabulary first, in its\n\t\t * order — `configForm` beats `configKeys` where both exist, keys only\n\t\t * one names are still rendered — then any key already set that neither\n\t\t * declares. `$`-prefixed keys are authoring annotations and stay in\n\t\t * Advanced.\n\t\t *\n\t\t * @return {Array<string>} The keys.\n\t\t */\n\t\t/**\n\t\t * Whether the raw-JSON escape hatch has anything to reach.\n\t\t *\n\t\t * True when the step declares options, or when the node already carries\n\t\t * config the form does not render. False for a step with neither, where\n\t\t * the hatch would only ever show an empty document.\n\t\t *\n\t\t * @return {boolean} Whether to offer the JSON editor.\n\t\t */\n\t\tcanEditAsJson() {\n\t\t\tif (this.formKeys.length > 0) {\n\t\t\t\treturn true\n\t\t\t}\n\n\t\t\treturn Object.keys(this.draft.config || {}).length > 0\n\t\t},\n\n\t\t/**\n\t\t * The signed-in user's id, or '' when there is no session.\n\t\t *\n\t\t * @return {string} The uid.\n\t\t */\n\t\tcurrentUid() {\n\t\t\treturn String(getCurrentUser()?.uid || '')\n\t\t},\n\n\t\t/**\n\t\t * The users offered for a `runAs` field.\n\t\t *\n\t\t * The current user is always present, and first. Naming yourself asserts\n\t\t * no delegation at all, so it is the one choice the server can never\n\t\t * refuse — which makes it both the right default and the right fallback\n\t\t * when the user list could not be read.\n\t\t *\n\t\t * @return {Array<object>} The options.\n\t\t */\n\t\tuserOptions() {\n\t\t\tconst me = this.currentUid\n\t\t\tconst mine = me === '' ? [] : [{ id: me, label: t('nextcloud-vue', '{uid} (you)', { uid: me }) }]\n\n\t\t\treturn [...mine, ...this.users.filter((user) => user.id !== me)]\n\t\t},\n\n\t\t/**\n\t\t * Everybody the picker can currently offer, users and groups together.\n\t\t *\n\t\t * @return {Array<object>} The options.\n\t\t */\n\t\tprincipalChoices() {\n\t\t\treturn this.principals\n\t\t},\n\n\t\tformKeys() {\n\t\t\tconst fromForm = (this.entry?.configForm || []).map((f) => f.key).filter(Boolean)\n\t\t\tconst declared = [\n\t\t\t\t...fromForm,\n\t\t\t\t...(this.entry?.configKeys || []).filter((k) => !fromForm.includes(k)),\n\t\t\t]\n\t\t\tconst present = Object.keys(this.draft.config).filter((k) => !k.startsWith('$') && !declared.includes(k))\n\n\t\t\treturn [...declared, ...present]\n\t\t},\n\n\t\t/**\n\t\t * @return {string} The draft config as pretty JSON, for Advanced.\n\t\t */\n\t\tadvancedJson() {\n\t\t\tif (this.advancedDraft !== null) {\n\t\t\t\treturn this.advancedDraft\n\t\t\t}\n\n\t\t\treturn JSON.stringify(this.draft.config, null, 2)\n\t\t},\n\n\t\t/**\n\t\t * @return {boolean} Whether any field holds unparseable JSON.\n\t\t */\n\t\thasErrors() {\n\t\t\treturn this.advancedError !== null || Object.keys(this.jsonErrors).length > 0\n\t\t},\n\t},\n\n\tcreated() {\n\t\t// Select fields need their options; everything else is local.\n\t\tfor (const [key, spec] of Object.entries(this.fieldSpecs)) {\n\t\t\tif (spec?.type === 'select' && spec?.optionsFrom) {\n\t\t\t\tthis.loadSelectOptions(key, spec)\n\t\t\t}\n\t\t}\n\n\t\tif (this.formKeys.some((key) => this.widgetFor(key) === 'principal')) {\n\t\t\t// An empty search returns the first page, so the picker opens with\n\t\t\t// something in it rather than an empty box the author has to guess\n\t\t\t// how to fill.\n\t\t\tthis.searchPrincipals('')\n\t\t}\n\n\t\tif (this.formKeys.some((key) => this.widgetFor(key) === 'user')) {\n\t\t\tthis.loadUsers()\n\t\t}\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Load the users a `runAs` field can name.\n\t\t *\n\t\t * Failure is not surfaced. The picker always offers the current user —\n\t\t * see `userOptions` — so a failed lookup costs the author the ability to\n\t\t * DELEGATE, not the ability to author a schedule at all. Blocking the\n\t\t * dialog on it would be a worse trade.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\t/**\n\t\t * The stored references on a field, as options the select can show.\n\t\t *\n\t\t * 🔴 A REFERENCE THE CURRENT USER CANNOT SEE MUST STILL SHOW. The\n\t\t * autocomplete endpoint answers with what THIS author may look up, and\n\t\t * a delegation is routinely to somebody they cannot. If an unmatched\n\t\t * reference rendered as nothing, opening a step and pressing Done would\n\t\t * silently clear it — a save that deletes the assignment while\n\t\t * appearing to change nothing.\n\t\t *\n\t\t * So every stored reference is synthesised into an option whether or\n\t\t * not the lookup found it, exactly as the single-user picker already\n\t\t * does for an unseen uid.\n\t\t *\n\t\t * @param {string} key The config key.\n\t\t * @return {Array<object>} The selected options.\n\t\t */\n\t\tprincipalOptions(key) {\n\t\t\treturn this.storedPrincipals(key).map((reference) => {\n\t\t\t\tconst id = `${reference.type}:${reference.id}`\n\t\t\t\tconst known = this.principals.find((option) => option.id === id)\n\n\t\t\t\treturn known || {\n\t\t\t\t\tid,\n\t\t\t\t\ttype: reference.type,\n\t\t\t\t\tvalue: reference.id,\n\t\t\t\t\tlabel: reference.id,\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * What a performer field currently holds, as `{type, id}` references.\n\t\t *\n\t\t * Reads both spellings, because both are stored across the fleet: a\n\t\t * bare string (which has always meant a user or a group of that name),\n\t\t * and a typed reference. A bare one is shown under the type the FIELD\n\t\t * NAME implies, so a `candidateGroups` entry does not appear as a\n\t\t * person.\n\t\t *\n\t\t * @param {string} key The config key.\n\t\t * @return {Array<object>} The references.\n\t\t */\n\t\tstoredPrincipals(key) {\n\t\t\tconst raw = this.draft.config[key]\n\t\t\tconst bareType = key === 'candidateGroups' || key === 'candidateRole' ? 'group' : 'user'\n\t\t\tconst list = Array.isArray(raw) ? raw : (raw === null || raw === undefined || raw === '' ? [] : [raw])\n\n\t\t\treturn list\n\t\t\t\t.map((entry) => {\n\t\t\t\t\tif (typeof entry === 'string') {\n\t\t\t\t\t\treturn entry.trim() === '' ? null : { type: bareType, id: entry.trim() }\n\t\t\t\t\t}\n\t\t\t\t\tif (entry && typeof entry === 'object') {\n\t\t\t\t\t\tconst id = String(entry.id ?? entry.value ?? '').trim()\n\n\t\t\t\t\t\treturn id === '' ? null : { type: String(entry.type || bareType), id }\n\t\t\t\t\t}\n\n\t\t\t\t\treturn null\n\t\t\t\t})\n\t\t\t\t.filter(Boolean)\n\t\t},\n\n\t\t/**\n\t\t * Write the picked references back onto the field.\n\t\t *\n\t\t * Always as typed references, never as bare strings: the whole point is\n\t\t * that the document records which kind of thing was meant, so a save\n\t\t * from this picker is never ambiguous again.\n\t\t *\n\t\t * @param {string} key The config key.\n\t\t * @param {Array<object>} picked What the select handed back.\n\t\t * @return {void}\n\t\t */\n\t\tsetPrincipals(key, picked) {\n\t\t\tconst references = (picked || []).map((option) => ({\n\t\t\t\ttype: option.type || 'user',\n\t\t\t\tid: option.value || String(option.id || '').split(':').slice(1).join(':'),\n\t\t\t})).filter((reference) => reference.id !== '')\n\n\t\t\t// A single-valued field keeps its shape: `assignee` is one\n\t\t\t// performer, and turning it into a list would change what the\n\t\t\t// engine reads.\n\t\t\tif (key === 'assignee' || key === 'routingFallback' || key === 'candidateRole') {\n\t\t\t\tthis.setKey(key, references[0] || '')\n\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tthis.setKey(key, references)\n\t\t},\n\n\t\t/**\n\t\t * Look people and groups up as the author types.\n\t\t *\n\t\t * 🔑 THE SAME ENDPOINT THE MENTION PICKER USES, with `shareTypes[]` 0\n\t\t * AND 1 — users and groups. OpenRegister publishes no user list and the\n\t\t * OCS user-listing API is admin-only, so this is the only source a\n\t\t * non-admin author can read.\n\t\t *\n\t\t * ⚠️ IT DOES NOT DECIDE WHAT IS VALID. A type this editor cannot search\n\t\t * — a position, a function, a case role — is still a legal reference,\n\t\t * and the server's resolver registry is what says so. That is why a\n\t\t * stored reference is synthesised rather than filtered against these\n\t\t * results.\n\t\t *\n\t\t * @param {string} query What the author typed.\n\t\t * @return {Promise<void>} When the lookup has settled.\n\t\t */\n\t\tasync searchPrincipals(query) {\n\t\t\tthis.principalsLoading = true\n\t\t\ttry {\n\t\t\t\tconst response = await axios.get(\n\t\t\t\t\tgenerateUrl('/ocs/v2.php/core/autocomplete/get'),\n\t\t\t\t\t{\n\t\t\t\t\t\tparams: {\n\t\t\t\t\t\t\tsearch: String(query || ''),\n\t\t\t\t\t\t\titemType: '',\n\t\t\t\t\t\t\titemId: '',\n\t\t\t\t\t\t\t'shareTypes[]': [0, 1],\n\t\t\t\t\t\t\tlimit: 50,\n\t\t\t\t\t\t},\n\t\t\t\t\t\theaders: { 'OCS-APIRequest': 'true', Accept: 'application/json' },\n\t\t\t\t\t},\n\t\t\t\t)\n\n\t\t\t\tconst rows = response?.data?.ocs?.data || []\n\t\t\t\tthis.principals = (Array.isArray(rows) ? rows : [])\n\t\t\t\t\t.map((row) => {\n\t\t\t\t\t\tconst type = row.source === 'groups' ? 'group' : 'user'\n\t\t\t\t\t\tconst id = String(row.id ?? '')\n\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tid: `${type}:${id}`,\n\t\t\t\t\t\t\ttype,\n\t\t\t\t\t\t\tvalue: id,\n\t\t\t\t\t\t\tlabel: `${String(row.label ?? id)}${type === 'group' ? this.t('nextcloud-vue', ' (group)') : ''}`,\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t.filter((option) => option.value !== '')\n\t\t\t} catch {\n\t\t\t\t// A failed lookup must not clear what is already picked: the\n\t\t\t\t// selected options are synthesised from the document, not from\n\t\t\t\t// this list.\n\t\t\t\tthis.principals = []\n\t\t\t} finally {\n\t\t\t\tthis.principalsLoading = false\n\t\t\t}\n\t\t},\n\n\t\tasync loadUsers() {\n\t\t\tthis.usersLoading = true\n\t\t\ttry {\n\t\t\t\t// Nextcloud's OWN autocomplete endpoint — the one the mention\n\t\t\t\t// picker uses. OpenRegister publishes no user list, and the OCS\n\t\t\t\t// user-listing API is admin-only, so this is the only source a\n\t\t\t\t// non-admin author can read. `shareTypes[]=0` restricts it to\n\t\t\t\t// users, keeping groups and circles out of a field that takes a\n\t\t\t\t// single uid.\n\t\t\t\tconst response = await axios.get(\n\t\t\t\t\tgenerateUrl('/ocs/v2.php/core/autocomplete/get'),\n\t\t\t\t\t{\n\t\t\t\t\t\tparams: { search: '', itemType: '', itemId: '', 'shareTypes[]': 0, limit: 50 },\n\t\t\t\t\t\theaders: { 'OCS-APIRequest': 'true', Accept: 'application/json' },\n\t\t\t\t\t},\n\t\t\t\t)\n\n\t\t\t\tconst rows = response?.data?.ocs?.data || []\n\t\t\t\tthis.users = (Array.isArray(rows) ? rows : [])\n\t\t\t\t\t.filter((row) => row.source === 'users')\n\t\t\t\t\t.map((row) => ({ id: String(row.id ?? ''), label: String(row.label ?? row.id ?? '') }))\n\t\t\t\t\t.filter((row) => row.id !== '')\n\t\t\t} catch {\n\t\t\t\tthis.users = []\n\t\t\t} finally {\n\t\t\t\tthis.usersLoading = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * The selected user for a key, synthesised when it is not in the list.\n\t\t *\n\t\t * A stored uid the current user cannot see must still SHOW. Dropping it\n\t\t * would make the field look empty and a save would then clear a\n\t\t * delegation the author never touched.\n\t\t *\n\t\t * @param {string} key The config key.\n\t\t * @return {object|null} The option.\n\t\t */\n\t\tuserOption(key) {\n\t\t\tconst value = String(this.draft.config[key] ?? '')\n\t\t\tif (value === '') {\n\t\t\t\treturn null\n\t\t\t}\n\n\t\t\treturn this.userOptions.find((option) => option.id === value) || { id: value, label: value }\n\t\t},\n\n\t\t/**\n\t\t * Which widget a key gets: the owner's declaration first, the VALUE\n\t\t * second, the key's name last.\n\t\t *\n\t\t * @param {string} key The config key.\n\t\t * @return {string} 'select' | 'switch' | 'number' | 'textarea' | 'json' | 'method' | 'text'\n\t\t */\n\t\twidgetFor(key) {\n\t\t\tconst spec = this.fieldSpecs[key]\n\t\t\tif (spec?.type === 'select' && spec?.optionsFrom) {\n\t\t\t\treturn 'select'\n\t\t\t}\n\t\t\tif (spec?.type === 'boolean') {\n\t\t\t\treturn 'switch'\n\t\t\t}\n\t\t\tif (spec?.type === 'number') {\n\t\t\t\treturn 'number'\n\t\t\t}\n\t\t\tif (spec?.type === 'textarea') {\n\t\t\t\treturn 'textarea'\n\t\t\t}\n\n\t\t\t// Keyed on the engine's own declaration where it makes one, and on\n\t\t\t// the key name otherwise. `cron` and `runAs` are the schedule\n\t\t\t// trigger's required vocabulary — a bare text box for either is a\n\t\t\t// schedule that fails at 03:00, with nobody watching.\n\t\t\tif (spec?.type === 'cron' || spec?.format === 'cron' || key === 'cron') {\n\t\t\t\treturn 'cron'\n\t\t\t}\n\t\t\t// 🔴 `runAs` KEEPS THE SINGLE-USER PICKER. It is not a performer:\n\t\t\t// it names the identity the step RUNS AS, the server decides\n\t\t\t// whether this author may delegate to it, and a group cannot be\n\t\t\t// one. Checked BEFORE the principal branch so a step that declares\n\t\t\t// `runAs` as a principal cannot widen it.\n\t\t\tif (key === 'runAs') {\n\t\t\t\treturn 'user'\n\t\t\t}\n\n\t\t\t// Who the step ASKS. Keyed on the engine's own declaration where it\n\t\t\t// makes one, and on the performer key names otherwise — those are\n\t\t\t// the fields that carried a bare name and meant a user OR a group.\n\t\t\tif (spec?.type === 'principal' || PRINCIPAL_KEYS.includes(key)) {\n\t\t\t\treturn 'principal'\n\t\t\t}\n\n\t\t\tif (spec?.type === 'user') {\n\t\t\t\treturn 'user'\n\t\t\t}\n\n\t\t\tconst value = this.draft.config[key]\n\t\t\tif (typeof value === 'boolean') {\n\t\t\t\treturn 'switch'\n\t\t\t}\n\t\t\tif (typeof value === 'number') {\n\t\t\t\treturn 'number'\n\t\t\t}\n\t\t\tif (value !== null && value !== undefined && typeof value === 'object') {\n\t\t\t\treturn 'json'\n\t\t\t}\n\t\t\tif (key === 'method') {\n\t\t\t\treturn 'method'\n\t\t\t}\n\n\t\t\treturn 'text'\n\t\t},\n\n\t\t/**\n\t\t * The picker option matching a select field's stored value —\n\t\t * synthesised from the raw value when it is not in the loaded options,\n\t\t * so an existing configuration is never blanked.\n\t\t *\n\t\t * @param {string} key The config key.\n\t\t * @return {object|null} The selected option.\n\t\t */\n\t\tselectedOption(key) {\n\t\t\tconst value = this.draft.config[key]\n\t\t\tif (value === undefined || value === null || value === '') {\n\t\t\t\treturn null\n\t\t\t}\n\n\t\t\tconst options = this.selectOptions[key] || []\n\t\t\treturn options.find((o) => o.id === value) || { id: value, label: String(value) }\n\t\t},\n\n\t\t/**\n\t\t * Load the pickable choices for one select field, from the URL its\n\t\t * owning app declared (`optionsFrom`).\n\t\t *\n\t\t * Accepts `{results: [...]}` or a bare array; items as `{id, label}`,\n\t\t * `{value, label}`, or OpenRegister objects (uuid from `@self`, label\n\t\t * from name/title) — the app owns the endpoint, this dialog only has\n\t\t * to read it.\n\t\t *\n\t\t * @param {string} key The config key.\n\t\t * @param {object} spec The field declaration carrying `optionsFrom`.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync loadSelectOptions(key, spec) {\n\t\t\tthis.selectLoading = { ...this.selectLoading, [key]: true }\n\t\t\ttry {\n\t\t\t\tconst url = String(spec.optionsFrom)\n\t\t\t\tconst response = await axios.get(url.startsWith('/') && !url.startsWith('/apps') && !url.startsWith('/index.php')\n\t\t\t\t\t? generateUrl(url)\n\t\t\t\t\t: url)\n\t\t\t\tconst rows = Array.isArray(response.data) ? response.data : (response.data?.results || [])\n\t\t\t\tconst options = rows.map((row) => {\n\t\t\t\t\tconst id = row.id ?? row.value ?? row['@self']?.uuid ?? row.uuid\n\t\t\t\t\treturn {\n\t\t\t\t\t\tid,\n\t\t\t\t\t\tlabel: row.label || row.name || row.title || String(id),\n\t\t\t\t\t}\n\t\t\t\t}).filter((o) => o.id !== undefined && o.id !== null && o.id !== '')\n\t\t\t\tthis.selectOptions = { ...this.selectOptions, [key]: options }\n\t\t\t} catch (error) {\n\t\t\t\t// A picker that could not load degrades to showing the stored\n\t\t\t\t// value; the Advanced editor still reaches everything.\n\t\t\t\t// eslint-disable-next-line no-console -- diagnostic for a failure this code already degrades from\n\t\t\t\tconsole.error(`cn-flow: could not load options for \"${key}\"`, error)\n\t\t\t} finally {\n\t\t\t\tthis.selectLoading = { ...this.selectLoading, [key]: false }\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * A key as a field label: the owner's translated `label` when the\n\t\t * configForm declares one, else `sourceId` → `Source id`.\n\t\t *\n\t\t * @param {string} key The config key.\n\t\t * @return {string} The label.\n\t\t */\n\t\tlabelFor(key) {\n\t\t\tconst declared = this.fieldSpecs[key]?.label\n\t\t\tif (declared) {\n\t\t\t\treturn declared\n\t\t\t}\n\n\t\t\tconst spaced = key\n\t\t\t\t.replace(/[_-]+/g, ' ')\n\t\t\t\t.replace(/([a-z0-9])([A-Z])/g, '$1 $2')\n\t\t\t\t.toLowerCase()\n\n\t\t\treturn spaced.charAt(0).toUpperCase() + spaced.slice(1)\n\t\t},\n\n\t\t/**\n\t\t * The helper line under a field: the owner's `help` (prefixed when the\n\t\t * field is required), else the built-in hints for keys that earn one.\n\t\t *\n\t\t * @param {string} key The config key.\n\t\t * @return {string|undefined} The helper line.\n\t\t */\n\t\thintFor(key) {\n\t\t\tconst spec = this.fieldSpecs[key]\n\t\t\tif (spec?.help) {\n\t\t\t\treturn spec.required === true\n\t\t\t\t\t? `${this.t('nextcloud-vue', 'Required.')} ${spec.help}`\n\t\t\t\t\t: spec.help\n\t\t\t}\n\t\t\tif (spec?.required === true) {\n\t\t\t\treturn this.t('nextcloud-vue', 'Required.')\n\t\t\t}\n\t\t\tif (key === 'cron') {\n\t\t\t\treturn this.t('nextcloud-vue', 'For example 0 9 * * 1 — 09:00 every Monday.')\n\t\t\t}\n\n\t\t\treturn undefined\n\t\t},\n\n\t\t/**\n\t\t * @param {string} key The config key.\n\t\t * @param {unknown} value The new value.\n\t\t * @return {void}\n\t\t */\n\t\tsetKey(key, value) {\n\t\t\tthis.draft.config = { ...this.draft.config, [key]: value }\n\t\t\tthis.advancedDraft = null\n\t\t\tthis.advancedError = null\n\t\t},\n\n\t\t/**\n\t\t * @param {string} key The config key.\n\t\t * @param {string} text The number field's text.\n\t\t * @return {void}\n\t\t */\n\t\tsetNumberKey(key, text) {\n\t\t\tconst parsed = Number(text)\n\t\t\tthis.setKey(key, Number.isFinite(parsed) ? parsed : text)\n\t\t},\n\n\t\t/**\n\t\t * @param {string} key The config key.\n\t\t * @return {string} The key's value as JSON text, or its mid-edit draft.\n\t\t */\n\t\tjsonDraftFor(key) {\n\t\t\tif (this.jsonDrafts[key] !== undefined) {\n\t\t\t\treturn this.jsonDrafts[key]\n\t\t\t}\n\n\t\t\treturn JSON.stringify(this.draft.config[key], null, 2)\n\t\t},\n\n\t\t/**\n\t\t * Parse one JSON-valued field, keeping the last valid value on error.\n\t\t *\n\t\t * @param {string} key The config key.\n\t\t * @param {string} text The raw JSON text.\n\t\t * @return {void}\n\t\t */\n\t\tsetJsonKey(key, text) {\n\t\t\tthis.jsonDrafts = { ...this.jsonDrafts, [key]: text }\n\t\t\ttry {\n\t\t\t\tconst parsed = JSON.parse(text)\n\t\t\t\tconst rest = { ...this.jsonErrors }\n\t\t\t\tdelete rest[key]\n\t\t\t\tthis.jsonErrors = rest\n\t\t\t\tthis.setKey(key, parsed)\n\t\t\t} catch {\n\t\t\t\tthis.jsonErrors = {\n\t\t\t\t\t...this.jsonErrors,\n\t\t\t\t\t[key]: this.t('nextcloud-vue', 'Not valid JSON, so this option keeps its previous value.'),\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Parse the whole document, keeping the last valid draft on error.\n\t\t *\n\t\t * @param {string} text The raw JSON text.\n\t\t * @return {void}\n\t\t */\n\t\tonAdvancedInput(text) {\n\t\t\tthis.advancedDraft = text\n\t\t\ttry {\n\t\t\t\tconst parsed = JSON.parse(text || '{}')\n\t\t\t\tif (parsed === null || typeof parsed !== 'object' || Array.isArray(parsed)) {\n\t\t\t\t\tthis.advancedError = this.t('nextcloud-vue', 'A step configuration must be a JSON object.')\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tthis.advancedError = null\n\t\t\t\tthis.draft.config = parsed\n\t\t\t\tthis.jsonDrafts = {}\n\t\t\t\tthis.jsonErrors = {}\n\t\t\t} catch {\n\t\t\t\tthis.advancedError = this.t('nextcloud-vue', 'Not valid JSON, so the configuration keeps its previous value.')\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Commit the draft and close.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tdone() {\n\t\t\tconst id = this.store.editingNodeId\n\t\t\tif (id !== null) {\n\t\t\t\tthis.store.setNodeConfigById(id, this.draft.config)\n\t\t\t\tthis.store.setNodeName(id, this.draft.name)\n\t\t\t}\n\t\t\tthis.store.editingNodeId = null\n\t\t},\n\n\t\t/**\n\t\t * Discard the draft and close.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tcancel() {\n\t\t\tthis.store.editingNodeId = null\n\t\t},\n\n\t\t/**\n\t\t * Remove the step entirely and close.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tremoveStep() {\n\t\t\tconst id = this.store.editingNodeId\n\t\t\tthis.store.editingNodeId = null\n\t\t\tif (id !== null) {\n\t\t\t\tthis.store.removeNode(id)\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-flow-node-edit {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 12px;\n\tpadding-block-end: 8px;\n}\n\n.cn-flow-node-edit__description {\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-flow-node-edit__id,\n.cn-flow-node-edit__hint {\n\tfont-size: 0.85em;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-flow-node-edit__advanced summary {\n\tcursor: pointer;\n\tcolor: var(--color-text-maxcontrast);\n\tmargin-block-end: 8px;\n}\n</style>\n"],"names":["_createBlock","_createVNode","_createElementVNode","_toDisplayString","_createElementBlock","_Fragment","_renderList","_createTextVNode"],"mappings":";;AAYM,MAAA,UAAA,GAAA,EAAA,KAAA,EAAA,mBAAA,GAAA;;;AAEY,EAAA,KAAA,EAAA,gCAAA;;AAGZ,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,uBAAuB,GAAA;;;AAwGL,EAAA,KAAK,EAAC,yBAAyB;;;;AAgB5B,EAAA,KAAE,EAAA,6BAAA;;;;;;;;;;;;uBAhIhCA;AAAQ,IAAA,IAAI,EAAC,QAAQ;AACrB,IAAA,IAAI,EAAE,QAAS,CAAA,SAAA;AACd,IAAA,SAAM,EAAE,QAAM,CAAA,MAAA;;AAyIL,IAAA,OAAO,UAChB,MAEU;MAFVC,WAEU,CAAA,mBAAA,EAAA;AAFD,QAAA,OAAO,EAAC,OAAO;AAAE,QAAA,OAAI,EAAG,QAAA,CAAA,UAAA;;yBACjC,MAAS;0CAAN,IAAC,CAAA,CAAA,CAAA,eAAA,EAAA,aAAA,CAAA,CAAA,EAAA,CAAA,YAAA;;;;iBAII,CAAA,mBAAA,EAAA,EAFE,OAAK,EAAE,QAAM,CAAA,MAAA,EAAA,EAAA;yBACvB,MAAS;0CAAN,IAAC,CAAA,CAAA,CAAA,eAAA,EAAA,QAAA,CAAA,CAAA,EAAA,CAAA,YAAA;;;;MAELA;AAAQ,QAAA,OAAA,EAAA,SAAA;AAAA,QAAA,QAAA,EAAA,QAAA,CAAA,SAAA;AAAA,QAAA,OAAA,EAAA,QAAA,CAAA,IAAA;;;;;;;;qBA/IR,MAsIK;AAtIL,MAAAC,kBAAA,CAsIK,OAtIL,UAsIK,EAAA;SApII,QAAK,CAAA,KAAA,IAAC,QAAA,CAAA,KAAA,CAAA,WAAA;8DACZC,eAAA,CAAA,QA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AA,KAAK,EAAE,IAAC,CAAA,CAAA,CAAA,eAAA,EAAA,sBAAA,CAAA;AACR,gBAAA,KAAK,EAAC,KAAA,CAAA,aAAA,KAAA,IAAA;gBACN,UAAC,EAAA,KAAA,CAAA,aAAA,IAAA,IAAA,CAAA,CAAA,CAAA,eAAA,EAAA,iEAAA,CAAA;;AAED,gBAAA,qBAAc,EAAA,QAAA,CAAA,eAAA;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"CnFlowNodeEditModal.vue3.js","sources":["../../../src/dialogs/CnFlowNodeEditModal.vue?vue&type=template&id=e107484a&lang.js"],"sourcesContent":["<!--\n SPDX-FileCopyrightText: 2026 Conduction B.V. <info@conduction.nl>\n SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<NcDialog size=\"normal\"\n\t\t:name=\"typeLabel\"\n\t\t@closing=\"cancel\">\n\t\t<div class=\"cn-flow-node-edit\">\n\t\t\t<!-- What this step IS, in the engine's own words. -->\n\t\t\t<p v-if=\"entry && entry.description\" class=\"cn-flow-node-edit__description\">\n\t\t\t\t{{ entry.description }}\n\t\t\t</p>\n\t\t\t<p class=\"cn-flow-node-edit__id\">\n\t\t\t\t{{ node.type }}\n\t\t\t</p>\n\n\t\t\t<NcTextField :modelValue=\"draft.name\"\n\t\t\t\t:label=\"t('nextcloud-vue', 'Step name')\"\n\t\t\t\t:placeholder=\"typeLabel\"\n\t\t\t\t:helperText=\"t('nextcloud-vue', 'Shown on the card. Leave empty to show the step type.')\"\n\t\t\t\t@update:modelValue=\"draft.name = $event\" />\n\n\t\t\t<!-- One field per option the ENGINE declares for this step\n\t\t\t (`configKeys`), plus any key already set on the node. The\n\t\t\t widget follows the value: switches for booleans, a number\n\t\t\t field for numbers, a JSON area for structured values. -->\n\t\t\t<div v-for=\"key in formKeys\" :key=\"key\" class=\"cn-flow-node-edit__field\">\n\t\t\t\t<NcCheckboxRadioSwitch v-if=\"widgetFor(key) === 'switch'\"\n\t\t\t\t\t:modelValue=\"draft.config[key] === true\"\n\t\t\t\t\ttype=\"switch\"\n\t\t\t\t\t@update:modelValue=\"setKey(key, $event)\">\n\t\t\t\t\t{{ labelFor(key) }}\n\t\t\t\t</NcCheckboxRadioSwitch>\n\n\t\t\t\t<NcSelect v-else-if=\"widgetFor(key) === 'method'\"\n\t\t\t\t\t:modelValue=\"draft.config[key] || null\"\n\t\t\t\t\t:options=\"HTTP_METHODS\"\n\t\t\t\t\t:inputLabel=\"labelFor(key)\"\n\t\t\t\t\t:placeholder=\"t('nextcloud-vue', 'GET')\"\n\t\t\t\t\t@update:modelValue=\"setKey(key, $event)\" />\n\n\t\t\t\t<!-- A `select` field renders as a picker, never a bare text box.\n\t\t\t\t Its choices come from the URL the OWNING APP declared\n\t\t\t\t (`optionsFrom`) or from the form itself (`options`), for a\n\t\t\t\t short fixed vocabulary with no endpoint of its own. -->\n\t\t\t\t<template v-else-if=\"widgetFor(key) === 'select'\">\n\t\t\t\t\t<NcSelect :modelValue=\"selectedOption(key)\"\n\t\t\t\t\t\tclass=\"cn-flow-node-edit__select\"\n\t\t\t\t\t\t:options=\"selectOptions[key] || []\"\n\t\t\t\t\t\t:inputLabel=\"labelFor(key)\"\n\t\t\t\t\t\t:loading=\"selectLoading[key] === true\"\n\t\t\t\t\t\t:placeholder=\"t('nextcloud-vue', 'Pick one…')\"\n\t\t\t\t\t\t@update:modelValue=\"setKey(key, $event ? $event.id : '')\" />\n\t\t\t\t\t<!-- NcSelect has no helper text of its own, so the help\n\t\t\t\t\t follows the control, the next thing a screen reader\n\t\t\t\t\t reads after it. -->\n\t\t\t\t\t<p v-if=\"hintFor(key)\"\n\t\t\t\t\t\tclass=\"cn-flow-node-edit__field-help\"\n\t\t\t\t\t\t:data-testid=\"`flow-node-help-${key}`\">\n\t\t\t\t\t\t{{ hintFor(key) }}\n\t\t\t\t\t</p>\n\t\t\t\t</template>\n\n\t\t\t\t<NcTextArea v-else-if=\"widgetFor(key) === 'textarea'\"\n\t\t\t\t\t:modelValue=\"String(draft.config[key] ?? '')\"\n\t\t\t\t\t:label=\"labelFor(key)\"\n\t\t\t\t\t:helperText=\"hintFor(key)\"\n\t\t\t\t\trows=\"4\"\n\t\t\t\t\t@update:modelValue=\"setKey(key, $event)\" />\n\n\t\t\t\t<NcTextField v-else-if=\"widgetFor(key) === 'number'\"\n\t\t\t\t\t:modelValue=\"String(draft.config[key] ?? '')\"\n\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t:label=\"labelFor(key)\"\n\t\t\t\t\t@update:modelValue=\"setNumberKey(key, $event)\" />\n\n\t\t\t\t<NcTextArea v-else-if=\"widgetFor(key) === 'json'\"\n\t\t\t\t\t:modelValue=\"jsonDraftFor(key)\"\n\t\t\t\t\t:label=\"labelFor(key)\"\n\t\t\t\t\t:error=\"jsonErrors[key] !== undefined\"\n\t\t\t\t\t:helperText=\"jsonErrors[key] || t('nextcloud-vue', 'A structured value, as JSON.')\"\n\t\t\t\t\trows=\"4\"\n\t\t\t\t\t@update:modelValue=\"setJsonKey(key, $event)\" />\n\n\t\t\t\t<CnCronField v-else-if=\"widgetFor(key) === 'cron'\"\n\t\t\t\t\t:modelValue=\"String(draft.config[key] ?? '')\"\n\t\t\t\t\t:label=\"labelFor(key)\"\n\t\t\t\t\t@update:modelValue=\"setKey(key, $event)\" />\n\n\t\t\t\t<!-- `runAs` is a Nextcloud user id, and the SERVER decides\n\t\t\t\t whether this saver may act as that user — see\n\t\t\t\t FlowTriggerValidator::validateDelegation(). The picker\n\t\t\t\t defaults to the current user, which asserts no delegation\n\t\t\t\t at all; naming anyone else is a request the save may\n\t\t\t\t refuse, and refusing it here would only hide the reason. -->\n\t\t\t\t<!-- WHO the step asks. Users AND groups, because the step has\n\t\t\t\t always been able to ask either and the field could only ever\n\t\t\t\t say one word. Each option carries its own TYPE, so\n\t\t\t\t `{type: 'group', id: 'bezwaar'}` is stored as a group and\n\t\t\t\t nothing has to guess later. -->\n\t\t\t\t<NcSelect v-else-if=\"widgetFor(key) === 'principal'\"\n\t\t\t\t\t:modelValue=\"principalOptions(key)\"\n\t\t\t\t\t:options=\"principalChoices\"\n\t\t\t\t\t:inputLabel=\"labelFor(key)\"\n\t\t\t\t\t:loading=\"principalsLoading\"\n\t\t\t\t\t:multiple=\"true\"\n\t\t\t\t\tkeepOpen\n\t\t\t\t\t:placeholder=\"t('nextcloud-vue', 'Search people and groups…')\"\n\t\t\t\t\t:data-testid=\"`flow-node-principal-${key}`\"\n\t\t\t\t\t@search=\"searchPrincipals\"\n\t\t\t\t\t@update:modelValue=\"setPrincipals(key, $event)\" />\n\n\t\t\t\t<NcSelect v-else-if=\"widgetFor(key) === 'user'\"\n\t\t\t\t\t:modelValue=\"userOption(key)\"\n\t\t\t\t\t:options=\"userOptions\"\n\t\t\t\t\t:inputLabel=\"labelFor(key)\"\n\t\t\t\t\t:loading=\"usersLoading\"\n\t\t\t\t\t:placeholder=\"t('nextcloud-vue', 'Pick a user…')\"\n\t\t\t\t\t@update:modelValue=\"setKey(key, $event ? $event.id : '')\" />\n\n\t\t\t\t<NcTextField v-else\n\t\t\t\t\t:modelValue=\"String(draft.config[key] ?? '')\"\n\t\t\t\t\t:label=\"labelFor(key)\"\n\t\t\t\t\t:helperText=\"hintFor(key)\"\n\t\t\t\t\t@update:modelValue=\"setKey(key, $event)\" />\n\t\t\t</div>\n\n\t\t\t<p v-if=\"!formKeys.length\" class=\"cn-flow-node-edit__hint\">\n\t\t\t\t{{ t('nextcloud-vue', 'This step has no options.') }}\n\t\t\t</p>\n\n\t\t\t<!-- The whole document, for anything the fields above cannot say.\n\t\t\t Collapsed: the fields ARE the interface; this is the escape\n\t\t\t hatch that keeps every present and future key reachable.\n\n\t\t\t HIDDEN when it can reach nothing. A step the engine declares no\n\t\t\t options for, carrying no config, was showing \"This step has no\n\t\t\t options\" and then — as the only thing on the dialog you could\n\t\t\t actually touch — a JSON editor containing `{}`. That reads as\n\t\t\t \"configuring this needs JSON\", which is both wrong and the\n\t\t\t opposite of what the form is for. An escape hatch with nothing\n\t\t\t to escape to is not an advanced feature; it is noise on the\n\t\t\t simplest step in the editor. -->\n\t\t\t<details v-if=\"canEditAsJson\" class=\"cn-flow-node-edit__advanced\">\n\t\t\t\t<summary>{{ t('nextcloud-vue', 'Advanced: edit as JSON') }}</summary>\n\t\t\t\t<NcTextArea :modelValue=\"advancedJson\"\n\t\t\t\t\t:label=\"t('nextcloud-vue', 'Configuration (JSON)')\"\n\t\t\t\t\t:error=\"advancedError !== null\"\n\t\t\t\t\t:helperText=\"advancedError || t('nextcloud-vue', 'The full configuration document. The fields above update along.')\"\n\t\t\t\t\trows=\"8\"\n\t\t\t\t\t@update:modelValue=\"onAdvancedInput\" />\n\t\t\t</details>\n\t\t</div>\n\n\t\t<template #actions>\n\t\t\t<NcButton variant=\"error\" @click=\"removeStep\">\n\t\t\t\t{{ t('nextcloud-vue', 'Remove step') }}\n\t\t\t</NcButton>\n\t\t\t<NcButton @click=\"cancel\">\n\t\t\t\t{{ t('nextcloud-vue', 'Cancel') }}\n\t\t\t</NcButton>\n\t\t\t<NcButton variant=\"primary\" :disabled=\"hasErrors\" @click=\"done\">\n\t\t\t\t{{ t('nextcloud-vue', 'Done') }}\n\t\t\t</NcButton>\n\t\t</template>\n\t</NcDialog>\n</template>\n\n<script>\nimport { getCurrentUser } from '@nextcloud/auth'\nimport axios from '@nextcloud/axios'\nimport { generateUrl } from '@nextcloud/router'\nimport {\n\tNcButton,\n\tNcCheckboxRadioSwitch,\n\tNcDialog,\n\tNcSelect,\n\tNcTextArea,\n\tNcTextField,\n} from '@nextcloud/vue'\nimport CnCronField from '../components/CnCronField/CnCronField.vue'\nimport { useFlowStore } from '../composables/useFlowStore.js'\nimport { hasStaticOptions, normaliseSelectOptions } from '../utils/selectOptions.js'\n\n/** The verbs an HTTP-shaped `method` option can take. */\n/**\n * The config keys that name WHO a step asks.\n *\n * These are the fields that carried a bare name and meant a user OR a group.\n * `runAs` is deliberately NOT here: it names the identity the step runs as,\n * which is a different question with a different answer type.\n */\nconst PRINCIPAL_KEYS = [\n\t'assignee',\n\t'candidates',\n\t'candidateUsers',\n\t'candidateGroups',\n\t'candidateRole',\n\t'routingFallback',\n]\n\nconst HTTP_METHODS = ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS']\n\n/**\n * CnFlowNodeEditModal — edit one flow step through a real form.\n *\n * One field per option the ENGINE declares for the step (the catalogue's\n * `configKeys`), plus any key already present on the node, each rendered with\n * a widget that follows the value: switches for booleans, a number field for\n * numbers, a JSON area for structured values, a method picker for `method`.\n * The catalogue publishes no per-key schema, so the widgets are derived — and\n * an Advanced section keeps the whole document editable, which is what keeps\n * every present and future key reachable without this dialog knowing it.\n *\n * Edits land on a DRAFT: Done commits it to `useFlowStore`, Cancel discards\n * it. Opened by setting `useFlowStore().editingNodeId`; hosted by\n * CnFlowDetail so it exists wherever the canvas does.\n */\nexport default {\n\tname: 'CnFlowNodeEditModal',\n\n\tcomponents: {\n\t\tCnCronField,\n\t\tNcButton,\n\t\tNcCheckboxRadioSwitch,\n\t\tNcDialog,\n\t\tNcSelect,\n\t\tNcTextArea,\n\t\tNcTextField,\n\t},\n\n\tsetup() {\n\t\treturn { store: useFlowStore() }\n\t},\n\n\tdata() {\n\t\tconst node = useFlowStore().editingNode || { config: {} }\n\n\t\treturn {\n\t\t\tHTTP_METHODS,\n\n\t\t\t// Everybody a step could ask, and whether that lookup is in\n\t\t\t// flight. Empty is a legitimate resting state: a stored reference\n\t\t\t// still shows, because it is synthesised rather than looked up.\n\t\t\tprincipals: [],\n\t\t\tprincipalsLoading: false,\n\n\t\t\t// Users for a `runAs`-shaped field, and whether that request is in\n\t\t\t// flight. Empty is a legitimate resting state: the picker still\n\t\t\t// offers the current user, so a schedule is authorable even when\n\t\t\t// the user list cannot be read.\n\t\t\tusers: [],\n\t\t\tusersLoading: false,\n\n\t\t\t// The draft the form edits. Committed on Done, discarded on Cancel.\n\t\t\tdraft: {\n\t\t\t\tname: node.name || '',\n\t\t\t\tconfig: JSON.parse(JSON.stringify(node.config || {})),\n\t\t\t},\n\n\t\t\t// Per-key raw text while a JSON-valued field is mid-edit, so typing\n\t\t\t// is not reformatted under the cursor.\n\t\t\tjsonDrafts: {},\n\t\t\tjsonErrors: {},\n\n\t\t\t// Options per select field, loaded from the `optionsFrom` URL the\n\t\t\t// OWNING APP declares for it in the node's configForm.\n\t\t\tselectOptions: {},\n\t\t\tselectLoading: {},\n\n\t\t\tadvancedDraft: null,\n\t\t\tadvancedError: null,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * @return {object} The node being edited. Falls back to an empty shape\n\t\t * so a dialog outliving its node cannot throw mid-render.\n\t\t */\n\t\tnode() {\n\t\t\treturn this.store.editingNode || { type: '', config: {} }\n\t\t},\n\n\t\t/**\n\t\t * @return {object|null} The catalogue entry for this node's type.\n\t\t */\n\t\tentry() {\n\t\t\treturn this.store.catalogEntry(this.node.type)\n\t\t},\n\n\t\t/**\n\t\t * @return {string} The dialog title: the step's human name.\n\t\t */\n\t\ttypeLabel() {\n\t\t\treturn this.entry ? (this.entry.displayName || this.entry.id) : (this.node.type || '—')\n\t\t},\n\n\t\t/**\n\t\t * The node's per-field declarations from the catalogue's `configForm`\n\t\t * ({key, label, type, help, required, optionsFrom, options}), keyed by config\n\t\t * key. `configKeys` is the degraded form. Either way the node's OWNER\n\t\t * declares the vocabulary — this dialog never invents fields.\n\t\t *\n\t\t * @return {object} key → field declaration.\n\t\t */\n\t\tfieldSpecs() {\n\t\t\tconst specs = {}\n\t\t\tfor (const field of (this.entry?.configForm || [])) {\n\t\t\t\tif (field && field.key) {\n\t\t\t\t\tspecs[field.key] = field\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn specs\n\t\t},\n\n\t\t/**\n\t\t * The keys the form renders: the declared vocabulary first, in its\n\t\t * order — `configForm` beats `configKeys` where both exist, keys only\n\t\t * one names are still rendered — then any key already set that neither\n\t\t * declares. `$`-prefixed keys are authoring annotations and stay in\n\t\t * Advanced.\n\t\t *\n\t\t * @return {Array<string>} The keys.\n\t\t */\n\t\t/**\n\t\t * Whether the raw-JSON escape hatch has anything to reach.\n\t\t *\n\t\t * True when the step declares options, or when the node already carries\n\t\t * config the form does not render. False for a step with neither, where\n\t\t * the hatch would only ever show an empty document.\n\t\t *\n\t\t * @return {boolean} Whether to offer the JSON editor.\n\t\t */\n\t\tcanEditAsJson() {\n\t\t\tif (this.formKeys.length > 0) {\n\t\t\t\treturn true\n\t\t\t}\n\n\t\t\treturn Object.keys(this.draft.config || {}).length > 0\n\t\t},\n\n\t\t/**\n\t\t * The signed-in user's id, or '' when there is no session.\n\t\t *\n\t\t * @return {string} The uid.\n\t\t */\n\t\tcurrentUid() {\n\t\t\treturn String(getCurrentUser()?.uid || '')\n\t\t},\n\n\t\t/**\n\t\t * The users offered for a `runAs` field.\n\t\t *\n\t\t * The current user is always present, and first. Naming yourself asserts\n\t\t * no delegation at all, so it is the one choice the server can never\n\t\t * refuse — which makes it both the right default and the right fallback\n\t\t * when the user list could not be read.\n\t\t *\n\t\t * @return {Array<object>} The options.\n\t\t */\n\t\tuserOptions() {\n\t\t\tconst me = this.currentUid\n\t\t\tconst mine = me === '' ? [] : [{ id: me, label: t('nextcloud-vue', '{uid} (you)', { uid: me }) }]\n\n\t\t\treturn [...mine, ...this.users.filter((user) => user.id !== me)]\n\t\t},\n\n\t\t/**\n\t\t * Everybody the picker can currently offer, users and groups together.\n\t\t *\n\t\t * @return {Array<object>} The options.\n\t\t */\n\t\tprincipalChoices() {\n\t\t\treturn this.principals\n\t\t},\n\n\t\tformKeys() {\n\t\t\tconst fromForm = (this.entry?.configForm || []).map((f) => f.key).filter(Boolean)\n\t\t\tconst declared = [\n\t\t\t\t...fromForm,\n\t\t\t\t...(this.entry?.configKeys || []).filter((k) => !fromForm.includes(k)),\n\t\t\t]\n\t\t\tconst present = Object.keys(this.draft.config).filter((k) => !k.startsWith('$') && !declared.includes(k))\n\n\t\t\treturn [...declared, ...present]\n\t\t},\n\n\t\t/**\n\t\t * @return {string} The draft config as pretty JSON, for Advanced.\n\t\t */\n\t\tadvancedJson() {\n\t\t\tif (this.advancedDraft !== null) {\n\t\t\t\treturn this.advancedDraft\n\t\t\t}\n\n\t\t\treturn JSON.stringify(this.draft.config, null, 2)\n\t\t},\n\n\t\t/**\n\t\t * @return {boolean} Whether any field holds unparseable JSON.\n\t\t */\n\t\thasErrors() {\n\t\t\treturn this.advancedError !== null || Object.keys(this.jsonErrors).length > 0\n\t\t},\n\t},\n\n\tcreated() {\n\t\t// Select fields need their options; everything else is local.\n\t\tfor (const [key, spec] of Object.entries(this.fieldSpecs)) {\n\t\t\tif (hasStaticOptions(spec)) {\n\t\t\t\tthis.selectOptions = { ...this.selectOptions, [key]: normaliseSelectOptions(spec.options) }\n\t\t\t} else if (spec?.type === 'select' && spec?.optionsFrom) {\n\t\t\t\tthis.loadSelectOptions(key, spec)\n\t\t\t}\n\t\t}\n\n\t\tif (this.formKeys.some((key) => this.widgetFor(key) === 'principal')) {\n\t\t\t// An empty search returns the first page, so the picker opens with\n\t\t\t// something in it rather than an empty box the author has to guess\n\t\t\t// how to fill.\n\t\t\tthis.searchPrincipals('')\n\t\t}\n\n\t\tif (this.formKeys.some((key) => this.widgetFor(key) === 'user')) {\n\t\t\tthis.loadUsers()\n\t\t}\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Load the users a `runAs` field can name.\n\t\t *\n\t\t * Failure is not surfaced. The picker always offers the current user —\n\t\t * see `userOptions` — so a failed lookup costs the author the ability to\n\t\t * DELEGATE, not the ability to author a schedule at all. Blocking the\n\t\t * dialog on it would be a worse trade.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\t/**\n\t\t * The stored references on a field, as options the select can show.\n\t\t *\n\t\t * 🔴 A REFERENCE THE CURRENT USER CANNOT SEE MUST STILL SHOW. The\n\t\t * autocomplete endpoint answers with what THIS author may look up, and\n\t\t * a delegation is routinely to somebody they cannot. If an unmatched\n\t\t * reference rendered as nothing, opening a step and pressing Done would\n\t\t * silently clear it — a save that deletes the assignment while\n\t\t * appearing to change nothing.\n\t\t *\n\t\t * So every stored reference is synthesised into an option whether or\n\t\t * not the lookup found it, exactly as the single-user picker already\n\t\t * does for an unseen uid.\n\t\t *\n\t\t * @param {string} key The config key.\n\t\t * @return {Array<object>} The selected options.\n\t\t */\n\t\tprincipalOptions(key) {\n\t\t\treturn this.storedPrincipals(key).map((reference) => {\n\t\t\t\tconst id = `${reference.type}:${reference.id}`\n\t\t\t\tconst known = this.principals.find((option) => option.id === id)\n\n\t\t\t\treturn known || {\n\t\t\t\t\tid,\n\t\t\t\t\ttype: reference.type,\n\t\t\t\t\tvalue: reference.id,\n\t\t\t\t\tlabel: reference.id,\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * What a performer field currently holds, as `{type, id}` references.\n\t\t *\n\t\t * Reads both spellings, because both are stored across the fleet: a\n\t\t * bare string (which has always meant a user or a group of that name),\n\t\t * and a typed reference. A bare one is shown under the type the FIELD\n\t\t * NAME implies, so a `candidateGroups` entry does not appear as a\n\t\t * person.\n\t\t *\n\t\t * @param {string} key The config key.\n\t\t * @return {Array<object>} The references.\n\t\t */\n\t\tstoredPrincipals(key) {\n\t\t\tconst raw = this.draft.config[key]\n\t\t\tconst bareType = key === 'candidateGroups' || key === 'candidateRole' ? 'group' : 'user'\n\t\t\tconst list = Array.isArray(raw) ? raw : (raw === null || raw === undefined || raw === '' ? [] : [raw])\n\n\t\t\treturn list\n\t\t\t\t.map((entry) => {\n\t\t\t\t\tif (typeof entry === 'string') {\n\t\t\t\t\t\treturn entry.trim() === '' ? null : { type: bareType, id: entry.trim() }\n\t\t\t\t\t}\n\t\t\t\t\tif (entry && typeof entry === 'object') {\n\t\t\t\t\t\tconst id = String(entry.id ?? entry.value ?? '').trim()\n\n\t\t\t\t\t\treturn id === '' ? null : { type: String(entry.type || bareType), id }\n\t\t\t\t\t}\n\n\t\t\t\t\treturn null\n\t\t\t\t})\n\t\t\t\t.filter(Boolean)\n\t\t},\n\n\t\t/**\n\t\t * Write the picked references back onto the field.\n\t\t *\n\t\t * Always as typed references, never as bare strings: the whole point is\n\t\t * that the document records which kind of thing was meant, so a save\n\t\t * from this picker is never ambiguous again.\n\t\t *\n\t\t * @param {string} key The config key.\n\t\t * @param {Array<object>} picked What the select handed back.\n\t\t * @return {void}\n\t\t */\n\t\tsetPrincipals(key, picked) {\n\t\t\tconst references = (picked || []).map((option) => ({\n\t\t\t\ttype: option.type || 'user',\n\t\t\t\tid: option.value || String(option.id || '').split(':').slice(1).join(':'),\n\t\t\t})).filter((reference) => reference.id !== '')\n\n\t\t\t// A single-valued field keeps its shape: `assignee` is one\n\t\t\t// performer, and turning it into a list would change what the\n\t\t\t// engine reads.\n\t\t\tif (key === 'assignee' || key === 'routingFallback' || key === 'candidateRole') {\n\t\t\t\tthis.setKey(key, references[0] || '')\n\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tthis.setKey(key, references)\n\t\t},\n\n\t\t/**\n\t\t * Look people and groups up as the author types.\n\t\t *\n\t\t * 🔑 THE SAME ENDPOINT THE MENTION PICKER USES, with `shareTypes[]` 0\n\t\t * AND 1 — users and groups. OpenRegister publishes no user list and the\n\t\t * OCS user-listing API is admin-only, so this is the only source a\n\t\t * non-admin author can read.\n\t\t *\n\t\t * ⚠️ IT DOES NOT DECIDE WHAT IS VALID. A type this editor cannot search\n\t\t * — a position, a function, a case role — is still a legal reference,\n\t\t * and the server's resolver registry is what says so. That is why a\n\t\t * stored reference is synthesised rather than filtered against these\n\t\t * results.\n\t\t *\n\t\t * @param {string} query What the author typed.\n\t\t * @return {Promise<void>} When the lookup has settled.\n\t\t */\n\t\tasync searchPrincipals(query) {\n\t\t\tthis.principalsLoading = true\n\t\t\ttry {\n\t\t\t\tconst response = await axios.get(\n\t\t\t\t\tgenerateUrl('/ocs/v2.php/core/autocomplete/get'),\n\t\t\t\t\t{\n\t\t\t\t\t\tparams: {\n\t\t\t\t\t\t\tsearch: String(query || ''),\n\t\t\t\t\t\t\titemType: '',\n\t\t\t\t\t\t\titemId: '',\n\t\t\t\t\t\t\t'shareTypes[]': [0, 1],\n\t\t\t\t\t\t\tlimit: 50,\n\t\t\t\t\t\t},\n\t\t\t\t\t\theaders: { 'OCS-APIRequest': 'true', Accept: 'application/json' },\n\t\t\t\t\t},\n\t\t\t\t)\n\n\t\t\t\tconst rows = response?.data?.ocs?.data || []\n\t\t\t\tthis.principals = (Array.isArray(rows) ? rows : [])\n\t\t\t\t\t.map((row) => {\n\t\t\t\t\t\tconst type = row.source === 'groups' ? 'group' : 'user'\n\t\t\t\t\t\tconst id = String(row.id ?? '')\n\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tid: `${type}:${id}`,\n\t\t\t\t\t\t\ttype,\n\t\t\t\t\t\t\tvalue: id,\n\t\t\t\t\t\t\tlabel: `${String(row.label ?? id)}${type === 'group' ? this.t('nextcloud-vue', ' (group)') : ''}`,\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t.filter((option) => option.value !== '')\n\t\t\t} catch {\n\t\t\t\t// A failed lookup must not clear what is already picked: the\n\t\t\t\t// selected options are synthesised from the document, not from\n\t\t\t\t// this list.\n\t\t\t\tthis.principals = []\n\t\t\t} finally {\n\t\t\t\tthis.principalsLoading = false\n\t\t\t}\n\t\t},\n\n\t\tasync loadUsers() {\n\t\t\tthis.usersLoading = true\n\t\t\ttry {\n\t\t\t\t// Nextcloud's OWN autocomplete endpoint — the one the mention\n\t\t\t\t// picker uses. OpenRegister publishes no user list, and the OCS\n\t\t\t\t// user-listing API is admin-only, so this is the only source a\n\t\t\t\t// non-admin author can read. `shareTypes[]=0` restricts it to\n\t\t\t\t// users, keeping groups and circles out of a field that takes a\n\t\t\t\t// single uid.\n\t\t\t\tconst response = await axios.get(\n\t\t\t\t\tgenerateUrl('/ocs/v2.php/core/autocomplete/get'),\n\t\t\t\t\t{\n\t\t\t\t\t\tparams: { search: '', itemType: '', itemId: '', 'shareTypes[]': 0, limit: 50 },\n\t\t\t\t\t\theaders: { 'OCS-APIRequest': 'true', Accept: 'application/json' },\n\t\t\t\t\t},\n\t\t\t\t)\n\n\t\t\t\tconst rows = response?.data?.ocs?.data || []\n\t\t\t\tthis.users = (Array.isArray(rows) ? rows : [])\n\t\t\t\t\t.filter((row) => row.source === 'users')\n\t\t\t\t\t.map((row) => ({ id: String(row.id ?? ''), label: String(row.label ?? row.id ?? '') }))\n\t\t\t\t\t.filter((row) => row.id !== '')\n\t\t\t} catch {\n\t\t\t\tthis.users = []\n\t\t\t} finally {\n\t\t\t\tthis.usersLoading = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * The selected user for a key, synthesised when it is not in the list.\n\t\t *\n\t\t * A stored uid the current user cannot see must still SHOW. Dropping it\n\t\t * would make the field look empty and a save would then clear a\n\t\t * delegation the author never touched.\n\t\t *\n\t\t * @param {string} key The config key.\n\t\t * @return {object|null} The option.\n\t\t */\n\t\tuserOption(key) {\n\t\t\tconst value = String(this.draft.config[key] ?? '')\n\t\t\tif (value === '') {\n\t\t\t\treturn null\n\t\t\t}\n\n\t\t\treturn this.userOptions.find((option) => option.id === value) || { id: value, label: value }\n\t\t},\n\n\t\t/**\n\t\t * Which widget a key gets: the owner's declaration first, the VALUE\n\t\t * second, the key's name last.\n\t\t *\n\t\t * @param {string} key The config key.\n\t\t * @return {string} 'select' | 'switch' | 'number' | 'textarea' | 'json' | 'method' | 'text'\n\t\t */\n\t\twidgetFor(key) {\n\t\t\tconst spec = this.fieldSpecs[key]\n\t\t\tif (spec?.type === 'select' && (spec?.optionsFrom || hasStaticOptions(spec))) {\n\t\t\t\treturn 'select'\n\t\t\t}\n\t\t\tif (spec?.type === 'boolean') {\n\t\t\t\treturn 'switch'\n\t\t\t}\n\t\t\tif (spec?.type === 'number') {\n\t\t\t\treturn 'number'\n\t\t\t}\n\t\t\tif (spec?.type === 'textarea') {\n\t\t\t\treturn 'textarea'\n\t\t\t}\n\n\t\t\t// Keyed on the engine's own declaration where it makes one, and on\n\t\t\t// the key name otherwise. `cron` and `runAs` are the schedule\n\t\t\t// trigger's required vocabulary — a bare text box for either is a\n\t\t\t// schedule that fails at 03:00, with nobody watching.\n\t\t\tif (spec?.type === 'cron' || spec?.format === 'cron' || key === 'cron') {\n\t\t\t\treturn 'cron'\n\t\t\t}\n\t\t\t// 🔴 `runAs` KEEPS THE SINGLE-USER PICKER. It is not a performer:\n\t\t\t// it names the identity the step RUNS AS, the server decides\n\t\t\t// whether this author may delegate to it, and a group cannot be\n\t\t\t// one. Checked BEFORE the principal branch so a step that declares\n\t\t\t// `runAs` as a principal cannot widen it.\n\t\t\tif (key === 'runAs') {\n\t\t\t\treturn 'user'\n\t\t\t}\n\n\t\t\t// Who the step ASKS. Keyed on the engine's own declaration where it\n\t\t\t// makes one, and on the performer key names otherwise — those are\n\t\t\t// the fields that carried a bare name and meant a user OR a group.\n\t\t\tif (spec?.type === 'principal' || PRINCIPAL_KEYS.includes(key)) {\n\t\t\t\treturn 'principal'\n\t\t\t}\n\n\t\t\tif (spec?.type === 'user') {\n\t\t\t\treturn 'user'\n\t\t\t}\n\n\t\t\tconst value = this.draft.config[key]\n\t\t\tif (typeof value === 'boolean') {\n\t\t\t\treturn 'switch'\n\t\t\t}\n\t\t\tif (typeof value === 'number') {\n\t\t\t\treturn 'number'\n\t\t\t}\n\t\t\tif (value !== null && value !== undefined && typeof value === 'object') {\n\t\t\t\treturn 'json'\n\t\t\t}\n\t\t\tif (key === 'method') {\n\t\t\t\treturn 'method'\n\t\t\t}\n\n\t\t\treturn 'text'\n\t\t},\n\n\t\t/**\n\t\t * The picker option matching a select field's stored value —\n\t\t * synthesised from the raw value when it is not in the loaded options,\n\t\t * so an existing configuration is never blanked.\n\t\t *\n\t\t * @param {string} key The config key.\n\t\t * @return {object|null} The selected option.\n\t\t */\n\t\tselectedOption(key) {\n\t\t\tconst value = this.draft.config[key]\n\t\t\tif (value === undefined || value === null || value === '') {\n\t\t\t\treturn null\n\t\t\t}\n\n\t\t\tconst options = this.selectOptions[key] || []\n\t\t\treturn options.find((o) => o.id === value) || { id: value, label: String(value) }\n\t\t},\n\n\t\t/**\n\t\t * Load the pickable choices for one select field, from the URL its\n\t\t * owning app declared (`optionsFrom`).\n\t\t *\n\t\t * Accepts `{results: [...]}` or a bare array; items as `{id, label}`,\n\t\t * `{value, label}`, or OpenRegister objects (uuid from `@self`, label\n\t\t * from name/title) — the app owns the endpoint, this dialog only has\n\t\t * to read it.\n\t\t *\n\t\t * @param {string} key The config key.\n\t\t * @param {object} spec The field declaration carrying `optionsFrom`.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync loadSelectOptions(key, spec) {\n\t\t\tthis.selectLoading = { ...this.selectLoading, [key]: true }\n\t\t\ttry {\n\t\t\t\tconst url = String(spec.optionsFrom)\n\t\t\t\tconst response = await axios.get(url.startsWith('/') && !url.startsWith('/apps') && !url.startsWith('/index.php')\n\t\t\t\t\t? generateUrl(url)\n\t\t\t\t\t: url)\n\t\t\t\tconst rows = Array.isArray(response.data) ? response.data : (response.data?.results || [])\n\t\t\t\tconst options = normaliseSelectOptions(rows)\n\t\t\t\tthis.selectOptions = { ...this.selectOptions, [key]: options }\n\t\t\t} catch (error) {\n\t\t\t\t// A picker that could not load degrades to showing the stored\n\t\t\t\t// value; the Advanced editor still reaches everything.\n\t\t\t\t// eslint-disable-next-line no-console -- diagnostic for a failure this code already degrades from\n\t\t\t\tconsole.error(`cn-flow: could not load options for \"${key}\"`, error)\n\t\t\t} finally {\n\t\t\t\tthis.selectLoading = { ...this.selectLoading, [key]: false }\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * A key as a field label: the owner's translated `label` when the\n\t\t * configForm declares one, else `sourceId` → `Source id`.\n\t\t *\n\t\t * @param {string} key The config key.\n\t\t * @return {string} The label.\n\t\t */\n\t\tlabelFor(key) {\n\t\t\tconst declared = this.fieldSpecs[key]?.label\n\t\t\tif (declared) {\n\t\t\t\treturn declared\n\t\t\t}\n\n\t\t\tconst spaced = key\n\t\t\t\t.replace(/[_-]+/g, ' ')\n\t\t\t\t.replace(/([a-z0-9])([A-Z])/g, '$1 $2')\n\t\t\t\t.toLowerCase()\n\n\t\t\treturn spaced.charAt(0).toUpperCase() + spaced.slice(1)\n\t\t},\n\n\t\t/**\n\t\t * The helper line under a field: the owner's `help` (prefixed when the\n\t\t * field is required), else the built-in hints for keys that earn one.\n\t\t *\n\t\t * @param {string} key The config key.\n\t\t * @return {string|undefined} The helper line.\n\t\t */\n\t\thintFor(key) {\n\t\t\tconst spec = this.fieldSpecs[key]\n\t\t\tif (spec?.help) {\n\t\t\t\treturn spec.required === true\n\t\t\t\t\t? `${this.t('nextcloud-vue', 'Required.')} ${spec.help}`\n\t\t\t\t\t: spec.help\n\t\t\t}\n\t\t\tif (spec?.required === true) {\n\t\t\t\treturn this.t('nextcloud-vue', 'Required.')\n\t\t\t}\n\t\t\tif (key === 'cron') {\n\t\t\t\treturn this.t('nextcloud-vue', 'For example 0 9 * * 1 — 09:00 every Monday.')\n\t\t\t}\n\n\t\t\treturn undefined\n\t\t},\n\n\t\t/**\n\t\t * @param {string} key The config key.\n\t\t * @param {unknown} value The new value.\n\t\t * @return {void}\n\t\t */\n\t\tsetKey(key, value) {\n\t\t\tthis.draft.config = { ...this.draft.config, [key]: value }\n\t\t\tthis.advancedDraft = null\n\t\t\tthis.advancedError = null\n\t\t},\n\n\t\t/**\n\t\t * @param {string} key The config key.\n\t\t * @param {string} text The number field's text.\n\t\t * @return {void}\n\t\t */\n\t\tsetNumberKey(key, text) {\n\t\t\tconst parsed = Number(text)\n\t\t\tthis.setKey(key, Number.isFinite(parsed) ? parsed : text)\n\t\t},\n\n\t\t/**\n\t\t * @param {string} key The config key.\n\t\t * @return {string} The key's value as JSON text, or its mid-edit draft.\n\t\t */\n\t\tjsonDraftFor(key) {\n\t\t\tif (this.jsonDrafts[key] !== undefined) {\n\t\t\t\treturn this.jsonDrafts[key]\n\t\t\t}\n\n\t\t\treturn JSON.stringify(this.draft.config[key], null, 2)\n\t\t},\n\n\t\t/**\n\t\t * Parse one JSON-valued field, keeping the last valid value on error.\n\t\t *\n\t\t * @param {string} key The config key.\n\t\t * @param {string} text The raw JSON text.\n\t\t * @return {void}\n\t\t */\n\t\tsetJsonKey(key, text) {\n\t\t\tthis.jsonDrafts = { ...this.jsonDrafts, [key]: text }\n\t\t\ttry {\n\t\t\t\tconst parsed = JSON.parse(text)\n\t\t\t\tconst rest = { ...this.jsonErrors }\n\t\t\t\tdelete rest[key]\n\t\t\t\tthis.jsonErrors = rest\n\t\t\t\tthis.setKey(key, parsed)\n\t\t\t} catch {\n\t\t\t\tthis.jsonErrors = {\n\t\t\t\t\t...this.jsonErrors,\n\t\t\t\t\t[key]: this.t('nextcloud-vue', 'Not valid JSON, so this option keeps its previous value.'),\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Parse the whole document, keeping the last valid draft on error.\n\t\t *\n\t\t * @param {string} text The raw JSON text.\n\t\t * @return {void}\n\t\t */\n\t\tonAdvancedInput(text) {\n\t\t\tthis.advancedDraft = text\n\t\t\ttry {\n\t\t\t\tconst parsed = JSON.parse(text || '{}')\n\t\t\t\tif (parsed === null || typeof parsed !== 'object' || Array.isArray(parsed)) {\n\t\t\t\t\tthis.advancedError = this.t('nextcloud-vue', 'A step configuration must be a JSON object.')\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tthis.advancedError = null\n\t\t\t\tthis.draft.config = parsed\n\t\t\t\tthis.jsonDrafts = {}\n\t\t\t\tthis.jsonErrors = {}\n\t\t\t} catch {\n\t\t\t\tthis.advancedError = this.t('nextcloud-vue', 'Not valid JSON, so the configuration keeps its previous value.')\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Commit the draft and close.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tdone() {\n\t\t\tconst id = this.store.editingNodeId\n\t\t\tif (id !== null) {\n\t\t\t\tthis.store.setNodeConfigById(id, this.draft.config)\n\t\t\t\tthis.store.setNodeName(id, this.draft.name)\n\t\t\t}\n\t\t\tthis.store.editingNodeId = null\n\t\t},\n\n\t\t/**\n\t\t * Discard the draft and close.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tcancel() {\n\t\t\tthis.store.editingNodeId = null\n\t\t},\n\n\t\t/**\n\t\t * Remove the step entirely and close.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tremoveStep() {\n\t\t\tconst id = this.store.editingNodeId\n\t\t\tthis.store.editingNodeId = null\n\t\t\tif (id !== null) {\n\t\t\t\tthis.store.removeNode(id)\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-flow-node-edit {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 12px;\n\tpadding-block-end: 8px;\n}\n\n.cn-flow-node-edit__description {\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-flow-node-edit__id,\n.cn-flow-node-edit__hint {\n\tfont-size: 0.85em;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n/* Full width, like the text fields around it: at its natural width the\n picker cut every option label in half. */\n.cn-flow-node-edit__select {\n\twidth: 100%;\n}\n\n.cn-flow-node-edit__field-help {\n\tmargin: 4px 0 0;\n\tpadding-inline-start: 8px;\n\tfont-size: 0.85em;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-flow-node-edit__advanced summary {\n\tcursor: pointer;\n\tcolor: var(--color-text-maxcontrast);\n\tmargin-block-end: 8px;\n}\n</style>\n"],"names":["_createBlock","_createVNode","_createElementVNode","_toDisplayString","_createElementBlock","_Fragment","_renderList","_createTextVNode"],"mappings":";;AAYM,MAAA,UAAA,GAAA,EAAA,KAAA,EAAA,mBAAA,GAAA;;;AAEY,EAAA,KAAA,EAAA,gCAAA;;AAGZ,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,uBAAuB,GAAA;;;;AAmHL,EAAA,KAAK,EAAC,yBAAyB;;;;A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,gBAAA,KAAK,EAAE,IAAC,CAAA,CAAA,CAAA,eAAA,EAAA,sBAAA,CAAA;AACR,gBAAA,KAAK,EAAC,KAAA,CAAA,aAAA,KAAA,IAAA;gBACN,UAAC,EAAA,KAAA,CAAA,aAAA,IAAA,IAAA,CAAA,CAAA,CAAA,eAAA,EAAA,iEAAA,CAAA;;AAED,gBAAA,qBAAc,EAAA,QAAA,CAAA,eAAA;;;;;;;;;;;;"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { translate } from '@nextcloud/l10n';
|
|
2
2
|
import { NcButton, NcCheckboxRadioSwitch, NcDialog, NcLoadingIcon, NcNoteCard, NcSelect, NcTextArea, NcTextField } from '@nextcloud/vue';
|
|
3
3
|
import { prefixUrl } from '../utils/headers.js';
|
|
4
|
+
import { hasStaticOptions, normaliseSelectOptions } from '../utils/selectOptions.js';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* The dialog `run-node` opens to collect a directly-invoked flow node's own
|
|
@@ -41,7 +42,9 @@ var script = {
|
|
|
41
42
|
title: { type: String, default: '' },
|
|
42
43
|
/**
|
|
43
44
|
* The node's declared config form — `IFlowNodeConfigForm::configForm()`'s
|
|
44
|
-
* shape, unchanged: `[{key, label, type, help?, required?, optionsFrom?}]`.
|
|
45
|
+
* shape, unchanged: `[{key, label, type, help?, required?, optionsFrom?, options?}]`.
|
|
46
|
+
* A `select` takes its choices from `optionsFrom` (a url) or `options`
|
|
47
|
+
* (strings, or `{value, label}` pairs declared in the form itself).
|
|
45
48
|
*
|
|
46
49
|
* @type {Array<object>}
|
|
47
50
|
*/
|
|
@@ -90,7 +93,9 @@ var script = {
|
|
|
90
93
|
}
|
|
91
94
|
this.values = seed;
|
|
92
95
|
for (const field of (fields || [])) {
|
|
93
|
-
if (field
|
|
96
|
+
if (hasStaticOptions(field)) {
|
|
97
|
+
this.options = { ...this.options, [field.key]: normaliseSelectOptions(field.options, (s) => this.tr(s)) };
|
|
98
|
+
} else if (field.type === 'select' && field.optionsFrom) {
|
|
94
99
|
this.loadOptions(field);
|
|
95
100
|
}
|
|
96
101
|
}
|
|
@@ -187,10 +192,7 @@ var script = {
|
|
|
187
192
|
const url = prefixUrl(raw);
|
|
188
193
|
const response = await axios.get(url);
|
|
189
194
|
const rows = Array.isArray(response.data) ? response.data : (response.data?.results || []);
|
|
190
|
-
const opts = rows
|
|
191
|
-
const id = row.id ?? row.value ?? row['@self']?.uuid ?? row.uuid;
|
|
192
|
-
return { id, label: row.label || row.name || row.title || String(id) }
|
|
193
|
-
}).filter((o) => o.id !== undefined && o.id !== null && o.id !== '');
|
|
195
|
+
const opts = normaliseSelectOptions(rows);
|
|
194
196
|
this.options = { ...this.options, [field.key]: opts };
|
|
195
197
|
} catch (error) {
|
|
196
198
|
// A picker that fails to load degrades to an empty list rather
|