From b41c91d2909fe293d35125d442b15ee06c2febec Mon Sep 17 00:00:00 2001 From: Mutasem Aldmour Date: Wed, 30 Oct 2024 13:34:07 +0100 Subject: [PATCH] add all filters --- .../editor-ui/src/views/WorkflowsView.vue | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/packages/editor-ui/src/views/WorkflowsView.vue b/packages/editor-ui/src/views/WorkflowsView.vue index 067ba4ca4a..da0ef743cd 100644 --- a/packages/editor-ui/src/views/WorkflowsView.vue +++ b/packages/editor-ui/src/views/WorkflowsView.vue @@ -63,7 +63,7 @@ interface Filters { nodeTypes: string[]; nodeName: string; webhookUrl: string; - httpRequestUrl: string; + httpNodeUrl: string; } const StatusFilter = { @@ -82,7 +82,7 @@ const filters = ref({ nodeTypes: [], nodeName: '', webhookUrl: '', - httpRequestUrl: '', + httpNodeUrl: '', }); const readOnlyEnv = computed(() => sourceControlStore.preferences.branchReadOnly); @@ -191,16 +191,20 @@ const trackCategoryLinkClick = (category: string) => { }; const fetchWorkflowsWithFilters = async () => { - const { homeProject, status, credentials } = filters.value; + const { homeProject, status, credentials, nodeTypes, nodeName, webhookUrl, httpNodeUrl } = + filters.value; const options: WorkflowsFetchOptions = { filter: { projectId: homeProject ? homeProject : undefined, active: status === StatusFilter.ACTIVE ? true : undefined, }, credentialIds: credentials.length ? credentials : undefined, + nodeTypes: nodeTypes.length ? nodeTypes : undefined, + nodeName: nodeName.length ? nodeName : undefined, + httpNodeURL: httpNodeUrl.length ? httpNodeUrl : undefined, + webhookURL: webhookUrl.length ? webhookUrl : undefined, }; - console.log('fetching', options); await workflowsStore.fetchAllWorkflows(options); }; @@ -254,8 +258,8 @@ const saveFiltersOnQueryString = () => { query.nodeName = filters.value.nodeName; } - if (filters.value.httpRequestUrl) { - query.httpRequestUrl = filters.value.httpRequestUrl; + if (filters.value.httpNodeUrl) { + query.httpNodeUrl = filters.value.httpNodeUrl; } if (filters.value.webhookUrl) { @@ -280,7 +284,7 @@ const setFiltersFromQueryString = async () => { credentials, nodeTypes, nodeName, - httpRequestUrl, + httpNodeUrl, webhookUrl, } = route.query ?? {}; @@ -306,8 +310,8 @@ const setFiltersFromQueryString = async () => { filters.value.nodeName = nodeName; } - if (httpRequestUrl && typeof httpRequestUrl === 'string') { - filters.value.httpRequestUrl = httpRequestUrl; + if (httpNodeUrl && typeof httpNodeUrl === 'string') { + filters.value.httpNodeUrl = httpNodeUrl; } if (webhookUrl && typeof webhookUrl === 'string') { @@ -562,6 +566,7 @@ onMounted(async () => { :model-value="filters.nodeTypes" :multiple="true" :placeholder="i18n.baseText('workflows.filters.nodeTypes.placeholder')" + :filterable="true" class="tags-container" @update:model-value="setKeyValue('nodeTypes', $event)" > @@ -618,8 +623,8 @@ onMounted(async () => { >