From 1542da0ebbe12e917645956510ee41b593117f3a Mon Sep 17 00:00:00 2001 From: olga-union <101579322+olga-union@users.noreply.github.com> Date: Fri, 21 Oct 2022 11:01:40 -0500 Subject: [PATCH] chore: fix filters (#621) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: move src to a new location Signed-off-by: Nastya Rusina * ci: allow branch to be built again Signed-off-by: Nastya Rusina * chore: replace link to github repository to a proper one Signed-off-by: Nastya Rusina * ci: basic test and test-coverage setup Signed-off-by: Nastya Rusina * chore: add first plugin package Signed-off-by: Nastya Rusina * chore: allow to start test from main directory Signed-off-by: Nastya Rusina * ci: update lowest mkdirp version (#423) Signed-off-by: Nastya Rusina * chore: add build scripts for console app (#429) Signed-off-by: Carina Ursu Co-authored-by: Carina Ursu * fix: hide the legend (#435) Signed-off-by: eugenejahn * ci: move storybook related packages to top level (#434) * ci: move storybook related packages to top level * ci: ensure that lint can be run in PR checks * ci: allow to run tests linux setup Signed-off-by: Nastya Rusina * fix: fix issue 386 (#437) Signed-off-by: eugenejahn * ci: ensure unified tsconfig and remove mocks, test, stories from build (#436) * ci: ensure unified tsconfig and remove mocks,test,stories from build * ci: move certificates into certificate folder inside script Signed-off-by: Nastya Rusina * Make whole row clickable to open TaskExecutionDetails panel (#444) * fix: issue 398 * fix: prevent parent onclick event trigger Signed-off-by: eugenejahn * ci: allow to start jest config for all project at once (#447) * minor: unable to view all the workflow versions (#446) * fix: unable to view all the workflow versions Signed-off-by: Carina Ursu * chore: cleanup Signed-off-by: Carina Ursu Co-authored-by: Carina Ursu * chore(tsc): exclude test/stories/mock files only from build (#451) * chore(tsc): exclude test/stories/mock files only from build Signed-off-by: Nastya Rusina * ci: ensure that webpack too doesn't include test/mock/specs files (#452) Signed-off-by: Nastya Rusina * minor: add support for StructuredDataSet Input/Output type (#445) * chore: support for StructuredDataSet Input/Output type Signed-off-by: Carina Ursu * chore: add tests Signed-off-by: Carina Ursu * chore: add package Signed-off-by: Carina Ursu * chore: resolving local package issue Signed-off-by: Carina Ursu * chore: yarn lock Signed-off-by: Carina Ursu * chore: stories Signed-off-by: Carina Ursu * chore: fix associative arrays in copy functionality Signed-off-by: Carina Ursu * chore: fix scalar stories Signed-off-by: Carina Ursu * chore: oops Signed-off-by: Carina Ursu * chore: cleanup Signed-off-by: Carina Ursu * chore: revert old viewer to original Signed-off-by: Carina Ursu * chore: fix Signed-off-by: Carina Ursu * chore: remove non-null assertion Signed-off-by: Carina Ursu * chore: fix types Signed-off-by: Carina Ursu * chore: cleanup Signed-off-by: Carina Ursu * chore: fix tests Signed-off-by: Carina Ursu * chore: fix test types Signed-off-by: Carina Ursu * chore: cleanup Signed-off-by: Carina Ursu * chore: cleanup Signed-off-by: Carina Ursu * chore: cleanup Signed-off-by: Carina Ursu * chore: cleanup Signed-off-by: Carina Ursu Co-authored-by: Carina Ursu * chore: Provide basic repo structure and ensure that stories, tests, vscode setup properly (#458) * chore: separate AppInfo * chore: vscode properly understands @flyteconsole * chore: add basics/locale entry * test: add storybooks and tests * test: fix istanbul test-coverage issue by binding babel versions Signed-off-by: Nastya Rusina * ci: minimize babel presence (#457) * ci: minimize babel presence Signed-off-by: Nastya Rusina * fix: update node executions to display map tasks (#455) * fix: update node executions to display map tasks * fix: update map task logs styles * test: add/update unit tests * fix: fix flickering and unnecessary re-renders Signed-off-by: Olga Nad * ci: resolve docker build issues (#462) * ci: resolve docker build issues * chore: remove unneeded changes Signed-off-by: Nastya Rusina * Chore: Rebase devmain on top of master (#464) * fix: ensure that admin version is fully shown (#465) * chore: fix for console not respecting admin url (#468) * chore: fix Signed-off-by: Carina Ursu * chore: remove console Signed-off-by: Carina Ursu * chore: add cherio o=to package Signed-off-by: Carina Ursu * chore: add cherio o=to package Signed-off-by: Carina Ursu * chore: fix start prod Signed-off-by: Carina Ursu * chore: fix start prod Signed-off-by: Carina Ursu * chore: cleanup Signed-off-by: Carina Ursu * chore: cleanup Signed-off-by: Carina Ursu Co-authored-by: Carina Ursu * chore: rebase on top of master Signed-off-by: Nastya <55718143+anrusina@users.noreply.github.com> * fix: trigger release #patch (#477) Signed-off-by: Nastya <55718143+anrusina@users.noreply.github.com> * feat: add task version info (#485) made the entities component become more generic that can support Workflow, Task, and others added the inputs and outputs to task details page added the versions table in task details page added the version details page added task details link in node side panel Signed-off-by: eugenejahn Co-authored-by: Eugene Jahn * chore: update Readme with python note + package version update (#486) Signed-off-by: Nastya Rusina Co-authored-by: Nastya Rusina * hotfix ci pipeline (#487) * hotfix ci pipeline Signed-off-by: Yuvraj * more changes Signed-off-by: Yuvraj Co-authored-by: Yuvraj * [Mapping][TaskInfo] V.2 - Update Task details to allow check information for child task execution (#467) * fix: add eventVersion check for map tasks (#484) * fix: resolve minimist package to v1.2.6 (#492) Signed-off-by: Nastya <55718143+anrusina@users.noreply.github.com> * ci: add flyte-api plugin package (#490) Signed-off-by: Nastya <55718143+anrusina@users.noreply.github.com> * fix: update/add graph related stories (#493) * fix: separate api auth to plugin folder (#495) * fix: separate api auth to plugin folder * chore: for local admin URL is undefined * chore: update README.md * test: fix tests + add new ones * v0.0.2 - release for flyte-api plugin Signed-off-by: Nastya <55718143+anrusina@users.noreply.github.com> * feat: rerun task action in execution page (#488) * feat: task rerun done Signed-off-by: Eugene Jahn * feat: fix initialParameters Signed-off-by: Eugene Jahn * fix: remove a file Signed-off-by: Eugene Jahn * feat: rerun task done Signed-off-by: Eugene Jahn * feat: rerun fix literal type Signed-off-by: Eugene Jahn * feat: small typo fixed Signed-off-by: Eugene Jahn * feat: small typo fixed Signed-off-by: Eugene Jahn * feat: fix test coverage Signed-off-by: Eugene Jahn * chore: update release version (#501) Signed-off-by: Nastya <55718143+anrusina@users.noreply.github.com> * chore(deps-dev): bump protobufjs from 6.8.9 to 6.11.3 (#502) Bumps [protobufjs](https://github.com/protobufjs/protobuf.js) from 6.8.9 to 6.11.3. - [Release notes](https://github.com/protobufjs/protobuf.js/releases) - [Changelog](https://github.com/protobufjs/protobuf.js/blob/v6.11.3/CHANGELOG.md) - [Commits](https://github.com/protobufjs/protobuf.js/commits/v6.11.3) --- updated-dependencies: - dependency-name: protobufjs dependency-type: direct:development ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: add package generator for basics/composites/plugins (#503) * chore: add package generator for basics/composites/plugins Signed-off-by: Nastya <55718143+anrusina@users.noreply.github.com> * Update CONTRIBUTING.md with package generate info * fix(bug-508): executions can not be filtered by start time (#509) Signed-off-by: Nastya <55718143+anrusina@users.noreply.github.com> * chore(deps-dev): bump semantic-release from 17.2.3 to 19.0.3 (#510) Bumps [semantic-release](https://github.com/semantic-release/semantic-release) from 17.2.3 to 19.0.3. - [Release notes](https://github.com/semantic-release/semantic-release/releases) - [Commits](https://github.com/semantic-release/semantic-release/compare/v17.2.3...v19.0.3) --- updated-dependencies: - dependency-name: semantic-release dependency-type: direct:development ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * feat: support flyte decks (#504) * feat: support flyte deck #none Signed-off-by: James * fix: rebase with master #none Signed-off-by: James * fix: fix iframe height and api response type; #none Signed-off-by: James * fix: modal style; #none; Signed-off-by: James * fix: use env variable for server ssl config #none; Signed-off-by: James * fix: use h2 instead of h3 for future migration #none Signed-off-by: James * feat: navbar navigation dropdown (#511) * feat: navbar navigstion dropdown * chore: storybook update * chore: fix test + add base readme Signed-off-by: Nastya <55718143+anrusina@users.noreply.github.com> * chore: support internal/external navigsation better (#513) Signed-off-by: Nastya <55718143+anrusina@users.noreply.github.com> * Update Contributing.md (#515) Add line how to add nodejs plugin to asdf, to simplify setup * chore: update navigationDropdown usage (#517) Signed-off-by: Work Co-authored-by: Work * chore(deps): bump jsdom from 16.4.0 to 16.7.0 (#516) Bumps [jsdom](https://github.com/jsdom/jsdom) from 16.4.0 to 16.7.0. - [Release notes](https://github.com/jsdom/jsdom/releases) - [Changelog](https://github.com/jsdom/jsdom/blob/master/Changelog.md) - [Commits](https://github.com/jsdom/jsdom/compare/16.4.0...16.7.0) --- updated-dependencies: - dependency-name: jsdom dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * feat: launch plans list & detail page #none; (#507) * feat: launch plans list #none; * fix: launch plan detail page the top navigation header * fix: added expected inputs and fixed inputs; #none * fix: remove radio buttons for view all launch plan versions; #none Signed-off-by: James * chore: release 1.1.3 (#520) Signed-off-by: Nastya Rusina * fix: cache icon fro map task (#519) * fix: cache icon fro map task * fix: icon and text center Signed-off-by: eugenejahn * fix: Relaunch form does not persist security context values when changed (#527) fix: use execution security context in relaunch; #none Signed-off-by: James * fix: release process (#529) * fix release process Signed-off-by: Yuvraj * more changes Signed-off-by: Yuvraj * more changes Signed-off-by: Yuvraj * fix workflow Signed-off-by: Yuvraj Co-authored-by: Yuvraj * fix: fix semantic-release config (#532) Signed-off-by: Yuvraj * test: fix time sensitive test (#533) chore: fix test Signed-off-by: Nastya Rusina * Rename upgrade idl workflow (#534) Signed-off-by: Yuvraj Co-authored-by: Yuvraj * fix: support mapped tasks (#494) * fix: support mapped tasks #none Signed-off-by: James * fix: fix comments #none Signed-off-by: James * fix: fix unit test #none Signed-off-by: James * fix: add string constants #none Signed-off-by: James * fix: added test for mapInputHelper #none Signed-off-by: James * fix: fix test for utils.test.ts #none Signed-off-by: James * chore: trigger snyk re-run * fix: multiple keys for mapped types; #none Signed-off-by: James * chore: storybook item (#530) Signed-off-by: Nastya Rusina * fix: fix validation for duplicate and fix focus issue Signed-off-by: James * chore: provide previous run values on relaunch Signed-off-by: Nastya Rusina Co-authored-by: Nastya <55718143+anrusina@users.noreply.github.com> Co-authored-by: Nastya Rusina * fix(491): remove favicon package + use favicon.svg by default (#537) * fix(491): remove favicon package + use favicon.svg by default Signed-off-by: Nastya Rusina * chore: resolve yarn.lock merge conflict Signed-off-by: Nastya Rusina * Fixed undefined task input types access in NodeExecutionActions (#538) * Fixed undefined task input types access in NodeExecutionActions Issue occurred due to race condition while loading data, indentical fix applies as for #506 Signed-off-by: Nick Müller * fix: cannot read properties of undefined (#506) fix: nullref Signed-off-by: Carina Ursu Co-authored-by: Carina Ursu (cherry picked from commit d38b98b2d68700415224ad6c621d79e928fded01) Signed-off-by: Nick Müller Co-authored-by: Carina Ursu * feat: support union type for launch plan (#540) * feat: support union type for launch plan Signed-off-by: eugenejahn * fix: format Signed-off-by: eugenejahn * fix: update type label Signed-off-by: eugenejahn * fix: update the format Signed-off-by: eugenejahn * fix: graph has realtime updates as execution progresses (#543) Signed-off-by: Olga Nad * fix: make sure groups used in graph aren't undefined (#545) Signed-off-by: Olga Nad * Hotfix docker push GHWF (#547) * Rename upgrade idl workflow Signed-off-by: Yuvraj * fix docker push wf Signed-off-by: Yuvraj Co-authored-by: Yuvraj * fix: Graph Center on initial render (#541) * fix: upgrade react-flow-renderer version Signed-off-by: James * fix: use setTimeout for queue on the next render Signed-off-by: James * fix: use one state variable and fitView after nodesChange Signed-off-by: James * introduce needFitView * fix: graph edge overlaps nodes (#542) * fix: upgrade react-flow-renderer version Signed-off-by: James * fix: use setTimeout for queue on the next render Signed-off-by: James * fix: use one state variable and fitView after nodesChange Signed-off-by: James * fix: graph edge overlaps nodes issue Signed-off-by: James * introduce needFitView * edge overlap * fix: flyteconsole tag in ci pipeline (#550) * fix tag issue in ci Signed-off-by: Yuvraj * remove welcome bot from boilerplate config Signed-off-by: Yuvraj Co-authored-by: Yuvraj * enable docker push for console (#552) * chore(deps): bump terser from 4.8.0 to 4.8.1 (#548) Bumps [terser](https://github.com/terser/terser) from 4.8.0 to 4.8.1. - [Release notes](https://github.com/terser/terser/releases) - [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md) - [Commits](https://github.com/terser/terser/commits) --- updated-dependencies: - dependency-name: terser dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update Flyteidl version (#558) Signed-off-by: Flyte-Bot Signed-off-by: Flyte-Bot Co-authored-by: flyte-bot * fix: fix searchbar X button (#564) chore: fix searchbar X button Signed-off-by: Carina Ursu Signed-off-by: Carina Ursu * fix: update timeline view to show dynamic wf internals on first render (#562) * fix: update timeline view to show dynamic wf internals on first render Signed-off-by: Olga Nad * fix: update tests and clean up code Signed-off-by: Olga Nad * fix: test Signed-off-by: Olga Nad Signed-off-by: Olga Nad * fix: webmanifest missing crossorigin attribute (#566) Signed-off-by: Carina Ursu Signed-off-by: Carina Ursu * fix: console showing subworkflows as unknown (#570) * fix: console showing subworkflows as unknown Signed-off-by: Olga Nad * fix: replace comparison with lodash isEqual Signed-off-by: Olga Nad * fix: remove checkIfObjectsAreSame Signed-off-by: Olga Nad Signed-off-by: Olga Nad * fix: Dict value loses 1 trailing character on UI Launch. (#561) fix: dict lose trailing issue Signed-off-by: James Signed-off-by: James * fix: launchform validation (#557) * fix: disable launch button and show validation messaages Signed-off-by: James * fix: code clean Signed-off-by: James Signed-off-by: James * fix: integrate timeline and graph tabs wrappers under one component (#572) * fix: integrate timeline and graph tabs wrappers under one component Signed-off-by: Olga Nad * fix: details tab in graph view and clean-up Signed-off-by: Olga Nad * fix: old unit tests Signed-off-by: Olga Nad * fix: temp filename change Signed-off-by: Olga Nad * fix: final filename change Signed-off-by: Olga Nad * fix: tsconfig Signed-off-by: Olga Nad Signed-off-by: Olga Nad * chore(deps-dev): bump moment from 2.29.3 to 2.29.4 (#549) Bumps [moment](https://github.com/moment/moment) from 2.29.3 to 2.29.4. - [Release notes](https://github.com/moment/moment/releases) - [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md) - [Commits](https://github.com/moment/moment/compare/2.29.3...2.29.4) --- updated-dependencies: - dependency-name: moment dependency-type: direct:development ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * added none type in union type (#577) * added none type in union type Signed-off-by: eugenejahn * udpated the test case Signed-off-by: eugenejahn * fix: fixed eslint Signed-off-by: eugenejahn Signed-off-by: eugenejahn * fix: correctly coerce `defaultValue` when rendering LaunchPlan details (#578) fix: correctly coerce defaultValue when rendering LaunchPlan details Signed-off-by: Rahul Mehta Signed-off-by: Rahul Mehta * #minor: inputHelpers InputProps (#579) fix: inputHelpers InputProps Signed-off-by: Carina Ursu Signed-off-by: Carina Ursu * fix: fix test of launchform (#581) * fix: fix test of launchform Signed-off-by: James * fix: inputHelpers tests regression Signed-off-by: Olga Nad * fix: update tests description Signed-off-by: Olga Nad * fix: spelling typo Signed-off-by: Olga Nad Signed-off-by: James Signed-off-by: Olga Nad Co-authored-by: Olga Nad * Pruning some unused packages (#583) Signed-off-by: Jason Porter Signed-off-by: Jason Porter * feat: minor change (#584) Minor change Signed-off-by: Jason Porter Signed-off-by: Jason Porter * fix: floor seconds to int in the edge case moment returns it as float (#582) Signed-off-by: Olga Nad Signed-off-by: Olga Nad * Update Flyteidl version (#575) Signed-off-by: Flyte-Bot Signed-off-by: Flyte-Bot Co-authored-by: flyte-bot * fix: add BASE_URL to dev startup, open deeply nested urls (#589) * fix: add BASE_URL to dev startup, open deeply nested urls Signed-off-by: Carina Ursu * fix: remove debug code Signed-off-by: Carina Ursu * chore: empty BASE_URL handling Signed-off-by: Carina Ursu Signed-off-by: Carina Ursu * fix: add default disabled state for only mine filter (#585) * fix: add default disabled state for only mine filter Signed-off-by: Olga Nad * fix: tests Signed-off-by: Olga Nad * fix: use api context to default filter state Signed-off-by: Olga Nad * fix: revert test updates Signed-off-by: Olga Nad Signed-off-by: Olga Nad * Update Flyteidl version (#590) Signed-off-by: Flyte-Bot Signed-off-by: Flyte-Bot Co-authored-by: flyte-bot * Launch plan ref v2 (#601) * progress * Fixed * Removed debug code Signed-off-by: Jason Porter Signed-off-by: Jason Porter * fix: enable deeplinks in development (#602) chore: enable deeplinks in development Signed-off-by: Carina Ursu Signed-off-by: Carina Ursu * chore: release 1.3.5 (#605) Signed-off-by: Jason Porter Signed-off-by: Jason Porter * fix: filters in node executions table view Signed-off-by: Olga Nad * fix: effect dependency and tests Signed-off-by: Olga Nad Signed-off-by: Nastya Rusina Signed-off-by: eugenejahn Signed-off-by: Olga Nad Signed-off-by: Nastya <55718143+anrusina@users.noreply.github.com> Signed-off-by: Eugene Jahn Signed-off-by: James Signed-off-by: Yuvraj Signed-off-by: Flyte-Bot Signed-off-by: Carina Ursu Signed-off-by: dependabot[bot] Signed-off-by: Rahul Mehta Signed-off-by: Jason Porter Co-authored-by: Nastya Rusina Co-authored-by: Nastya <55718143+anrusina@users.noreply.github.com> Co-authored-by: Carina Ursu Co-authored-by: Carina Ursu Co-authored-by: Eugene Jahn Co-authored-by: apTalya <99441958+apTalya@users.noreply.github.com> Co-authored-by: Yuvraj Co-authored-by: Yuvraj Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: james-union <105876962+james-union@users.noreply.github.com> Co-authored-by: Work Co-authored-by: Nick Müller Co-authored-by: Flyte Bot Co-authored-by: flyte-bot Co-authored-by: Rahul Mehta <98349643+rahul-theorem@users.noreply.github.com> Co-authored-by: Jason Porter <84735036+jsonporter@users.noreply.github.com> --- .../src/components/Entities/EntityInputs.tsx | 37 +------ .../ExecutionDetails/ExecutionNodeViews.tsx | 38 +++++--- .../ExecutionDetails/ExecutionTab.tsx | 2 +- .../ExecutionDetails/ExecutionTabContent.tsx | 71 ++++++++++++-- .../test/ExecutionNodeViews.test.tsx | 34 ++++--- .../Executions/ExecutionFilters.tsx | 8 +- .../Executions/Tables/NodeExecutionsTable.tsx | 19 ++-- .../Tables/test/NodeExecutionsTable.test.tsx | 97 ++++++++++--------- .../src/components/Executions/constants.ts | 30 ++++++ .../src/components/Executions/contexts.ts | 11 +-- .../Executions/filters/startTimeFilters.ts | 4 +- .../Executions/filters/statusFilters.ts | 38 +++++--- .../src/components/Executions/types.ts | 1 + .../console/src/models/Execution/enums.ts | 7 +- .../console/src/models/Execution/types.ts | 9 +- 15 files changed, 244 insertions(+), 162 deletions(-) diff --git a/packages/zapp/console/src/components/Entities/EntityInputs.tsx b/packages/zapp/console/src/components/Entities/EntityInputs.tsx index ede82f6dd..4b85a2047 100644 --- a/packages/zapp/console/src/components/Entities/EntityInputs.tsx +++ b/packages/zapp/console/src/components/Entities/EntityInputs.tsx @@ -16,6 +16,7 @@ import { FilterOperationName } from 'models/AdminEntity/types'; import { ResourceIdentifier } from 'models/Common/types'; import { LaunchPlanClosure, LaunchPlanSpec } from 'models/Launch/types'; import * as React from 'react'; +import { useMemo } from 'react'; import t from './strings'; import { transformLiterals } from '../Literals/helpers'; @@ -104,8 +105,8 @@ export const EntityInputs: React.FC<{ ? launchPlanState.value[0].spec : ({} as LaunchPlanSpec); - const expectedInputs = React.useMemo(() => { - const results = [] as Input[]; + const expectedInputs = useMemo(() => { + const results: Input[] = []; Object.keys(closure?.expectedInputs?.parameters ?? {}).forEach((name) => { const parameter = closure?.expectedInputs.parameters[name]; if (parameter?.var?.type) { @@ -121,25 +122,11 @@ export const EntityInputs: React.FC<{ return results; }, [closure]); - const fixedInputs = React.useMemo(() => { + const fixedInputs = useMemo(() => { const inputsMap = transformLiterals(spec?.fixedInputs?.literals ?? {}); return Object.keys(inputsMap).map((name) => ({ name, defaultValue: inputsMap[name] })); }, [spec]); - const configs = React.useMemo( - () => [ - { name: t('configType'), value: 'single (csv)' }, - { - name: t('configUrl'), - value: - 'https://raw.githubusercontent.com/jbrownlee/Datasets/master/pima-indians-diabetes.data.csv', - }, - { name: t('configSeed'), value: '7' }, - { name: t('configTestSplitRatio'), value: '0.33' }, - ], - [], - ); - return ( <> @@ -232,22 +219,6 @@ export const EntityInputs: React.FC<{ )} - {/*
-
- - {t('configuration')} - -
    - {configs.map(({ name, value }) => ( -
  • - {name}: - {value} -
  • - ))} -
-
-
-
*/} ); }; diff --git a/packages/zapp/console/src/components/Executions/ExecutionDetails/ExecutionNodeViews.tsx b/packages/zapp/console/src/components/Executions/ExecutionDetails/ExecutionNodeViews.tsx index f7f51f694..8cf4f29f7 100644 --- a/packages/zapp/console/src/components/Executions/ExecutionDetails/ExecutionNodeViews.tsx +++ b/packages/zapp/console/src/components/Executions/ExecutionDetails/ExecutionNodeViews.tsx @@ -6,13 +6,14 @@ import { DataError } from 'components/Errors/DataError'; import { useTabState } from 'components/hooks/useTabState'; import { secondaryBackgroundColor } from 'components/Theme/constants'; import { Execution, ExternalResource, LogsByPhase, NodeExecution } from 'models/Execution/types'; -import { useContext, useEffect, useMemo, useState } from 'react'; +import { useEffect, useMemo, useState } from 'react'; import { keyBy } from 'lodash'; import { isMapTaskV1 } from 'models/Task/utils'; import { useQueryClient } from 'react-query'; import { LargeLoadingSpinner } from 'components/common/LoadingSpinner'; +import { FilterOperation } from 'models/AdminEntity/types'; import { NodeExecutionDetailsContextProvider } from '../contextProvider/NodeExecutionDetails'; -import { NodeExecutionsByIdContext, NodeExecutionsRequestConfigContext } from '../contexts'; +import { NodeExecutionsByIdContext } from '../contexts'; import { ExecutionFilters } from '../ExecutionFilters'; import { useNodeExecutionFiltersState } from '../filters/useExecutionFiltersState'; import { tabs } from './constants'; @@ -42,6 +43,13 @@ const useStyles = makeStyles((theme: Theme) => ({ }, })); +const isPhaseFilter = (appliedFilters: FilterOperation[]) => { + if (appliedFilters.length === 1 && appliedFilters[0].key === 'phase') { + return true; + } + return false; +}; + interface WorkflowNodeExecution extends NodeExecution { logsByPhase?: LogsByPhase; } @@ -57,7 +65,6 @@ export const ExecutionNodeViews: React.FC = ({ executio const filterState = useNodeExecutionFiltersState(); const tabState = useTabState(tabs, defaultTab); const queryClient = useQueryClient(); - const requestConfig = useContext(NodeExecutionsRequestConfigContext); // Can't find initialization of the provider const [nodeExecutionsLoading, setNodeExecutionsLoading] = useState(true); const { @@ -73,12 +80,12 @@ export const ExecutionNodeViews: React.FC = ({ executio return keyBy(nodeExecutionsWithResources, 'scopedId'); }, [nodeExecutionsWithResources]); - /* We want to maintain the filter selection when switching away from the Nodes - tab and back, but do not want to filter the nodes when viewing the graph. So, - we will only pass filters to the execution state when on the nodes tab. */ - const appliedFilters = tabState.value === tabs.nodes.id ? filterState.appliedFilters : []; - - const { nodeExecutionsQuery } = useExecutionNodeViewsState(execution, appliedFilters); + // query to get all data to build Graph and Timeline + const { nodeExecutionsQuery } = useExecutionNodeViewsState(execution); + // query to get filtered data to narrow down Table outputs + const { + nodeExecutionsQuery: { data: filteredNodeExecutions }, + } = useExecutionNodeViewsState(execution, filterState.appliedFilters); useEffect(() => { let isCurrent = true; @@ -131,10 +138,7 @@ export const ExecutionNodeViews: React.FC = ({ executio }; }, [nodeExecutions]); - const childGroupsQuery = useAllTreeNodeExecutionGroupsQuery( - nodeExecutionsQuery.data ?? [], - requestConfig, - ); + const childGroupsQuery = useAllTreeNodeExecutionGroupsQuery(nodeExecutionsQuery.data ?? [], {}); useEffect(() => { if (!childGroupsQuery.isLoading && childGroupsQuery.data) { @@ -161,7 +165,13 @@ export const ExecutionNodeViews: React.FC = ({ executio loadingComponent={LoadingComponent} > {() => ( - + )} ); diff --git a/packages/zapp/console/src/components/Executions/ExecutionDetails/ExecutionTab.tsx b/packages/zapp/console/src/components/Executions/ExecutionDetails/ExecutionTab.tsx index 5f6eb55e7..c5dd4a50b 100644 --- a/packages/zapp/console/src/components/Executions/ExecutionDetails/ExecutionTab.tsx +++ b/packages/zapp/console/src/components/Executions/ExecutionDetails/ExecutionTab.tsx @@ -11,7 +11,7 @@ import { ExecutionTabContent } from './ExecutionTabContent'; export interface ExecutionTabProps { tabType: string; - filteredNodeExecutions: NodeExecution[]; + filteredNodeExecutions?: NodeExecution[]; } /** Contains the available ways to visualize the nodes of a WorkflowExecution */ diff --git a/packages/zapp/console/src/components/Executions/ExecutionDetails/ExecutionTabContent.tsx b/packages/zapp/console/src/components/Executions/ExecutionDetails/ExecutionTabContent.tsx index b5029e0b2..db69cd778 100644 --- a/packages/zapp/console/src/components/Executions/ExecutionDetails/ExecutionTabContent.tsx +++ b/packages/zapp/console/src/components/Executions/ExecutionDetails/ExecutionTabContent.tsx @@ -11,6 +11,12 @@ import { checkForDynamicExecutions } from 'components/common/utils'; import { dNode } from 'models/Graph/types'; import { useContext, useEffect, useMemo, useState } from 'react'; import { useQuery } from 'react-query'; +import { + FilterOperation, + FilterOperationName, + FilterOperationValueList, +} from 'models/AdminEntity/types'; +import { isEqual } from 'lodash'; import { useNodeExecutionContext } from '../contextProvider/NodeExecutionDetails'; import { NodeExecutionsByIdContext } from '../contexts'; import { NodeExecutionsTable } from '../Tables/NodeExecutionsTable'; @@ -20,10 +26,12 @@ import { ExecutionTimeline } from './Timeline/ExecutionTimeline'; import { ExecutionTimelineFooter } from './Timeline/ExecutionTimelineFooter'; import { convertToPlainNodes, TimeZone } from './Timeline/helpers'; import { DetailsPanelContext } from './DetailsPanelContext'; +import { useNodeExecutionFiltersState } from '../filters/useExecutionFiltersState'; +import { nodeExecutionPhaseConstants } from '../constants'; export interface ExecutionTabContentProps { tabType: string; - filteredNodeExecutions: NodeExecution[]; + filteredNodeExecutions?: NodeExecution[]; } const useStyles = makeStyles(() => ({ @@ -39,29 +47,50 @@ const useStyles = makeStyles(() => ({ }, })); +const executionMatchesPhaseFilter = ( + nodeExecution: NodeExecution, + { key, value, operation }: FilterOperation, +) => { + if (key === 'phase' && operation === FilterOperationName.VALUE_IN) { + // default to UNKNOWN phase if the field does not exist on a closure + const itemValue = + nodeExecutionPhaseConstants[nodeExecution?.closure[key]]?.value ?? + nodeExecutionPhaseConstants[0].value; + // phase check filters always return values in an array + const valuesArray = value as FilterOperationValueList; + return valuesArray.includes(itemValue); + } + return false; +}; + export const ExecutionTabContent: React.FC = ({ tabType, filteredNodeExecutions, }) => { const styles = useStyles(); const { compiledWorkflowClosure } = useNodeExecutionContext(); + const { appliedFilters } = useNodeExecutionFiltersState(); + const nodeExecutionsById = useContext(NodeExecutionsByIdContext); + const { dag, staticExecutionIdsMap, error } = compiledWorkflowClosure ? transformerWorkflowToDag(compiledWorkflowClosure) : { dag: {}, staticExecutionIdsMap: {}, error: null }; - const nodeExecutionsById = useContext(NodeExecutionsByIdContext); const dynamicParents = checkForDynamicExecutions(nodeExecutionsById, staticExecutionIdsMap); const { data: dynamicWorkflows } = useQuery( makeNodeExecutionDynamicWorkflowQuery(dynamicParents), ); const [initialNodes, setInitialNodes] = useState([]); + const [initialFilteredNodes, setInitialFilteredNodes] = useState(undefined); const [mergedDag, setMergedDag] = useState(null); + const [filters, setFilters] = useState(appliedFilters); + const [isFiltersChanged, setIsFiltersChanged] = useState(false); useEffect(() => { const nodes: dNode[] = compiledWorkflowClosure ? transformerWorkflowToDag(compiledWorkflowClosure, dynamicWorkflows).dag.nodes : []; // we remove start/end node info in the root dNode list during first assignment - const initialNodes = convertToPlainNodes(nodes); + const plainNodes = convertToPlainNodes(nodes); let newMergedDag = dag; @@ -77,9 +106,38 @@ export const ExecutionTabContent: React.FC = ({ } } setMergedDag(newMergedDag); - setInitialNodes(initialNodes); + setInitialNodes(plainNodes); }, [compiledWorkflowClosure, dynamicWorkflows]); + useEffect(() => { + if (!isEqual(filters, appliedFilters)) { + setFilters(appliedFilters); + setIsFiltersChanged(true); + } else { + setIsFiltersChanged(false); + } + }, [appliedFilters]); + + useEffect(() => { + if (appliedFilters.length > 0) { + // if filter was apllied, but filteredNodeExecutions is empty, we only appliied Phase filter, + // and need to clear out items manually + if (!filteredNodeExecutions) { + const filteredNodes = initialNodes.filter((node) => + executionMatchesPhaseFilter(nodeExecutionsById[node.scopedId], appliedFilters[0]), + ); + setInitialFilteredNodes(filteredNodes); + } else { + const filteredNodes = initialNodes.filter((node: dNode) => + filteredNodeExecutions.find( + (execution: NodeExecution) => execution.scopedId === node.scopedId, + ), + ); + setInitialFilteredNodes(filteredNodes); + } + } + }, [initialNodes, filteredNodeExecutions, isFiltersChanged]); + const [selectedNodes, setSelectedNodes] = useState([]); // Note: flytegraph allows multiple selection, but we only support showing @@ -140,10 +198,7 @@ export const ExecutionTabContent: React.FC = ({ switch (tabType) { case tabs.nodes.id: return ( - + ); case tabs.graph.id: return ( diff --git a/packages/zapp/console/src/components/Executions/ExecutionDetails/test/ExecutionNodeViews.test.tsx b/packages/zapp/console/src/components/Executions/ExecutionDetails/test/ExecutionNodeViews.test.tsx index d8a5a683f..76c24e3d9 100644 --- a/packages/zapp/console/src/components/Executions/ExecutionDetails/test/ExecutionNodeViews.test.tsx +++ b/packages/zapp/console/src/components/Executions/ExecutionDetails/test/ExecutionNodeViews.test.tsx @@ -11,24 +11,26 @@ import { createTestQueryClient } from 'test/utils'; import { tabs } from '../constants'; import { ExecutionNodeViews } from '../ExecutionNodeViews'; -jest.mock('chart.js', () => ({ - Chart: { register: () => null }, - Tooltip: { positioners: { cursor: () => null } }, - registerables: [], -})); - -jest.mock('chartjs-plugin-datalabels', () => ({ - ChartDataLabels: null, -})); - jest.mock('components/Executions/Tables/NodeExecutionRow', () => ({ - NodeExecutionRow: jest.fn(({ children, execution }) => ( + NodeExecutionRow: jest.fn(({ nodeExecution }) => (
- {execution?.id?.nodeId} - {children} + {nodeExecution?.id?.nodeId}
)), })); + +jest.mock('components/Executions/ExecutionDetails/Timeline/ExecutionTimelineFooter', () => ({ + ExecutionTimelineFooter: jest.fn(() =>
), +})); + +jest.mock('components/Executions/ExecutionDetails/Timeline/TimelineChart/index', () => ({ + TimelineChart: jest.fn(() =>
), +})); + +jest.mock('components/Executions/ExecutionDetails/Timeline/NodeExecutionName', () => ({ + NodeExecutionName: jest.fn(({ name }) =>
{name}
), +})); + // ExecutionNodeViews uses query params for NE list, so we must match them // for the list to be returned properly const baseQueryParams = { @@ -77,7 +79,7 @@ describe('ExecutionNodeViews', () => { await waitFor(() => getByText(tabs.nodes.label)); const nodesTab = getByText(tabs.nodes.label); - const graphTab = getByText(tabs.graph.label); + const timelineTab = getByText(tabs.timeline.label); // Ensure we are on Nodes tab fireEvent.click(nodesTab); @@ -96,11 +98,11 @@ describe('ExecutionNodeViews', () => { await waitFor(() => queryByText(failedNodeName)); expect(queryByText(succeededNodeName)).not.toBeInTheDocument(); - expect(getByText(failedNodeName)).toBeInTheDocument(); + expect(queryByText(failedNodeName)).toBeInTheDocument(); // Switch to the Graph tab fireEvent.click(statusButton); - fireEvent.click(graphTab); + fireEvent.click(timelineTab); await waitFor(() => queryByText(succeededNodeName)); expect(queryByText(succeededNodeName)).toBeInTheDocument(); diff --git a/packages/zapp/console/src/components/Executions/ExecutionFilters.tsx b/packages/zapp/console/src/components/Executions/ExecutionFilters.tsx index 2b4ce8d5c..a93ad844b 100644 --- a/packages/zapp/console/src/components/Executions/ExecutionFilters.tsx +++ b/packages/zapp/console/src/components/Executions/ExecutionFilters.tsx @@ -79,8 +79,12 @@ export const ExecutionFilters: React.FC = ({ filters = filters.map((filter) => { const onChangeFunc = filter.onChange; filter.onChange = (value) => { - if (clearCharts) clearCharts(); - if (onChangeFunc) onChangeFunc(value); + if (clearCharts) { + clearCharts(); + } + if (onChangeFunc) { + onChangeFunc(value); + } }; return filter; }); diff --git a/packages/zapp/console/src/components/Executions/Tables/NodeExecutionsTable.tsx b/packages/zapp/console/src/components/Executions/Tables/NodeExecutionsTable.tsx index 0979b0b33..d32c2104a 100644 --- a/packages/zapp/console/src/components/Executions/Tables/NodeExecutionsTable.tsx +++ b/packages/zapp/console/src/components/Executions/Tables/NodeExecutionsTable.tsx @@ -15,13 +15,13 @@ import { NoExecutionsContent } from './NoExecutionsContent'; import { useColumnStyles, useExecutionTableStyles } from './styles'; import { NodeExecutionsByIdContext } from '../contexts'; import { convertToPlainNodes } from '../ExecutionDetails/Timeline/helpers'; -// import { useNodeExecutionFiltersState } from '../filters/useExecutionFiltersState'; import { useNodeExecutionContext } from '../contextProvider/NodeExecutionDetails'; import { NodeExecutionRow } from './NodeExecutionRow'; +import { useNodeExecutionFiltersState } from '../filters/useExecutionFiltersState'; export interface NodeExecutionsTableProps { initialNodes: dNode[]; - filteredNodeExecutions: NodeExecution[]; + filteredNodes?: dNode[]; } const scrollbarPadding = scrollbarSize(); @@ -36,13 +36,18 @@ const scrollbarPadding = scrollbarSize(); * NodeExecutions are expandable and will potentially render a list of child * TaskExecutions */ -export const NodeExecutionsTable: React.FC = ({ initialNodes }) => { +export const NodeExecutionsTable: React.FC = ({ + initialNodes, + filteredNodes, +}) => { const commonStyles = useCommonStyles(); const tableStyles = useExecutionTableStyles(); const nodeExecutionsById = useContext(NodeExecutionsByIdContext); - const [originalNodes, setOriginalNodes] = useState(initialNodes); + const { appliedFilters } = useNodeExecutionFiltersState(); + const [originalNodes, setOriginalNodes] = useState( + appliedFilters.length > 0 && filteredNodes ? filteredNodes : initialNodes, + ); const [showNodes, setShowNodes] = useState([]); - // const filterState = useNodeExecutionFiltersState(); const { compiledWorkflowClosure } = useNodeExecutionContext(); const columnStyles = useColumnStyles(); @@ -53,7 +58,7 @@ export const NodeExecutionsTable: React.FC = ({ initia ); useEffect(() => { - setOriginalNodes(initialNodes); + setOriginalNodes(appliedFilters.length > 0 && filteredNodes ? filteredNodes : initialNodes); const plainNodes = convertToPlainNodes(originalNodes); const updatedShownNodesMap = plainNodes.map((node) => { const execution = nodeExecutionsById[node.scopedId]; @@ -64,7 +69,7 @@ export const NodeExecutionsTable: React.FC = ({ initia }; }); setShowNodes(updatedShownNodesMap); - }, [initialNodes, originalNodes, nodeExecutionsById]); + }, [initialNodes, filteredNodes, originalNodes, nodeExecutionsById]); const toggleNode = (id: string, scopeId: string, level: number) => { const searchNode = (nodes: dNode[], nodeLevel: number) => { diff --git a/packages/zapp/console/src/components/Executions/Tables/test/NodeExecutionsTable.test.tsx b/packages/zapp/console/src/components/Executions/Tables/test/NodeExecutionsTable.test.tsx index 4b7f06a32..e9600a9c3 100644 --- a/packages/zapp/console/src/components/Executions/Tables/test/NodeExecutionsTable.test.tsx +++ b/packages/zapp/console/src/components/Executions/Tables/test/NodeExecutionsTable.test.tsx @@ -1,27 +1,27 @@ import { render, waitFor } from '@testing-library/react'; import { NodeExecutionDetailsContextProvider } from 'components/Executions/contextProvider/NodeExecutionDetails'; -import { - NodeExecutionsByIdContext, - NodeExecutionsRequestConfigContext, -} from 'components/Executions/contexts'; +import { NodeExecutionsByIdContext } from 'components/Executions/contexts'; import { basicPythonWorkflow } from 'mocks/data/fixtures/basicPythonWorkflow'; import { noExecutionsFoundString } from 'common/constants'; import { mockWorkflowId } from 'mocks/data/fixtures/types'; import { insertFixture } from 'mocks/data/insertFixture'; import { mockServer } from 'mocks/server'; -import { RequestConfig } from 'models/AdminEntity/types'; import { NodeExecutionPhase } from 'models/Execution/enums'; import * as React from 'react'; import { dateToTimestamp } from 'common/utils'; import { QueryClient, QueryClientProvider } from 'react-query'; import { createTestQueryClient } from 'test/utils'; -import { NodeExecution } from 'models/Execution/types'; import { dNode } from 'models/Graph/types'; +import { useNodeExecutionFiltersState } from 'components/Executions/filters/useExecutionFiltersState'; import { NodeExecutionsTable } from '../NodeExecutionsTable'; jest.mock('components/Workflow/workflowQueries'); const { fetchWorkflow } = require('components/Workflow/workflowQueries'); +jest.mock('components/Executions/filters/useExecutionFiltersState'); +const mockUseNodeExecutionFiltersState = useNodeExecutionFiltersState as jest.Mock; +mockUseNodeExecutionFiltersState.mockReturnValue({ filters: [], appliedFilters: [] }); + jest.mock('components/Executions/Tables/NodeExecutionRow', () => ({ NodeExecutionRow: jest.fn(({ nodeExecution }) => (
@@ -46,26 +46,6 @@ const mockNodes = (n: number): dNode[] => { return nodes; }; -const mockNodeExecutions = (n: number, phases: NodeExecutionPhase[]): NodeExecution[] => { - const nodeExecutions: NodeExecution[] = []; - for (let i = 1; i <= n; i++) { - nodeExecutions.push({ - closure: { - createdAt: dateToTimestamp(new Date()), - outputUri: '', - phase: phases[i - 1], - }, - id: { - executionId: { domain: 'domain', name: 'name', project: 'project' }, - nodeId: `node${i}`, - }, - inputUri: '', - scopedId: `n${i}`, - }); - } - return nodeExecutions; -}; - const mockExecutionsById = (n: number, phases: NodeExecutionPhase[]) => { const nodeExecutionsById = {}; @@ -89,31 +69,24 @@ const mockExecutionsById = (n: number, phases: NodeExecutionPhase[]) => { describe('NodeExecutionsTableExecutions > Tables > NodeExecutionsTable', () => { let queryClient: QueryClient; - let requestConfig: RequestConfig; let fixture: ReturnType; const initialNodes = mockNodes(2); beforeEach(() => { - requestConfig = {}; queryClient = createTestQueryClient(); fixture = basicPythonWorkflow.generate(); insertFixture(mockServer, fixture); fetchWorkflow.mockImplementation(() => Promise.resolve(fixture.workflows.top)); }); - const renderTable = ({ nodeExecutionsById, initialNodes, filteredNodeExecutions }) => + const renderTable = ({ nodeExecutionsById, initialNodes, filteredNodes }) => render( - - - - - - - + + + + + , ); @@ -121,7 +94,7 @@ describe('NodeExecutionsTableExecutions > Tables > NodeExecutionsTable', () => { const { queryByText, queryByTestId } = renderTable({ initialNodes: [], nodeExecutionsById: {}, - filteredNodeExecutions: [], + filteredNodes: [], }); await waitFor(() => queryByText(noExecutionsFoundString)); @@ -130,15 +103,14 @@ describe('NodeExecutionsTableExecutions > Tables > NodeExecutionsTable', () => { expect(queryByTestId('node-execution-row')).not.toBeInTheDocument(); }); - it('renders NodeExecutionRows with proper nodeExecutions', async () => { + it('renders NodeExecutionRows with initialNodes when no filteredNodes were provided', async () => { const phases = [NodeExecutionPhase.FAILED, NodeExecutionPhase.SUCCEEDED]; const nodeExecutionsById = mockExecutionsById(2, phases); - const filteredNodeExecutions = mockNodeExecutions(2, phases); const { queryAllByTestId } = renderTable({ initialNodes, nodeExecutionsById, - filteredNodeExecutions, + filteredNodes: undefined, }); await waitFor(() => queryAllByTestId('node-execution-row')); @@ -154,15 +126,15 @@ describe('NodeExecutionsTableExecutions > Tables > NodeExecutionsTable', () => { } }); - it('renders future nodes with UNDEFINED phase', async () => { - const phases = [NodeExecutionPhase.SUCCEEDED, NodeExecutionPhase.UNDEFINED]; - const nodeExecutionsById = mockExecutionsById(1, phases); - const filteredNodeExecutions = mockNodeExecutions(1, phases); + it('renders NodeExecutionRows with initialNodes even when filterNodes were provided, if appliedFilters is empty', async () => { + const phases = [NodeExecutionPhase.FAILED, NodeExecutionPhase.SUCCEEDED]; + const nodeExecutionsById = mockExecutionsById(2, phases); + const filteredNodes = mockNodes(1); const { queryAllByTestId } = renderTable({ initialNodes, nodeExecutionsById, - filteredNodeExecutions, + filteredNodes, }); await waitFor(() => queryAllByTestId('node-execution-row')); @@ -177,4 +149,33 @@ describe('NodeExecutionsTableExecutions > Tables > NodeExecutionsTable', () => { expect(renderedPhases[i]).toHaveTextContent(phases[i].toString()); } }); + + it('renders NodeExecutionRows with filterNodes if appliedFilters is not empty', async () => { + mockUseNodeExecutionFiltersState.mockReturnValueOnce({ + filters: [], + appliedFilters: [{ key: 'phase', operation: 'value_in', value: ['FAILED', 'SUCCEEDED'] }], + }); + + const phases = [NodeExecutionPhase.FAILED, NodeExecutionPhase.SUCCEEDED]; + const nodeExecutionsById = mockExecutionsById(2, phases); + const filteredNodes = mockNodes(1); + + const { queryAllByTestId } = renderTable({ + initialNodes, + nodeExecutionsById, + filteredNodes, + }); + + await waitFor(() => queryAllByTestId('node-execution-row')); + + expect(queryAllByTestId('node-execution-row')).toHaveLength(filteredNodes.length); + const ids = queryAllByTestId('node-execution-col-id'); + expect(ids).toHaveLength(filteredNodes.length); + const renderedPhases = queryAllByTestId('node-execution-col-phase'); + expect(renderedPhases).toHaveLength(filteredNodes.length); + for (const i in filteredNodes) { + expect(ids[i]).toHaveTextContent(filteredNodes[i].id); + expect(renderedPhases[i]).toHaveTextContent(phases[i].toString()); + } + }); }); diff --git a/packages/zapp/console/src/components/Executions/constants.ts b/packages/zapp/console/src/components/Executions/constants.ts index ded16e059..4a24e391a 100644 --- a/packages/zapp/console/src/components/Executions/constants.ts +++ b/packages/zapp/console/src/components/Executions/constants.ts @@ -24,60 +24,70 @@ export const workflowExecutionPhaseConstants: { } = { [WorkflowExecutionPhase.ABORTED]: { text: t('aborted'), + value: 'ABORTED', badgeColor: statusColors.SKIPPED, nodeColor: graphStatusColors.ABORTED, textColor: negativeTextColor, }, [WorkflowExecutionPhase.ABORTING]: { text: t('aborting'), + value: 'ABORTING', badgeColor: statusColors.SKIPPED, nodeColor: graphStatusColors.ABORTED, textColor: negativeTextColor, }, [WorkflowExecutionPhase.FAILING]: { text: t('failing'), + value: 'FAILING', badgeColor: statusColors.FAILURE, nodeColor: graphStatusColors.FAILING, textColor: negativeTextColor, }, [WorkflowExecutionPhase.FAILED]: { text: t('failed'), + value: 'FAILED', badgeColor: statusColors.FAILURE, nodeColor: graphStatusColors.FAILED, textColor: negativeTextColor, }, [WorkflowExecutionPhase.QUEUED]: { text: t('queued'), + value: 'QUEUED', badgeColor: statusColors.QUEUED, nodeColor: graphStatusColors.QUEUED, textColor: secondaryTextColor, }, [WorkflowExecutionPhase.RUNNING]: { text: t('running'), + value: 'RUNNING', badgeColor: statusColors.RUNNING, nodeColor: graphStatusColors.RUNNING, textColor: secondaryTextColor, }, [WorkflowExecutionPhase.SUCCEEDED]: { text: t('succeeded'), + value: 'SUCCEEDED', badgeColor: statusColors.SUCCESS, nodeColor: graphStatusColors.SUCCEEDED, textColor: positiveTextColor, }, [WorkflowExecutionPhase.SUCCEEDING]: { text: t('succeeding'), + value: 'SUCCEEDING', badgeColor: statusColors.SUCCESS, nodeColor: graphStatusColors.SUCCEEDED, textColor: positiveTextColor, }, [WorkflowExecutionPhase.TIMED_OUT]: { text: t('timedOut'), + value: 'TIMED_OUT', badgeColor: statusColors.FAILURE, nodeColor: graphStatusColors.FAILED, textColor: negativeTextColor, }, [WorkflowExecutionPhase.UNDEFINED]: { text: t('unknown'), + value: 'UNKNOWN', badgeColor: statusColors.UNKNOWN, nodeColor: graphStatusColors.UNDEFINED, textColor: secondaryTextColor, @@ -90,72 +100,84 @@ export const nodeExecutionPhaseConstants: { } = { [NodeExecutionPhase.ABORTED]: { text: t('aborted'), + value: 'ABORTED', badgeColor: statusColors.FAILURE, nodeColor: graphStatusColors.ABORTED, textColor: negativeTextColor, }, [NodeExecutionPhase.FAILING]: { text: t('failing'), + value: 'FAILING', badgeColor: statusColors.FAILURE, nodeColor: graphStatusColors.FAILING, textColor: negativeTextColor, }, [NodeExecutionPhase.FAILED]: { text: t('failed'), + value: 'FAILED', badgeColor: statusColors.FAILURE, nodeColor: graphStatusColors.FAILED, textColor: negativeTextColor, }, [NodeExecutionPhase.QUEUED]: { text: t('queued'), + value: 'QUEUED', badgeColor: statusColors.RUNNING, nodeColor: graphStatusColors.QUEUED, textColor: secondaryTextColor, }, [NodeExecutionPhase.RUNNING]: { text: t('running'), + value: 'RUNNING', badgeColor: statusColors.RUNNING, nodeColor: graphStatusColors.RUNNING, textColor: secondaryTextColor, }, [NodeExecutionPhase.DYNAMIC_RUNNING]: { text: t('running'), + value: 'RUNNING', badgeColor: statusColors.RUNNING, nodeColor: graphStatusColors.RUNNING, textColor: secondaryTextColor, }, [NodeExecutionPhase.SUCCEEDED]: { text: t('succeeded'), + value: 'SUCCEEDED', badgeColor: statusColors.SUCCESS, nodeColor: graphStatusColors.SUCCEEDED, textColor: positiveTextColor, }, [NodeExecutionPhase.TIMED_OUT]: { text: t('timedOut'), + value: 'TIMED_OUT', badgeColor: statusColors.FAILURE, nodeColor: graphStatusColors.FAILED, textColor: negativeTextColor, }, [NodeExecutionPhase.SKIPPED]: { text: t('skipped'), + value: 'SKIPPED', badgeColor: statusColors.UNKNOWN, nodeColor: graphStatusColors.UNDEFINED, textColor: secondaryTextColor, }, [NodeExecutionPhase.RECOVERED]: { text: t('recovered'), + value: 'RECOVERED', badgeColor: statusColors.SUCCESS, nodeColor: graphStatusColors.SUCCEEDED, textColor: positiveTextColor, }, [NodeExecutionPhase.PAUSED]: { text: t('paused'), + value: 'PAUSED', badgeColor: statusColors.PAUSED, nodeColor: graphStatusColors.PAUSED, textColor: secondaryTextColor, }, [NodeExecutionPhase.UNDEFINED]: { text: t('unknown'), + value: 'UNKNOWN', badgeColor: statusColors.UNKNOWN, nodeColor: graphStatusColors.UNDEFINED, textColor: secondaryTextColor, @@ -168,48 +190,56 @@ export const taskExecutionPhaseConstants: { } = { [TaskExecutionPhase.ABORTED]: { text: t('aborted'), + value: 'ABORTED', badgeColor: statusColors.FAILURE, nodeColor: graphStatusColors.ABORTED, textColor: negativeTextColor, }, [TaskExecutionPhase.FAILED]: { text: t('failed'), + value: 'FAILED', badgeColor: statusColors.FAILURE, nodeColor: graphStatusColors.FAILED, textColor: negativeTextColor, }, [TaskExecutionPhase.WAITING_FOR_RESOURCES]: { text: t('waiting'), + value: 'WAITING', badgeColor: statusColors.RUNNING, nodeColor: graphStatusColors.RUNNING, textColor: secondaryTextColor, }, [TaskExecutionPhase.QUEUED]: { text: t('queued'), + value: 'QUEUED', badgeColor: statusColors.RUNNING, nodeColor: graphStatusColors.QUEUED, textColor: secondaryTextColor, }, [TaskExecutionPhase.INITIALIZING]: { text: t('initializing'), + value: 'INITIALIZING', badgeColor: statusColors.RUNNING, nodeColor: graphStatusColors.RUNNING, textColor: secondaryTextColor, }, [TaskExecutionPhase.RUNNING]: { text: t('running'), + value: 'RUNNING', badgeColor: statusColors.RUNNING, nodeColor: graphStatusColors.RUNNING, textColor: secondaryTextColor, }, [TaskExecutionPhase.SUCCEEDED]: { text: t('succeeded'), + value: 'SUCCEEDED', badgeColor: statusColors.SUCCESS, nodeColor: graphStatusColors.SUCCEEDED, textColor: positiveTextColor, }, [TaskExecutionPhase.UNDEFINED]: { text: t('unknown'), + value: 'UNKNOWN', badgeColor: statusColors.UNKNOWN, nodeColor: graphStatusColors.UNDEFINED, textColor: secondaryTextColor, diff --git a/packages/zapp/console/src/components/Executions/contexts.ts b/packages/zapp/console/src/components/Executions/contexts.ts index faeb47b6d..e5ca0d492 100644 --- a/packages/zapp/console/src/components/Executions/contexts.ts +++ b/packages/zapp/console/src/components/Executions/contexts.ts @@ -1,15 +1,10 @@ -import { RequestConfig } from 'models/AdminEntity/types'; import { Execution, NodeExecution } from 'models/Execution/types'; -import * as React from 'react'; +import { createContext } from 'react'; export interface ExecutionContextData { execution: Execution; } -export const ExecutionContext = React.createContext( - {} as ExecutionContextData, -); +export const ExecutionContext = createContext({} as ExecutionContextData); -export const NodeExecutionsByIdContext = React.createContext>({}); - -export const NodeExecutionsRequestConfigContext = React.createContext({}); +export const NodeExecutionsByIdContext = createContext>({}); diff --git a/packages/zapp/console/src/components/Executions/filters/startTimeFilters.ts b/packages/zapp/console/src/components/Executions/filters/startTimeFilters.ts index bd268a7b8..16847621e 100644 --- a/packages/zapp/console/src/components/Executions/filters/startTimeFilters.ts +++ b/packages/zapp/console/src/components/Executions/filters/startTimeFilters.ts @@ -2,8 +2,8 @@ import * as moment from 'moment'; import { FilterOperationName } from 'models/AdminEntity/types'; import { FilterMap } from './types'; -const workflowExecutionStartTimeKey = 'execution_created_at'; -const nodeExecutionStartTimeKey = 'node_execution_created_at'; +const workflowExecutionStartTimeKey = 'created_at'; +const nodeExecutionStartTimeKey = 'created_at'; export type StartTimeFilterKey = | 'all' diff --git a/packages/zapp/console/src/components/Executions/filters/statusFilters.ts b/packages/zapp/console/src/components/Executions/filters/statusFilters.ts index 9cddf0150..7b2293820 100644 --- a/packages/zapp/console/src/components/Executions/filters/statusFilters.ts +++ b/packages/zapp/console/src/components/Executions/filters/statusFilters.ts @@ -1,3 +1,7 @@ +import { + nodeExecutionPhaseConstants, + workflowExecutionPhaseConstants, +} from 'components/Executions/constants'; import { NodeExecutionPhase, WorkflowExecutionPhase } from 'models/Execution/enums'; import { FilterMap } from './types'; @@ -15,32 +19,32 @@ export const workflowExecutionStatusFilters: FilterMap; export type ExecutionError = RequiredNonNullable; @@ -104,7 +99,7 @@ export interface NodeExecutionClosure extends Admin.INodeExecutionClosure { duration?: Protobuf.Duration; error?: ExecutionError; outputUri: string; - phase: NodeExecutionPhase; + phase: Core.NodeExecution.Phase; startedAt?: Protobuf.ITimestamp; taskNodeMetadata?: TaskNodeMetadata; workflowNodeMetadata?: WorkflowNodeMetadata;