mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
refactor(editor): Apply Prettier (no-changelog) (#4920)
* ⚡ Adjust `format` script * 🔥 Remove exemption for `editor-ui` * 🎨 Prettify * 👕 Fix lint
This commit is contained in:
@@ -3,7 +3,11 @@
|
||||
:name="WORKFLOW_SETTINGS_MODAL_KEY"
|
||||
width="65%"
|
||||
maxHeight="80%"
|
||||
:title="$locale.baseText('workflowSettings.settingsFor', { interpolate: { workflowName, workflowId } })"
|
||||
:title="
|
||||
$locale.baseText('workflowSettings.settingsFor', {
|
||||
interpolate: { workflowName, workflowId },
|
||||
})
|
||||
"
|
||||
:eventBus="modalBus"
|
||||
:scrollable="true"
|
||||
>
|
||||
@@ -11,8 +15,8 @@
|
||||
<div v-loading="isLoading" class="workflow-settings">
|
||||
<el-row>
|
||||
<el-col :span="10" class="setting-name">
|
||||
{{ $locale.baseText('workflowSettings.errorWorkflow') + ":" }}
|
||||
<n8n-tooltip class="setting-info" placement="top" >
|
||||
{{ $locale.baseText('workflowSettings.errorWorkflow') + ':' }}
|
||||
<n8n-tooltip class="setting-info" placement="top">
|
||||
<template #content>
|
||||
<div v-html="helpTexts.errorWorkflow"></div>
|
||||
</template>
|
||||
@@ -20,20 +24,27 @@
|
||||
</n8n-tooltip>
|
||||
</el-col>
|
||||
<el-col :span="14" class="ignore-key-press">
|
||||
<n8n-select v-model="workflowSettings.errorWorkflow" placeholder="Select Workflow" size="medium" filterable :limit-popper-width="true">
|
||||
<n8n-select
|
||||
v-model="workflowSettings.errorWorkflow"
|
||||
placeholder="Select Workflow"
|
||||
size="medium"
|
||||
filterable
|
||||
:limit-popper-width="true"
|
||||
>
|
||||
<n8n-option
|
||||
v-for="item in workflows"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
:value="item.id"
|
||||
>
|
||||
</n8n-option>
|
||||
</n8n-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10" class="setting-name">
|
||||
{{ $locale.baseText('workflowSettings.timezone') + ":" }}
|
||||
<n8n-tooltip class="setting-info" placement="top" >
|
||||
{{ $locale.baseText('workflowSettings.timezone') + ':' }}
|
||||
<n8n-tooltip class="setting-info" placement="top">
|
||||
<template #content>
|
||||
<div v-text="helpTexts.timezone"></div>
|
||||
</template>
|
||||
@@ -41,20 +52,27 @@
|
||||
</n8n-tooltip>
|
||||
</el-col>
|
||||
<el-col :span="14" class="ignore-key-press">
|
||||
<n8n-select v-model="workflowSettings.timezone" placeholder="Select Timezone" size="medium" filterable :limit-popper-width="true">
|
||||
<n8n-select
|
||||
v-model="workflowSettings.timezone"
|
||||
placeholder="Select Timezone"
|
||||
size="medium"
|
||||
filterable
|
||||
:limit-popper-width="true"
|
||||
>
|
||||
<n8n-option
|
||||
v-for="timezone of timezones"
|
||||
:key="timezone.key"
|
||||
:label="timezone.value"
|
||||
:value="timezone.key">
|
||||
:value="timezone.key"
|
||||
>
|
||||
</n8n-option>
|
||||
</n8n-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10" class="setting-name">
|
||||
{{ $locale.baseText('workflowSettings.saveDataErrorExecution') + ":" }}
|
||||
<n8n-tooltip class="setting-info" placement="top" >
|
||||
{{ $locale.baseText('workflowSettings.saveDataErrorExecution') + ':' }}
|
||||
<n8n-tooltip class="setting-info" placement="top">
|
||||
<template #content>
|
||||
<div v-text="helpTexts.saveDataErrorExecution"></div>
|
||||
</template>
|
||||
@@ -62,20 +80,27 @@
|
||||
</n8n-tooltip>
|
||||
</el-col>
|
||||
<el-col :span="14" class="ignore-key-press">
|
||||
<n8n-select v-model="workflowSettings.saveDataErrorExecution" :placeholder="$locale.baseText('workflowSettings.selectOption')" size="medium" filterable :limit-popper-width="true">
|
||||
<n8n-select
|
||||
v-model="workflowSettings.saveDataErrorExecution"
|
||||
:placeholder="$locale.baseText('workflowSettings.selectOption')"
|
||||
size="medium"
|
||||
filterable
|
||||
:limit-popper-width="true"
|
||||
>
|
||||
<n8n-option
|
||||
v-for="option of saveDataErrorExecutionOptions"
|
||||
:key="option.key"
|
||||
:label="option.value"
|
||||
:value="option.key">
|
||||
:value="option.key"
|
||||
>
|
||||
</n8n-option>
|
||||
</n8n-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10" class="setting-name">
|
||||
{{ $locale.baseText('workflowSettings.saveDataSuccessExecution') + ":" }}
|
||||
<n8n-tooltip class="setting-info" placement="top" >
|
||||
{{ $locale.baseText('workflowSettings.saveDataSuccessExecution') + ':' }}
|
||||
<n8n-tooltip class="setting-info" placement="top">
|
||||
<template #content>
|
||||
<div v-text="helpTexts.saveDataSuccessExecution"></div>
|
||||
</template>
|
||||
@@ -83,20 +108,27 @@
|
||||
</n8n-tooltip>
|
||||
</el-col>
|
||||
<el-col :span="14" class="ignore-key-press">
|
||||
<n8n-select v-model="workflowSettings.saveDataSuccessExecution" :placeholder="$locale.baseText('workflowSettings.selectOption')" size="medium" filterable :limit-popper-width="true">
|
||||
<n8n-select
|
||||
v-model="workflowSettings.saveDataSuccessExecution"
|
||||
:placeholder="$locale.baseText('workflowSettings.selectOption')"
|
||||
size="medium"
|
||||
filterable
|
||||
:limit-popper-width="true"
|
||||
>
|
||||
<n8n-option
|
||||
v-for="option of saveDataSuccessExecutionOptions"
|
||||
:key="option.key"
|
||||
:label="option.value"
|
||||
:value="option.key">
|
||||
:value="option.key"
|
||||
>
|
||||
</n8n-option>
|
||||
</n8n-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10" class="setting-name">
|
||||
{{ $locale.baseText('workflowSettings.saveManualExecutions') + ":" }}
|
||||
<n8n-tooltip class="setting-info" placement="top" >
|
||||
{{ $locale.baseText('workflowSettings.saveManualExecutions') + ':' }}
|
||||
<n8n-tooltip class="setting-info" placement="top">
|
||||
<template #content>
|
||||
<div v-text="helpTexts.saveManualExecutions"></div>
|
||||
</template>
|
||||
@@ -104,20 +136,27 @@
|
||||
</n8n-tooltip>
|
||||
</el-col>
|
||||
<el-col :span="14" class="ignore-key-press">
|
||||
<n8n-select v-model="workflowSettings.saveManualExecutions" :placeholder="$locale.baseText('workflowSettings.selectOption')" size="medium" filterable :limit-popper-width="true">
|
||||
<n8n-select
|
||||
v-model="workflowSettings.saveManualExecutions"
|
||||
:placeholder="$locale.baseText('workflowSettings.selectOption')"
|
||||
size="medium"
|
||||
filterable
|
||||
:limit-popper-width="true"
|
||||
>
|
||||
<n8n-option
|
||||
v-for="option of saveManualOptions"
|
||||
:key="option.key"
|
||||
:label="option.value"
|
||||
:value="option.key">
|
||||
:value="option.key"
|
||||
>
|
||||
</n8n-option>
|
||||
</n8n-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10" class="setting-name">
|
||||
{{ $locale.baseText('workflowSettings.saveExecutionProgress') + ":" }}
|
||||
<n8n-tooltip class="setting-info" placement="top" >
|
||||
{{ $locale.baseText('workflowSettings.saveExecutionProgress') + ':' }}
|
||||
<n8n-tooltip class="setting-info" placement="top">
|
||||
<template #content>
|
||||
<div v-text="helpTexts.saveExecutionProgress"></div>
|
||||
</template>
|
||||
@@ -125,12 +164,19 @@
|
||||
</n8n-tooltip>
|
||||
</el-col>
|
||||
<el-col :span="14" class="ignore-key-press">
|
||||
<n8n-select v-model="workflowSettings.saveExecutionProgress" :placeholder="$locale.baseText('workflowSettings.selectOption')" size="medium" filterable :limit-popper-width="true">
|
||||
<n8n-select
|
||||
v-model="workflowSettings.saveExecutionProgress"
|
||||
:placeholder="$locale.baseText('workflowSettings.selectOption')"
|
||||
size="medium"
|
||||
filterable
|
||||
:limit-popper-width="true"
|
||||
>
|
||||
<n8n-option
|
||||
v-for="option of saveExecutionProgressOptions"
|
||||
:key="option.key"
|
||||
:label="option.value"
|
||||
:value="option.key">
|
||||
:value="option.key"
|
||||
>
|
||||
</n8n-option>
|
||||
</n8n-select>
|
||||
</el-col>
|
||||
@@ -138,8 +184,8 @@
|
||||
<div v-if="isWorkflowSharingEnabled">
|
||||
<el-row>
|
||||
<el-col :span="10" class="setting-name">
|
||||
{{ $locale.baseText('workflowSettings.callerPolicy') + ":" }}
|
||||
<n8n-tooltip class="setting-info" placement="top" >
|
||||
{{ $locale.baseText('workflowSettings.callerPolicy') + ':' }}
|
||||
<n8n-tooltip class="setting-info" placement="top">
|
||||
<template #content>
|
||||
<div v-text="helpTexts.workflowCallerPolicy"></div>
|
||||
</template>
|
||||
@@ -148,20 +194,27 @@
|
||||
</el-col>
|
||||
|
||||
<el-col :span="14" class="ignore-key-press">
|
||||
<n8n-select v-model="workflowSettings.callerPolicy" :placeholder="$locale.baseText('workflowSettings.selectOption')" size="medium" filterable :limit-popper-width="true">
|
||||
<n8n-select
|
||||
v-model="workflowSettings.callerPolicy"
|
||||
:placeholder="$locale.baseText('workflowSettings.selectOption')"
|
||||
size="medium"
|
||||
filterable
|
||||
:limit-popper-width="true"
|
||||
>
|
||||
<n8n-option
|
||||
v-for="option of workflowCallerPolicyOptions"
|
||||
:key="option.key"
|
||||
:label="option.value"
|
||||
:value="option.key">
|
||||
:value="option.key"
|
||||
>
|
||||
</n8n-option>
|
||||
</n8n-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-if="workflowSettings.callerPolicy === 'workflowsFromAList'">
|
||||
<el-col :span="10" class="setting-name">
|
||||
{{ $locale.baseText('workflowSettings.callerIds') + ":" }}
|
||||
<n8n-tooltip class="setting-info" placement="top" >
|
||||
{{ $locale.baseText('workflowSettings.callerIds') + ':' }}
|
||||
<n8n-tooltip class="setting-info" placement="top">
|
||||
<template #content>
|
||||
<div v-text="helpTexts.workflowCallerIds"></div>
|
||||
</template>
|
||||
@@ -180,8 +233,8 @@
|
||||
</div>
|
||||
<el-row>
|
||||
<el-col :span="10" class="setting-name">
|
||||
{{ $locale.baseText('workflowSettings.timeoutWorkflow') + ":" }}
|
||||
<n8n-tooltip class="setting-info" placement="top" >
|
||||
{{ $locale.baseText('workflowSettings.timeoutWorkflow') + ':' }}
|
||||
<n8n-tooltip class="setting-info" placement="top">
|
||||
<template #content>
|
||||
<div v-text="helpTexts.executionTimeoutToggle"></div>
|
||||
</template>
|
||||
@@ -190,15 +243,20 @@
|
||||
</el-col>
|
||||
<el-col :span="14">
|
||||
<div>
|
||||
<el-switch ref="inputField" :value="workflowSettings.executionTimeout > -1" @change="toggleTimeout" active-color="#13ce66"></el-switch>
|
||||
<el-switch
|
||||
ref="inputField"
|
||||
:value="workflowSettings.executionTimeout > -1"
|
||||
@change="toggleTimeout"
|
||||
active-color="#13ce66"
|
||||
></el-switch>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div v-if="workflowSettings.executionTimeout > -1">
|
||||
<el-row>
|
||||
<el-col :span="10" class="setting-name">
|
||||
{{ $locale.baseText('workflowSettings.timeoutAfter') + ":" }}
|
||||
<n8n-tooltip class="setting-info" placement="top" >
|
||||
{{ $locale.baseText('workflowSettings.timeoutAfter') + ':' }}
|
||||
<n8n-tooltip class="setting-info" placement="top">
|
||||
<template #content>
|
||||
<div v-text="helpTexts.executionTimeout"></div>
|
||||
</template>
|
||||
@@ -206,17 +264,34 @@
|
||||
</n8n-tooltip>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<n8n-input size="medium" :value="timeoutHMS.hours" @input="(value) => setTimeout('hours', value)" :min="0">
|
||||
<n8n-input
|
||||
size="medium"
|
||||
:value="timeoutHMS.hours"
|
||||
@input="(value) => setTimeout('hours', value)"
|
||||
:min="0"
|
||||
>
|
||||
<template #append>{{ $locale.baseText('workflowSettings.hours') }}</template>
|
||||
</n8n-input>
|
||||
</el-col>
|
||||
<el-col :span="4" class="timeout-input">
|
||||
<n8n-input size="medium" :value="timeoutHMS.minutes" @input="(value) => setTimeout('minutes', value)" :min="0" :max="60">
|
||||
<n8n-input
|
||||
size="medium"
|
||||
:value="timeoutHMS.minutes"
|
||||
@input="(value) => setTimeout('minutes', value)"
|
||||
:min="0"
|
||||
:max="60"
|
||||
>
|
||||
<template #append>{{ $locale.baseText('workflowSettings.minutes') }}</template>
|
||||
</n8n-input>
|
||||
</el-col>
|
||||
<el-col :span="4" class="timeout-input">
|
||||
<n8n-input size="medium" :value="timeoutHMS.seconds" @input="(value) => setTimeout('seconds', value)" :min="0" :max="60">
|
||||
<n8n-input
|
||||
size="medium"
|
||||
:value="timeoutHMS.seconds"
|
||||
@input="(value) => setTimeout('seconds', value)"
|
||||
:min="0"
|
||||
:max="60"
|
||||
>
|
||||
<template #append>{{ $locale.baseText('workflowSettings.seconds') }}</template>
|
||||
</n8n-input>
|
||||
</el-col>
|
||||
@@ -226,7 +301,12 @@
|
||||
</template>
|
||||
<template #footer>
|
||||
<div class="action-buttons">
|
||||
<n8n-button :label="$locale.baseText('workflowSettings.save')" size="large" float="right" @click="saveSettings" />
|
||||
<n8n-button
|
||||
:label="$locale.baseText('workflowSettings.save')"
|
||||
size="large"
|
||||
float="right"
|
||||
@click="saveSettings"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
</Modal>
|
||||
@@ -251,35 +331,42 @@ import { PLACEHOLDER_EMPTY_WORKFLOW_ID, WORKFLOW_SETTINGS_MODAL_KEY } from '../c
|
||||
|
||||
import mixins from 'vue-typed-mixins';
|
||||
|
||||
import { deepCopy } from "n8n-workflow";
|
||||
import { deepCopy } from 'n8n-workflow';
|
||||
import { mapStores } from 'pinia';
|
||||
import { useWorkflowsStore } from '@/stores/workflows';
|
||||
import { useSettingsStore } from '@/stores/settings';
|
||||
import { useRootStore } from '@/stores/n8nRootStore';
|
||||
|
||||
export default mixins(
|
||||
externalHooks,
|
||||
genericHelpers,
|
||||
restApi,
|
||||
showMessage,
|
||||
).extend({
|
||||
export default mixins(externalHooks, genericHelpers, restApi, showMessage).extend({
|
||||
name: 'WorkflowSettings',
|
||||
components: {
|
||||
Modal,
|
||||
},
|
||||
data () {
|
||||
data() {
|
||||
return {
|
||||
isLoading: true,
|
||||
helpTexts: {
|
||||
errorWorkflow: this.$locale.baseText('workflowSettings.helpTexts.errorWorkflow'),
|
||||
timezone: this.$locale.baseText('workflowSettings.helpTexts.timezone'),
|
||||
saveDataErrorExecution: this.$locale.baseText('workflowSettings.helpTexts.saveDataErrorExecution'),
|
||||
saveDataSuccessExecution: this.$locale.baseText('workflowSettings.helpTexts.saveDataSuccessExecution'),
|
||||
saveExecutionProgress: this.$locale.baseText('workflowSettings.helpTexts.saveExecutionProgress'),
|
||||
saveManualExecutions: this.$locale.baseText('workflowSettings.helpTexts.saveManualExecutions'),
|
||||
executionTimeoutToggle: this.$locale.baseText('workflowSettings.helpTexts.executionTimeoutToggle'),
|
||||
saveDataErrorExecution: this.$locale.baseText(
|
||||
'workflowSettings.helpTexts.saveDataErrorExecution',
|
||||
),
|
||||
saveDataSuccessExecution: this.$locale.baseText(
|
||||
'workflowSettings.helpTexts.saveDataSuccessExecution',
|
||||
),
|
||||
saveExecutionProgress: this.$locale.baseText(
|
||||
'workflowSettings.helpTexts.saveExecutionProgress',
|
||||
),
|
||||
saveManualExecutions: this.$locale.baseText(
|
||||
'workflowSettings.helpTexts.saveManualExecutions',
|
||||
),
|
||||
executionTimeoutToggle: this.$locale.baseText(
|
||||
'workflowSettings.helpTexts.executionTimeoutToggle',
|
||||
),
|
||||
executionTimeout: this.$locale.baseText('workflowSettings.helpTexts.executionTimeout'),
|
||||
workflowCallerPolicy: this.$locale.baseText('workflowSettings.helpTexts.workflowCallerPolicy'),
|
||||
workflowCallerPolicy: this.$locale.baseText(
|
||||
'workflowSettings.helpTexts.workflowCallerPolicy',
|
||||
),
|
||||
workflowCallerIds: this.$locale.baseText('workflowSettings.helpTexts.workflowCallerIds'),
|
||||
},
|
||||
defaultValues: {
|
||||
@@ -290,12 +377,12 @@ export default mixins(
|
||||
saveManualExecutions: false,
|
||||
workflowCallerPolicy: '',
|
||||
},
|
||||
workflowCallerPolicyOptions: [] as Array<{ key: string, value: string }>,
|
||||
saveDataErrorExecutionOptions: [] as Array<{ key: string, value: string }>,
|
||||
saveDataSuccessExecutionOptions: [] as Array<{ key: string, value: string }>,
|
||||
saveExecutionProgressOptions: [] as Array<{ key: string | boolean, value: string }>,
|
||||
saveManualOptions: [] as Array<{ key: string | boolean, value: string }>,
|
||||
timezones: [] as Array<{ key: string, value: string }>,
|
||||
workflowCallerPolicyOptions: [] as Array<{ key: string; value: string }>,
|
||||
saveDataErrorExecutionOptions: [] as Array<{ key: string; value: string }>,
|
||||
saveDataSuccessExecutionOptions: [] as Array<{ key: string; value: string }>,
|
||||
saveExecutionProgressOptions: [] as Array<{ key: string | boolean; value: string }>,
|
||||
saveManualOptions: [] as Array<{ key: string | boolean; value: string }>,
|
||||
timezones: [] as Array<{ key: string; value: string }>,
|
||||
workflowSettings: {} as IWorkflowSettings,
|
||||
workflows: [] as IWorkflowShortResponse[],
|
||||
executionTimeout: 0,
|
||||
@@ -307,11 +394,7 @@ export default mixins(
|
||||
},
|
||||
|
||||
computed: {
|
||||
...mapStores(
|
||||
useRootStore,
|
||||
useSettingsStore,
|
||||
useWorkflowsStore,
|
||||
),
|
||||
...mapStores(useRootStore, useSettingsStore, useWorkflowsStore),
|
||||
workflowName(): string {
|
||||
return this.workflowsStore.workflowName;
|
||||
},
|
||||
@@ -322,7 +405,7 @@ export default mixins(
|
||||
return this.settingsStore.isWorkflowSharingEnabled;
|
||||
},
|
||||
},
|
||||
async mounted () {
|
||||
async mounted() {
|
||||
this.executionTimeout = this.rootStore.executionTimeout;
|
||||
this.maxExecutionTimeout = this.rootStore.maxExecutionTimeout;
|
||||
|
||||
@@ -356,7 +439,11 @@ export default mixins(
|
||||
try {
|
||||
await Promise.all(promises);
|
||||
} catch (error) {
|
||||
this.$showError(error, 'Problem loading settings', 'The following error occurred loading the data:');
|
||||
this.$showError(
|
||||
error,
|
||||
'Problem loading settings',
|
||||
'The following error occurred loading the data:',
|
||||
);
|
||||
}
|
||||
|
||||
const workflowSettings = deepCopy(this.workflowsStore.workflowSettings) as IWorkflowSettings;
|
||||
@@ -377,7 +464,8 @@ export default mixins(
|
||||
workflowSettings.saveManualExecutions = this.defaultValues.saveManualExecutions;
|
||||
}
|
||||
if (workflowSettings.callerPolicy === undefined) {
|
||||
workflowSettings.callerPolicy = this.defaultValues.workflowCallerPolicy as WorkflowCallerPolicyDefaultOption;
|
||||
workflowSettings.callerPolicy = this.defaultValues
|
||||
.workflowCallerPolicy as WorkflowCallerPolicyDefaultOption;
|
||||
}
|
||||
if (workflowSettings.executionTimeout === undefined) {
|
||||
workflowSettings.executionTimeout = this.rootStore.executionTimeout;
|
||||
@@ -391,7 +479,9 @@ export default mixins(
|
||||
this.isLoading = false;
|
||||
|
||||
this.$externalHooks().run('workflowSettings.dialogVisibleChanged', { dialogVisible: true });
|
||||
this.$telemetry.track('User opened workflow settings', { workflow_id: this.workflowsStore.workflowId });
|
||||
this.$telemetry.track('User opened workflow settings', {
|
||||
workflow_id: this.workflowsStore.workflowId,
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
onCallerIdsInput(str: string) {
|
||||
@@ -399,11 +489,11 @@ export default mixins(
|
||||
? str
|
||||
: str.replace(/[^0-9,\s]/g, '');
|
||||
},
|
||||
closeDialog () {
|
||||
closeDialog() {
|
||||
this.modalBus.$emit('close');
|
||||
this.$externalHooks().run('workflowSettings.dialogVisibleChanged', { dialogVisible: false });
|
||||
},
|
||||
setTimeout (key: string, value: string) {
|
||||
setTimeout(key: string, value: string) {
|
||||
const time = value ? parseInt(value, 10) : 0;
|
||||
|
||||
this.timeoutHMS = {
|
||||
@@ -411,7 +501,7 @@ export default mixins(
|
||||
[key]: time,
|
||||
};
|
||||
},
|
||||
async loadWorkflowCallerPolicyOptions () {
|
||||
async loadWorkflowCallerPolicyOptions() {
|
||||
this.workflowCallerPolicyOptions = [
|
||||
{
|
||||
key: 'any',
|
||||
@@ -427,19 +517,24 @@ export default mixins(
|
||||
},
|
||||
];
|
||||
},
|
||||
async loadSaveDataErrorExecutionOptions () {
|
||||
async loadSaveDataErrorExecutionOptions() {
|
||||
this.saveDataErrorExecutionOptions.length = 0;
|
||||
this.saveDataErrorExecutionOptions.push.apply( // eslint-disable-line no-useless-call
|
||||
this.saveDataErrorExecutionOptions, [
|
||||
this.saveDataErrorExecutionOptions.push.apply(
|
||||
// eslint-disable-line no-useless-call
|
||||
this.saveDataErrorExecutionOptions,
|
||||
[
|
||||
{
|
||||
key: 'DEFAULT',
|
||||
value: this.$locale.baseText(
|
||||
'workflowSettings.saveDataErrorExecutionOptions.defaultSave',
|
||||
{
|
||||
interpolate: {
|
||||
defaultValue: this.defaultValues.saveDataErrorExecution === 'all'
|
||||
? this.$locale.baseText('workflowSettings.saveDataErrorExecutionOptions.save')
|
||||
: this.$locale.baseText('workflowSettings.saveDataErrorExecutionOptions.doNotSave'),
|
||||
defaultValue:
|
||||
this.defaultValues.saveDataErrorExecution === 'all'
|
||||
? this.$locale.baseText('workflowSettings.saveDataErrorExecutionOptions.save')
|
||||
: this.$locale.baseText(
|
||||
'workflowSettings.saveDataErrorExecutionOptions.doNotSave',
|
||||
),
|
||||
},
|
||||
},
|
||||
),
|
||||
@@ -450,24 +545,33 @@ export default mixins(
|
||||
},
|
||||
{
|
||||
key: 'none',
|
||||
value: this.$locale.baseText('workflowSettings.saveDataErrorExecutionOptions.doNotSave'),
|
||||
value: this.$locale.baseText(
|
||||
'workflowSettings.saveDataErrorExecutionOptions.doNotSave',
|
||||
),
|
||||
},
|
||||
],
|
||||
);
|
||||
},
|
||||
async loadSaveDataSuccessExecutionOptions () {
|
||||
async loadSaveDataSuccessExecutionOptions() {
|
||||
this.saveDataSuccessExecutionOptions.length = 0;
|
||||
this.saveDataSuccessExecutionOptions.push.apply( // eslint-disable-line no-useless-call
|
||||
this.saveDataSuccessExecutionOptions, [
|
||||
this.saveDataSuccessExecutionOptions.push.apply(
|
||||
// eslint-disable-line no-useless-call
|
||||
this.saveDataSuccessExecutionOptions,
|
||||
[
|
||||
{
|
||||
key: 'DEFAULT',
|
||||
value: this.$locale.baseText(
|
||||
'workflowSettings.saveDataSuccessExecutionOptions.defaultSave',
|
||||
{
|
||||
interpolate: {
|
||||
defaultValue: this.defaultValues.saveDataSuccessExecution === 'all'
|
||||
? this.$locale.baseText('workflowSettings.saveDataSuccessExecutionOptions.save')
|
||||
: this.$locale.baseText('workflowSettings.saveDataSuccessExecutionOptions.doNotSave'),
|
||||
defaultValue:
|
||||
this.defaultValues.saveDataSuccessExecution === 'all'
|
||||
? this.$locale.baseText(
|
||||
'workflowSettings.saveDataSuccessExecutionOptions.save',
|
||||
)
|
||||
: this.$locale.baseText(
|
||||
'workflowSettings.saveDataSuccessExecutionOptions.doNotSave',
|
||||
),
|
||||
},
|
||||
},
|
||||
),
|
||||
@@ -478,22 +582,28 @@ export default mixins(
|
||||
},
|
||||
{
|
||||
key: 'none',
|
||||
value: this.$locale.baseText('workflowSettings.saveDataSuccessExecutionOptions.doNotSave'),
|
||||
value: this.$locale.baseText(
|
||||
'workflowSettings.saveDataSuccessExecutionOptions.doNotSave',
|
||||
),
|
||||
},
|
||||
],
|
||||
);
|
||||
},
|
||||
async loadSaveExecutionProgressOptions () {
|
||||
async loadSaveExecutionProgressOptions() {
|
||||
this.saveExecutionProgressOptions.length = 0;
|
||||
this.saveExecutionProgressOptions.push.apply( // eslint-disable-line no-useless-call
|
||||
this.saveExecutionProgressOptions, [
|
||||
this.saveExecutionProgressOptions.push.apply(
|
||||
// eslint-disable-line no-useless-call
|
||||
this.saveExecutionProgressOptions,
|
||||
[
|
||||
{
|
||||
key: 'DEFAULT',
|
||||
value: this.$locale.baseText(
|
||||
'workflowSettings.saveExecutionProgressOptions.defaultSave',
|
||||
{
|
||||
interpolate: {
|
||||
defaultValue: this.defaultValues.saveExecutionProgress ? this.$locale.baseText('workflowSettings.saveExecutionProgressOptions.yes') : this.$locale.baseText('workflowSettings.saveExecutionProgressOptions.no'),
|
||||
defaultValue: this.defaultValues.saveExecutionProgress
|
||||
? this.$locale.baseText('workflowSettings.saveExecutionProgressOptions.yes')
|
||||
: this.$locale.baseText('workflowSettings.saveExecutionProgressOptions.no'),
|
||||
},
|
||||
},
|
||||
),
|
||||
@@ -509,18 +619,17 @@ export default mixins(
|
||||
],
|
||||
);
|
||||
},
|
||||
async loadSaveManualOptions () {
|
||||
async loadSaveManualOptions() {
|
||||
this.saveManualOptions.length = 0;
|
||||
this.saveManualOptions.push({
|
||||
key: 'DEFAULT',
|
||||
value: this.$locale.baseText(
|
||||
'workflowSettings.saveManualOptions.defaultSave',
|
||||
{
|
||||
interpolate: {
|
||||
defaultValue: this.defaultValues.saveManualExecutions ? this.$locale.baseText('workflowSettings.saveManualOptions.yes') : this.$locale.baseText('workflowSettings.saveManualOptions.no'),
|
||||
},
|
||||
value: this.$locale.baseText('workflowSettings.saveManualOptions.defaultSave', {
|
||||
interpolate: {
|
||||
defaultValue: this.defaultValues.saveManualExecutions
|
||||
? this.$locale.baseText('workflowSettings.saveManualOptions.yes')
|
||||
: this.$locale.baseText('workflowSettings.saveManualOptions.no'),
|
||||
},
|
||||
),
|
||||
}),
|
||||
});
|
||||
this.saveManualOptions.push({
|
||||
key: true,
|
||||
@@ -532,7 +641,7 @@ export default mixins(
|
||||
});
|
||||
},
|
||||
|
||||
async loadTimezones () {
|
||||
async loadTimezones() {
|
||||
if (this.timezones.length !== 0) {
|
||||
// Data got already loaded
|
||||
return;
|
||||
@@ -547,10 +656,9 @@ export default mixins(
|
||||
|
||||
this.timezones.push({
|
||||
key: 'DEFAULT',
|
||||
value: this.$locale.baseText(
|
||||
'workflowSettings.defaultTimezone',
|
||||
{ interpolate: { defaultTimezoneValue } },
|
||||
),
|
||||
value: this.$locale.baseText('workflowSettings.defaultTimezone', {
|
||||
interpolate: { defaultTimezoneValue },
|
||||
}),
|
||||
});
|
||||
for (const timezone of Object.keys(timezones)) {
|
||||
this.timezones.push({
|
||||
@@ -559,7 +667,7 @@ export default mixins(
|
||||
});
|
||||
}
|
||||
},
|
||||
async loadWorkflows () {
|
||||
async loadWorkflows() {
|
||||
const workflows = await this.restApi().getWorkflows();
|
||||
workflows.sort((a, b) => {
|
||||
if (a.name.toLowerCase() < b.name.toLowerCase()) {
|
||||
@@ -579,7 +687,7 @@ export default mixins(
|
||||
|
||||
Vue.set(this, 'workflows', workflows);
|
||||
},
|
||||
async saveSettings () {
|
||||
async saveSettings() {
|
||||
// Set that the active state should be changed
|
||||
const data: IWorkflowDataUpdate = {
|
||||
settings: this.workflowSettings,
|
||||
@@ -588,9 +696,7 @@ export default mixins(
|
||||
// Convert hours, minutes, seconds into seconds for the workflow timeout
|
||||
const { hours, minutes, seconds } = this.timeoutHMS;
|
||||
data.settings!.executionTimeout =
|
||||
data.settings!.executionTimeout !== -1
|
||||
? hours * 3600 + minutes * 60 + seconds
|
||||
: -1;
|
||||
data.settings!.executionTimeout !== -1 ? hours * 3600 + minutes * 60 + seconds : -1;
|
||||
|
||||
if (data.settings!.executionTimeout === 0) {
|
||||
this.$showError(
|
||||
@@ -603,19 +709,18 @@ export default mixins(
|
||||
|
||||
// @ts-ignore
|
||||
if (data.settings!.executionTimeout > this.workflowSettings.maxExecutionTimeout) {
|
||||
const { hours, minutes, seconds } = this.convertToHMS(this.workflowSettings.maxExecutionTimeout as number);
|
||||
const { hours, minutes, seconds } = this.convertToHMS(
|
||||
this.workflowSettings.maxExecutionTimeout as number,
|
||||
);
|
||||
this.$showError(
|
||||
new Error(
|
||||
this.$locale.baseText(
|
||||
'workflowSettings.showError.saveSettings2.errorMessage',
|
||||
{
|
||||
interpolate: {
|
||||
hours: hours.toString(),
|
||||
minutes: minutes.toString(),
|
||||
seconds: seconds.toString(),
|
||||
},
|
||||
this.$locale.baseText('workflowSettings.showError.saveSettings2.errorMessage', {
|
||||
interpolate: {
|
||||
hours: hours.toString(),
|
||||
minutes: minutes.toString(),
|
||||
seconds: seconds.toString(),
|
||||
},
|
||||
),
|
||||
}),
|
||||
),
|
||||
this.$locale.baseText('workflowSettings.showError.saveSettings2.title'),
|
||||
this.$locale.baseText('workflowSettings.showError.saveSettings2.message') + ':',
|
||||
@@ -661,10 +766,13 @@ export default mixins(
|
||||
this.closeDialog();
|
||||
|
||||
this.$externalHooks().run('workflowSettings.saveSettings', { oldSettings });
|
||||
this.$telemetry.track('User updated workflow settings', { workflow_id: this.workflowsStore.workflowId });
|
||||
this.$telemetry.track('User updated workflow settings', {
|
||||
workflow_id: this.workflowsStore.workflowId,
|
||||
});
|
||||
},
|
||||
toggleTimeout() {
|
||||
this.workflowSettings.executionTimeout = this.workflowSettings.executionTimeout === -1 ? 0 : -1;
|
||||
this.workflowSettings.executionTimeout =
|
||||
this.workflowSettings.executionTimeout === -1 ? 0 : -1;
|
||||
},
|
||||
convertToHMS(num: number): ITimeoutHMS {
|
||||
if (num > 0) {
|
||||
@@ -705,5 +813,4 @@ export default mixins(
|
||||
.timeout-input {
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user