fix(editor): Fix type errors in components/executions/workflow (#9448)

This commit is contained in:
Milorad FIlipović 2024-05-17 15:14:59 +02:00 committed by GitHub
parent 003a4ea620
commit 9c768a0443
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 42 additions and 24 deletions

View file

@ -12,7 +12,7 @@
<router-link
:class="$style.executionLink"
:to="{
name: VIEWS.EXECUTION_PREVIEW,
name: executionPreviewViewName,
params: { name: currentWorkflow, executionId: execution.id },
}"
:data-test-execution-status="executionUIDetails.name"
@ -115,7 +115,6 @@ export default defineComponent({
return {
executionHelpers,
VIEWS,
};
},
computed: {
@ -144,6 +143,9 @@ export default defineComponent({
isRetriable(): boolean {
return this.executionHelpers.isExecutionRetriable(this.execution);
},
executionPreviewViewName() {
return VIEWS.EXECUTION_PREVIEW;
},
},
methods: {
onRetryMenuItemSelect(action: string): void {

View file

@ -84,17 +84,6 @@ export default defineComponent({
} as IWorkflowSaveSettings,
};
},
watch: {
workflowSettings(newSettings: IWorkflowSettings) {
this.updateSettings(newSettings);
},
},
mounted() {
this.defaultValues.saveFailedExecutions = this.settingsStore.saveDataErrorExecution;
this.defaultValues.saveSuccessfulExecutions = this.settingsStore.saveDataSuccessExecution;
this.defaultValues.saveManualExecutions = this.settingsStore.saveManualExecutions;
this.updateSettings(this.workflowSettings);
},
computed: {
...mapStores(useRootStore, useSettingsStore, useUIStore, useWorkflowsStore),
accordionItems(): object[] {
@ -182,6 +171,17 @@ export default defineComponent({
return this.workflowsStore.workflowTags;
},
},
watch: {
workflowSettings(newSettings: IWorkflowSettings) {
this.updateSettings(newSettings);
},
},
mounted() {
this.defaultValues.saveFailedExecutions = this.settingsStore.saveDataErrorExecution;
this.defaultValues.saveSuccessfulExecutions = this.settingsStore.saveDataSuccessExecution;
this.defaultValues.saveManualExecutions = this.settingsStore.saveManualExecutions;
this.updateSettings(this.workflowSettings);
},
methods: {
updateSettings(workflowSettings: IWorkflowSettings): void {
this.workflowSaveSettings.saveFailedExecutions =
@ -209,15 +209,19 @@ export default defineComponent({
this.uiStore.openModal(WORKFLOW_SETTINGS_MODAL_KEY);
}
},
openWorkflowSettings(event: MouseEvent): void {
openWorkflowSettings(): void {
this.uiStore.openModal(WORKFLOW_SETTINGS_MODAL_KEY);
},
async onSaveWorkflowClick(event: MouseEvent): void {
let currentId = undefined;
async onSaveWorkflowClick(): Promise<void> {
let currentId: string | undefined = undefined;
if (this.currentWorkflowId !== PLACEHOLDER_EMPTY_WORKFLOW_ID) {
currentId = this.currentWorkflowId;
} else if (this.$route.params.name && this.$route.params.name !== 'new') {
currentId = this.$route.params.name;
const routeName = this.$route.params.name;
currentId = Array.isArray(routeName) ? routeName[0] : routeName;
}
if (!currentId) {
return;
}
const saved = await this.workflowHelpers.saveCurrentWorkflow({
id: currentId,

View file

@ -45,7 +45,7 @@ export default defineComponent({
},
},
methods: {
onSetupFirstStep(event: MouseEvent): void {
onSetupFirstStep(): void {
this.uiStore.addFirstStepOnLoad = true;
const workflowRoute = this.getWorkflowRoute();
void this.$router.push(workflowRoute);

View file

@ -129,7 +129,7 @@ export default defineComponent({
setup() {
const externalHooks = useExternalHooks();
const router = useRouter();
const workflowHelpers = useWorkflowHelpers(router);
const workflowHelpers = useWorkflowHelpers({ router });
const { callDebounced } = useDebounce();
return {

View file

@ -10,7 +10,7 @@
{{ $locale.baseText('executionsList.stopExecution') }}
</n8n-button>
</div>
<div v-else :class="$style.previewContainer">
<div v-else-if="executionUIDetails" :class="$style.previewContainer">
<div
v-if="execution"
:class="$style.executionDetails"
@ -67,7 +67,7 @@
<router-link
:class="$style.executionLink"
:to="{
name: VIEWS.EXECUTION_PREVIEW,
name: executionPreviewViewName,
params: {
workflowId: execution.workflowId,
executionId: execution.retryOf,
@ -82,7 +82,7 @@
<n8n-button size="medium" :type="debugButtonData.type" :class="$style.debugLink">
<router-link
:to="{
name: VIEWS.EXECUTION_DEBUG,
name: executionDebugViewName,
params: {
name: execution.workflowId,
executionId: execution.id,
@ -173,7 +173,6 @@ export default defineComponent({
const executionHelpers = useExecutionHelpers();
return {
VIEWS,
executionHelpers,
...useMessage(),
...useExecutionDebugging(),
@ -204,6 +203,12 @@ export default defineComponent({
isRetriable(): boolean {
return !!this.execution && this.executionHelpers.isExecutionRetriable(this.execution);
},
executionDebugViewName() {
return VIEWS.EXECUTION_DEBUG;
},
executionPreviewViewName() {
return VIEWS.EXECUTION_PREVIEW;
},
},
methods: {
async onDeleteExecution(): Promise<void> {

View file

@ -106,9 +106,16 @@ export default defineComponent({
default: null,
},
},
emits: {
retryExecution: null,
loadMore: null,
refresh: null,
filterUpdated: null,
reloadExecutions: null,
'update:autoRefresh': null,
},
data() {
return {
VIEWS,
filter: {} as ExecutionFilterType,
};
},