mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
refactor(editor): Stop expecting null
execution status (no-changelog) (#9672)
This commit is contained in:
parent
67932c0b76
commit
b0b4093072
|
@ -185,7 +185,7 @@ export interface IExecutionsCurrentSummary {
|
|||
startedAt: Date;
|
||||
mode: WorkflowExecuteMode;
|
||||
workflowId: string;
|
||||
status?: ExecutionStatus;
|
||||
status: ExecutionStatus;
|
||||
}
|
||||
|
||||
export interface IExecutingWorkflowData {
|
||||
|
|
|
@ -381,6 +381,7 @@ export interface IExecutionBase {
|
|||
id?: string;
|
||||
finished: boolean;
|
||||
mode: WorkflowExecuteMode;
|
||||
status: ExecutionStatus;
|
||||
retryOf?: string;
|
||||
retrySuccessId?: string;
|
||||
startedAt: Date;
|
||||
|
@ -404,7 +405,6 @@ export interface IExecutionPushResponse {
|
|||
|
||||
export interface IExecutionResponse extends IExecutionBase {
|
||||
id: string;
|
||||
status: string;
|
||||
data?: IRunExecutionData;
|
||||
workflowData: IWorkflowDb;
|
||||
executedNode?: string;
|
||||
|
|
|
@ -51,7 +51,7 @@ const isRetriable = computed(() => executionHelpers.isExecutionRetriable(props.e
|
|||
const classes = computed(() => {
|
||||
return {
|
||||
[style.executionListItem]: true,
|
||||
[style[props.execution.status ?? '']]: !!props.execution.status,
|
||||
[style[props.execution.status]]: true,
|
||||
};
|
||||
});
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ export function useExecutionHelpers() {
|
|||
|
||||
function isExecutionRetriable(execution: ExecutionSummary): boolean {
|
||||
return (
|
||||
['crashed', 'error'].includes(execution.status ?? '') &&
|
||||
['crashed', 'error'].includes(execution.status) &&
|
||||
!execution.retryOf &&
|
||||
!execution.retrySuccessId
|
||||
);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { defineStore } from 'pinia';
|
||||
import { computed, ref } from 'vue';
|
||||
import type { ExecutionStatus, IDataObject, ExecutionSummary } from 'n8n-workflow';
|
||||
import type { IDataObject, ExecutionSummary } from 'n8n-workflow';
|
||||
import type {
|
||||
ExecutionFilterType,
|
||||
ExecutionsQueryFilter,
|
||||
|
@ -83,7 +83,6 @@ export const useExecutionsStore = defineStore('executions', () => {
|
|||
function addExecution(execution: ExecutionSummary) {
|
||||
executionsById.value[execution.id] = {
|
||||
...execution,
|
||||
status: execution.status ?? getExecutionStatus(execution),
|
||||
mode: execution.mode,
|
||||
};
|
||||
}
|
||||
|
@ -91,7 +90,6 @@ export const useExecutionsStore = defineStore('executions', () => {
|
|||
function addCurrentExecution(execution: ExecutionSummary) {
|
||||
currentExecutionsById.value[execution.id] = {
|
||||
...execution,
|
||||
status: execution.status ?? getExecutionStatus(execution),
|
||||
mode: execution.mode,
|
||||
};
|
||||
}
|
||||
|
@ -113,24 +111,6 @@ export const useExecutionsStore = defineStore('executions', () => {
|
|||
await startAutoRefreshInterval(workflowId);
|
||||
}
|
||||
|
||||
function getExecutionStatus(execution: ExecutionSummary): ExecutionStatus {
|
||||
if (execution.status) {
|
||||
return execution.status;
|
||||
} else {
|
||||
if (execution.waitTill) {
|
||||
return 'waiting';
|
||||
} else if (execution.stoppedAt === undefined) {
|
||||
return 'running';
|
||||
} else if (execution.finished) {
|
||||
return 'success';
|
||||
} else if (execution.stoppedAt !== null) {
|
||||
return 'error';
|
||||
} else {
|
||||
return 'unknown';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function fetchExecutions(
|
||||
filter = executionsFilters.value,
|
||||
lastId?: string,
|
||||
|
@ -274,7 +254,6 @@ export const useExecutionsStore = defineStore('executions', () => {
|
|||
activeExecution,
|
||||
fetchExecutions,
|
||||
fetchExecution,
|
||||
getExecutionStatus,
|
||||
autoRefresh,
|
||||
autoRefreshTimeout,
|
||||
startAutoRefreshInterval,
|
||||
|
|
|
@ -175,11 +175,9 @@ export async function patch(
|
|||
*
|
||||
* @param {IExecutionFlattedResponse} fullExecutionData The data to unflatten
|
||||
*/
|
||||
export function unflattenExecutionData(
|
||||
fullExecutionData: IExecutionFlattedResponse,
|
||||
): Omit<IExecutionResponse, 'status'> {
|
||||
export function unflattenExecutionData(fullExecutionData: IExecutionFlattedResponse) {
|
||||
// Unflatten the data
|
||||
const returnData: Omit<IExecutionResponse, 'status'> = {
|
||||
const returnData: IExecutionResponse = {
|
||||
...fullExecutionData,
|
||||
workflowData: fullExecutionData.workflowData,
|
||||
data: parse(fullExecutionData.data),
|
||||
|
|
|
@ -2371,7 +2371,7 @@ export interface ExecutionSummary {
|
|||
stoppedAt?: Date;
|
||||
workflowId: string;
|
||||
workflowName?: string;
|
||||
status?: ExecutionStatus;
|
||||
status: ExecutionStatus;
|
||||
lastNodeExecuted?: string;
|
||||
executionError?: ExecutionError;
|
||||
nodeExecutionStatus?: {
|
||||
|
|
Loading…
Reference in a new issue