From: Michal Klobukowski Date: Tue, 23 Oct 2018 10:18:01 +0000 (+0200) Subject: Fix run a process workflows case sensitive search X-Git-Tag: 1.3.0~49^2^2~1 X-Git-Url: https://git.arvados.org/arvados-workbench2.git/commitdiff_plain/df894154236c20546f8c4439ecc81815413598f7 Fix run a process workflows case sensitive search refs # Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski --- diff --git a/src/store/run-process-panel/run-process-panel-reducer.ts b/src/store/run-process-panel/run-process-panel-reducer.ts index 0f220419..560e91cd 100644 --- a/src/store/run-process-panel/run-process-panel-reducer.ts +++ b/src/store/run-process-panel/run-process-panel-reducer.ts @@ -33,7 +33,13 @@ export const runProcessPanelReducer = (state = initialState, action: RunProcessP inputs: getWorkflowInputs(parseWorkflowDefinition(selectedWorkflow)) || [], }), SET_WORKFLOWS: workflows => ({ ...state, workflows, searchWorkflows: workflows }), - SEARCH_WORKFLOWS: term => ({ ...state, searchWorkflows: state.workflows.filter(workflow => workflow.name.includes(term)) }), + SEARCH_WORKFLOWS: term => { + const termRegex = new RegExp(term, 'i'); + return { + ...state, + searchWorkflows: state.workflows.filter(workflow => termRegex.test(workflow.name)), + }; + }, RESET_RUN_PROCESS_PANEL: () => ({ ...initialState, processOwnerUuid: state.processOwnerUuid }), default: () => state }); \ No newline at end of file