mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-05 22:38:48 +00:00
Fix: Workflow app crashes when user clicks on response node (#13217)
* Added controller and service for fetching logs and nodes seperately * Add inifinte scroll pagination for workflow logs * Fix "All Nodes" not renderd on Nodes column * Fix reducer to append logs on Logs column * Fix: incorrect code placement * Fix reducer to append logs on Nodes column * Prepend execution log on workflow run * Fix node ordering * Decouple logs panel from workflow editor * Update execution nodes when log panel is opened * Reset log selection on workflow run * Added 'updatePreviewState' function * Update ee-server submodule reference
This commit is contained in:
parent
4c67f5db8b
commit
2447a55e22
10 changed files with 91 additions and 3 deletions
|
|
@ -1 +1 @@
|
|||
Subproject commit b1b81cebd4a8f2e03d927722084c76bc3c660b41
|
||||
Subproject commit b8bb0fdd287f4cf52d044a02be8b8d4777abfbe6
|
||||
|
|
@ -10,6 +10,8 @@ export const workflowExecutionsService = {
|
|||
all,
|
||||
enableWebhook,
|
||||
previewQueryNode,
|
||||
getPaginatedExecutions,
|
||||
getPaginatedNodes,
|
||||
trigger,
|
||||
streamSSE,
|
||||
};
|
||||
|
|
@ -73,6 +75,22 @@ function enableWebhook(appId, value) {
|
|||
return fetch(`${config.apiUrl}/v2/webhooks/workflows/${appId}`, requestOptions).then(handleResponse);
|
||||
}
|
||||
|
||||
function getPaginatedExecutions(appVersionId, page = 1, perPage = 10) {
|
||||
const requestOptions = { method: 'GET', headers: authHeader(), credentials: 'include' };
|
||||
return fetch(
|
||||
`${config.apiUrl}/workflow_executions?appVersionId=${appVersionId}&page=${page}&per_page=${perPage}`,
|
||||
requestOptions
|
||||
).then(handleResponse);
|
||||
}
|
||||
|
||||
function getPaginatedNodes(executionId, page = 1, perPage = 20) {
|
||||
const requestOptions = { method: 'GET', headers: authHeader(), credentials: 'include' };
|
||||
return fetch(
|
||||
`${config.apiUrl}/workflow_executions/${executionId}/nodes?page=${page}&per_page=${perPage}`,
|
||||
requestOptions
|
||||
).then(handleResponse);
|
||||
}
|
||||
|
||||
function trigger(workflowAppId, params, environmentId) {
|
||||
const currentSession = authenticationService.currentSessionValue;
|
||||
const body = {
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 1adb563573bde7d204976a45c06ef4ce96d7dad3
|
||||
Subproject commit d5eb650e9c5dc62c4a3db1a29f6216315871f195
|
||||
|
|
@ -8,6 +8,8 @@ export const FEATURES: FeaturesConfig = {
|
|||
[FEATURE_KEY.WORKFLOW_EXECUTION_STATUS]: {},
|
||||
[FEATURE_KEY.WORKFLOW_EXECUTION_DETAILS]: {}, //Basic plan users can access worfklows
|
||||
[FEATURE_KEY.LIST_WORKFLOW_EXECUTIONS]: {},
|
||||
[FEATURE_KEY.FETCH_EXECUTION_LOGS]: {},
|
||||
[FEATURE_KEY.FETCH_EXECUTION_NODES]: {},
|
||||
[FEATURE_KEY.PREVIEW_QUERY_NODE]: {},
|
||||
|
||||
[FEATURE_KEY.CREATE_WORKFLOW_SCHEDULE]: {},
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ export enum FEATURE_KEY {
|
|||
WORKFLOW_EXECUTION_STATUS = 'workflow_execution_status',
|
||||
WORKFLOW_EXECUTION_DETAILS = 'workflow_execution_details',
|
||||
LIST_WORKFLOW_EXECUTIONS = 'list_workflow_executions',
|
||||
FETCH_EXECUTION_LOGS = 'fetch_execution_logs',
|
||||
FETCH_EXECUTION_NODES = 'fetch_execution_nodes',
|
||||
PREVIEW_QUERY_NODE = 'preview_query_node',
|
||||
|
||||
CREATE_WORKFLOW_SCHEDULE = 'create_workflow_schedule',
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { Body, Controller, Get, Param, Post, Res, Sse } from '@nestjs/common';
|
||||
import { Body, Controller, Get, Param, Post, Query, Res, Sse } from '@nestjs/common';
|
||||
import { Response } from 'express';
|
||||
import { IWorkflowExecutionController } from '../interfaces/IWorkflowExecutionController';
|
||||
import { CreateWorkflowExecutionDto } from '@dto/create-workflow-execution.dto';
|
||||
|
|
@ -44,6 +44,28 @@ export class WorkflowExecutionsController implements IWorkflowExecutionControlle
|
|||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
@InitFeature(FEATURE_KEY.FETCH_EXECUTION_LOGS)
|
||||
@Get()
|
||||
async getExecutions(
|
||||
@Query('appVersionId') appVersionId: string,
|
||||
@Query('page') page = '1',
|
||||
@Query('per_page') perPage = '10',
|
||||
@User() user
|
||||
): Promise<any> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
@InitFeature(FEATURE_KEY.FETCH_EXECUTION_NODES)
|
||||
@Get(':id/nodes')
|
||||
async getExecutionNodes(
|
||||
@Param('id') id: string,
|
||||
@Query('page') page = '1',
|
||||
@Query('per_page') perPage = '10',
|
||||
@User() user
|
||||
): Promise<any> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
@InitFeature(FEATURE_KEY.PREVIEW_QUERY_NODE)
|
||||
@Post('previewQueryNode')
|
||||
async previewQueryNode(
|
||||
|
|
|
|||
|
|
@ -16,5 +16,9 @@ export interface IWorkflowExecutionController {
|
|||
|
||||
index(appVersionId: any, user: any): Promise<WorkflowExecution[]>;
|
||||
|
||||
getExecutions(appVersionId: string, page: any, perPage: any, user: any): Promise<any>;
|
||||
|
||||
getExecutionNodes(id: string, user: any, page: any, perPage: any): Promise<any>;
|
||||
|
||||
previewQueryNode(user: any, previewNodeDto: PreviewWorkflowNodeDto, response: Response): Promise<{ result: any }>;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import { AppVersion } from 'src/entities/app_version.entity';
|
|||
import { User } from 'src/entities/user.entity';
|
||||
import { Response } from 'express';
|
||||
import { QueryResult } from '@tooljet/plugins/dist/packages/common/lib';
|
||||
import { WorkflowExecutionNode } from 'src/entities/workflow_execution_node.entity';
|
||||
|
||||
export interface IWorkflowExecutionsService {
|
||||
create(createWorkflowExecutionDto: CreateWorkflowExecutionDto): Promise<WorkflowExecution>;
|
||||
|
|
@ -42,4 +43,20 @@ export interface IWorkflowExecutionsService {
|
|||
user: User,
|
||||
response: Response
|
||||
): Promise<any>;
|
||||
|
||||
getWorkflowExecutionsLogs(appVersionId: string, page?: number, limit?: number): Promise<{
|
||||
data: WorkflowExecution[];
|
||||
page: number;
|
||||
per_page: number;
|
||||
total: number;
|
||||
total_pages: number;
|
||||
}>;
|
||||
|
||||
getWorkflowExecutionNodes(workflowExecutionId: string, page?: number, limit?: number): Promise<{
|
||||
data: WorkflowExecutionNode[];
|
||||
page: number;
|
||||
per_page: number;
|
||||
total: number;
|
||||
total_pages: number;
|
||||
}>;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import { Response } from 'express';
|
|||
import { IWorkflowExecutionsService } from '../interfaces/IWorkflowExecutionsService';
|
||||
import { CreateWorkflowExecutionDto } from '@dto/create-workflow-execution.dto';
|
||||
import { QueryResult } from '@tooljet/plugins/dist/packages/common/lib';
|
||||
import { WorkflowExecutionNode } from 'src/entities/workflow_execution_node.entity';
|
||||
|
||||
@Injectable()
|
||||
export class WorkflowExecutionsService implements IWorkflowExecutionsService {
|
||||
|
|
@ -61,4 +62,24 @@ export class WorkflowExecutionsService implements IWorkflowExecutionsService {
|
|||
async findOne(id: string, relations?: string[]): Promise<WorkflowExecution> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
async getWorkflowExecutionsLogs(appVersionId: string, page: number = 1, limit: number = 10): Promise<{
|
||||
data: WorkflowExecution[];
|
||||
page: number;
|
||||
per_page: number;
|
||||
total: number;
|
||||
total_pages: number;
|
||||
}> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
async getWorkflowExecutionNodes(workflowExecutionId: string, page: number = 1, limit: number = 10): Promise<{
|
||||
data: WorkflowExecutionNode[];
|
||||
page: number;
|
||||
per_page: number;
|
||||
total: number;
|
||||
total_pages: number;
|
||||
}> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ interface Features {
|
|||
[FEATURE_KEY.WORKFLOW_EXECUTION_STATUS]: FeatureConfig;
|
||||
[FEATURE_KEY.WORKFLOW_EXECUTION_DETAILS]: FeatureConfig;
|
||||
[FEATURE_KEY.LIST_WORKFLOW_EXECUTIONS]: FeatureConfig;
|
||||
[FEATURE_KEY.FETCH_EXECUTION_LOGS]: FeatureConfig;
|
||||
[FEATURE_KEY.FETCH_EXECUTION_NODES]: FeatureConfig;
|
||||
[FEATURE_KEY.PREVIEW_QUERY_NODE]: FeatureConfig;
|
||||
[FEATURE_KEY.CREATE_WORKFLOW_SCHEDULE]: FeatureConfig;
|
||||
[FEATURE_KEY.LIST_WORKFLOW_SCHEDULES]: FeatureConfig;
|
||||
|
|
|
|||
Loading…
Reference in a new issue