Skip to content

Commit

Permalink
fix(editor): Fix type errors in components/executions/workflow (#9448)
Browse files Browse the repository at this point in the history
  • Loading branch information
MiloradFilipovic authored May 17, 2024
1 parent 003a4ea commit 9c768a0
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -115,7 +115,6 @@ export default defineComponent({

return {
executionHelpers,
VIEWS,
};
},
computed: {
Expand Down Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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[] {
Expand Down Expand Up @@ -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 =
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -67,7 +67,7 @@
<router-link
:class="$style.executionLink"
:to="{
name: VIEWS.EXECUTION_PREVIEW,
name: executionPreviewViewName,
params: {
workflowId: execution.workflowId,
executionId: execution.retryOf,
Expand All @@ -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,
Expand Down Expand Up @@ -173,7 +173,6 @@ export default defineComponent({
const executionHelpers = useExecutionHelpers();
return {
VIEWS,
executionHelpers,
...useMessage(),
...useExecutionDebugging(),
Expand Down Expand Up @@ -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> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
},
Expand Down

0 comments on commit 9c768a0

Please sign in to comment.