From 303562a385f46eaa50a4d72280bbeaab2fe9d38d Mon Sep 17 00:00:00 2001 From: 4nalog <4nalog@protonmail.com> Date: Wed, 1 Mar 2023 18:17:55 +0530 Subject: [PATCH 01/34] fix: type error on invalid nested json input Signed-off-by: 4nalog <4nalog@protonmail.com> --- .../console/src/components/Launch/LaunchForm/StructInput.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/console/src/components/Launch/LaunchForm/StructInput.tsx b/packages/console/src/components/Launch/LaunchForm/StructInput.tsx index dcdcb7962..5577fad01 100644 --- a/packages/console/src/components/Launch/LaunchForm/StructInput.tsx +++ b/packages/console/src/components/Launch/LaunchForm/StructInput.tsx @@ -40,7 +40,7 @@ const formatJson = data => { keys.forEach(key => { const item = data[`${key}`]; if (typeof item === 'object') { - data = { ...data, [key]: formatJson(item) }; + data = { ...data, [key]: formatJson(item ?? {}) }; } }); From 4a16973436247832b5ff71793a02ac459dabaaaa Mon Sep 17 00:00:00 2001 From: james-union <105876962+james-union@users.noreply.github.com> Date: Wed, 1 Mar 2023 20:36:35 -0500 Subject: [PATCH 02/34] LaunchForm RJSF Form issue (#692) * fix: launchform Signed-off-by: James * fix: stuck issue Signed-off-by: James * fix: on form change Signed-off-by: James * fix: merge master into branch Signed-off-by: James --------- Signed-off-by: James Signed-off-by: 4nalog <4nalog@protonmail.com> --- packages/console/package.json | 8 +- .../LaunchForm/LaunchFormAdvancedInputs.tsx | 3 + .../Launch/LaunchForm/LaunchWorkflowForm.tsx | 7 +- .../Launch/LaunchForm/StructInput.tsx | 6 +- yarn.lock | 200 ++++++++++++------ 5 files changed, 152 insertions(+), 72 deletions(-) diff --git a/packages/console/package.json b/packages/console/package.json index 95e572196..34fe369b5 100644 --- a/packages/console/package.json +++ b/packages/console/package.json @@ -61,10 +61,10 @@ "@material-ui/core": "^4.12.4", "@material-ui/icons": "^4.11.3", "@material-ui/pickers": "^3.2.2", - "@rjsf/core": "3.2.1", - "@rjsf/material-ui": "3.2.1", - "@rjsf/utils": "^5.0.0-beta.12", - "@rjsf/validator-ajv6": "^5.0.0-beta.12", + "@rjsf/core": "^5.1.0", + "@rjsf/material-ui": "^5.1.0", + "@rjsf/utils": "^5.1.0", + "@rjsf/validator-ajv8": "^5.1.0", "@types/d3-shape": "^1.2.6", "@xstate/react": "^1.0.0", "axios": "^0.27.2", diff --git a/packages/console/src/components/Launch/LaunchForm/LaunchFormAdvancedInputs.tsx b/packages/console/src/components/Launch/LaunchForm/LaunchFormAdvancedInputs.tsx index 9811305d6..5fa632e89 100644 --- a/packages/console/src/components/Launch/LaunchForm/LaunchFormAdvancedInputs.tsx +++ b/packages/console/src/components/Launch/LaunchForm/LaunchFormAdvancedInputs.tsx @@ -12,6 +12,7 @@ import TextField from '@material-ui/core/TextField'; import Typography from '@material-ui/core/Typography'; import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; import Form from '@rjsf/material-ui'; +import validator from '@rjsf/validator-ajv8'; import { State } from 'xstate'; import { LaunchAdvancedOptionsRef } from './types'; import { @@ -194,6 +195,7 @@ export const LaunchFormAdvancedInputs = React.forwardRef< }} formData={labelsParamData} onChange={handleLabelsChange} + validator={validator} >
@@ -226,6 +228,7 @@ export const LaunchFormAdvancedInputs = React.forwardRef< }} formData={annotationsParamData} onChange={handleAnnotationsParamData} + validator={validator} >
diff --git a/packages/console/src/components/Launch/LaunchForm/LaunchWorkflowForm.tsx b/packages/console/src/components/Launch/LaunchForm/LaunchWorkflowForm.tsx index ee01653a8..7e6d9f663 100644 --- a/packages/console/src/components/Launch/LaunchForm/LaunchWorkflowForm.tsx +++ b/packages/console/src/components/Launch/LaunchForm/LaunchWorkflowForm.tsx @@ -134,7 +134,12 @@ export const LaunchWorkflowForm: React.FC = props => { showErrors={state.context.showErrors} /> ) : null} - + {isEnterInputsState(baseState) ? ( + + ) : null} = props => { jsonFormRenderable && value ? JSON.parse(value as string) : {}, ); - const onFormChange = ({ formData }, _e) => { + const onFormChange = React.useCallback(({ formData }) => { onChange(JSON.stringify(formData)); setParamData(formData); - }; + }, []); return jsonFormRenderable ? ( @@ -98,6 +99,7 @@ export const StructInput: React.FC = props => {
diff --git a/yarn.lock b/yarn.lock index 87381ae63..a3249fc07 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2119,10 +2119,10 @@ __metadata: "@material-ui/core": ^4.12.4 "@material-ui/icons": ^4.11.3 "@material-ui/pickers": ^3.2.2 - "@rjsf/core": 3.2.1 - "@rjsf/material-ui": 3.2.1 - "@rjsf/utils": ^5.0.0-beta.12 - "@rjsf/validator-ajv6": ^5.0.0-beta.12 + "@rjsf/core": ^5.1.0 + "@rjsf/material-ui": ^5.1.0 + "@rjsf/utils": ^5.1.0 + "@rjsf/validator-ajv8": ^5.1.0 "@types/d3-shape": ^1.2.6 "@types/debug": ^0.0.30 "@types/dom-helpers": ^3.4.1 @@ -3366,6 +3366,21 @@ __metadata: languageName: node linkType: hard +"@rjsf/core@npm:^5.1.0": + version: 5.1.0 + resolution: "@rjsf/core@npm:5.1.0" + dependencies: + lodash: ^4.17.15 + lodash-es: ^4.17.15 + nanoid: ^3.3.4 + prop-types: ^15.7.2 + peerDependencies: + "@rjsf/utils": ^5.0.0 + react: ^16.14.0 || >=17 + checksum: ff38046bb25de86b57e404c5d1ccea84b0485e916caf33a3cb25b030a38ed930a9b89a411671a7c29b047da38e0c682e20b43b13e61d77df770299385ba3c67a + languageName: node + linkType: hard + "@rjsf/material-ui@npm:3.2.1": version: 3.2.1 resolution: "@rjsf/material-ui@npm:3.2.1" @@ -3378,6 +3393,19 @@ __metadata: languageName: node linkType: hard +"@rjsf/material-ui@npm:^5.1.0": + version: 5.1.0 + resolution: "@rjsf/material-ui@npm:5.1.0" + peerDependencies: + "@material-ui/core": ^4.12.3 + "@material-ui/icons": ^4.11.2 + "@rjsf/core": ^5.0.0 + "@rjsf/utils": ^5.0.0 + react: ^16.14.0 || >=17 + checksum: f8e2c486f33a60703cae5bb42ae82bc431b3d743c239868ca71907e7b4127a39d1688200820c0c8acdf3ecd3f5eaddef4ba47264695feead28e9b439d9be7ce8 + languageName: node + linkType: hard + "@rjsf/utils@npm:^5.0.0-beta.12": version: 5.0.0-beta.14 resolution: "@rjsf/utils@npm:5.0.0-beta.14" @@ -3393,6 +3421,21 @@ __metadata: languageName: node linkType: hard +"@rjsf/utils@npm:^5.1.0": + version: 5.1.0 + resolution: "@rjsf/utils@npm:5.1.0" + dependencies: + json-schema-merge-allof: ^0.8.1 + jsonpointer: ^5.0.1 + lodash: ^4.17.15 + lodash-es: ^4.17.15 + react-is: ^18.2.0 + peerDependencies: + react: ^16.14.0 || >=17 + checksum: 76d7caf144f98b1547067bfdc2b1baecf452c63bd9d6f2cae6c162a99154bb4d2f5033f6abc0e26ab767dca9ea743f1f5a9d796696e90dd5ed1fdca5ee3c5280 + languageName: node + linkType: hard + "@rjsf/validator-ajv6@npm:^5.0.0-beta.12": version: 5.0.0-beta.14 resolution: "@rjsf/validator-ajv6@npm:5.0.0-beta.14" @@ -3406,6 +3449,20 @@ __metadata: languageName: node linkType: hard +"@rjsf/validator-ajv8@npm:^5.1.0": + version: 5.1.0 + resolution: "@rjsf/validator-ajv8@npm:5.1.0" + dependencies: + ajv: ^8.12.0 + ajv-formats: ^2.1.1 + lodash: ^4.17.15 + lodash-es: ^4.17.15 + peerDependencies: + "@rjsf/utils": ^5.0.0 + checksum: 3430a0aea8235deedd306b535ea3a62a9bcdd4dcf0bf1d022fe036041dceb5ca7c147b17ae50a0d25bb7c953729e987d96c68f5220f8fde4b56a89cf3f106a49 + languageName: node + linkType: hard + "@semantic-release/changelog@npm:^5.0.1": version: 5.0.1 resolution: "@semantic-release/changelog@npm:5.0.1" @@ -5387,12 +5444,12 @@ __metadata: languageName: node linkType: hard -"@types/morgan@npm:^1.9.3": - version: 1.9.3 - resolution: "@types/morgan@npm:1.9.3" +"@types/morgan@npm:^1.9.4": + version: 1.9.4 + resolution: "@types/morgan@npm:1.9.4" dependencies: "@types/node": "*" - checksum: 0b9bc8641ce03f7176f617523b8da300e5d47225b1667396749950ac7fdfa1f990447d490648fbaff050c2b0ef5fa60c3f2f00c6b76efec06fe5148de5020813 + checksum: d1e99c66a43501dcdf6e94e013dfff4e6c152cbb5f782d954bb722d230a9c1c0fe06fab6df3f3dfa3547735a7598f9471633cc6813d794e9562fd022e217c6ae languageName: node linkType: hard @@ -5756,14 +5813,15 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/eslint-plugin@npm:^5.47.0": - version: 5.47.0 - resolution: "@typescript-eslint/eslint-plugin@npm:5.47.0" +"@typescript-eslint/eslint-plugin@npm:^5.48.2": + version: 5.54.0 + resolution: "@typescript-eslint/eslint-plugin@npm:5.54.0" dependencies: - "@typescript-eslint/scope-manager": 5.47.0 - "@typescript-eslint/type-utils": 5.47.0 - "@typescript-eslint/utils": 5.47.0 + "@typescript-eslint/scope-manager": 5.54.0 + "@typescript-eslint/type-utils": 5.54.0 + "@typescript-eslint/utils": 5.54.0 debug: ^4.3.4 + grapheme-splitter: ^1.0.4 ignore: ^5.2.0 natural-compare-lite: ^1.4.0 regexpp: ^3.2.0 @@ -5775,43 +5833,43 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: fd867eb2b668d1f476fd28d38c2df2a680bf510a265a6e714b28d8f77e7a37e74e32294b70262a6fd1aec99ddb2fddef0212c862b4465ca4f83bb1172476f6e7 + checksum: 4fdb520b8e0f6b9eb878206ddfa4212522f170d1507d7aba8a975159a198efa37af6d2d17982dd560317452d0748f2e2da5dd7347b172bc4446d1c5562ce2e94 languageName: node linkType: hard -"@typescript-eslint/parser@npm:^5.47.0": - version: 5.47.0 - resolution: "@typescript-eslint/parser@npm:5.47.0" +"@typescript-eslint/parser@npm:^5.48.2": + version: 5.54.0 + resolution: "@typescript-eslint/parser@npm:5.54.0" dependencies: - "@typescript-eslint/scope-manager": 5.47.0 - "@typescript-eslint/types": 5.47.0 - "@typescript-eslint/typescript-estree": 5.47.0 + "@typescript-eslint/scope-manager": 5.54.0 + "@typescript-eslint/types": 5.54.0 + "@typescript-eslint/typescript-estree": 5.54.0 debug: ^4.3.4 peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 peerDependenciesMeta: typescript: optional: true - checksum: 5c864ca74b86ca740c73e5b87d90d43bb832b20ba6be0a39089175435771527722a7bf0a8ef7ddbd64b85235fbb7f6dbe8ae55a8bc73c6242f5559d580a8a80c + checksum: 368d6dd85be42c3f518f0ddeed23ecd1d3c9484a77ae291ee4e08e2703ed379bed613bde014cd8ab2a3e06e85dd8aef201112ae5e3d2a07deba29ae80bb1fe06 languageName: node linkType: hard -"@typescript-eslint/scope-manager@npm:5.47.0": - version: 5.47.0 - resolution: "@typescript-eslint/scope-manager@npm:5.47.0" +"@typescript-eslint/scope-manager@npm:5.54.0": + version: 5.54.0 + resolution: "@typescript-eslint/scope-manager@npm:5.54.0" dependencies: - "@typescript-eslint/types": 5.47.0 - "@typescript-eslint/visitor-keys": 5.47.0 - checksum: f637268a4cb065a89bb53d72620cc553f8c0d9f00805d6e6aac558cc4d3c08f3329208b0b4d5566d21eb636b080d453e5890221baef0e4bc4d67251f07cccd0d + "@typescript-eslint/types": 5.54.0 + "@typescript-eslint/visitor-keys": 5.54.0 + checksum: e50f12396de0ddb94aab119bdd5f4769b80dd2c273e137fd25e5811e25114d7a3d3668cdb3c454aca9537e940744881d62a1fed2ec86f07f60533dc7382ae15c languageName: node linkType: hard -"@typescript-eslint/type-utils@npm:5.47.0": - version: 5.47.0 - resolution: "@typescript-eslint/type-utils@npm:5.47.0" +"@typescript-eslint/type-utils@npm:5.54.0": + version: 5.54.0 + resolution: "@typescript-eslint/type-utils@npm:5.54.0" dependencies: - "@typescript-eslint/typescript-estree": 5.47.0 - "@typescript-eslint/utils": 5.47.0 + "@typescript-eslint/typescript-estree": 5.54.0 + "@typescript-eslint/utils": 5.54.0 debug: ^4.3.4 tsutils: ^3.21.0 peerDependencies: @@ -5819,23 +5877,23 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 504b3e883ac02cb8e69957b706e76cb79fa2192aa62702c2a658119f28f8f50f1e668efb62318e85aeda6522e1d948b59382cae4ef3300a3f4eea809a87dec26 + checksum: 9cb5b52c7277bdf74b9ea3282fc40f41fda90ea4b1d33039044476e43cf05a766b1294e7d45f429594f2776828f7d17729cfa4ea027315f3df883e748ba57514 languageName: node linkType: hard -"@typescript-eslint/types@npm:5.47.0": - version: 5.47.0 - resolution: "@typescript-eslint/types@npm:5.47.0" - checksum: 5a856e190cc2103427dbe15ccbbf87238261b5ed0859390a9e55f93afc2057f79dcbb4ac0db4d35787466f5e73f271111d19b2e725cf444af41d30e09678bf7a +"@typescript-eslint/types@npm:5.54.0": + version: 5.54.0 + resolution: "@typescript-eslint/types@npm:5.54.0" + checksum: 0f66b1b93078f3afea6dfcd3d4e2f0abea4f60cd0c613c2cf13f85098e5bf786185484c9846ed80b6c4272de2c31a70c5a8aacb91314cf1b6da7dcb8855cb7ac languageName: node linkType: hard -"@typescript-eslint/typescript-estree@npm:5.47.0": - version: 5.47.0 - resolution: "@typescript-eslint/typescript-estree@npm:5.47.0" +"@typescript-eslint/typescript-estree@npm:5.54.0": + version: 5.54.0 + resolution: "@typescript-eslint/typescript-estree@npm:5.54.0" dependencies: - "@typescript-eslint/types": 5.47.0 - "@typescript-eslint/visitor-keys": 5.47.0 + "@typescript-eslint/types": 5.54.0 + "@typescript-eslint/visitor-keys": 5.54.0 debug: ^4.3.4 globby: ^11.1.0 is-glob: ^4.0.3 @@ -5844,35 +5902,35 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: a9adfe8955b7dc9dfa9f43d450b782b83f506eaadae2a13f4e1bbe6c733be446d3edb26910954aec1bdc60d94ecc55c4e200d5b19bb24e6742f02329a4fb3e8c + checksum: 377c75c34c4f95b7ab6218c1d96a6db3ea6ed6727711b6a09354582fe0157861dc1b6fb9e3f7113cd09741f713735d59d5ab5845457f5733a4ebad7470bf600a languageName: node linkType: hard -"@typescript-eslint/utils@npm:5.47.0": - version: 5.47.0 - resolution: "@typescript-eslint/utils@npm:5.47.0" +"@typescript-eslint/utils@npm:5.54.0": + version: 5.54.0 + resolution: "@typescript-eslint/utils@npm:5.54.0" dependencies: "@types/json-schema": ^7.0.9 "@types/semver": ^7.3.12 - "@typescript-eslint/scope-manager": 5.47.0 - "@typescript-eslint/types": 5.47.0 - "@typescript-eslint/typescript-estree": 5.47.0 + "@typescript-eslint/scope-manager": 5.54.0 + "@typescript-eslint/types": 5.54.0 + "@typescript-eslint/typescript-estree": 5.54.0 eslint-scope: ^5.1.1 eslint-utils: ^3.0.0 semver: ^7.3.7 peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - checksum: f168920eec6f77651107f190b4ecadd82951fe4e3c0321ff660ac7380f4315d5ae30a1b63b4d2818f5e6f007a3f34c5df202619c24ec3a7e2ef25b215ec7b813 + checksum: b8f344fc2961c7af530b93e53d5a17b5084cdf550b381082e3fb7f349ef16e718d9eebde1b9fc2d8fc4ecf8d60d334b004359977247554265c1afc87323bed37 languageName: node linkType: hard -"@typescript-eslint/visitor-keys@npm:5.47.0": - version: 5.47.0 - resolution: "@typescript-eslint/visitor-keys@npm:5.47.0" +"@typescript-eslint/visitor-keys@npm:5.54.0": + version: 5.54.0 + resolution: "@typescript-eslint/visitor-keys@npm:5.54.0" dependencies: - "@typescript-eslint/types": 5.47.0 + "@typescript-eslint/types": 5.54.0 eslint-visitor-keys: ^3.3.0 - checksum: 2191c079154bdfd1b85b8cd24baa6c0f55c73527c6c8460789483555b4eb5c72e3dc6d1aa4bbac2cf7b86b474588b45682a8deb151e9d903cf72c8f336141f1f + checksum: 17fc323c09e6272b603cdaec30a99916600fbbb737e1fbc8c1727a487753b4363cea112277fa43e0562bff34bdd1de9ad73ff9433118b1fd469b112fad0313ca languageName: node linkType: hard @@ -6524,6 +6582,18 @@ __metadata: languageName: node linkType: hard +"ajv@npm:^8.12.0": + version: 8.12.0 + resolution: "ajv@npm:8.12.0" + dependencies: + fast-deep-equal: ^3.1.1 + json-schema-traverse: ^1.0.0 + require-from-string: ^2.0.2 + uri-js: ^4.2.2 + checksum: 4dc13714e316e67537c8b31bc063f99a1d9d9a497eb4bbd55191ac0dcd5e4985bbb71570352ad6f1e76684fb6d790928f96ba3b2d4fd6e10024be9612fe3f001 + languageName: node + linkType: hard + "ansi-align@npm:^3.0.0": version: 3.0.1 resolution: "ansi-align@npm:3.0.1" @@ -11598,11 +11668,11 @@ __metadata: "@testing-library/jest-dom": ^5.5.0 "@testing-library/react": ^10.0.3 "@testing-library/react-hooks": ^7.0.2 - "@types/morgan": ^1.9.3 - "@types/react": ^16.9.34 + "@types/morgan": ^1.9.4 + "@types/react": ^16.14.35 "@types/react-dom": ^16.9.7 - "@typescript-eslint/eslint-plugin": ^5.47.0 - "@typescript-eslint/parser": ^5.47.0 + "@typescript-eslint/eslint-plugin": ^5.48.2 + "@typescript-eslint/parser": ^5.48.2 babel-loader: ^8.2.5 chalk: ^2.0.1 compression-webpack-plugin: ^9.2.0 @@ -11627,7 +11697,7 @@ __metadata: morgan: ^1.10.0 msw: ^0.24.1 node-polyfill-webpack-plugin: ^2.0.1 - prettier: ^2.5.1 + prettier: ^2.8.3 react: ^16.13.1 react-dom: ^16.13.1 serve-static: ^1.12.3 @@ -17987,12 +18057,12 @@ __metadata: languageName: node linkType: hard -"prettier@npm:^2.5.1": - version: 2.8.1 - resolution: "prettier@npm:2.8.1" +"prettier@npm:^2.8.3": + version: 2.8.4 + resolution: "prettier@npm:2.8.4" bin: prettier: bin-prettier.js - checksum: 4f21a0f1269f76fb36f54e9a8a1ea4c11e27478958bf860661fb4b6d7ac69aac1581f8724fa98ea3585e56d42a2ea317a17ff6e3324f40cb11ff9e20b73785cc + checksum: c173064bf3df57b6d93d19aa98753b9b9dd7657212e33b41ada8e2e9f9884066bb9ca0b4005b89b3ab137efffdf8fbe0b462785aba20364798ff4303aadda57e languageName: node linkType: hard From 0636f14dd7909b34544a6d105e037c0fd47c538a Mon Sep 17 00:00:00 2001 From: 4nalog <4nalog@protonmail.com> Date: Thu, 2 Mar 2023 20:52:30 +0530 Subject: [PATCH 03/34] chore: bump minor version Signed-off-by: 4nalog <4nalog@protonmail.com> --- packages/console/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/console/package.json b/packages/console/package.json index 34fe369b5..edbfa576a 100644 --- a/packages/console/package.json +++ b/packages/console/package.json @@ -1,6 +1,6 @@ { "name": "@flyteorg/console", - "version": "0.0.11", + "version": "0.0.12", "description": "Flyteconsole main app module", "main": "./dist/index.js", "module": "./lib/index.js", From 0aa80772221fc525d5045f1b5ec43fa7cc7f5331 Mon Sep 17 00:00:00 2001 From: Jason Porter <84735036+jsonporter@users.noreply.github.com> Date: Fri, 3 Mar 2023 10:15:38 -0800 Subject: [PATCH 04/34] fix: package version to 1.4.2 (#700) Signed-off-by: Jason Porter Signed-off-by: 4nalog <4nalog@protonmail.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ecabc3726..961bdfe5f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "flyteconsole", - "version": "2.0.0", + "version": "1.4.2", "private": true, "description": "The web UI for the Flyte platform", "repository": { From 4d60595991e8ed9f1ae13982eef1e2ed5e7294c5 Mon Sep 17 00:00:00 2001 From: 4nalog <88684372+4nalog@users.noreply.github.com> Date: Sat, 4 Mar 2023 02:47:56 +0530 Subject: [PATCH 05/34] fix: project settings dashbboard tests (#701) * fix: project settings dashbboard tests Signed-off-by: 4nalog <4nalog@protonmail.com> * chore: remove .only Signed-off-by: 4nalog <4nalog@protonmail.com> * refactor: remove empty waitFor Signed-off-by: 4nalog <4nalog@protonmail.com> --------- Signed-off-by: 4nalog <4nalog@protonmail.com> --- .../Project/test/ProjectDashboard.test.tsx | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/packages/console/src/components/Project/test/ProjectDashboard.test.tsx b/packages/console/src/components/Project/test/ProjectDashboard.test.tsx index ecc9c299f..592b104e7 100644 --- a/packages/console/src/components/Project/test/ProjectDashboard.test.tsx +++ b/packages/console/src/components/Project/test/ProjectDashboard.test.tsx @@ -26,6 +26,7 @@ import { } from 'models/Project/api'; import { Admin } from '@flyteorg/flyteidl-types'; import * as LocalCache from 'basics/LocalCache'; +import { LocalCacheProvider } from 'basics/LocalCache/ContextProvider'; import { ProjectDashboard } from '../ProjectDashboard'; import { failedToLoadExecutionsString } from '../constants'; @@ -141,25 +142,31 @@ describe('ProjectDashboard', () => { render( - + + + , ); it('should display domain attributes section when config was provided', async () => { const { getByText } = renderView(); - expect(getProjectAttributes).toHaveBeenCalled(); expect(getProjectDomainAttributes).toHaveBeenCalled(); + await waitFor(() => { + expect(getProjectAttributes).toHaveBeenCalled(); + }); + await waitFor(() => { expect(getByText('Domain Settings')).toBeInTheDocument(); - expect( - getByText('cliOutputLocationPrefixFromProjectAttributes'), - ).toBeInTheDocument(); - expect(getByText('cliAnnotationKey')).toBeInTheDocument(); - expect( - getByText('cliAnnotationValueFromProjectAttributes'), - ).not.toBeInTheDocument(); }); + + expect( + getByText('cliOutputLocationPrefixFromProjectAttributes'), + ).toBeInTheDocument(); + expect(getByText('cliAnnotationKey')).toBeInTheDocument(); }); it('should show loading spinner', async () => { From 91567cba02860836e610627ac4ded635b8052562 Mon Sep 17 00:00:00 2001 From: Jason Porter <84735036+jsonporter@users.noreply.github.com> Date: Fri, 3 Mar 2023 17:15:59 -0800 Subject: [PATCH 06/34] fix: upgrading node version to 18 (#703) Upgrading node version to 18 Signed-off-by: Jason Porter Signed-off-by: 4nalog <4nalog@protonmail.com> --- .github/workflows/checks.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 8c84b322e..d1973a60d 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -31,7 +31,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-node@v2 with: - node-version: 16 + node-version: 18 - uses: bahmutov/npm-install@v1 - name: Run tests and generate coverage run: make test_unit_codecov @@ -46,7 +46,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: - node-version: 16 + node-version: 18 - uses: bahmutov/npm-install@v1 - name: Run linter run: make lint @@ -66,7 +66,13 @@ jobs: release: name: Generate Release if: ${{ (github.event_name != 'pull_request') && (needs.extract_branch.outputs.branch == 'master') }} - needs: [unit_tests_with_coverage, lint_project, build_docker_image, extract_branch] + needs: + [ + unit_tests_with_coverage, + lint_project, + build_docker_image, + extract_branch, + ] runs-on: ubuntu-latest steps: - name: Checkout @@ -74,7 +80,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v1 with: - node-version: 16 + node-version: 18 - name: Install dependencies run: yarn install --frozen-lockfile - name: Release @@ -113,7 +119,7 @@ jobs: push_docker_image: name: Build & Push FlyteConsole Image if: ${{ needs.check_for_tag.outputs.currentTag != '' }} - needs: [ check_for_tag ] + needs: [check_for_tag] uses: flyteorg/flytetools/.github/workflows/publish.yml@master with: before-build: | From 00542c6d1d59b603174da4dcd4653896472d5dcf Mon Sep 17 00:00:00 2001 From: Carina Ursu Date: Mon, 6 Mar 2023 10:23:23 -0800 Subject: [PATCH 07/34] fix: revert node version (#704) * fix: revert node version Signed-off-by: Carina Ursu * Revert "fix: upgrading node version to 18 (#703)" This reverts commit e5f9a8b00ac54cf370f0ccb07d6a8677066d33e0. Signed-off-by: Carina Ursu --------- Signed-off-by: Carina Ursu Signed-off-by: 4nalog <4nalog@protonmail.com> --- .github/workflows/checks.yml | 16 +++++----------- .tool-versions | 4 ++-- Dockerfile | 2 +- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index d1973a60d..8c84b322e 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -31,7 +31,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-node@v2 with: - node-version: 18 + node-version: 16 - uses: bahmutov/npm-install@v1 - name: Run tests and generate coverage run: make test_unit_codecov @@ -46,7 +46,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: - node-version: 18 + node-version: 16 - uses: bahmutov/npm-install@v1 - name: Run linter run: make lint @@ -66,13 +66,7 @@ jobs: release: name: Generate Release if: ${{ (github.event_name != 'pull_request') && (needs.extract_branch.outputs.branch == 'master') }} - needs: - [ - unit_tests_with_coverage, - lint_project, - build_docker_image, - extract_branch, - ] + needs: [unit_tests_with_coverage, lint_project, build_docker_image, extract_branch] runs-on: ubuntu-latest steps: - name: Checkout @@ -80,7 +74,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v1 with: - node-version: 18 + node-version: 16 - name: Install dependencies run: yarn install --frozen-lockfile - name: Release @@ -119,7 +113,7 @@ jobs: push_docker_image: name: Build & Push FlyteConsole Image if: ${{ needs.check_for_tag.outputs.currentTag != '' }} - needs: [check_for_tag] + needs: [ check_for_tag ] uses: flyteorg/flytetools/.github/workflows/publish.yml@master with: before-build: | diff --git a/.tool-versions b/.tool-versions index ed5138baa..72d3eae28 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,2 +1,2 @@ -nodejs 18.1.0 -yarn 3.2.1 \ No newline at end of file +nodejs 16.18.0 +yarn 3.2.1 diff --git a/Dockerfile b/Dockerfile index 580915288..10c112b41 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # syntax=docker/dockerfile:experimental -FROM node:18.1.0 as builder +FROM node:16 as builder LABEL org.opencontainers.image.source https://github.com/flyteorg/flyteconsole From dc32d0b7344a3f3abbe0baf8b5ba49943efd4b04 Mon Sep 17 00:00:00 2001 From: Carina Ursu Date: Mon, 6 Mar 2023 14:16:45 -0800 Subject: [PATCH 08/34] fix: deployment optimization (#706) * fix: deployment optimization Signed-off-by: Carina Ursu * clean up node modules and one file that we think is not needed Signed-off-by: Yee Hing Tong --------- Signed-off-by: Carina Ursu Signed-off-by: Yee Hing Tong Co-authored-by: Yee Hing Tong --- Dockerfile | 16 ++- package.json | 1 + packages/common/package.json | 1 + packages/components/package.json | 1 + packages/console/package.json | 5 +- packages/flyte-api/package.json | 1 + packages/flyteidl-types/package.json | 1 + packages/locale/package.json | 1 + packages/ui-atoms/package.json | 1 + website/package.json | 2 +- yarn.lock | 158 ++------------------------- 11 files changed, 31 insertions(+), 157 deletions(-) diff --git a/Dockerfile b/Dockerfile index 10c112b41..fd3b89c57 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,15 @@ # syntax=docker/dockerfile:experimental -FROM node:16 as builder - +# Use node:17 to docker build on M1 +FROM --platform=${BUILDPLATFORM} node:16 as builder LABEL org.opencontainers.image.source https://github.com/flyteorg/flyteconsole +ARG TARGETARCH +ENV npm_config_target_arch "${TARGETARCH}" +ENV npm_config_target_platform linux +ENV npm_config_target_libc glibc + WORKDIR /my-project/ COPY . /my-project/ - RUN : \ --mount=type=cache,target=/root/.yarn \ # install production dependencies @@ -15,15 +19,17 @@ RUN : \ && rm -rf node_modules/@flyteorg \ && cp -R node_modules /app -WORKDIR /my-project/ RUN : \ --mount=type=cache,target=/root/.yarn \ # install all dependencies so we can build && yarn workspaces focus --all --production \ - && yarn build:pack \ + && yarn build:types \ && BASE_URL=/console yarn run build:prod \ && cp -R ./website/dist/* /app +RUN rm -rf /app/node_modules +RUN rm -f /app/client-stats.json + FROM gcr.io/distroless/nodejs LABEL org.opencontainers.image.source https://github.com/flyteorg/flyteconsole diff --git a/package.json b/package.json index 961bdfe5f..7925dbb22 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "scripts": { "postinstall": "husky install", "build:pack": "yarn workspaces foreach -vit --include '{@flyteorg/flyteidl-types,@flyteorg/flyte-api,@flyteorg/ui-atoms,@flyteorg/common,@flyteorg/locale,@flyteorg/flyte-api,@flyteorg/components,@flyteorg/console}' run build", + "build:types": "yarn workspaces foreach -vit --include '{@flyteorg/flyteidl-types,@flyteorg/flyte-api,@flyteorg/ui-atoms,@flyteorg/common,@flyteorg/locale,@flyteorg/flyte-api,@flyteorg/components,@flyteorg/console}' run build:types", "clean": "git clean -fxd --exclude script", "gen:ssl": "make generate_ssl", "start": "yarn workspace @flyteconsole/client-app start", diff --git a/packages/common/package.json b/packages/common/package.json index 3c2abd4cc..24b427853 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -30,6 +30,7 @@ "build": "yarn clean && yarn build:esm && yarn build:cjs", "build:esm": "run -T tsc --module esnext --project ./tsconfig.build.es.json && run -T tsc-alias -p ./tsconfig.build.es.json", "build:cjs": "run -T tsc --project ./tsconfig.build.json && run -T tsc-alias -p ./tsconfig.build.json", + "build:types": "run -T tsc --module esnext --project ./tsconfig.build.es.json --emitDeclarationOnly && run -T tsc-alias -p ./tsconfig.build.es.json", "test": "NODE_ENV=test jest" } } diff --git a/packages/components/package.json b/packages/components/package.json index 8bbb3141b..4efc1313f 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -36,6 +36,7 @@ "build": "yarn clean && yarn build:esm && yarn build:cjs", "build:esm": "run -T tsc --module esnext --project ./tsconfig.build.es.json && run -T tsc-alias -p ./tsconfig.build.es.json", "build:cjs": "run -T tsc --project ./tsconfig.build.json && run -T tsc-alias -p ./tsconfig.build.json", + "build:types": "run -T tsc --module esnext --project ./tsconfig.build.es.json --emitDeclarationOnly && run -T tsc-alias -p ./tsconfig.build.es.json", "test": "NODE_ENV=test jest" }, "dependencies": { diff --git a/packages/console/package.json b/packages/console/package.json index edbfa576a..6583c2605 100644 --- a/packages/console/package.json +++ b/packages/console/package.json @@ -1,6 +1,6 @@ { "name": "@flyteorg/console", - "version": "0.0.12", + "version": "0.0.10", "description": "Flyteconsole main app module", "main": "./dist/index.js", "module": "./lib/index.js", @@ -33,8 +33,9 @@ "clean": "rm -rf dist && rm -rf lib && rm -rf **.tsbuildinfo || true", "build:watch": "run -T tsc-watch --noClear -p ./tsconfig.es.build.json --onSuccess \"yarn build\"", "build": "yarn clean && yarn build:esm && yarn build:cjs", - "build:esm": "mkdir lib && cp -R src/assets ./lib && run -T tsc --module esnext --outDir ./lib --project ./tsconfig.build.es.json && run -T tsc-alias -p ./tsconfig.build.es.json", + "build:esm": "mkdir lib && cp -R src/assets ./lib && run -T tsc --module esnext --project ./tsconfig.build.es.json && run -T tsc-alias -p ./tsconfig.build.es.json", "build:cjs": "mkdir dist && cp -R src/assets ./dist && run -T wait-on ./dist/assets && run -T tsc --project ./tsconfig.build.json && run -T tsc-alias -p ./tsconfig.build.json", + "build:types": "run -T tsc --module esnext --project ./tsconfig.build.es.json --emitDeclarationOnly && run -T tsc-alias -p ./tsconfig.build.es.json", "test": "NODE_ENV=test jest" }, "installConfig": { diff --git a/packages/flyte-api/package.json b/packages/flyte-api/package.json index 173983dd4..d51134565 100644 --- a/packages/flyte-api/package.json +++ b/packages/flyte-api/package.json @@ -36,6 +36,7 @@ "build": "yarn clean && yarn build:esm && yarn build:cjs", "build:esm": "run -T tsc --module esnext --project ./tsconfig.build.es.json && run -T tsc-alias -p ./tsconfig.build.es.json", "build:cjs": "run -T tsc --project ./tsconfig.build.json && run -T tsc-alias -p ./tsconfig.build.json", + "build:types": "run -T tsc --module esnext --project ./tsconfig.build.es.json --emitDeclarationOnly && run -T tsc-alias -p ./tsconfig.build.es.json", "push:update": "yarn clean && yarn build && yarn publish", "test": "NODE_ENV=test jest" }, diff --git a/packages/flyteidl-types/package.json b/packages/flyteidl-types/package.json index 844c0b834..f9931cda3 100644 --- a/packages/flyteidl-types/package.json +++ b/packages/flyteidl-types/package.json @@ -36,6 +36,7 @@ "build": "yarn clean && yarn build:esm && yarn build:cjs", "build:esm": "run -T tsc --module esnext --project ./tsconfig.build.es.json && run -T tsc-alias -p ./tsconfig.build.es.json", "build:cjs": "run -T tsc --project ./tsconfig.build.json && run -T tsc-alias -p ./tsconfig.build.json", + "build:types": "run -T tsc --module esnext --project ./tsconfig.build.es.json --emitDeclarationOnly && run -T tsc-alias -p ./tsconfig.build.es.json", "test": "NODE_ENV=test jest" }, "peerDependencies": { diff --git a/packages/locale/package.json b/packages/locale/package.json index 0247ce006..13efbee62 100644 --- a/packages/locale/package.json +++ b/packages/locale/package.json @@ -36,6 +36,7 @@ "build": "yarn clean && yarn build:esm && yarn build:cjs", "build:esm": "run -T tsc --module esnext --project ./tsconfig.build.es.json && run -T tsc-alias -p ./tsconfig.build.es.json", "build:cjs": "run -T tsc --project ./tsconfig.build.json && run -T tsc-alias -p ./tsconfig.build.json", + "build:types": "run -T tsc --module esnext --project ./tsconfig.build.es.json --emitDeclarationOnly && run -T tsc-alias -p ./tsconfig.build.es.json", "test": "NODE_ENV=test jest" }, "devDependencies": { diff --git a/packages/ui-atoms/package.json b/packages/ui-atoms/package.json index 6e784bc72..de1597275 100644 --- a/packages/ui-atoms/package.json +++ b/packages/ui-atoms/package.json @@ -27,6 +27,7 @@ "build": "yarn clean && yarn build:esm && yarn build:cjs", "build:esm": "run -T tsc --module esnext --project ./tsconfig.build.es.json && run -T tsc-alias -p ./tsconfig.build.es.json", "build:cjs": "run -T tsc --project ./tsconfig.build.json && run -T tsc-alias -p ./tsconfig.build.json", + "build:types": "run -T tsc --module esnext --project ./tsconfig.build.es.json --emitDeclarationOnly && run -T tsc-alias -p ./tsconfig.build.es.json", "test": "NODE_ENV=test jest" }, "installConfig": { diff --git a/website/package.json b/website/package.json index 50f4ad92b..7fac358a1 100644 --- a/website/package.json +++ b/website/package.json @@ -37,7 +37,7 @@ }, "dependencies": { "@flyteorg/common": "^0.0.3", - "@flyteorg/console": "^0.0.7", + "@flyteorg/console": "^0.0.10", "long": "^4.0.0", "protobufjs": "~6.11.3", "react-ga4": "^1.4.1", diff --git a/yarn.lock b/yarn.lock index a3249fc07..2790aa96b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1995,7 +1995,7 @@ __metadata: resolution: "@flyteconsole/client-app@workspace:website" dependencies: "@flyteorg/common": ^0.0.3 - "@flyteorg/console": ^0.0.7 + "@flyteorg/console": ^0.0.10 "@types/long": ^3.0.32 long: ^4.0.0 protobufjs: ~6.11.3 @@ -2034,77 +2034,7 @@ __metadata: languageName: unknown linkType: soft -"@flyteorg/console@npm:^0.0.7": - version: 0.0.7 - resolution: "@flyteorg/console@npm:0.0.7" - dependencies: - "@date-io/moment": 1.3.9 - "@emotion/core": 10.1.1 - "@flyteorg/common": ^0.0.3 - "@flyteorg/components": ^0.0.3 - "@flyteorg/flyte-api": ^0.0.2 - "@flyteorg/flyteidl-types": ^0.0.3 - "@flyteorg/locale": ^0.0.2 - "@flyteorg/ui-atoms": ^0.0.3 - "@material-ui/core": ^4.12.4 - "@material-ui/icons": ^4.11.3 - "@material-ui/pickers": ^3.2.2 - "@rjsf/core": 3.2.1 - "@rjsf/material-ui": 3.2.1 - "@rjsf/utils": ^5.0.0-beta.12 - "@rjsf/validator-ajv6": ^5.0.0-beta.12 - "@types/d3-shape": ^1.2.6 - "@xstate/react": ^1.0.0 - axios: ^0.27.2 - chart.js: 3.6.2 - chartjs-plugin-datalabels: 2.0.0 - classnames: ^2.3.1 - copy-to-clipboard: ^3.0.8 - cronstrue: ^1.31.0 - d3-dag: ^0.3.4 - d3-shape: ^1.2.2 - dagre: 0.8.5 - dagre-d3: ^0.6.4 - debug: 2.6.9 - dom-helpers: ^3.4.0 - fuzzysort: ^1.1.1 - intersection-observer: ^0.7.0 - js-yaml: ^3.13.1 - linkify-it: ^2.2.0 - lodash: ^4.17.21 - lossless-json: ^1.0.3 - memoize-one: ^5.0.0 - moment: ^2.29.4 - moment-timezone: ^0.5.28 - notistack: ^1.0.10 - object-hash: ^1.3.1 - prop-types: 15.6.0 - query-string: ^6.5.0 - react-chartjs-2: ^4.3.1 - react-flow-renderer: 10.3.8 - react-ga4: ^1.4.1 - react-intersection-observer: ^8.25.1 - react-json-view: ^1.21.3 - react-loading-skeleton: ^1.1.2 - react-query: 3.3.0 - react-query-devtools: 3.0.0-beta.1 - react-virtualized: ^9.21.1 - shallowequal: ^1.1.0 - url-search-params: ^0.10.0 - xstate: 4.33.6 - peerDependencies: - long: ^4.0.0 - protobufjs: ~6.11.3 - react: ^16.14.0 - react-dom: ^16.14.0 - react-router: ^5.3.4 - react-router-dom: ^5.3.4 - use-react-router: ^1.0.7 - checksum: 998c925f806d61cd549687fb36d24c765f42daacd1892dea8c2fc1f334ce8e1d0146bf1687f7e1328a4df29fd620d78f5ecc17ca7e4547d595420c876e963fd8 - languageName: node - linkType: hard - -"@flyteorg/console@workspace:packages/console": +"@flyteorg/console@^0.0.10, @flyteorg/console@workspace:packages/console": version: 0.0.0-use.local resolution: "@flyteorg/console@workspace:packages/console" dependencies: @@ -3347,25 +3277,6 @@ __metadata: languageName: node linkType: hard -"@rjsf/core@npm:3.2.1": - version: 3.2.1 - resolution: "@rjsf/core@npm:3.2.1" - dependencies: - "@types/json-schema": ^7.0.7 - ajv: ^6.7.0 - core-js-pure: ^3.6.5 - json-schema-merge-allof: ^0.6.0 - jsonpointer: ^5.0.0 - lodash: ^4.17.15 - nanoid: ^3.1.23 - prop-types: ^15.7.2 - react-is: ^16.9.0 - peerDependencies: - react: ">=16" - checksum: 2142d4a31229ea242b79aca4ed93e2fe89e75f15ce93111457c3017d3ab295cae8f53e4dd870c619afa571959d00f46b3c19085c6a336f522c891fc07ecc46f1 - languageName: node - linkType: hard - "@rjsf/core@npm:^5.1.0": version: 5.1.0 resolution: "@rjsf/core@npm:5.1.0" @@ -3381,18 +3292,6 @@ __metadata: languageName: node linkType: hard -"@rjsf/material-ui@npm:3.2.1": - version: 3.2.1 - resolution: "@rjsf/material-ui@npm:3.2.1" - peerDependencies: - "@material-ui/core": ^4.2.0 - "@material-ui/icons": ^4.2.1 - "@rjsf/core": ^3.0.0 - react: ">=16" - checksum: bd25cd9f2e2d568c653755e7268fe3e53279e1ae675e39bccd85f65557623d2052b706763e017a949f897751e25a16d0f2c8b995508bb56907be6786b09e2b1e - languageName: node - linkType: hard - "@rjsf/material-ui@npm:^5.1.0": version: 5.1.0 resolution: "@rjsf/material-ui@npm:5.1.0" @@ -3406,21 +3305,6 @@ __metadata: languageName: node linkType: hard -"@rjsf/utils@npm:^5.0.0-beta.12": - version: 5.0.0-beta.14 - resolution: "@rjsf/utils@npm:5.0.0-beta.14" - dependencies: - json-schema-merge-allof: ^0.8.1 - jsonpointer: ^5.0.1 - lodash: ^4.17.15 - lodash-es: ^4.17.15 - react-is: ^18.2.0 - peerDependencies: - react: ^16.14.0 || >=17 - checksum: 66d29377c98f6e778ec0b167734a949528b0ca2bfb4776dea74fd70add1fb339e14ec878b9162a152e83804bc8094c3ebcd9ebf8b1b68a63c6ee2bf4548938c8 - languageName: node - linkType: hard - "@rjsf/utils@npm:^5.1.0": version: 5.1.0 resolution: "@rjsf/utils@npm:5.1.0" @@ -3436,19 +3320,6 @@ __metadata: languageName: node linkType: hard -"@rjsf/validator-ajv6@npm:^5.0.0-beta.12": - version: 5.0.0-beta.14 - resolution: "@rjsf/validator-ajv6@npm:5.0.0-beta.14" - dependencies: - ajv: ^6.7.0 - lodash: ^4.17.15 - lodash-es: ^4.17.15 - peerDependencies: - "@rjsf/utils": ^5.0.0-beta.1 - checksum: 57b5c6968475a66762f644f2832aad077f8dde0ca9e71c8b0b27c06174855b7e6330f44fa6078fc0f347b728a4a5fd62399378fad26ada3cde32da89bddf6f9f - languageName: node - linkType: hard - "@rjsf/validator-ajv8@npm:^5.1.0": version: 5.1.0 resolution: "@rjsf/validator-ajv8@npm:5.1.0" @@ -5333,7 +5204,7 @@ __metadata: languageName: node linkType: hard -"@types/json-schema@npm:*, @types/json-schema@npm:^7.0.4, @types/json-schema@npm:^7.0.5, @types/json-schema@npm:^7.0.7, @types/json-schema@npm:^7.0.8, @types/json-schema@npm:^7.0.9": +"@types/json-schema@npm:*, @types/json-schema@npm:^7.0.4, @types/json-schema@npm:^7.0.5, @types/json-schema@npm:^7.0.8, @types/json-schema@npm:^7.0.9": version: 7.0.11 resolution: "@types/json-schema@npm:7.0.11" checksum: 527bddfe62db9012fccd7627794bd4c71beb77601861055d87e3ee464f2217c85fca7a4b56ae677478367bbd248dbde13553312b7d4dbc702a2f2bbf60c4018d @@ -6558,7 +6429,7 @@ __metadata: languageName: node linkType: hard -"ajv@npm:^6.1.0, ajv@npm:^6.10.0, ajv@npm:^6.10.2, ajv@npm:^6.12.2, ajv@npm:^6.12.4, ajv@npm:^6.12.5, ajv@npm:^6.7.0": +"ajv@npm:^6.1.0, ajv@npm:^6.10.0, ajv@npm:^6.10.2, ajv@npm:^6.12.2, ajv@npm:^6.12.4, ajv@npm:^6.12.5": version: 6.12.6 resolution: "ajv@npm:6.12.6" dependencies: @@ -8714,7 +8585,7 @@ __metadata: languageName: node linkType: hard -"compute-lcm@npm:^1.1.0, compute-lcm@npm:^1.1.2": +"compute-lcm@npm:^1.1.2": version: 1.1.2 resolution: "compute-lcm@npm:1.1.2" dependencies: @@ -8963,7 +8834,7 @@ __metadata: languageName: node linkType: hard -"core-js-pure@npm:^3.23.3, core-js-pure@npm:^3.25.1, core-js-pure@npm:^3.6.5": +"core-js-pure@npm:^3.23.3, core-js-pure@npm:^3.25.1": version: 3.26.1 resolution: "core-js-pure@npm:3.26.1" checksum: d88c40e5e29e413c11d1ef991a8d5b6a63f00bd94707af0f649d3fc18b3524108b202f4ae75ce77620a1557d1ba340bc3362b4f25d590eccc37cf80fc75f7cd4 @@ -14743,17 +14614,6 @@ __metadata: languageName: node linkType: hard -"json-schema-merge-allof@npm:^0.6.0": - version: 0.6.0 - resolution: "json-schema-merge-allof@npm:0.6.0" - dependencies: - compute-lcm: ^1.1.0 - json-schema-compare: ^0.2.2 - lodash: ^4.17.4 - checksum: 2008aede3f5d05d7870e7d5e554e5c6a5b451cfff1357d34d3d8b34e2ba57468a97c76aa5b967bdb411d91b98c734f19f350de578d25b2a0a27cd4e1ca92bd1d - languageName: node - linkType: hard - "json-schema-merge-allof@npm:^0.8.1": version: 0.8.1 resolution: "json-schema-merge-allof@npm:0.8.1" @@ -14840,7 +14700,7 @@ __metadata: languageName: node linkType: hard -"jsonpointer@npm:^5.0.0, jsonpointer@npm:^5.0.1": +"jsonpointer@npm:^5.0.1": version: 5.0.1 resolution: "jsonpointer@npm:5.0.1" checksum: 0b40f712900ad0c846681ea2db23b6684b9d5eedf55807b4708c656f5894b63507d0e28ae10aa1bddbea551241035afe62b6df0800fc94c2e2806a7f3adecd7c @@ -16391,7 +16251,7 @@ __metadata: languageName: node linkType: hard -"nanoid@npm:^3.1.23, nanoid@npm:^3.3.1, nanoid@npm:^3.3.4": +"nanoid@npm:^3.3.1, nanoid@npm:^3.3.4": version: 3.3.4 resolution: "nanoid@npm:3.3.4" bin: @@ -18704,7 +18564,7 @@ __metadata: languageName: node linkType: hard -"react-is@npm:^16.13.1, react-is@npm:^16.6.0, react-is@npm:^16.7.0, react-is@npm:^16.9.0": +"react-is@npm:^16.13.1, react-is@npm:^16.6.0, react-is@npm:^16.7.0": version: 16.13.1 resolution: "react-is@npm:16.13.1" checksum: f7a19ac3496de32ca9ae12aa030f00f14a3d45374f1ceca0af707c831b2a6098ef0d6bdae51bd437b0a306d7f01d4677fcc8de7c0d331eb47ad0f46130e53c5f From b2a7529c6e986ace10b29ac5bc00c571e24d512a Mon Sep 17 00:00:00 2001 From: Carina Ursu Date: Mon, 6 Mar 2023 14:40:04 -0800 Subject: [PATCH 09/34] fix: upgrade release node version (#707) Signed-off-by: Carina Ursu Signed-off-by: 4nalog <4nalog@protonmail.com> --- .github/workflows/checks.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 8c84b322e..2a59db501 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -66,7 +66,13 @@ jobs: release: name: Generate Release if: ${{ (github.event_name != 'pull_request') && (needs.extract_branch.outputs.branch == 'master') }} - needs: [unit_tests_with_coverage, lint_project, build_docker_image, extract_branch] + needs: + [ + unit_tests_with_coverage, + lint_project, + build_docker_image, + extract_branch, + ] runs-on: ubuntu-latest steps: - name: Checkout @@ -74,7 +80,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v1 with: - node-version: 16 + node-version: 18 - name: Install dependencies run: yarn install --frozen-lockfile - name: Release @@ -113,7 +119,7 @@ jobs: push_docker_image: name: Build & Push FlyteConsole Image if: ${{ needs.check_for_tag.outputs.currentTag != '' }} - needs: [ check_for_tag ] + needs: [check_for_tag] uses: flyteorg/flytetools/.github/workflows/publish.yml@master with: before-build: | From 30c6c7f1d128e58048896632b8c7a4c1868bfb75 Mon Sep 17 00:00:00 2001 From: Carina Ursu Date: Mon, 6 Mar 2023 17:54:19 -0800 Subject: [PATCH 10/34] fix: update chalk, add semantic-release test cmd (#708) Signed-off-by: Carina Ursu Signed-off-by: 4nalog <4nalog@protonmail.com> --- .releaserc.json | 14 ---------- package.json | 8 +++--- release.config.js | 68 +++++++++++++++++++++++++++++++++++++++++++++++ yarn.lock | 13 +++------ 4 files changed, 76 insertions(+), 27 deletions(-) delete mode 100644 .releaserc.json create mode 100644 release.config.js diff --git a/.releaserc.json b/.releaserc.json deleted file mode 100644 index bf7adaa31..000000000 --- a/.releaserc.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "plugins": [ - "@semantic-release/commit-analyzer", - "@semantic-release/release-notes-generator", - [ - "@semantic-release/changelog", - { - "changelogTitle": "# Changelog\n\nAll notable changes to this project will be documented in this file. See\n[Conventional Commits](https://conventionalcommits.org) for commit guidelines." - } - ], - ["@semantic-release/npm", { "npmPublish": false }], - "@semantic-release/github" - ] -} diff --git a/package.json b/package.json index 7925dbb22..1be3af05c 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,8 @@ "storybook": "start-storybook -p 6006", "test": "NODE_ENV=test BASE_URL=/console jest", "test:clear": "jest --clearCache", - "test-coverage": "NODE_ENV=test BASE_URL=/console jest --coverage" + "test-coverage": "NODE_ENV=test BASE_URL=/console jest --coverage", + "test-release": "npx semantic-release --debug --no-ci --test-run" }, "husky": { "hooks": { @@ -57,7 +58,7 @@ "@types/react-dom": "^16.9.7", "@typescript-eslint/eslint-plugin": "^5.48.2", "@typescript-eslint/parser": "^5.48.2", - "chalk": "^2.0.1", + "chalk": "^4", "compression-webpack-plugin": "^9.2.0", "cookie-parser": "^1.4.3", "copy-webpack-plugin": "^11.0.0", @@ -135,7 +136,8 @@ "@babel/preset-react": "~7.16.7", "@babel/preset-typescript": "~7.16.7", "minimist": "1.2.6", - "@types/react": "16.14.34" + "@types/react": "16.14.34", + "npm/chalk": "^4" }, "packageManager": "yarn@3.2.1" } diff --git a/release.config.js b/release.config.js new file mode 100644 index 000000000..2fb3b438d --- /dev/null +++ b/release.config.js @@ -0,0 +1,68 @@ +const { execSync } = require('child_process'); + +/** + * + * @returns Production release configuration + */ +function getProdConfiguration() { + return { + plugins: [ + '@semantic-release/commit-analyzer', + '@semantic-release/release-notes-generator', + [ + '@semantic-release/changelog', + { + changelogTitle: + '# Changelog\n\nAll notable changes to this project will be documented in this file. See\n[Conventional Commits](https://conventionalcommits.org) for commit guidelines.', + }, + ], + ['@semantic-release/npm', { npmPublish: false }], + '@semantic-release/github', + ], + }; +} + +/** + * + * ################################################################ + * ################################################################ + * ################ FOR TESTING ########################## + * ################################################################ + * ################################################################ + */ +function isTestRun() { + return ( + process.argv.includes('--dry-run') || process.argv.includes('--test-run') + ); +} + +function getTestConfiguration() { + const localGitRepoPath = `file://${process.cwd()}/.git`; + const localBranchName = execSync('git branch --show-current') + .toString() + .trim(); + + return { + repositoryUrl: localGitRepoPath, + branches: localBranchName, + plugins: [ + '@semantic-release/commit-analyzer', + '@semantic-release/release-notes-generator', + [ + '@semantic-release/changelog', + { + changelogTitle: + '# Changelog\n\nAll notable changes to this project will be documented in this file. See\n[Conventional Commits](https://conventionalcommits.org) for commit guidelines.', + }, + ], + ['@semantic-release/npm', { npmPublish: false }], + // ["@semantic-release/github", { + // "verifyConditions": false, + // "publish": false, + // 'addReleases': false + // }], + ], + }; +} + +module.exports = isTestRun() ? getTestConfiguration() : getProdConfiguration(); diff --git a/yarn.lock b/yarn.lock index 2790aa96b..2b05d24cf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7979,14 +7979,7 @@ __metadata: languageName: node linkType: hard -"chalk@npm:*": - version: 5.2.0 - resolution: "chalk@npm:5.2.0" - checksum: 03d8060277de6cf2fd567dc25fcf770593eb5bb85f460ce443e49255a30ff1242edd0c90a06a03803b0466ff0687a939b41db1757bec987113e83de89a003caa - languageName: node - linkType: hard - -"chalk@npm:^2.0.0, chalk@npm:^2.0.1, chalk@npm:^2.4.1": +"chalk@npm:^2.0.0, chalk@npm:^2.4.1": version: 2.4.2 resolution: "chalk@npm:2.4.2" dependencies: @@ -8007,7 +8000,7 @@ __metadata: languageName: node linkType: hard -"chalk@npm:^4.0.0, chalk@npm:^4.1.0, chalk@npm:^4.1.2": +"chalk@npm:^4, chalk@npm:^4.0.0, chalk@npm:^4.1.0, chalk@npm:^4.1.2": version: 4.1.2 resolution: "chalk@npm:4.1.2" dependencies: @@ -11545,7 +11538,7 @@ __metadata: "@typescript-eslint/eslint-plugin": ^5.48.2 "@typescript-eslint/parser": ^5.48.2 babel-loader: ^8.2.5 - chalk: ^2.0.1 + chalk: ^4 compression-webpack-plugin: ^9.2.0 cookie-parser: ^1.4.3 copy-webpack-plugin: ^11.0.0 From ed495bb1e24dd8c94511252eabe112e30697e8c6 Mon Sep 17 00:00:00 2001 From: 4nalog <4nalog@protonmail.com> Date: Wed, 8 Mar 2023 20:47:41 +0530 Subject: [PATCH 11/34] chore: implement logic to handle multiple keys for nested data classes Signed-off-by: 4nalog <4nalog@protonmail.com> --- .../Launch/LaunchForm/StructInput.tsx | 7 +- yarn.lock | 73 ++++++++++++++++++- 2 files changed, 77 insertions(+), 3 deletions(-) diff --git a/packages/console/src/components/Launch/LaunchForm/StructInput.tsx b/packages/console/src/components/Launch/LaunchForm/StructInput.tsx index 4c401c239..cb8be5f83 100644 --- a/packages/console/src/components/Launch/LaunchForm/StructInput.tsx +++ b/packages/console/src/components/Launch/LaunchForm/StructInput.tsx @@ -29,7 +29,7 @@ muiTheme.typography.h5 = { fontWeight: 400, }; -const formatJson = data => { +const formatJson = (data) => { const keys = Object.keys(data); if (keys.includes('title')) { @@ -69,7 +69,10 @@ export const StructInput: React.FC = props => { literalType?.metadata?.fields?.definitions?.structValue?.fields, ); - if (keys[0]) { + if (keys.length > 1) { + // If there are multiple keys, we can't render a form because of not supporting nested structs + jsonFormRenderable = false; + } else if (keys[0]) { parsedJson = protobufValueToPrimitive( literalType.metadata.fields.definitions.structValue.fields[ `${keys[0]}` diff --git a/yarn.lock b/yarn.lock index 2b05d24cf..e379e9ace 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2034,7 +2034,78 @@ __metadata: languageName: unknown linkType: soft -"@flyteorg/console@^0.0.10, @flyteorg/console@workspace:packages/console": +"@flyteorg/console@npm:^0.0.10": + version: 0.0.10 + resolution: "@flyteorg/console@npm:0.0.10" + dependencies: + "@date-io/moment": 1.3.9 + "@emotion/core": 10.1.1 + "@flyteorg/common": ^0.0.3 + "@flyteorg/components": ^0.0.3 + "@flyteorg/flyte-api": ^0.0.2 + "@flyteorg/flyteidl-types": ^0.0.3 + "@flyteorg/locale": ^0.0.2 + "@flyteorg/ui-atoms": ^0.0.3 + "@material-ui/core": ^4.12.4 + "@material-ui/icons": ^4.11.3 + "@material-ui/pickers": ^3.2.2 + "@rjsf/core": ^5.1.0 + "@rjsf/material-ui": ^5.1.0 + "@rjsf/utils": ^5.1.0 + "@rjsf/validator-ajv8": ^5.1.0 + "@types/d3-shape": ^1.2.6 + "@xstate/react": ^1.0.0 + axios: ^0.27.2 + chart.js: 3.6.2 + chartjs-plugin-datalabels: 2.0.0 + classnames: ^2.3.1 + copy-to-clipboard: ^3.0.8 + cronstrue: ^1.31.0 + d3-dag: ^0.3.4 + d3-shape: ^1.2.2 + dagre: 0.8.5 + dagre-d3: ^0.6.4 + debug: 2.6.9 + dom-helpers: ^3.4.0 + fuzzysort: ^1.1.1 + intersection-observer: ^0.7.0 + js-yaml: ^3.13.1 + linkify-it: ^2.2.0 + lodash: ^4.17.21 + lossless-json: ^1.0.3 + memoize-one: ^5.0.0 + moment: ^2.29.4 + moment-timezone: ^0.5.28 + notistack: ^1.0.10 + object-hash: ^1.3.1 + prop-types: 15.6.0 + query-string: ^6.5.0 + react-chartjs-2: ^4.3.1 + react-dropzone: ^14.2.3 + react-flow-renderer: 10.3.8 + react-ga4: ^1.4.1 + react-intersection-observer: ^8.25.1 + react-json-view: ^1.21.3 + react-loading-skeleton: ^1.1.2 + react-query: 3.3.0 + react-query-devtools: 3.0.0-beta.1 + react-virtualized: ^9.21.1 + shallowequal: ^1.1.0 + url-search-params: ^0.10.0 + xstate: 4.33.6 + peerDependencies: + long: ^4.0.0 + protobufjs: ~6.11.3 + react: ^16.14.0 + react-dom: ^16.14.0 + react-router: ^5.3.4 + react-router-dom: ^5.3.4 + use-react-router: ^1.0.7 + checksum: 4bbde43dc8885a3e98aff2562583a4ad08ddd5d4352fdc25622653b9132dc36f5a50057f6ba2a6e1940c199d5fa81225e61c8a2395c8f834538ffd9de7ed54c9 + languageName: node + linkType: hard + +"@flyteorg/console@workspace:packages/console": version: 0.0.0-use.local resolution: "@flyteorg/console@workspace:packages/console" dependencies: From 50309bafaed3d1143fa258e9553575c859ec2ed7 Mon Sep 17 00:00:00 2001 From: Carina Ursu Date: Tue, 7 Mar 2023 07:50:55 -0800 Subject: [PATCH 12/34] chore: fix update_npmversion (#709) * chore: fix update_npmversion Signed-off-by: Carina Ursu * chore: edits Signed-off-by: Carina Ursu --------- Signed-off-by: Carina Ursu Signed-off-by: 4nalog <4nalog@protonmail.com> --- CONTRIBUTING.md | 2 +- Makefile | 4 +- README.md | 146 ++++++++++++++++++++++++------------------------ 3 files changed, 76 insertions(+), 76 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7ddf6a18f..df1a7463c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -36,7 +36,7 @@ For example in case if package plan to be used in `console` app Ensure to add proper webpack alias path resolutions into: - ./storybook/main.js - as `'@flyteorg/flyte-api': path.resolve(__dirname, '../packages/flyte-api/src’),` -- packages/zapp/console/webpack.common.config.ts to alias section - as `'@flyteorg/flyte-api': path.resolve(__dirname, '../packages/flyte-api/src’),` +- website/webpack.utilities.ts to alias section - as `'@flyteorg/flyte-api': path.resolve(__dirname, '../packages/flyte-api/src’),` To add child package usage to other package, in parent package -> diff --git a/Makefile b/Makefile index fc14da47a..136020c79 100644 --- a/Makefile +++ b/Makefile @@ -53,5 +53,5 @@ PLACEHOLDER_NPM := \"version\": \"0.0.0-develop\" .PHONY: update_npmversion update_npmversion: - grep "$(PLACEHOLDER_NPM)" "packages/zapp/console/package.json" - sed -i "s/$(PLACEHOLDER_NPM)/\"version\": \"${VERSION}\"/g" "packages/zapp/console/package.json" + grep "$(PLACEHOLDER_NPM)" "website/package.json" + sed -i "s/$(PLACEHOLDER_NPM)/\"version\": \"${VERSION}\"/g" "website/package.json" diff --git a/README.md b/README.md index f24a757b2..6eaf3801a 100644 --- a/README.md +++ b/README.md @@ -41,20 +41,20 @@ For help with installing dependencies look into ## 🚀 Quick Start 1. Follow [Start a Local flyte backend](https://docs.flyte.org/en/latest/getting_started/index.html), like: - ```bash - docker run --rm --privileged -p 30080:30080 -p 30081:30081 -p 30082:30082 -p 30084:30084 cr.flyte.org/flyteorg/flyte-sandbox - ``` + ```bash + docker run --rm --privileged -p 30080:30080 -p 30081:30081 -p 30082:30082 -p 30084:30084 cr.flyte.org/flyteorg/flyte-sandbox + ``` 2. Now, export the following env variables: - `export ADMIN_API_URL=http://localhost:30080 export DISABLE_AUTH=1` + `export ADMIN_API_URL=http://localhost:30080 export DISABLE_AUTH=1` - > You can persist these environment variables either in the current shell or in a `.env` file at the root - > of the repository. A `.env` file will persist the settings across multiple terminal - > sessions. + > You can persist these environment variables either in the current shell or in a `.env` file at the root + > of the repository. A `.env` file will persist the settings across multiple terminal + > sessions. 3. Start the server (uses localhost:3000) - `bash yarn start ` + `bash yarn start ` 4. Explore your local copy at `http://localhost:3000` @@ -63,7 +63,7 @@ For help with installing dependencies look into Recently OSX (12.3) removed python 2.7 from default installation and this can cause build errors for some users depending on it's setup. In this repository you can experience `env: python: No such file or directory` error from gyp ([node-gyp](https://github.com/nodejs/node-gyp)). The easiest way to fix it: -- Install the XCode Command Line Tools standalone by running `xcode-select --install` in the terminal +- Install the XCode Command Line Tools standalone by running `xcode-select --install` in the terminal OR @@ -78,34 +78,34 @@ OR ### Environment Variables -- `ADMIN_API_URL` (default: [window.location.origin](https://developer.mozilla.org/en-US/docs/Web/API/Window/location>)) +- `ADMIN_API_URL` (default: [window.location.origin](https://developer.mozilla.org/en-US/docs/Web/API/Window/location>)) - The Flyte Console displays information fetched from the FlyteAdmin API. This - environment variable specifies the host prefix used in constructing API requests. + The Flyte Console displays information fetched from the FlyteAdmin API. This + environment variable specifies the host prefix used in constructing API requests. - _Note_: this is only the host portion of the API endpoint, consisting of the - protocol, domain, and port (if not using the standard 80/443). + _Note_: this is only the host portion of the API endpoint, consisting of the + protocol, domain, and port (if not using the standard 80/443). - This value will be combined with a suffix (such as `/api/v1`) to construct the - final URL used in an API request. + This value will be combined with a suffix (such as `/api/v1`) to construct the + final URL used in an API request. - _Default Behavior_ + _Default Behavior_ - In most cases, `flyteconsole` will be hosted in the same cluster as the Admin - API, meaning that the domain used to access the console is the same value used to - access the API. For this reason, if no value is set for `ADMIN_API_URL`, the - default behavior is to use the value of `window.location.origin`. + In most cases, `flyteconsole` will be hosted in the same cluster as the Admin + API, meaning that the domain used to access the console is the same value used to + access the API. For this reason, if no value is set for `ADMIN_API_URL`, the + default behavior is to use the value of `window.location.origin`. -- `BASE_URL` (default: `undefined`) +- `BASE_URL` (default: `undefined`) - This setting allows running the console at a prefix on the target host. This is - necessary when hosting the API and console on the same domain (with prefixes of - `/api/v1` and `/console` for example). For local development, this is - usually not needed, so the default behavior is to run without a prefix. + This setting allows running the console at a prefix on the target host. This is + necessary when hosting the API and console on the same domain (with prefixes of + `/api/v1` and `/console` for example). For local development, this is + usually not needed, so the default behavior is to run without a prefix. -- `FLYTE_NAVIGATION` (default: `undefined`) - UI related. Allows you to change colors of the navigation bar and add links - to other internal pages or external sites. **[More info](packages/zapp/console/src/components/Navigation/Readme.md)** +- `FLYTE_NAVIGATION` (default: `undefined`) + UI related. Allows you to change colors of the navigation bar and add links + to other internal pages or external sites. **[More info](packages/console/src/components/Navigation/Readme.md)** ### Running from docker image as localhost @@ -140,75 +140,75 @@ at http://localhost:3000 (if using the default port). ### 🎱 Using items in your own application -- Authorize your app to call flyte admin api. **[More info](packages/plugins/flyte-api/README.md)** +- Authorize your app to call flyte admin api. **[More info](packages/flyte-api/README.md)** ## 🛠 Development For continious development we are using: -- **[Protobuf and Debug Output](CONTRIBUTING.md#protobuf-and-debug-output)**. - Protobuf is a binary response/request format, which makes _Network Tab_ hardly useful. - To get more info on requests - use our Debug Output -- **[Storybook](CONTRIBUTING.md#storybook)** - \- used for component stories and base UI testing. +- **[Protobuf and Debug Output](CONTRIBUTING.md#protobuf-and-debug-output)**. + Protobuf is a binary response/request format, which makes _Network Tab_ hardly useful. + To get more info on requests - use our Debug Output +- **[Storybook](CONTRIBUTING.md#storybook)** + \- used for component stories and base UI testing. -- **[Feature flags](CONTRIBUTING.md#feature-flags)** - \- allows to enable/disable specific code paths. Used to simplify continious development. +- **[Feature flags](CONTRIBUTING.md#feature-flags)** + \- allows to enable/disable specific code paths. Used to simplify continious development. -- **[Google Analytics](CONTRIBUTING.md#google-analytics)** - \- adds tracking code to the app or website. To disable use `ENABLE_GA=false` +- **[Google Analytics](CONTRIBUTING.md#google-analytics)** + \- adds tracking code to the app or website. To disable use `ENABLE_GA=false` More info on each section could be found at [CONTRIBUTING.md](CONTRIBUTING.md) -- Set `ADMIN_API_URL` and `ADMIN_API_USE_SSL` +- Set `ADMIN_API_URL` and `ADMIN_API_USE_SSL` - ```bash - export ADMIN_API_URL=https://different.admin.service.com - export ADMIN_API_USE_SSL="https" - export LOCAL_DEV_HOST=localhost.different.admin.service.com - ``` + ```bash + export ADMIN_API_URL=https://different.admin.service.com + export ADMIN_API_USE_SSL="https" + export LOCAL_DEV_HOST=localhost.different.admin.service.com + ``` - > **Hint:** Add these to your local profile (eg, `./profile`) to prevent having to do this step each time + > **Hint:** Add these to your local profile (eg, `./profile`) to prevent having to do this step each time -- Generate SSL certificate +- Generate SSL certificate - Run the following command from your `flyteconsole` directory + Run the following command from your `flyteconsole` directory - ```bash - make generate_ssl - ``` + ```bash + make generate_ssl + ``` -- Add new record to hosts file +- Add new record to hosts file - ```bash - sudo vim /etc/hosts - ``` + ```bash + sudo vim /etc/hosts + ``` - Add the following record + Add the following record - ```bash - 127.0.0.1 localhost.different.admin.service.com - ``` + ```bash + 127.0.0.1 localhost.different.admin.service.com + ``` -- Install Chrome plugin: [Moesif Origin & CORS Changer](https://chrome.google.com/webstore/detail/moesif-origin-cors-change/digfbfaphojjndkpccljibejjbppifbc) +- Install Chrome plugin: [Moesif Origin & CORS Changer](https://chrome.google.com/webstore/detail/moesif-origin-cors-change/digfbfaphojjndkpccljibejjbppifbc) - > _NOTE:_ - > - > 1. Activate plugin (toggle to "on") - > 1. Open 'Advanced Settings': - > - > - set `Access-Control-Allow-Credentials`: `true` - > - set `Domain List`: `your.localhost.com` + > _NOTE:_ + > + > 1. Activate plugin (toggle to "on") + > 1. Open 'Advanced Settings': + > + > - set `Access-Control-Allow-Credentials`: `true` + > - set `Domain List`: `your.localhost.com` -- Start `flyteconsole` +- Start `flyteconsole` - ```bash - yarn start - ``` + ```bash + yarn start + ``` - Your new localhost is [localhost.different.admin.service.com](http://localhost.different.admin.service.com) + Your new localhost is [localhost.different.admin.service.com](http://localhost.different.admin.service.com) - > **Hint:** Ensure you don't have `ADMIN_API_URL` set (eg, in your `/.profile`.) + > **Hint:** Ensure you don't have `ADMIN_API_URL` set (eg, in your `/.profile`.) ## ⛳️ Release From d417ce55803d00c113521b4908413990ffe5a3b2 Mon Sep 17 00:00:00 2001 From: james-union <105876962+james-union@users.noreply.github.com> Date: Tue, 7 Mar 2023 11:52:30 -0500 Subject: [PATCH 13/34] Mapped Tasks not showing cache status correctly. (#712) * fix: cache status logs indexing mismatch and react rendering cycle issue Signed-off-by: James * fix: mapped task cache status Signed-off-by: James --------- Signed-off-by: James Co-authored-by: Carina Ursu Signed-off-by: 4nalog <4nalog@protonmail.com> --- .../MapTaskExecutionsList/TaskNameList.tsx | 34 +++++++++++-------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/packages/console/src/components/common/MapTaskExecutionsList/TaskNameList.tsx b/packages/console/src/components/common/MapTaskExecutionsList/TaskNameList.tsx index cadf4a7ba..4d2dd4984 100644 --- a/packages/console/src/components/common/MapTaskExecutionsList/TaskNameList.tsx +++ b/packages/console/src/components/common/MapTaskExecutionsList/TaskNameList.tsx @@ -8,17 +8,19 @@ import { noLogsFoundString } from 'components/Executions/constants'; import { CacheStatus } from 'components/Executions/CacheStatus'; import { useCommonStyles } from '../styles'; -interface StyleProps { - isLink: boolean; -} - const useStyles = makeStyles((_theme: Theme) => ({ - taskTitle: ({ isLink }: StyleProps) => ({ - cursor: isLink ? 'pointer' : 'default', + taskTitle: { + cursor: 'default', '&:hover': { - textDecoration: isLink ? 'underline' : 'none', + textDecoration: 'none', }, - }), + }, + taskTitleLink: { + cursor: 'pointer', + '&:hover': { + textDecoration: 'underline', + }, + }, })); interface TaskNameListProps { @@ -33,6 +35,7 @@ export const TaskNameList = ({ onTaskSelected, }: TaskNameListProps) => { const commonStyles = useCommonStyles(); + const styles = useStyles(); if (logs.length === 0) { return {noLogsFoundString}; @@ -41,16 +44,17 @@ export const TaskNameList = ({ return ( <> {logs.map((log, taskIndex) => { - const styles = useStyles({ isLink: !!log.uri }); const taskLogName = getTaskLogName( taskExecution.id.taskId.name, log.name ?? '', ); + const cacheStatus = - taskIndex != null - ? taskExecution.closure?.metadata?.externalResources?.[taskIndex] - ?.cacheStatus - : null; + taskExecution.closure?.metadata?.externalResources?.find( + item => + item.externalId === log.name || + !!item.logs?.find(l => l.name === log.name), + )?.cacheStatus; const handleClick = () => { onTaskSelected({ ...taskExecution, taskIndex }); @@ -62,13 +66,13 @@ export const TaskNameList = ({ display: 'flex', alignItems: 'center', }} + key={taskLogName} > {taskLogName} From e08f7e4bf3eeb531b6200164b38362303c4c97ac Mon Sep 17 00:00:00 2001 From: Carina Ursu Date: Tue, 7 Mar 2023 08:53:01 -0800 Subject: [PATCH 14/34] fix: cleanup, passthrough runtime variables (#710) fix: passthrough runtime variables Signed-off-by: Carina Ursu Signed-off-by: 4nalog <4nalog@protonmail.com> --- Dockerfile | 13 +------------ package.json | 3 +-- website/package.json | 2 +- website/src/server/index.ts | 11 ++++++++--- website/webpack.config.ts | 2 -- website/webpack.utilities.ts | 15 +-------------- yarn.lock | 8 -------- 7 files changed, 12 insertions(+), 42 deletions(-) diff --git a/Dockerfile b/Dockerfile index fd3b89c57..58127cd42 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,23 +13,12 @@ COPY . /my-project/ RUN : \ --mount=type=cache,target=/root/.yarn \ # install production dependencies - && yarn workspaces focus @flyteconsole/client-app --production \ - # move the production dependencies to the /app folder - && mkdir /app \ - && rm -rf node_modules/@flyteorg \ - && cp -R node_modules /app - -RUN : \ - --mount=type=cache,target=/root/.yarn \ - # install all dependencies so we can build && yarn workspaces focus --all --production \ && yarn build:types \ && BASE_URL=/console yarn run build:prod \ + && mkdir /app \ && cp -R ./website/dist/* /app -RUN rm -rf /app/node_modules -RUN rm -f /app/client-stats.json - FROM gcr.io/distroless/nodejs LABEL org.opencontainers.image.source https://github.com/flyteorg/flyteconsole diff --git a/package.json b/package.json index 1be3af05c..08f1a1bdb 100644 --- a/package.json +++ b/package.json @@ -91,8 +91,7 @@ "webpack-cli": "^4.10.0", "webpack-dev-server": "^4.7.4", "webpack-merge": "^5.8.0", - "webpack-node-externals": "^3.0.0", - "webpack-stats-plugin": "^1.1.1" + "webpack-node-externals": "^3.0.0" }, "devDependencies": { "@babel/core": "~7.16.12", diff --git a/website/package.json b/website/package.json index 7fac358a1..2a84ca37f 100644 --- a/website/package.json +++ b/website/package.json @@ -14,7 +14,7 @@ "build": "TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\"}' NODE_ENV=development run -T webpack --config webpack.config.ts --mode=development --progress", "build:prod": "TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\"}' NODE_ENV=production run -T webpack --config webpack.config.ts --mode=production --progress", "start": "NODE_ENV=development run -T webpack serve --config webpack.config.ts --mode=development", - "start:prod": "NODE_ENV=production node -r dotenv/config dist/server.js", + "start:prod": "NODE_ENV=production node dist/server.js", "lint": "run -T eslint . --ext .js,.jsx,.ts,.tsx", "format": "run -T prettier --ignore-path .eslintignore --write \"**/*.+(js|jsx|ts|tsx|json)\"", "fix": "yarn lint --fix && yarn format", diff --git a/website/src/server/index.ts b/website/src/server/index.ts index e58044a0a..12aa2c5f6 100644 --- a/website/src/server/index.ts +++ b/website/src/server/index.ts @@ -13,11 +13,12 @@ import { applyMiddleware } from './plugins'; import env from '../../env'; const expressStaticGzip = require('express-static-gzip'); +const dotenv = require('dotenv'); -console.log(env); +// configure runtime env variables +dotenv.config(); const PORT = process.env.PORT || 3000; - const app = express(); // Enable logging for HTTP access @@ -45,6 +46,11 @@ const showEntryPointUrl = () => { env.LOCAL_DEV_HOST || env.ADMIN_API_URL?.replace('https', '') }:${PORT}${env.BASE_URL}`; + console.log( + chalk.green(`App started with the following config:`), + chalk.white(JSON.stringify(env, null, 2)), + ); + // Open a new browser tab if in development if (env.NODE_ENV === 'development') { // eslint-disable-next-line global-require @@ -77,7 +83,6 @@ if (env.ADMIN_API_USE_SSL === 'https') { app, ) .listen(PORT, showEntryPointUrl); - console.log(`Server started with SSL: https://localhost:${PORT}/`); } else { server = app.listen(PORT, showEntryPointUrl); } diff --git a/website/webpack.config.ts b/website/webpack.config.ts index b2f5e3373..b2d383386 100644 --- a/website/webpack.config.ts +++ b/website/webpack.config.ts @@ -14,7 +14,6 @@ import { WEBPACK_PATHS, getConfigFile, getDefinePlugin, - statsWriterPlugin, resolveOptions, getModuleOptions, getShouldLoadReactFromCDN, @@ -89,7 +88,6 @@ module.exports = (_env: any, argv: { mode: Mode }) => { module: getModuleOptions(mode), plugins: [ - statsWriterPlugin, getDefinePlugin(false), new NodePolyfillPlugin({ includeAliases: ['http', 'https', 'stream', 'zlib'], diff --git a/website/webpack.utilities.ts b/website/webpack.utilities.ts index 002d85320..6a826e025 100644 --- a/website/webpack.utilities.ts +++ b/website/webpack.utilities.ts @@ -14,7 +14,6 @@ import { } from './env'; const fs = require('fs'); -const { StatsWriterPlugin } = require('webpack-stats-plugin'); export type Mode = 'development' | 'production'; @@ -112,7 +111,7 @@ export const logWebpackStats = (mode: Mode) => { ); console.log(chalk.blue('Public path:'), chalk.green(publicPath)); console.log( - chalk.yellow('TSconfig file used for build:'), + chalk.blue('TSconfig file used for build:'), chalk.green(getConfigFile(mode)), ); }; @@ -134,18 +133,6 @@ export function absoluteVersion(version: string) { ************************************************************************************** ************************************************************************************** */ -/** Write client stats to a JSON file for production */ -export const statsWriterPlugin = new StatsWriterPlugin({ - filename: 'client-stats.json', - fields: [ - 'chunks', - 'publicPath', - 'assets', - 'assetsByChunkName', - 'assetsByChunkId', - ], -}); - /** Limit server chunks to be only one. No need to split code in server */ export const LimitChunksPlugin = new webpack.optimize.LimitChunkCountPlugin({ maxChunks: 1, diff --git a/yarn.lock b/yarn.lock index e379e9ace..e88032bea 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11649,7 +11649,6 @@ __metadata: webpack-dev-server: ^4.7.4 webpack-merge: ^5.8.0 webpack-node-externals: ^3.0.0 - webpack-stats-plugin: ^1.1.1 languageName: unknown linkType: soft @@ -22475,13 +22474,6 @@ __metadata: languageName: node linkType: hard -"webpack-stats-plugin@npm:^1.1.1": - version: 1.1.1 - resolution: "webpack-stats-plugin@npm:1.1.1" - checksum: aa553ccfb9389f2d8a2d04eb6289230bc323edb11b0cbdd676d41617dd790a7f0d0844c46b927a9465139b3edb9da2cc7a2ef664891920c052ef4fa5f2797230 - languageName: node - linkType: hard - "webpack-virtual-modules@npm:^0.2.2": version: 0.2.2 resolution: "webpack-virtual-modules@npm:0.2.2" From 19895c547d1a1081dd6d454e243124bd87605ca7 Mon Sep 17 00:00:00 2001 From: Carina Ursu Date: Tue, 7 Mar 2023 13:15:22 -0800 Subject: [PATCH 15/34] fix: update_npmversion (#713) Signed-off-by: Carina Ursu Signed-off-by: 4nalog <4nalog@protonmail.com> --- Makefile | 7 ++++--- website/package.json | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 136020c79..c205846ae 100644 --- a/Makefile +++ b/Makefile @@ -49,9 +49,10 @@ test_unit_codecov: generate_ssl: ./script/generate_ssl.sh -PLACEHOLDER_NPM := \"version\": \"0.0.0-develop\" +PLACEHOLDER_NPM := "version": "0.0.0-develop" .PHONY: update_npmversion update_npmversion: - grep "$(PLACEHOLDER_NPM)" "website/package.json" - sed -i "s/$(PLACEHOLDER_NPM)/\"version\": \"${VERSION}\"/g" "website/package.json" + echo "Updating client-app version to: $(VERSION)" + grep '$(PLACEHOLDER_NPM)' website/package.json + sed -i '' 's/$(PLACEHOLDER_NPM)/"version": "$(VERSION)"/g' website/package.json diff --git a/website/package.json b/website/package.json index 2a84ca37f..4d2a22b6f 100644 --- a/website/package.json +++ b/website/package.json @@ -1,6 +1,6 @@ { "name": "@flyteconsole/client-app", - "version": "2.0.0", + "version": "0.0.0-develop", "description": "The web UI for the Flyte platform", "private": true, "repository": { From e78a1060054c96602c4c5a9d9845e950575ebb2a Mon Sep 17 00:00:00 2001 From: Carina Ursu Date: Wed, 8 Mar 2023 10:36:42 -0800 Subject: [PATCH 16/34] fix: fix sed makefile error (#714) Signed-off-by: Carina Ursu Signed-off-by: 4nalog <4nalog@protonmail.com> --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c205846ae..b8be0f95f 100644 --- a/Makefile +++ b/Makefile @@ -55,4 +55,4 @@ PLACEHOLDER_NPM := "version": "0.0.0-develop" update_npmversion: echo "Updating client-app version to: $(VERSION)" grep '$(PLACEHOLDER_NPM)' website/package.json - sed -i '' 's/$(PLACEHOLDER_NPM)/"version": "$(VERSION)"/g' website/package.json + sed -i 's/$(PLACEHOLDER_NPM)/"version": "$(VERSION)"/g' website/package.json From c9700bab82c5daac0bed423dcbe31ed09f9bfc0c Mon Sep 17 00:00:00 2001 From: james-union <105876962+james-union@users.noreply.github.com> Date: Thu, 9 Mar 2023 10:59:15 -0500 Subject: [PATCH 17/34] FE: Update flyteconsole to Node 18 (#717) fix: nodejs 18 upgrade Signed-off-by: James Signed-off-by: 4nalog <4nalog@protonmail.com> --- .github/workflows/checks.yml | 4 ++-- .tool-versions | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 2a59db501..d1973a60d 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -31,7 +31,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-node@v2 with: - node-version: 16 + node-version: 18 - uses: bahmutov/npm-install@v1 - name: Run tests and generate coverage run: make test_unit_codecov @@ -46,7 +46,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: - node-version: 16 + node-version: 18 - uses: bahmutov/npm-install@v1 - name: Run linter run: make lint diff --git a/.tool-versions b/.tool-versions index 72d3eae28..18de0230f 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,2 +1,2 @@ -nodejs 16.18.0 +nodejs 18.1.0 yarn 3.2.1 From c37050bd5ad652efa088842bd7030021b9c6ed33 Mon Sep 17 00:00:00 2001 From: Carina Ursu Date: Thu, 9 Mar 2023 10:22:20 -0800 Subject: [PATCH 18/34] chore: allow complex workflow names (#715) * chore: allow complex workflow names Signed-off-by: Carina Ursu * chore: fix buold:watch Signed-off-by: Carina Ursu * chore: yarn.lock Signed-off-by: Carina Ursu * chore: upgrade package Signed-off-by: Carina Ursu --------- Signed-off-by: Carina Ursu --- Makefile | 7 +- package.json | 1 + packages/console/package.json | 4 +- .../Executions/Tables/EntityVersionsTable.tsx | 2 +- packages/console/src/models/Common/utils.ts | 7 +- packages/console/src/routes/routes.ts | 2 +- website/package.json | 2 +- yarn.lock | 175 ++++++++++-------- 8 files changed, 119 insertions(+), 81 deletions(-) diff --git a/Makefile b/Makefile index b8be0f95f..e82de749e 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ lint: #lints the package for common code smells .PHONY: build_prod build_prod: yarn run clean - make pack + make types BASE_URL=/console yarn run build:prod .PHONY: pack @@ -25,6 +25,11 @@ pack: yarn workspaces focus --production --all yarn run build:pack +.PHONY: types +types: + yarn workspaces focus --production --all + yarn run build:types + # test_unit runs all unit tests .PHONY: test_unit test_unit: diff --git a/package.json b/package.json index 08f1a1bdb..2337c81b7 100644 --- a/package.json +++ b/package.json @@ -84,6 +84,7 @@ "ts-loader": "^9.2.6", "ts-node": "^8.0.2", "tsc-alias": "^1.7.0", + "tsc-watch": "^6.0.0", "tslib": "^2.4.1", "typescript": "^4.9.4", "wait-on": "^6.0.1", diff --git a/packages/console/package.json b/packages/console/package.json index 6583c2605..b7e08bc16 100644 --- a/packages/console/package.json +++ b/packages/console/package.json @@ -1,6 +1,6 @@ { "name": "@flyteorg/console", - "version": "0.0.10", + "version": "0.0.11", "description": "Flyteconsole main app module", "main": "./dist/index.js", "module": "./lib/index.js", @@ -31,7 +31,7 @@ "scripts": { "debug": "NM_DEBUG_LEVEL=2 yarn", "clean": "rm -rf dist && rm -rf lib && rm -rf **.tsbuildinfo || true", - "build:watch": "run -T tsc-watch --noClear -p ./tsconfig.es.build.json --onSuccess \"yarn build\"", + "build:watch": "run -T tsc-watch --noClear -p ./tsconfig.build.es.json --onSuccess \"yarn build\"", "build": "yarn clean && yarn build:esm && yarn build:cjs", "build:esm": "mkdir lib && cp -R src/assets ./lib && run -T tsc --module esnext --project ./tsconfig.build.es.json && run -T tsc-alias -p ./tsconfig.build.es.json", "build:cjs": "mkdir dist && cp -R src/assets ./dist && run -T wait-on ./dist/assets && run -T tsc --project ./tsconfig.build.json && run -T tsc-alias -p ./tsconfig.build.json", diff --git a/packages/console/src/components/Executions/Tables/EntityVersionsTable.tsx b/packages/console/src/components/Executions/Tables/EntityVersionsTable.tsx index dc010698a..e0f347515 100644 --- a/packages/console/src/components/Executions/Tables/EntityVersionsTable.tsx +++ b/packages/console/src/components/Executions/Tables/EntityVersionsTable.tsx @@ -69,7 +69,7 @@ export const EntityVersionsTable: React.FC< state={state} versionView={versionView} onClick={handleClickRow({ ...row.id, resourceType })} - isChecked={entityVersion === row.id.version} + isChecked={decodeURIComponent(entityVersion) === row.id.version} key={`workflow-version-row-${row.id.version}`} /> ); diff --git a/packages/console/src/models/Common/utils.ts b/packages/console/src/models/Common/utils.ts index a7ff53abf..9c005bfd2 100644 --- a/packages/console/src/models/Common/utils.ts +++ b/packages/console/src/models/Common/utils.ts @@ -24,7 +24,12 @@ export function makeIdentifierPath( prefix: string, { project, domain, name, version }: Partial, ) { - const path = takeWhile([project, domain, name, version]).join('/'); + const path = takeWhile([ + project, + domain, + name, + decodeURIComponent(version || ''), + ]).join('/'); return `${prefix}/${path}`; } diff --git a/packages/console/src/routes/routes.ts b/packages/console/src/routes/routes.ts index fb6ca3e65..fa9394231 100644 --- a/packages/console/src/routes/routes.ts +++ b/packages/console/src/routes/routes.ts @@ -107,7 +107,7 @@ export class Routes { makeProjectDomainBoundPath( project, domain, - `/${entityType}/${entityName}/version/${version}`, + `/${entityType}/${entityName}/version/${encodeURIComponent(version)}`, ), path: `${projectDomainBasePath}/:entityType/:entityName/version/:entityVersion`, }; diff --git a/website/package.json b/website/package.json index 4d2a22b6f..2fcd76852 100644 --- a/website/package.json +++ b/website/package.json @@ -37,7 +37,7 @@ }, "dependencies": { "@flyteorg/common": "^0.0.3", - "@flyteorg/console": "^0.0.10", + "@flyteorg/console": "^0.0.11", "long": "^4.0.0", "protobufjs": "~6.11.3", "react-ga4": "^1.4.1", diff --git a/yarn.lock b/yarn.lock index e88032bea..c283330da 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1995,7 +1995,7 @@ __metadata: resolution: "@flyteconsole/client-app@workspace:website" dependencies: "@flyteorg/common": ^0.0.3 - "@flyteorg/console": ^0.0.10 + "@flyteorg/console": ^0.0.11 "@types/long": ^3.0.32 long: ^4.0.0 protobufjs: ~6.11.3 @@ -2034,78 +2034,7 @@ __metadata: languageName: unknown linkType: soft -"@flyteorg/console@npm:^0.0.10": - version: 0.0.10 - resolution: "@flyteorg/console@npm:0.0.10" - dependencies: - "@date-io/moment": 1.3.9 - "@emotion/core": 10.1.1 - "@flyteorg/common": ^0.0.3 - "@flyteorg/components": ^0.0.3 - "@flyteorg/flyte-api": ^0.0.2 - "@flyteorg/flyteidl-types": ^0.0.3 - "@flyteorg/locale": ^0.0.2 - "@flyteorg/ui-atoms": ^0.0.3 - "@material-ui/core": ^4.12.4 - "@material-ui/icons": ^4.11.3 - "@material-ui/pickers": ^3.2.2 - "@rjsf/core": ^5.1.0 - "@rjsf/material-ui": ^5.1.0 - "@rjsf/utils": ^5.1.0 - "@rjsf/validator-ajv8": ^5.1.0 - "@types/d3-shape": ^1.2.6 - "@xstate/react": ^1.0.0 - axios: ^0.27.2 - chart.js: 3.6.2 - chartjs-plugin-datalabels: 2.0.0 - classnames: ^2.3.1 - copy-to-clipboard: ^3.0.8 - cronstrue: ^1.31.0 - d3-dag: ^0.3.4 - d3-shape: ^1.2.2 - dagre: 0.8.5 - dagre-d3: ^0.6.4 - debug: 2.6.9 - dom-helpers: ^3.4.0 - fuzzysort: ^1.1.1 - intersection-observer: ^0.7.0 - js-yaml: ^3.13.1 - linkify-it: ^2.2.0 - lodash: ^4.17.21 - lossless-json: ^1.0.3 - memoize-one: ^5.0.0 - moment: ^2.29.4 - moment-timezone: ^0.5.28 - notistack: ^1.0.10 - object-hash: ^1.3.1 - prop-types: 15.6.0 - query-string: ^6.5.0 - react-chartjs-2: ^4.3.1 - react-dropzone: ^14.2.3 - react-flow-renderer: 10.3.8 - react-ga4: ^1.4.1 - react-intersection-observer: ^8.25.1 - react-json-view: ^1.21.3 - react-loading-skeleton: ^1.1.2 - react-query: 3.3.0 - react-query-devtools: 3.0.0-beta.1 - react-virtualized: ^9.21.1 - shallowequal: ^1.1.0 - url-search-params: ^0.10.0 - xstate: 4.33.6 - peerDependencies: - long: ^4.0.0 - protobufjs: ~6.11.3 - react: ^16.14.0 - react-dom: ^16.14.0 - react-router: ^5.3.4 - react-router-dom: ^5.3.4 - use-react-router: ^1.0.7 - checksum: 4bbde43dc8885a3e98aff2562583a4ad08ddd5d4352fdc25622653b9132dc36f5a50057f6ba2a6e1940c199d5fa81225e61c8a2395c8f834538ffd9de7ed54c9 - languageName: node - linkType: hard - -"@flyteorg/console@workspace:packages/console": +"@flyteorg/console@^0.0.11, @flyteorg/console@workspace:packages/console": version: 0.0.0-use.local resolution: "@flyteorg/console@workspace:packages/console" dependencies: @@ -10279,6 +10208,13 @@ __metadata: languageName: node linkType: hard +"duplexer@npm:~0.1.1": + version: 0.1.2 + resolution: "duplexer@npm:0.1.2" + checksum: 62ba61a830c56801db28ff6305c7d289b6dc9f859054e8c982abd8ee0b0a14d2e9a8e7d086ffee12e868d43e2bbe8a964be55ddbd8c8957714c87373c7a4f9b0 + languageName: node + linkType: hard + "duplexify@npm:^3.4.2, duplexify@npm:^3.6.0": version: 3.7.1 resolution: "duplexify@npm:3.7.1" @@ -10972,6 +10908,21 @@ __metadata: languageName: node linkType: hard +"event-stream@npm:=3.3.4": + version: 3.3.4 + resolution: "event-stream@npm:3.3.4" + dependencies: + duplexer: ~0.1.1 + from: ~0 + map-stream: ~0.1.0 + pause-stream: 0.0.11 + split: 0.3 + stream-combiner: ~0.0.4 + through: ~2.3.1 + checksum: 80b467820b6daf824d9fb4345d2daf115a056e5c104463f2e98534e92d196a27f2df5ea2aa085624db26f4c45698905499e881d13bc7c01f7a13eac85be72a22 + languageName: node + linkType: hard + "event-target-shim@npm:^5.0.0": version: 5.0.1 resolution: "event-target-shim@npm:5.0.1" @@ -11641,6 +11592,7 @@ __metadata: ts-loader: ^9.2.6 ts-node: ^8.0.2 tsc-alias: ^1.7.0 + tsc-watch: ^6.0.0 tslib: ^2.4.1 typescript: ^4.9.4 wait-on: ^6.0.1 @@ -11825,6 +11777,13 @@ __metadata: languageName: node linkType: hard +"from@npm:~0": + version: 0.1.7 + resolution: "from@npm:0.1.7" + checksum: b85125b7890489656eb2e4f208f7654a93ec26e3aefaf3bbbcc0d496fc1941e4405834fcc9fe7333192aa2187905510ace70417bbf9ac6f6f4784a731d986939 + languageName: node + linkType: hard + "fs-extra@npm:^10.0.0, fs-extra@npm:^10.1.0": version: 10.1.0 resolution: "fs-extra@npm:10.1.0" @@ -15616,6 +15575,13 @@ __metadata: languageName: node linkType: hard +"map-stream@npm:~0.1.0": + version: 0.1.0 + resolution: "map-stream@npm:0.1.0" + checksum: 38abbe4eb883888031e6b2fc0630bc583c99396be16b8ace5794b937b682a8a081f03e8b15bfd4914d1bc88318f0e9ac73ba3512ae65955cd449f63256ddb31d + languageName: node + linkType: hard + "map-visit@npm:^1.0.0": version: 1.0.0 resolution: "map-visit@npm:1.0.0" @@ -16408,6 +16374,13 @@ __metadata: languageName: node linkType: hard +"node-cleanup@npm:^2.1.2": + version: 2.1.2 + resolution: "node-cleanup@npm:2.1.2" + checksum: 584cdc3e42560a998b4579f91ed8f936b27011628f3102e5a1093205f0691cdf8d899287d1f2e4d2071ea4ab1d615810bad6dbe2b988ef173a1cbaa76d8165b3 + languageName: node + linkType: hard + "node-dir@npm:^0.1.10": version: 0.1.17 resolution: "node-dir@npm:0.1.17" @@ -17654,6 +17627,15 @@ __metadata: languageName: node linkType: hard +"pause-stream@npm:0.0.11": + version: 0.0.11 + resolution: "pause-stream@npm:0.0.11" + dependencies: + through: ~2.3 + checksum: 3c4a14052a638b92e0c96eb00c0d7977df7f79ea28395250c525d197f1fc02d34ce1165d5362e2e6ebbb251524b94a76f3f0d4abc39ab8b016d97449fe15583c + languageName: node + linkType: hard + "pbkdf2@npm:^3.0.3": version: 3.1.2 resolution: "pbkdf2@npm:3.1.2" @@ -18227,6 +18209,17 @@ __metadata: languageName: node linkType: hard +"ps-tree@npm:^1.2.0": + version: 1.2.0 + resolution: "ps-tree@npm:1.2.0" + dependencies: + event-stream: =3.3.4 + bin: + ps-tree: ./bin/ps-tree.js + checksum: e635dd00f53d30d31696cf5f95b3a8dbdf9b1aeb36d4391578ce8e8cd22949b7c5536c73b0dc18c78615ea3ddd4be96101166be59ca2e3e3cb1e2f79ba3c7f98 + languageName: node + linkType: hard + "psl@npm:^1.1.33": version: 1.9.0 resolution: "psl@npm:1.9.0" @@ -20243,6 +20236,15 @@ __metadata: languageName: node linkType: hard +"split@npm:0.3": + version: 0.3.3 + resolution: "split@npm:0.3.3" + dependencies: + through: 2 + checksum: 2e076634c9637cfdc54ab4387b6a243b8c33b360874a25adf6f327a5647f07cb3bf1c755d515248eb3afee4e382278d01f62c62d87263c118f28065b86f74f02 + languageName: node + linkType: hard + "split@npm:^1.0.0": version: 1.0.1 resolution: "split@npm:1.0.1" @@ -20376,6 +20378,15 @@ __metadata: languageName: node linkType: hard +"stream-combiner@npm:~0.0.4": + version: 0.0.4 + resolution: "stream-combiner@npm:0.0.4" + dependencies: + duplexer: ~0.1.1 + checksum: 844b622cfe8b9de45a6007404f613b60aaf85200ab9862299066204242f89a7c8033b1c356c998aa6cfc630f6cd9eba119ec1c6dc1f93e245982be4a847aee7d + languageName: node + linkType: hard + "stream-each@npm:^1.1.0": version: 1.2.3 resolution: "stream-each@npm:1.2.3" @@ -20962,7 +20973,7 @@ __metadata: languageName: node linkType: hard -"through@npm:2, through@npm:>=2.2.7 <3, through@npm:^2.3.8": +"through@npm:2, through@npm:>=2.2.7 <3, through@npm:^2.3.8, through@npm:~2.3, through@npm:~2.3.1": version: 2.3.8 resolution: "through@npm:2.3.8" checksum: a38c3e059853c494af95d50c072b83f8b676a9ba2818dcc5b108ef252230735c54e0185437618596c790bbba8fcdaef5b290405981ffa09dce67b1f1bf190cbd @@ -21280,6 +21291,22 @@ __metadata: languageName: node linkType: hard +"tsc-watch@npm:^6.0.0": + version: 6.0.0 + resolution: "tsc-watch@npm:6.0.0" + dependencies: + cross-spawn: ^7.0.3 + node-cleanup: ^2.1.2 + ps-tree: ^1.2.0 + string-argv: ^0.3.1 + peerDependencies: + typescript: "*" + bin: + tsc-watch: dist/lib/tsc-watch.js + checksum: 34e74a703ecb28689d0f6ba311781ff68be47f5f095439654b095f3ea4a5921708fca61b5727e33527639a9a147b42d10bc3fe3595afee92b41b2bacfba06043 + languageName: node + linkType: hard + "tsconfig-paths@npm:^3.14.1": version: 3.14.1 resolution: "tsconfig-paths@npm:3.14.1" From c36e80a4e312c2c0ecfb798046405c3b7fbc51bf Mon Sep 17 00:00:00 2001 From: Carina Ursu Date: Thu, 9 Mar 2023 11:54:48 -0800 Subject: [PATCH 19/34] chore: show correct app version in info (#716) * chore: show correct app version in info Signed-off-by: Carina Ursu * chore: update ver Signed-off-by: Carina Ursu --------- Signed-off-by: Carina Ursu Signed-off-by: 4nalog <4nalog@protonmail.com> --- packages/console/package.json | 2 +- .../Navigation/DefaultAppBarContent.tsx | 24 ++++++++++++++++--- .../src/components/Navigation/NavBar.tsx | 20 +++++++++------- .../src/components/Navigation/strings.ts | 1 + website/package.json | 2 +- yarn.lock | 4 ++-- 6 files changed, 38 insertions(+), 15 deletions(-) diff --git a/packages/console/package.json b/packages/console/package.json index b7e08bc16..25a04b341 100644 --- a/packages/console/package.json +++ b/packages/console/package.json @@ -1,6 +1,6 @@ { "name": "@flyteorg/console", - "version": "0.0.11", + "version": "0.0.12", "description": "Flyteconsole main app module", "main": "./dist/index.js", "module": "./lib/index.js", diff --git a/packages/console/src/components/Navigation/DefaultAppBarContent.tsx b/packages/console/src/components/Navigation/DefaultAppBarContent.tsx index 1b1bb1550..452a73460 100644 --- a/packages/console/src/components/Navigation/DefaultAppBarContent.tsx +++ b/packages/console/src/components/Navigation/DefaultAppBarContent.tsx @@ -1,9 +1,9 @@ +import * as React from 'react'; import { makeStyles, Theme } from '@material-ui/core/styles'; import classnames from 'classnames'; import { AppInfo, VersionInfo } from '@flyteorg/components'; import { FlyteLogo } from '@flyteorg/ui-atoms'; import { useCommonStyles } from 'components/common/styles'; -import * as React from 'react'; import { Link } from 'react-router-dom'; import { Routes } from 'routes/routes'; import { FeatureFlag, useFeatureFlag } from 'basics/FeatureFlags'; @@ -15,8 +15,6 @@ import { OnlyMine } from './OnlyMine'; import { FlyteNavItem } from './utils'; import t, { patternKey } from './strings'; -const { version: platformVersion } = require('../../../package.json'); - const useStyles = makeStyles((theme: Theme) => ({ spacer: { flexGrow: 1, @@ -33,6 +31,8 @@ interface DefaultAppBarProps { /** Renders the default content for the app bar, which is the logo and help links */ export const DefaultAppBarContent = (props: DefaultAppBarProps) => { + const [platformVersion, setPlatformVersion] = React.useState(''); + const [consoleVersion, setConsoleVersion] = React.useState(''); const commonStyles = useCommonStyles(); const styles = useStyles(); @@ -40,12 +40,28 @@ export const DefaultAppBarContent = (props: DefaultAppBarProps) => { const { adminVersion } = useAdminVersion(); const isGAEnabled = env.ENABLE_GA === 'true' && env.GA_TRACKING_ID !== ''; + React.useEffect(() => { + try { + const { version } = require('../../../../../website/package.json'); + const { version: packageVersion } = require('../../../package.json'); + + setPlatformVersion(version); + setConsoleVersion(packageVersion); + } catch { + /* no-op */ + } + }, []); const versions: VersionInfo[] = [ { name: t('versionConsoleUi'), version: platformVersion, url: `https://github.com/flyteorg/flyteconsole/releases/tag/v${platformVersion}`, }, + { + name: t('versionConsolePackage'), + version: consoleVersion, + url: `https://github.com/flyteorg/flyteconsole/tree/master/packages/console`, + }, { name: t('versionAdmin'), version: adminVersion, @@ -81,3 +97,5 @@ export const DefaultAppBarContent = (props: DefaultAppBarProps) => { ); }; + +export default DefaultAppBarContent; diff --git a/packages/console/src/components/Navigation/NavBar.tsx b/packages/console/src/components/Navigation/NavBar.tsx index 4316699b9..8bb17ef96 100644 --- a/packages/console/src/components/Navigation/NavBar.tsx +++ b/packages/console/src/components/Navigation/NavBar.tsx @@ -1,11 +1,9 @@ +import * as React from 'react'; +import { Suspense, lazy } from 'react'; import AppBar from '@material-ui/core/AppBar'; import Toolbar from '@material-ui/core/Toolbar'; import { navBarContentId } from 'common/constants'; -import { COLOR_SPECTRUM } from 'components/Theme/colorSpectrum'; -import { whiteColor } from 'components/Theme/constants'; import { FlyteNavigation } from '@flyteorg/common'; -import * as React from 'react'; -import { DefaultAppBarContent } from './DefaultAppBarContent'; import { getFlyteNavigationData } from './utils'; export interface NavBarProps { @@ -13,16 +11,20 @@ export interface NavBarProps { navigationData?: FlyteNavigation; } +const DefaultAppBarContent = lazy(() => import('./DefaultAppBarContent')); + /** Contains all content in the top navbar of the application. */ export const NavBar = (props: NavBarProps) => { const navData = props.navigationData ?? getFlyteNavigationData(); const content = props.useCustomContent ? (
) : ( - + + + ); return ( @@ -40,3 +42,5 @@ export const NavBar = (props: NavBarProps) => { ); }; + +export default NavBar; diff --git a/packages/console/src/components/Navigation/strings.ts b/packages/console/src/components/Navigation/strings.ts index f0e809c77..ebc78aeb5 100644 --- a/packages/console/src/components/Navigation/strings.ts +++ b/packages/console/src/components/Navigation/strings.ts @@ -3,6 +3,7 @@ import { createLocalizedString } from '@flyteorg/locale'; const str = { login: 'Login', versionConsoleUi: 'UI Version', + versionConsolePackage: 'Package Version', versionAdmin: 'Admin Version', versionGoogleAnalytics: 'Google Analytics', gaActive_: 'Active', diff --git a/website/package.json b/website/package.json index 2fcd76852..abd65f515 100644 --- a/website/package.json +++ b/website/package.json @@ -37,7 +37,7 @@ }, "dependencies": { "@flyteorg/common": "^0.0.3", - "@flyteorg/console": "^0.0.11", + "@flyteorg/console": "^0.0.12", "long": "^4.0.0", "protobufjs": "~6.11.3", "react-ga4": "^1.4.1", diff --git a/yarn.lock b/yarn.lock index c283330da..24053c01d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1995,7 +1995,7 @@ __metadata: resolution: "@flyteconsole/client-app@workspace:website" dependencies: "@flyteorg/common": ^0.0.3 - "@flyteorg/console": ^0.0.11 + "@flyteorg/console": ^0.0.12 "@types/long": ^3.0.32 long: ^4.0.0 protobufjs: ~6.11.3 @@ -2034,7 +2034,7 @@ __metadata: languageName: unknown linkType: soft -"@flyteorg/console@^0.0.11, @flyteorg/console@workspace:packages/console": +"@flyteorg/console@^0.0.12, @flyteorg/console@workspace:packages/console": version: 0.0.0-use.local resolution: "@flyteorg/console@workspace:packages/console" dependencies: From 997ce2ca1f86579b0a9eb2d43217a279e2a63427 Mon Sep 17 00:00:00 2001 From: Carina Ursu Date: Thu, 9 Mar 2023 12:07:34 -0800 Subject: [PATCH 20/34] fix: left nav doesn't accurately update on workflow version page (#718) Signed-off-by: Carina Ursu Signed-off-by: 4nalog <4nalog@protonmail.com> --- packages/console/package.json | 2 +- .../console/src/components/Tables/PaginatedDataList.tsx | 9 ++++----- packages/console/src/routes/routes.ts | 2 +- website/package.json | 2 +- yarn.lock | 4 ++-- 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/packages/console/package.json b/packages/console/package.json index 25a04b341..f348cf25c 100644 --- a/packages/console/package.json +++ b/packages/console/package.json @@ -1,6 +1,6 @@ { "name": "@flyteorg/console", - "version": "0.0.12", + "version": "0.0.13", "description": "Flyteconsole main app module", "main": "./dist/index.js", "module": "./lib/index.js", diff --git a/packages/console/src/components/Tables/PaginatedDataList.tsx b/packages/console/src/components/Tables/PaginatedDataList.tsx index 7a27cb2ef..50bd00368 100644 --- a/packages/console/src/components/Tables/PaginatedDataList.tsx +++ b/packages/console/src/components/Tables/PaginatedDataList.tsx @@ -115,7 +115,7 @@ const PaginatedDataListHeader = ( className={column.className} key={column.key} align="left" - padding="default" + padding="normal" sortDirection={orderBy === column.key ? order : false} > ({ totalRows, showRadioButton, fillEmptyRows = true, - noDataString, }: PropsWithChildren>) => { const classes = useStyles(); const [order, setOrder] = React.useState('asc'); const [orderBy, setOrderBy] = React.useState('calories'); - const [page, setPage] = React.useState(0); - const [rowsPerPage, setRowsPerPage] = React.useState(5); + const [page] = React.useState(0); + const [rowsPerPage] = React.useState(5); const handleRequestSort = ( event: React.MouseEvent, @@ -198,7 +197,7 @@ const PaginatedDataList = ({ showRadioButton={showRadioButton} /> - {data.map((row, index) => { + {data.map((row, _index) => { return rowRenderer(row); })} {fillEmptyRows && !showRadioButton && emptyRows > 0 && ( diff --git a/packages/console/src/routes/routes.ts b/packages/console/src/routes/routes.ts index fa9394231..7d910a460 100644 --- a/packages/console/src/routes/routes.ts +++ b/packages/console/src/routes/routes.ts @@ -81,7 +81,7 @@ export class Routes { static WorkflowDetails = { makeUrl: (project: string, domain: string, workflowName: string) => makeProjectDomainBoundPath(project, domain, `/workflows/${workflowName}`), - path: `${projectDomainBasePath}/workflows/:workflowName`, + path: `${projectDomainBasePath}/(workflows|workflow)/:workflowName`, }; // LaunchPlans diff --git a/website/package.json b/website/package.json index abd65f515..e90aba2b1 100644 --- a/website/package.json +++ b/website/package.json @@ -37,7 +37,7 @@ }, "dependencies": { "@flyteorg/common": "^0.0.3", - "@flyteorg/console": "^0.0.12", + "@flyteorg/console": "^0.0.13", "long": "^4.0.0", "protobufjs": "~6.11.3", "react-ga4": "^1.4.1", diff --git a/yarn.lock b/yarn.lock index 24053c01d..43c7cf0cd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1995,7 +1995,7 @@ __metadata: resolution: "@flyteconsole/client-app@workspace:website" dependencies: "@flyteorg/common": ^0.0.3 - "@flyteorg/console": ^0.0.12 + "@flyteorg/console": ^0.0.13 "@types/long": ^3.0.32 long: ^4.0.0 protobufjs: ~6.11.3 @@ -2034,7 +2034,7 @@ __metadata: languageName: unknown linkType: soft -"@flyteorg/console@^0.0.12, @flyteorg/console@workspace:packages/console": +"@flyteorg/console@^0.0.13, @flyteorg/console@workspace:packages/console": version: 0.0.0-use.local resolution: "@flyteorg/console@workspace:packages/console" dependencies: From 41a55620f4a2d5d82baec0f6debe7915d79f2ad7 Mon Sep 17 00:00:00 2001 From: james-union <105876962+james-union@users.noreply.github.com> Date: Fri, 10 Mar 2023 17:24:54 -0500 Subject: [PATCH 21/34] feat: differentiate between cache disabled and cache put failure (#719) fix: add icon for put failure Signed-off-by: James Signed-off-by: 4nalog <4nalog@protonmail.com> --- .../console/src/components/Executions/CacheStatus.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/console/src/components/Executions/CacheStatus.tsx b/packages/console/src/components/Executions/CacheStatus.tsx index 9ec6f1255..2772c7054 100644 --- a/packages/console/src/components/Executions/CacheStatus.tsx +++ b/packages/console/src/components/Executions/CacheStatus.tsx @@ -3,6 +3,7 @@ import { makeStyles, Theme } from '@material-ui/core/styles'; import CachedOutlined from '@material-ui/icons/CachedOutlined'; import ErrorOutlined from '@material-ui/icons/ErrorOutlined'; import InfoOutlined from '@material-ui/icons/InfoOutlined'; +import SmsFailedOutlinedIcon from '@material-ui/icons/SmsFailedOutlined'; import classnames from 'classnames'; import { assertNever } from 'common/utils'; import { PublishedWithChangesOutlined } from 'components/common/PublishedWithChanges'; @@ -37,10 +38,14 @@ const NodeExecutionCacheStatusIcon: React.ComponentType< } > = React.forwardRef(({ status, ...props }, ref) => { switch (status) { - case CatalogCacheStatus.CACHE_DISABLED: + case CatalogCacheStatus.CACHE_DISABLED: { + return ; + } case CatalogCacheStatus.CACHE_MISS: case CatalogCacheStatus.CACHE_SKIPPED: { - return ; + return ( + + ); } case CatalogCacheStatus.CACHE_HIT: { return ; From 7035652762afcf89b59d9a9ab472cea73526e901 Mon Sep 17 00:00:00 2001 From: 4nalog <4nalog@protonmail.com> Date: Sat, 11 Mar 2023 04:04:08 +0530 Subject: [PATCH 22/34] chore: fix formatting Signed-off-by: 4nalog <4nalog@protonmail.com> --- .../console/src/components/Launch/LaunchForm/StructInput.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/console/src/components/Launch/LaunchForm/StructInput.tsx b/packages/console/src/components/Launch/LaunchForm/StructInput.tsx index cb8be5f83..f3dbecaf4 100644 --- a/packages/console/src/components/Launch/LaunchForm/StructInput.tsx +++ b/packages/console/src/components/Launch/LaunchForm/StructInput.tsx @@ -29,7 +29,7 @@ muiTheme.typography.h5 = { fontWeight: 400, }; -const formatJson = (data) => { +const formatJson = data => { const keys = Object.keys(data); if (keys.includes('title')) { From 0fab0d7faddf6ff6243a01b72bff9e43e596a8dd Mon Sep 17 00:00:00 2001 From: Carina Ursu Date: Tue, 14 Mar 2023 11:17:16 -0700 Subject: [PATCH 23/34] fix: add material-ui class name seed (#721) * chore: add material-ui class name seed Signed-off-by: Carina Ursu * fix: overflow of modal Signed-off-by: James --------- Signed-off-by: Carina Ursu Signed-off-by: James Co-authored-by: James Signed-off-by: 4nalog <4nalog@protonmail.com> --- packages/components/src/AppInfo/index.tsx | 1 + packages/console/src/components/App/App.tsx | 67 ++++++++++++--------- 2 files changed, 40 insertions(+), 28 deletions(-) diff --git a/packages/components/src/AppInfo/index.tsx b/packages/components/src/AppInfo/index.tsx index 610db00f3..098ab46e8 100644 --- a/packages/components/src/AppInfo/index.tsx +++ b/packages/components/src/AppInfo/index.tsx @@ -31,6 +31,7 @@ const useStyles = makeStyles((theme: Theme) => ({ display: 'flex', flexDirection: 'column', alignItems: 'center', + overflowY: 'initial', }, dialog: { width: `${INFO_WINDOW_WIDTH}px`, diff --git a/packages/console/src/components/App/App.tsx b/packages/console/src/components/App/App.tsx index 37e56c95e..4aa0dd90c 100644 --- a/packages/console/src/components/App/App.tsx +++ b/packages/console/src/components/App/App.tsx @@ -1,6 +1,11 @@ import 'intersection-observer'; import * as React from 'react'; -import { CssBaseline, Collapse } from '@material-ui/core'; +import { + CssBaseline, + Collapse, + StylesProvider, + createGenerateClassName, +} from '@material-ui/core'; import { ThemeProvider } from '@material-ui/styles'; import { FlyteApiProvider } from '@flyteorg/flyte-api'; import { SnackbarProvider } from 'notistack'; @@ -57,34 +62,40 @@ export const AppComponent: React.FC = ( - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + From 45c6386fe1bc0cfaada3050a897e9f63227c916a Mon Sep 17 00:00:00 2001 From: james-union <105876962+james-union@users.noreply.github.com> Date: Tue, 14 Mar 2023 23:02:00 -0400 Subject: [PATCH 24/34] The rendering of node status in a dynamic workflow is not functioning correctly (#723) fix: dynamic nodes status Signed-off-by: James Signed-off-by: 4nalog <4nalog@protonmail.com> --- .../Executions/ExecutionDetails/ExecutionNodeViews.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/console/src/components/Executions/ExecutionDetails/ExecutionNodeViews.tsx b/packages/console/src/components/Executions/ExecutionDetails/ExecutionNodeViews.tsx index e88e90e2b..dc09b04d6 100644 --- a/packages/console/src/components/Executions/ExecutionDetails/ExecutionNodeViews.tsx +++ b/packages/console/src/components/Executions/ExecutionDetails/ExecutionNodeViews.tsx @@ -6,7 +6,7 @@ import { DataError } from 'components/Errors/DataError'; import { useTabState } from 'components/hooks/useTabState'; import { secondaryBackgroundColor } from 'components/Theme/constants'; import { Execution } from 'models/Execution/types'; -import { keyBy } from 'lodash'; +import { clone, keyBy, merge } from 'lodash'; import { LargeLoadingSpinner } from 'components/common/LoadingSpinner'; import { FilterOperation } from 'models/AdminEntity/types'; import { NodeExecutionDetailsContextProvider } from '../contextProvider/NodeExecutionDetails'; @@ -77,7 +77,12 @@ export const ExecutionNodeViews: React.FC = ({ nodeExecutionsQuery.data, 'scopedId', ); - setCurrentNodeExecutionsById(currentNodeExecutionsById); + const prevNodeExecutionsById = clone(nodeExecutionsById); + const newNodeExecutionsById = merge( + prevNodeExecutionsById, + currentNodeExecutionsById, + ); + setCurrentNodeExecutionsById(newNodeExecutionsById); }, [nodeExecutionsQuery.data]); const LoadingComponent = () => { From d5a17a27cd2403dc8c8c1a25faebca419b931d76 Mon Sep 17 00:00:00 2001 From: Carina Ursu Date: Thu, 16 Mar 2023 16:06:45 -0700 Subject: [PATCH 25/34] fix: backfill index on execution task logs (#725) * chore: backfill index on execution task logs Signed-off-by: Carina Ursu * chore: add comments Signed-off-by: Carina Ursu * chore: bump version Signed-off-by: Carina Ursu * chore: remove backfill Signed-off-by: Carina Ursu * chore: lint Signed-off-by: Carina Ursu --------- Signed-off-by: Carina Ursu Signed-off-by: 4nalog <4nalog@protonmail.com> --- packages/console/package.json | 2 +- .../src/components/Executions/TaskExecutionsList/utils.ts | 4 +++- .../common/MapTaskExecutionsList/TaskNameList.tsx | 8 ++++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/console/package.json b/packages/console/package.json index f348cf25c..db5ad95bf 100644 --- a/packages/console/package.json +++ b/packages/console/package.json @@ -1,6 +1,6 @@ { "name": "@flyteorg/console", - "version": "0.0.13", + "version": "0.0.14", "description": "Flyteconsole main app module", "main": "./dist/index.js", "module": "./lib/index.js", diff --git a/packages/console/src/components/Executions/TaskExecutionsList/utils.ts b/packages/console/src/components/Executions/TaskExecutionsList/utils.ts index 0f06b11c3..f12397eed 100644 --- a/packages/console/src/components/Executions/TaskExecutionsList/utils.ts +++ b/packages/console/src/components/Executions/TaskExecutionsList/utils.ts @@ -65,7 +65,9 @@ export const getGroupedLogs = ( // if there is no log with active url, just create an item with externalId, // for user to understand which array items are in this state const newLogs = - item.logs.length > 0 ? item.logs : [{ name: item.externalId }]; + item.logs.length > 0 + ? item.logs.map(l => ({ ...l, index: item.index })) + : [{ name: item.externalId, index: item.index }]; logsByPhase.set( phase, currentValue ? [...currentValue, ...newLogs] : [...newLogs], diff --git a/packages/console/src/components/common/MapTaskExecutionsList/TaskNameList.tsx b/packages/console/src/components/common/MapTaskExecutionsList/TaskNameList.tsx index 4d2dd4984..fd7ce0461 100644 --- a/packages/console/src/components/common/MapTaskExecutionsList/TaskNameList.tsx +++ b/packages/console/src/components/common/MapTaskExecutionsList/TaskNameList.tsx @@ -43,7 +43,7 @@ export const TaskNameList = ({ return ( <> - {logs.map((log, taskIndex) => { + {logs.map((log, _taskIndex) => { const taskLogName = getTaskLogName( taskExecution.id.taskId.name, log.name ?? '', @@ -57,7 +57,11 @@ export const TaskNameList = ({ )?.cacheStatus; const handleClick = () => { - onTaskSelected({ ...taskExecution, taskIndex }); + // Use the resource's index instead of the log index + onTaskSelected({ + ...taskExecution, + taskIndex: (log as any).index || 0, + }); }; return ( From 7d2b69f82a3c381f0e6338776146af1ff84e2d57 Mon Sep 17 00:00:00 2001 From: Carina Ursu Date: Fri, 17 Mar 2023 10:14:15 -0700 Subject: [PATCH 26/34] fix: release fail (#726) Signed-off-by: Carina Ursu Signed-off-by: 4nalog <4nalog@protonmail.com> --- .github/workflows/checks.yml | 16 ++++++++-------- .github/workflows/upgrade_automation.yml | 3 +-- website/package.json | 2 +- yarn.lock | 4 ++-- 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index d1973a60d..cb017896c 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -25,11 +25,11 @@ jobs: unit_tests_with_coverage: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: # We need history for codecov to work correctly fetch-depth: 0 - - uses: actions/setup-node@v2 + - uses: actions/setup-node@v3 with: node-version: 18 - uses: bahmutov/npm-install@v1 @@ -43,8 +43,8 @@ jobs: lint_project: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 with: node-version: 18 - uses: bahmutov/npm-install@v1 @@ -76,13 +76,13 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup Node.js - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: 18 - name: Install dependencies - run: yarn install --frozen-lockfile + run: yarn install --immutable - name: Release env: GITHUB_TOKEN: ${{ secrets.FLYTE_BOT_PAT }} @@ -99,7 +99,7 @@ jobs: outputs: currentTag: ${{ steps.setTag.outputs.currentTag }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: # Use the latest commit on the branch which triggered this workflow, # not the commit which triggered the workflow diff --git a/.github/workflows/upgrade_automation.yml b/.github/workflows/upgrade_automation.yml index 763fd73b0..d63f34ec9 100644 --- a/.github/workflows/upgrade_automation.yml +++ b/.github/workflows/upgrade_automation.yml @@ -26,7 +26,7 @@ jobs: runs-on: ubuntu-latest if: ${{ github.event.inputs.component == 'flyteidl' }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: "0" - name: Set up Go @@ -58,4 +58,3 @@ jobs: owners maintainers draft: false - diff --git a/website/package.json b/website/package.json index e90aba2b1..f77846c17 100644 --- a/website/package.json +++ b/website/package.json @@ -37,7 +37,7 @@ }, "dependencies": { "@flyteorg/common": "^0.0.3", - "@flyteorg/console": "^0.0.13", + "@flyteorg/console": "^0.0.14", "long": "^4.0.0", "protobufjs": "~6.11.3", "react-ga4": "^1.4.1", diff --git a/yarn.lock b/yarn.lock index 43c7cf0cd..9e9a32076 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1995,7 +1995,7 @@ __metadata: resolution: "@flyteconsole/client-app@workspace:website" dependencies: "@flyteorg/common": ^0.0.3 - "@flyteorg/console": ^0.0.13 + "@flyteorg/console": ^0.0.14 "@types/long": ^3.0.32 long: ^4.0.0 protobufjs: ~6.11.3 @@ -2034,7 +2034,7 @@ __metadata: languageName: unknown linkType: soft -"@flyteorg/console@^0.0.13, @flyteorg/console@workspace:packages/console": +"@flyteorg/console@^0.0.14, @flyteorg/console@workspace:packages/console": version: 0.0.0-use.local resolution: "@flyteorg/console@workspace:packages/console" dependencies: From ddae902d39c7f6fa25c0c6452f558f0452e201d7 Mon Sep 17 00:00:00 2001 From: Eduardo Apolinario <653394+eapolinario@users.noreply.github.com> Date: Tue, 21 Mar 2023 11:15:07 -0700 Subject: [PATCH 27/34] Install deps directly in checks.yml (#728) Signed-off-by: eduardo apolinario Co-authored-by: eduardo apolinario Signed-off-by: 4nalog <4nalog@protonmail.com> --- .github/workflows/checks.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index cb017896c..8bc17209a 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -32,7 +32,9 @@ jobs: - uses: actions/setup-node@v3 with: node-version: 18 - - uses: bahmutov/npm-install@v1 + cache: yarn + - name: Install deps + run: yarn install --frozen-lockfile - name: Run tests and generate coverage run: make test_unit_codecov - uses: codecov/codecov-action@v1 From 5e252b453636ecf10a0b30f15eb037c080ec97c7 Mon Sep 17 00:00:00 2001 From: Carina Ursu Date: Tue, 21 Mar 2023 14:24:28 -0700 Subject: [PATCH 28/34] fix: show correct i/o in details panel (#727) * chore: show correct i/o in details panel Signed-off-by: Carina Ursu * chore: bump version Signed-off-by: Carina Ursu * chore: feedback Signed-off-by: Carina Ursu --------- Signed-off-by: Carina Ursu Signed-off-by: 4nalog <4nalog@protonmail.com> --- packages/console/package.json | 2 +- .../NodeExecutionDetailsPanelContent.tsx | 1 + .../NodeExecutionTabs/NodeExecutionInputs.tsx | 12 ++++--- .../NodeExecutionOutputs.tsx | 12 ++++--- .../NodeExecutionTabs/index.tsx | 10 ++++-- .../Executions/TaskExecutionsList/utils.ts | 4 +-- .../components/Literals/LiteralMapViewer.tsx | 5 +-- .../src/components/Literals/helpers.ts | 35 +++++++++++++------ .../MapTaskExecutionsList/TaskNameList.tsx | 2 +- website/package.json | 2 +- yarn.lock | 4 +-- 11 files changed, 59 insertions(+), 30 deletions(-) diff --git a/packages/console/package.json b/packages/console/package.json index db5ad95bf..5315d2f0e 100644 --- a/packages/console/package.json +++ b/packages/console/package.json @@ -1,6 +1,6 @@ { "name": "@flyteorg/console", - "version": "0.0.14", + "version": "0.0.15", "description": "Flyteconsole main app module", "main": "./dist/index.js", "module": "./lib/index.js", diff --git a/packages/console/src/components/Executions/ExecutionDetails/NodeExecutionDetailsPanelContent.tsx b/packages/console/src/components/Executions/ExecutionDetails/NodeExecutionDetailsPanelContent.tsx index 40cb0a87b..179c7151b 100644 --- a/packages/console/src/components/Executions/ExecutionDetails/NodeExecutionDetailsPanelContent.tsx +++ b/packages/console/src/components/Executions/ExecutionDetails/NodeExecutionDetailsPanelContent.tsx @@ -495,6 +495,7 @@ export const NodeExecutionDetailsPanelContent: React.FC< phase={taskPhase} taskTemplate={details?.taskTemplate} onTaskSelected={setSelectedTaskExecution} + taskIndex={selectedTaskExecution?.taskIndex!} /> ) : null; diff --git a/packages/console/src/components/Executions/ExecutionDetails/NodeExecutionTabs/NodeExecutionInputs.tsx b/packages/console/src/components/Executions/ExecutionDetails/NodeExecutionTabs/NodeExecutionInputs.tsx index e4059f153..02c92329f 100644 --- a/packages/console/src/components/Executions/ExecutionDetails/NodeExecutionTabs/NodeExecutionInputs.tsx +++ b/packages/console/src/components/Executions/ExecutionDetails/NodeExecutionTabs/NodeExecutionInputs.tsx @@ -6,14 +6,18 @@ import { NodeExecution } from 'models/Execution/types'; import * as React from 'react'; /** Fetches and renders the input data for a given `NodeExecution` */ -export const NodeExecutionInputs: React.FC<{ execution: NodeExecution }> = ({ - execution, -}) => { +export const NodeExecutionInputs: React.FC<{ + execution: NodeExecution; + taskIndex?: number; +}> = ({ execution, taskIndex }) => { const executionData = useNodeExecutionData(execution.id); return ( - + ); diff --git a/packages/console/src/components/Executions/ExecutionDetails/NodeExecutionTabs/NodeExecutionOutputs.tsx b/packages/console/src/components/Executions/ExecutionDetails/NodeExecutionTabs/NodeExecutionOutputs.tsx index 42f7429a1..0aa836661 100644 --- a/packages/console/src/components/Executions/ExecutionDetails/NodeExecutionTabs/NodeExecutionOutputs.tsx +++ b/packages/console/src/components/Executions/ExecutionDetails/NodeExecutionTabs/NodeExecutionOutputs.tsx @@ -6,14 +6,18 @@ import { NodeExecution } from 'models/Execution/types'; import * as React from 'react'; /** Fetches and renders the output data for a given `NodeExecution` */ -export const NodeExecutionOutputs: React.FC<{ execution: NodeExecution }> = ({ - execution, -}) => { +export const NodeExecutionOutputs: React.FC<{ + execution: NodeExecution; + taskIndex?: number; +}> = ({ execution, taskIndex }) => { const executionData = useNodeExecutionData(execution.id); return ( - + ); diff --git a/packages/console/src/components/Executions/ExecutionDetails/NodeExecutionTabs/index.tsx b/packages/console/src/components/Executions/ExecutionDetails/NodeExecutionTabs/index.tsx index 3a289b0c0..100d6cd58 100644 --- a/packages/console/src/components/Executions/ExecutionDetails/NodeExecutionTabs/index.tsx +++ b/packages/console/src/components/Executions/ExecutionDetails/NodeExecutionTabs/index.tsx @@ -47,12 +47,14 @@ export const NodeExecutionTabs: React.FC<{ onTaskSelected: (val: MapTaskExecution) => void; phase?: TaskExecutionPhase; taskTemplate?: TaskTemplate | null; + taskIndex?: number; }> = ({ nodeExecution, selectedTaskExecution, onTaskSelected, taskTemplate, phase, + taskIndex, }) => { const styles = useStyles(); const tabState = useTabState(tabIds, defaultTab); @@ -80,11 +82,15 @@ export const NodeExecutionTabs: React.FC<{ break; } case tabIds.inputs: { - tabContent = ; + tabContent = ( + + ); break; } case tabIds.outputs: { - tabContent = ; + tabContent = ( + + ); break; } case tabIds.task: { diff --git a/packages/console/src/components/Executions/TaskExecutionsList/utils.ts b/packages/console/src/components/Executions/TaskExecutionsList/utils.ts index f12397eed..e56951146 100644 --- a/packages/console/src/components/Executions/TaskExecutionsList/utils.ts +++ b/packages/console/src/components/Executions/TaskExecutionsList/utils.ts @@ -66,8 +66,8 @@ export const getGroupedLogs = ( // for user to understand which array items are in this state const newLogs = item.logs.length > 0 - ? item.logs.map(l => ({ ...l, index: item.index })) - : [{ name: item.externalId, index: item.index }]; + ? item.logs.map(l => ({ ...l, index: item.index || 0 })) + : [{ name: item.externalId }]; logsByPhase.set( phase, currentValue ? [...currentValue, ...newLogs] : [...newLogs], diff --git a/packages/console/src/components/Literals/LiteralMapViewer.tsx b/packages/console/src/components/Literals/LiteralMapViewer.tsx index 77be18da2..a09fd9ae5 100644 --- a/packages/console/src/components/Literals/LiteralMapViewer.tsx +++ b/packages/console/src/components/Literals/LiteralMapViewer.tsx @@ -17,7 +17,8 @@ export const LiteralMapViewer: React.FC<{ className?: string; map: LiteralMap | null; showBrackets?: boolean; -}> = ({ map }) => { + mapTaskIndex?: number; +}> = ({ map, mapTaskIndex }) => { if (!map) { return ; } @@ -28,7 +29,7 @@ export const LiteralMapViewer: React.FC<{ return ; } - const transformedLiterals = transformLiterals(literals); + const transformedLiterals = transformLiterals(literals, mapTaskIndex); return ; }; diff --git a/packages/console/src/components/Literals/helpers.ts b/packages/console/src/components/Literals/helpers.ts index 22e9c844a..53a8ccb5b 100644 --- a/packages/console/src/components/Literals/helpers.ts +++ b/packages/console/src/components/Literals/helpers.ts @@ -146,7 +146,7 @@ function processUnionType(union?: Core.IUnionType | null, shortString = false) { } function processUnion(union: Core.IUnion) { - return DEFAULT_UNSUPPORTED; + return { union: processLiteral(union.value!) }; } /* eslint-enable @typescript-eslint/no-unused-vars */ @@ -351,27 +351,37 @@ function processScalar( } } -function processCollection(collection?: Core.ILiteralCollection | null) { - const literals = collection?.literals; +function processCollection( + collection?: Core.ILiteralCollection | null, + mapTaskIndex?: number, +) { + let literals = collection?.literals; if (!literals) { return 'invalid collection'; } - return literals?.map(literal => processLiteral(literal)); + if (!isNaN(mapTaskIndex!)) { + literals = (literals || []).splice(mapTaskIndex!, 1); + } + + return literals?.map(literal => processLiteral(literal, mapTaskIndex)); } -function processMap(map?: Core.ILiteralMap | null) { +function processMap(map?: Core.ILiteralMap | null, mapTaskIndex?: number) { const literals = map?.literals; if (!literals) { return 'invalid map'; } - return transformLiterals(literals); + return transformLiterals(literals, mapTaskIndex); } -function processLiteral(literal?: Core.ILiteral & Pick) { +function processLiteral( + literal?: Core.ILiteral & Pick, + mapTaskIndex?: number, +) { const type = literal?.value; if (!literal) { @@ -382,18 +392,21 @@ function processLiteral(literal?: Core.ILiteral & Pick) { case 'scalar': return processScalar(literal.scalar); case 'collection': - return processCollection(literal.collection); + return processCollection(literal.collection, mapTaskIndex); case 'map': - return processMap(literal.map); + return processMap(literal.map, mapTaskIndex); default: return DEFAULT_UNSUPPORTED; } } -export function transformLiterals(json: { [k: string]: Core.ILiteral }) { +export function transformLiterals( + json: { [k: string]: Core.ILiteral }, + mapTaskIndex?: number, +) { const obj = Object.entries(json) .map(([key, literal]) => ({ - [key]: processLiteral(literal), + [key]: processLiteral(literal, mapTaskIndex), })) .reduce( (acc, cur) => ({ diff --git a/packages/console/src/components/common/MapTaskExecutionsList/TaskNameList.tsx b/packages/console/src/components/common/MapTaskExecutionsList/TaskNameList.tsx index fd7ce0461..c68acee91 100644 --- a/packages/console/src/components/common/MapTaskExecutionsList/TaskNameList.tsx +++ b/packages/console/src/components/common/MapTaskExecutionsList/TaskNameList.tsx @@ -60,7 +60,7 @@ export const TaskNameList = ({ // Use the resource's index instead of the log index onTaskSelected({ ...taskExecution, - taskIndex: (log as any).index || 0, + taskIndex: (log as any).index, }); }; diff --git a/website/package.json b/website/package.json index f77846c17..ee73c71ff 100644 --- a/website/package.json +++ b/website/package.json @@ -37,7 +37,7 @@ }, "dependencies": { "@flyteorg/common": "^0.0.3", - "@flyteorg/console": "^0.0.14", + "@flyteorg/console": "^0.0.15", "long": "^4.0.0", "protobufjs": "~6.11.3", "react-ga4": "^1.4.1", diff --git a/yarn.lock b/yarn.lock index 9e9a32076..f6f3db62c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1995,7 +1995,7 @@ __metadata: resolution: "@flyteconsole/client-app@workspace:website" dependencies: "@flyteorg/common": ^0.0.3 - "@flyteorg/console": ^0.0.14 + "@flyteorg/console": ^0.0.15 "@types/long": ^3.0.32 long: ^4.0.0 protobufjs: ~6.11.3 @@ -2034,7 +2034,7 @@ __metadata: languageName: unknown linkType: soft -"@flyteorg/console@^0.0.14, @flyteorg/console@workspace:packages/console": +"@flyteorg/console@^0.0.15, @flyteorg/console@workspace:packages/console": version: 0.0.0-use.local resolution: "@flyteorg/console@workspace:packages/console" dependencies: From d4fd39ee4ec369c1ddfd5d56e9235d8411f478f9 Mon Sep 17 00:00:00 2001 From: Carina Ursu Date: Wed, 22 Mar 2023 12:15:49 -0700 Subject: [PATCH 29/34] chore: task observability (#720) * chore: tlro basic setup Signed-off-by: Carina Ursu * progress checkin * Stable state refactored to use generic naming * updated types * working before updating routes * chore: progress Signed-off-by: Carina Ursu * chore: remove debugger Signed-off-by: Carina Ursu * chore: allow custom class in execution actions Signed-off-by: Carina Ursu * chore: lint fix Signed-off-by: Carina Ursu * chore: bump console Signed-off-by: Carina Ursu * chore: up package version Signed-off-by: Carina Ursu --------- Signed-off-by: Carina Ursu Co-authored-by: Jason Porter Signed-off-by: 4nalog <4nalog@protonmail.com> --- .vscode/settings.json | 2 +- Makefile | 3 +- packages/console/package.json | 16 ++++--- .../console/src/basics/ExternalConfigHoc.tsx | 5 +++ .../ExternalConfigurationProvider.tsx | 31 ++++++++++++++ .../ExternalConfigurationProvider/index.ts | 1 + packages/console/src/basics/index.ts | 4 ++ packages/console/src/common/index.ts | 4 ++ packages/console/src/components/App/App.tsx | 31 +++++++------- .../ExecutionDetailsActions.tsx | 17 ++++++-- .../Executions/ExecutionStatusBadge.tsx | 16 ++++++- .../Executions/Tables/NodeExecutionsTable.tsx | 2 +- .../TaskExecutionsList/TaskExecutionLogs.tsx | 4 +- .../TaskExecutionLogsCard.tsx | 42 +++++++++++++------ .../components/Navigation/NavBarContent.tsx | 4 +- .../console/src/components/common/index.ts | 5 +++ packages/console/src/components/index.ts | 20 +++++++++ packages/console/src/index.ts | 5 ++- packages/console/src/models/index.ts | 4 ++ .../console/src/routes/ApplicationRouter.tsx | 14 ++++--- packages/console/src/routes/NavBarRouter.tsx | 30 ++++++------- packages/console/src/routes/index.ts | 3 ++ website/package.json | 2 +- yarn.lock | 29 +++++-------- 24 files changed, 207 insertions(+), 87 deletions(-) create mode 100644 packages/console/src/basics/ExternalConfigHoc.tsx create mode 100644 packages/console/src/basics/ExternalConfigurationProvider/ExternalConfigurationProvider.tsx create mode 100644 packages/console/src/basics/ExternalConfigurationProvider/index.ts create mode 100644 packages/console/src/basics/index.ts create mode 100644 packages/console/src/common/index.ts create mode 100644 packages/console/src/components/common/index.ts create mode 100644 packages/console/src/routes/index.ts diff --git a/.vscode/settings.json b/.vscode/settings.json index de2d2d07b..463fd54f2 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,5 @@ { - "explorer.autoReveal": "focusNoScroll", + "explorer.autoReveal": true, "explorer.enableUndo": true, "explorer.excludeGitIgnore": false, diff --git a/Makefile b/Makefile index e82de749e..5c3a66552 100644 --- a/Makefile +++ b/Makefile @@ -22,8 +22,7 @@ build_prod: .PHONY: pack pack: - yarn workspaces focus --production --all - yarn run build:pack + yarn run build:pack .PHONY: types types: diff --git a/packages/console/package.json b/packages/console/package.json index 5315d2f0e..2bfd56bfe 100644 --- a/packages/console/package.json +++ b/packages/console/package.json @@ -1,6 +1,6 @@ { "name": "@flyteorg/console", - "version": "0.0.15", + "version": "0.0.16", "description": "Flyteconsole main app module", "main": "./dist/index.js", "module": "./lib/index.js", @@ -20,7 +20,8 @@ "README.md", "dist", "lib", - "node_modules" + "node_modules", + "src" ], "keywords": [ "flyteorg", @@ -31,9 +32,11 @@ "scripts": { "debug": "NM_DEBUG_LEVEL=2 yarn", "clean": "rm -rf dist && rm -rf lib && rm -rf **.tsbuildinfo || true", - "build:watch": "run -T tsc-watch --noClear -p ./tsconfig.build.es.json --onSuccess \"yarn build\"", + "build:watch": "run -T tsc-watch --noClear --signalEmittedFiles -p ./tsconfig.build.es.json --onSuccess \"yarn build:watch:success\"", + "build:watch:success": "yarn build:esm:alias && yalc push", "build": "yarn clean && yarn build:esm && yarn build:cjs", - "build:esm": "mkdir lib && cp -R src/assets ./lib && run -T tsc --module esnext --project ./tsconfig.build.es.json && run -T tsc-alias -p ./tsconfig.build.es.json", + "build:esm": "mkdir lib && cp -R src/assets ./lib && run -T tsc --module esnext --project ./tsconfig.build.es.json && yarn build:esm:alias", + "build:esm:alias": "run -T tsc-alias -p ./tsconfig.build.es.json", "build:cjs": "mkdir dist && cp -R src/assets ./dist && run -T wait-on ./dist/assets && run -T tsc --project ./tsconfig.build.json && run -T tsc-alias -p ./tsconfig.build.json", "build:types": "run -T tsc --module esnext --project ./tsconfig.build.es.json --emitDeclarationOnly && run -T tsc-alias -p ./tsconfig.build.es.json", "test": "NODE_ENV=test jest" @@ -79,7 +82,7 @@ "dagre": "0.8.5", "dagre-d3": "^0.6.4", "debug": "2.6.9", - "dom-helpers": "^3.4.0", + "dom-helpers": "5.2.1", "fuzzysort": "^1.1.1", "intersection-observer": "^0.7.0", "js-yaml": "^3.13.1", @@ -109,7 +112,7 @@ }, "devDependencies": { "@types/debug": "^0.0.30", - "@types/dom-helpers": "^3.4.1", + "@types/dom-helpers": "^5.0.1", "@types/js-yaml": "^3.10.1", "@types/linkify-it": "^2.1.0", "@types/lodash": "^4.14.68", @@ -129,6 +132,7 @@ }, "resolutions": { "react": "^16.13.1", + "dom-helpers": "5.2.1", "react-dom": "^16.13.1", "micromatch": "^4.0.0", "@types/react": "^16.9.34", diff --git a/packages/console/src/basics/ExternalConfigHoc.tsx b/packages/console/src/basics/ExternalConfigHoc.tsx new file mode 100644 index 000000000..1dc35424f --- /dev/null +++ b/packages/console/src/basics/ExternalConfigHoc.tsx @@ -0,0 +1,5 @@ +import * as React from 'react'; + +export const ExternalConfigHoc = ({ ChildComponent, data }): any => { + return ; +}; diff --git a/packages/console/src/basics/ExternalConfigurationProvider/ExternalConfigurationProvider.tsx b/packages/console/src/basics/ExternalConfigurationProvider/ExternalConfigurationProvider.tsx new file mode 100644 index 000000000..26219089f --- /dev/null +++ b/packages/console/src/basics/ExternalConfigurationProvider/ExternalConfigurationProvider.tsx @@ -0,0 +1,31 @@ +import React, { PropsWithChildren, useContext } from 'react'; +import { AppConfig } from '@flyteorg/common'; + +export interface ExternalConfigurationProviderProps { + registry?: { + nav?: React.FC; + taskExecutionAttemps?: React.FC; + additionalRoutes?: any; + }; + env?: any; + config?: AppConfig; +} + +export const ExternalConfigurationContext = + React.createContext({}); + +export const ExternalConfigurationProvider = ({ + children, + config, + env, + registry, +}: PropsWithChildren) => { + return ( + + {children} + + ); +}; + +export const useExternalConfigurationContext = () => + useContext(ExternalConfigurationContext); diff --git a/packages/console/src/basics/ExternalConfigurationProvider/index.ts b/packages/console/src/basics/ExternalConfigurationProvider/index.ts new file mode 100644 index 000000000..e1c599476 --- /dev/null +++ b/packages/console/src/basics/ExternalConfigurationProvider/index.ts @@ -0,0 +1 @@ +export * from './ExternalConfigurationProvider'; diff --git a/packages/console/src/basics/index.ts b/packages/console/src/basics/index.ts new file mode 100644 index 000000000..9010fa09d --- /dev/null +++ b/packages/console/src/basics/index.ts @@ -0,0 +1,4 @@ +export { + type ExternalConfigurationProviderProps, + ExternalConfigurationProvider, +} from './ExternalConfigurationProvider'; diff --git a/packages/console/src/common/index.ts b/packages/console/src/common/index.ts new file mode 100644 index 000000000..e3e1c5534 --- /dev/null +++ b/packages/console/src/common/index.ts @@ -0,0 +1,4 @@ +export { navbarGridHeight } from './layout'; +export { unknownValueString } from './constants'; +export { dateWithFromNow, protobufDurationToHMS } from './formatters'; +export { timestampToDate } from './utils'; diff --git a/packages/console/src/components/App/App.tsx b/packages/console/src/components/App/App.tsx index 4aa0dd90c..acb40fd58 100644 --- a/packages/console/src/components/App/App.tsx +++ b/packages/console/src/components/App/App.tsx @@ -10,7 +10,7 @@ import { ThemeProvider } from '@material-ui/styles'; import { FlyteApiProvider } from '@flyteorg/flyte-api'; import { SnackbarProvider } from 'notistack'; import { FeatureFlagsProvider } from 'basics/FeatureFlags'; -import { env, updateEnv, AppConfig } from '@flyteorg/common'; +import { env, updateEnv } from '@flyteorg/common'; import { debug, debugPrefix } from 'common/log'; import { ErrorBoundary } from 'components/common/ErrorBoundary'; import { APIContext, useAPIState } from 'components/data/apiContext'; @@ -31,17 +31,14 @@ import { ApplicationRouter } from 'routes/ApplicationRouter'; import { history } from 'routes/history'; import { NavBarRouter } from 'routes/NavBarRouter'; import { LocalCacheProvider } from 'basics/LocalCache/ContextProvider'; +import { + ExternalConfigurationProvider, + ExternalConfigurationProviderProps, +} from 'basics/ExternalConfigurationProvider'; -const queryClient = createQueryClient(); - -interface AppComponentProps { - registry?: { - nav?: React.FC; - }; - env?: any; - config?: AppConfig; -} +export type AppComponentProps = ExternalConfigurationProviderProps; +const queryClient = createQueryClient(); let overrided = false; export const AppComponent: React.FC = ( @@ -82,12 +79,14 @@ export const AppComponent: React.FC = ( highlightColor={skeletonHighlightColor} > - - - - - - + + + + + + + + diff --git a/packages/console/src/components/Executions/ExecutionDetails/ExecutionDetailsActions.tsx b/packages/console/src/components/Executions/ExecutionDetails/ExecutionDetailsActions.tsx index 112eabcb6..8cbab6bb2 100644 --- a/packages/console/src/components/Executions/ExecutionDetails/ExecutionDetailsActions.tsx +++ b/packages/console/src/components/Executions/ExecutionDetails/ExecutionDetailsActions.tsx @@ -14,6 +14,7 @@ import { TaskInitialLaunchParameters } from 'components/Launch/LaunchForm/types' import { NodeExecutionPhase } from 'models/Execution/enums'; import Close from '@material-ui/icons/Close'; import { useEffect, useState } from 'react'; +import classnames from 'classnames'; import { NodeExecutionDetails } from '../types'; import t from './strings'; import { ExecutionNodeDeck } from './ExecutionNodeDeck'; @@ -62,15 +63,23 @@ const useStyles = makeStyles((theme: Theme) => { }); interface ExecutionDetailsActionsProps { + className?: string; details?: NodeExecutionDetails; nodeExecutionId: NodeExecutionIdentifier; phase: NodeExecutionPhase; + text?: { + flyteDeckText?: string; + rerunText?: string; + resumeText?: string; + }; } export const ExecutionDetailsActions = ({ + className, details, nodeExecutionId, phase, + text, }: ExecutionDetailsActionsProps): JSX.Element => { const styles = useStyles(); @@ -128,7 +137,7 @@ export const ExecutionDetailsActions = ({ return ( <> -
+
{execution?.value?.closure?.deckUri && ( )} {id && initialParameters && details && ( )} {phase === NodeExecutionPhase.PAUSED && ( )}
diff --git a/packages/console/src/components/Executions/ExecutionStatusBadge.tsx b/packages/console/src/components/Executions/ExecutionStatusBadge.tsx index 345b15c33..df10152b1 100644 --- a/packages/console/src/components/Executions/ExecutionStatusBadge.tsx +++ b/packages/console/src/components/Executions/ExecutionStatusBadge.tsx @@ -85,11 +85,19 @@ export function getPhaseConstants( * a badge with the proper text and styling to indicate the status (succeeded/ * failed etc.) */ -export const ExecutionStatusBadge: React.FC = ({ +export const ExecutionStatusBadge: React.FC< + ExecutionStatusBadgeProps & + React.DetailedHTMLProps< + React.HTMLAttributes, + HTMLDivElement + > +> = ({ phase, type, variant = 'default', disabled = false, + className, + ...htmlProps }) => { const styles = useStyles(); const style: React.CSSProperties = {}; @@ -102,7 +110,11 @@ export const ExecutionStatusBadge: React.FC = ({ } return ( -
+
{text}
); diff --git a/packages/console/src/components/Executions/Tables/NodeExecutionsTable.tsx b/packages/console/src/components/Executions/Tables/NodeExecutionsTable.tsx index 8e5371d23..fe24341b0 100644 --- a/packages/console/src/components/Executions/Tables/NodeExecutionsTable.tsx +++ b/packages/console/src/components/Executions/Tables/NodeExecutionsTable.tsx @@ -1,7 +1,7 @@ import classnames from 'classnames'; import { getCacheKey } from 'components/Cache/utils'; import { useCommonStyles } from 'components/common/styles'; -import scrollbarSize from 'dom-helpers/util/scrollbarSize'; +import scrollbarSize from 'dom-helpers/scrollbarSize'; import { NodeExecution } from 'models/Execution/types'; import { dNode } from 'models/Graph/types'; import { NodeExecutionPhase } from 'models/Execution/enums'; diff --git a/packages/console/src/components/Executions/TaskExecutionsList/TaskExecutionLogs.tsx b/packages/console/src/components/Executions/TaskExecutionsList/TaskExecutionLogs.tsx index 0d1b52cd4..5a81e2fd5 100644 --- a/packages/console/src/components/Executions/TaskExecutionsList/TaskExecutionLogs.tsx +++ b/packages/console/src/components/Executions/TaskExecutionsList/TaskExecutionLogs.tsx @@ -38,7 +38,9 @@ export const TaskLogList: React.FC<{ logs: Core.ITaskLog[] }> = ({ logs }) => { ) : ( // If there is no url, show item a a name string only, as it's not really clickable -
{name}
+
+ {name} +
), )} diff --git a/packages/console/src/components/Executions/TaskExecutionsList/TaskExecutionLogsCard.tsx b/packages/console/src/components/Executions/TaskExecutionsList/TaskExecutionLogsCard.tsx index e1dc541f6..c3baa8c9a 100644 --- a/packages/console/src/components/Executions/TaskExecutionsList/TaskExecutionLogsCard.tsx +++ b/packages/console/src/components/Executions/TaskExecutionsList/TaskExecutionLogsCard.tsx @@ -6,6 +6,8 @@ import { useCommonStyles } from 'components/common/styles'; import { TaskExecutionPhase } from 'models/Execution/enums'; import { TaskExecution } from 'models/Execution/types'; import { Core } from '@flyteorg/flyteidl-types'; +import { ExternalConfigHoc } from 'basics/ExternalConfigHoc'; +import { useExternalConfigurationContext } from 'basics/ExternalConfigurationProvider'; import { ExecutionStatusBadge } from '../ExecutionStatusBadge'; import { TaskExecutionDetails } from './TaskExecutionDetails'; import { TaskExecutionError } from './TaskExecutionError'; @@ -20,6 +22,10 @@ const useStyles = makeStyles((theme: Theme) => ({ }, title: { marginBottom: theme.spacing(1), + + '& > svg': { + verticalAlign: 'middle', + }, }, showDetailsButton: { marginTop: theme.spacing(1), @@ -36,30 +42,40 @@ interface TaskExecutionLogsCardProps { logs: Core.ITaskLog[]; } -export const TaskExecutionLogsCard: React.FC = ({ - taskExecution, - headerText, - phase, - logs, -}) => { +export const TaskExecutionLogsCard: React.FC< + TaskExecutionLogsCardProps +> = props => { + const { taskExecution, headerText, phase, logs } = props; const commonStyles = useCommonStyles(); const styles = useStyles(); + const { registry } = useExternalConfigurationContext(); const { closure: { error, startedAt, updatedAt, duration }, } = taskExecution; - const taskHasStarted = phase >= TaskExecutionPhase.QUEUED; + const taskHasStarted = phase >= TaskExecutionPhase.QUEUED; + const externalProps = { ...props, styles, commonStyles }; return ( <>
- - {headerText} - + {registry?.taskExecutionAttemps ? ( + // Alternate path + + + ) : ( + // default path + + {headerText} + + )}
diff --git a/packages/console/src/components/Navigation/NavBarContent.tsx b/packages/console/src/components/Navigation/NavBarContent.tsx index 237e3509f..a48f13042 100644 --- a/packages/console/src/components/Navigation/NavBarContent.tsx +++ b/packages/console/src/components/Navigation/NavBarContent.tsx @@ -4,7 +4,9 @@ import * as React from 'react'; import ReactDOM from 'react-dom'; /** Complements NavBar, allowing pages to inject custom content. */ -export const NavBarContent: React.FC<{}> = ({ children }) => { +export const NavBarContent: React.FC> = ({ + children, +}) => { const navBar = document.getElementById(navBarContentId); if (navBar == null) { log.warn(` diff --git a/packages/console/src/components/common/index.ts b/packages/console/src/components/common/index.ts new file mode 100644 index 000000000..1d7d32d99 --- /dev/null +++ b/packages/console/src/components/common/index.ts @@ -0,0 +1,5 @@ +export { useCommonStyles } from './styles'; +export { withRouteParams } from './withRouteParams'; +export { WaitForData } from './WaitForData'; +export { WaitForQuery } from './WaitForQuery'; +export { DetailsGroup } from './DetailsGroup'; diff --git a/packages/console/src/components/index.ts b/packages/console/src/components/index.ts index fb4007b3f..e62525c3c 100644 --- a/packages/console/src/components/index.ts +++ b/packages/console/src/components/index.ts @@ -1,2 +1,22 @@ +export * from './common'; + export * from './Navigation'; export * from './App/App'; + +export { NavBarContent } from './Navigation/NavBarContent'; +export { useNodeExecution } from './hooks/useNodeExecution'; +export { useConditionalQuery } from './hooks/useConditionalQuery'; + +export * from './Executions/types'; +export { type ExecutionDetailsRouteParams } from './Executions/ExecutionDetails/ExecutionDetails'; +export { ExecutionStatusBadge } from './Executions/ExecutionStatusBadge'; +export { formatRetryAttempt } from './Executions/TaskExecutionsList/utils'; +export { TaskExecutionDetails } from './Executions/TaskExecutionsList/TaskExecutionDetails'; +export { makeTaskExecutionListQuery } from './Executions/taskExecutionQueries'; +export { useWorkflowExecutionQuery } from './Executions/useWorkflowExecution'; +export { NodeExecutionDetailsContextProvider } from './Executions/contextProvider/NodeExecutionDetails'; +export { getNodeFrontendPhase } from './Executions/utils'; +export { useWorkflowExecutionData } from './Executions/useWorkflowExecution'; +export { useNodeExecutionContext } from './Executions/contextProvider/NodeExecutionDetails'; +export { ExecutionDetailsActions } from './Executions/ExecutionDetails/ExecutionDetailsActions'; +export { makeNodeExecutionQuery } from './Executions/nodeExecutionQueries'; diff --git a/packages/console/src/index.ts b/packages/console/src/index.ts index bfaee7070..585e1a880 100644 --- a/packages/console/src/index.ts +++ b/packages/console/src/index.ts @@ -1,4 +1,7 @@ import './common/setupProtobuf'; -import './models'; export * from './components'; +export * from './routes'; +export * from './models'; +export * from './common'; +export * from './basics'; diff --git a/packages/console/src/models/index.ts b/packages/console/src/models/index.ts index d9754150a..a410e4922 100644 --- a/packages/console/src/models/index.ts +++ b/packages/console/src/models/index.ts @@ -1 +1,5 @@ export * from './AdminEntity'; +export * from './Execution/enums'; +export * from './Execution/types'; +export { taskSortFields } from './Task/constants'; +export * from './Common/types'; diff --git a/packages/console/src/routes/ApplicationRouter.tsx b/packages/console/src/routes/ApplicationRouter.tsx index 9d3f50b12..2c31cefae 100644 --- a/packages/console/src/routes/ApplicationRouter.tsx +++ b/packages/console/src/routes/ApplicationRouter.tsx @@ -5,10 +5,11 @@ import { import { withSideNavigation } from 'components/Navigation/withSideNavigation'; import * as React from 'react'; import { Route, Switch } from 'react-router-dom'; +import { useExternalConfigurationContext } from 'basics/ExternalConfigurationProvider'; import { components } from './components'; import { Routes } from './routes'; -function withContentContainer

( +export function withContentContainer

( WrappedComponent: React.FC

, contentContainerProps?: ContentContainerProps, ) { @@ -19,9 +20,12 @@ function withContentContainer

( ); } -export const ApplicationRouter: React.FC = () => ( - <> +export const ApplicationRouter: React.FC = () => { + const additionalRoutes = + useExternalConfigurationContext()?.registry?.additionalRoutes || null; + return ( + {additionalRoutes} ( /> - -); + ); +}; diff --git a/packages/console/src/routes/NavBarRouter.tsx b/packages/console/src/routes/NavBarRouter.tsx index 07e9fe248..af6d1eb58 100644 --- a/packages/console/src/routes/NavBarRouter.tsx +++ b/packages/console/src/routes/NavBarRouter.tsx @@ -1,23 +1,23 @@ import { NavBar } from 'components/Navigation/NavBar'; import * as React from 'react'; import { Route, Switch } from 'react-router-dom'; +import { useExternalConfigurationContext } from 'basics/ExternalConfigurationProvider'; import { Routes } from './routes'; const CustomNavBar = () => ; -interface NavBarRouterProps { - registry?: { - nav?: React.FC; - }; -} +interface NavBarRouterProps {} /** Handles the routing for content displayed in the NavBar */ -export const NavBarRouter: React.FC = ( - props: NavBarRouterProps, -) => ( - <> - - - - - -); +export const NavBarRouter: React.FC = () => { + const { registry } = useExternalConfigurationContext(); + + const ExternalNav = registry?.nav; + return ( + <> + + + + + + ); +}; diff --git a/packages/console/src/routes/index.ts b/packages/console/src/routes/index.ts new file mode 100644 index 000000000..3ae21e10d --- /dev/null +++ b/packages/console/src/routes/index.ts @@ -0,0 +1,3 @@ +export * from './routes'; +export * from './ApplicationRouter'; +export * from './constants'; diff --git a/website/package.json b/website/package.json index ee73c71ff..2242f70b5 100644 --- a/website/package.json +++ b/website/package.json @@ -37,7 +37,7 @@ }, "dependencies": { "@flyteorg/common": "^0.0.3", - "@flyteorg/console": "^0.0.15", + "@flyteorg/console": "^0.0.16", "long": "^4.0.0", "protobufjs": "~6.11.3", "react-ga4": "^1.4.1", diff --git a/yarn.lock b/yarn.lock index f6f3db62c..a5618970a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1995,7 +1995,7 @@ __metadata: resolution: "@flyteconsole/client-app@workspace:website" dependencies: "@flyteorg/common": ^0.0.3 - "@flyteorg/console": ^0.0.15 + "@flyteorg/console": ^0.0.16 "@types/long": ^3.0.32 long: ^4.0.0 protobufjs: ~6.11.3 @@ -2034,7 +2034,7 @@ __metadata: languageName: unknown linkType: soft -"@flyteorg/console@^0.0.15, @flyteorg/console@workspace:packages/console": +"@flyteorg/console@^0.0.16, @flyteorg/console@workspace:packages/console": version: 0.0.0-use.local resolution: "@flyteorg/console@workspace:packages/console" dependencies: @@ -2055,7 +2055,7 @@ __metadata: "@rjsf/validator-ajv8": ^5.1.0 "@types/d3-shape": ^1.2.6 "@types/debug": ^0.0.30 - "@types/dom-helpers": ^3.4.1 + "@types/dom-helpers": ^5.0.1 "@types/js-yaml": ^3.10.1 "@types/linkify-it": ^2.1.0 "@types/lodash": ^4.14.68 @@ -2084,7 +2084,7 @@ __metadata: dagre: 0.8.5 dagre-d3: ^0.6.4 debug: 2.6.9 - dom-helpers: ^3.4.0 + dom-helpers: 5.2.1 fuzzysort: ^1.1.1 intersection-observer: ^0.7.0 js-yaml: ^3.13.1 @@ -5030,10 +5030,12 @@ __metadata: languageName: node linkType: hard -"@types/dom-helpers@npm:^3.4.1": - version: 3.4.1 - resolution: "@types/dom-helpers@npm:3.4.1" - checksum: 6386baf650eb80903312691882e53012d431ef1686c5b1a6d0593a2a130162bce1adccc21aa67ba6066536cbc95841719051b58648963d73653913f7be23eef8 +"@types/dom-helpers@npm:^5.0.1": + version: 5.0.1 + resolution: "@types/dom-helpers@npm:5.0.1" + dependencies: + dom-helpers: "*" + checksum: 9e79b97b31e0a1ad805bd192f19856cb7b38042083c92a2bc54f3ae8432b7e7a5f92f605b705979b82b4b234f711599c79892d291d7c74f3999d054effefc21c languageName: node linkType: hard @@ -10081,16 +10083,7 @@ __metadata: languageName: node linkType: hard -"dom-helpers@npm:^3.4.0": - version: 3.4.0 - resolution: "dom-helpers@npm:3.4.0" - dependencies: - "@babel/runtime": ^7.1.2 - checksum: 58d9f1c4a96daf77eddc63ae1236b826e1cddd6db66bbf39b18d7e21896d99365b376593352d52a60969d67fa4a8dbef26adc1439fa2c1b355efa37cacbaf637 - languageName: node - linkType: hard - -"dom-helpers@npm:^5.0.1, dom-helpers@npm:^5.1.3": +"dom-helpers@npm:*, dom-helpers@npm:5.2.1, dom-helpers@npm:^5.0.1, dom-helpers@npm:^5.1.3": version: 5.2.1 resolution: "dom-helpers@npm:5.2.1" dependencies: From 16211bbe7f56992734f581de0817f55770303886 Mon Sep 17 00:00:00 2001 From: Carina Ursu Date: Thu, 23 Mar 2023 14:49:50 -0700 Subject: [PATCH 30/34] chore: fix contextual menu action buttons color (#730) * chore: fix contextual menu action buttons color Signed-off-by: Carina Ursu * chore: up console version Signed-off-by: Carina Ursu --------- Signed-off-by: Carina Ursu Signed-off-by: 4nalog <4nalog@protonmail.com> --- packages/console/package.json | 2 +- packages/console/src/components/index.ts | 3 +-- website/package.json | 2 +- yarn.lock | 4 ++-- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/console/package.json b/packages/console/package.json index 2bfd56bfe..870ac6776 100644 --- a/packages/console/package.json +++ b/packages/console/package.json @@ -1,6 +1,6 @@ { "name": "@flyteorg/console", - "version": "0.0.16", + "version": "0.0.17", "description": "Flyteconsole main app module", "main": "./dist/index.js", "module": "./lib/index.js", diff --git a/packages/console/src/components/index.ts b/packages/console/src/components/index.ts index e62525c3c..46d6d87d4 100644 --- a/packages/console/src/components/index.ts +++ b/packages/console/src/components/index.ts @@ -1,5 +1,3 @@ -export * from './common'; - export * from './Navigation'; export * from './App/App'; @@ -20,3 +18,4 @@ export { useWorkflowExecutionData } from './Executions/useWorkflowExecution'; export { useNodeExecutionContext } from './Executions/contextProvider/NodeExecutionDetails'; export { ExecutionDetailsActions } from './Executions/ExecutionDetails/ExecutionDetailsActions'; export { makeNodeExecutionQuery } from './Executions/nodeExecutionQueries'; +export * from './common'; diff --git a/website/package.json b/website/package.json index 2242f70b5..d8177bf2f 100644 --- a/website/package.json +++ b/website/package.json @@ -37,7 +37,7 @@ }, "dependencies": { "@flyteorg/common": "^0.0.3", - "@flyteorg/console": "^0.0.16", + "@flyteorg/console": "^0.0.17", "long": "^4.0.0", "protobufjs": "~6.11.3", "react-ga4": "^1.4.1", diff --git a/yarn.lock b/yarn.lock index a5618970a..a867b1bde 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1995,7 +1995,7 @@ __metadata: resolution: "@flyteconsole/client-app@workspace:website" dependencies: "@flyteorg/common": ^0.0.3 - "@flyteorg/console": ^0.0.16 + "@flyteorg/console": ^0.0.17 "@types/long": ^3.0.32 long: ^4.0.0 protobufjs: ~6.11.3 @@ -2034,7 +2034,7 @@ __metadata: languageName: unknown linkType: soft -"@flyteorg/console@^0.0.16, @flyteorg/console@workspace:packages/console": +"@flyteorg/console@^0.0.17, @flyteorg/console@workspace:packages/console": version: 0.0.0-use.local resolution: "@flyteorg/console@workspace:packages/console" dependencies: From 26600f6ae250fd0e9b02cdb19d99615ffced45d4 Mon Sep 17 00:00:00 2001 From: Carina Ursu Date: Fri, 24 Mar 2023 13:30:59 -0700 Subject: [PATCH 31/34] chore: add build:watch to all packages (#731) Signed-off-by: Carina Ursu Signed-off-by: 4nalog <4nalog@protonmail.com> --- package.json | 46 +++++++++---------- packages/common/package.json | 5 +- packages/components/package.json | 5 +- packages/console/package.json | 2 +- .../src/components/Executions/index.ts | 13 ++++++ .../src/components/Navigation/index.ts | 1 + .../console/src/components/hooks/index.ts | 2 + packages/console/src/components/index.ts | 20 ++------ packages/flyte-api/package.json | 5 +- packages/flyteidl-types/package.json | 5 +- packages/locale/package.json | 3 +- packages/ui-atoms/package.json | 5 +- yarn.lock | 20 ++++---- 13 files changed, 75 insertions(+), 57 deletions(-) create mode 100644 packages/console/src/components/Executions/index.ts create mode 100644 packages/console/src/components/hooks/index.ts diff --git a/package.json b/package.json index 2337c81b7..b8a993008 100644 --- a/package.json +++ b/package.json @@ -53,11 +53,27 @@ ] }, "dependencies": { + "@babel/core": "~7.16.12", + "@babel/preset-env": "~7.16.11", + "@commitlint/cli": "^17.3.0", + "@commitlint/config-conventional": "^17.3.0", + "@material-ui/core": "^4.2.0", + "@material-ui/icons": "^4.2.1", + "@semantic-release/changelog": "^5.0.1", + "@semantic-release/commit-analyzer": "^8.0.1", + "@semantic-release/git": "^9.0.0", + "@semantic-release/github": "^7.0.5", + "@semantic-release/npm": "^7.0.5", + "@semantic-release/release-notes-generator": "^9.0.1", + "@testing-library/jest-dom": "^5.5.0", + "@testing-library/react": "^10.0.3", + "@testing-library/react-hooks": "^7.0.2", "@types/morgan": "^1.9.4", "@types/react": "^16.14.35", "@types/react-dom": "^16.9.7", "@typescript-eslint/eslint-plugin": "^5.48.2", "@typescript-eslint/parser": "^5.48.2", + "babel-loader": "^8.2.5", "chalk": "^4", "compression-webpack-plugin": "^9.2.0", "cookie-parser": "^1.4.3", @@ -75,12 +91,18 @@ "fork-ts-checker-webpack-plugin": "^7.2.11", "html-webpack-plugin": "^5.5.0", "husky": "^8.0.2", + "jest": "^26.0.0", + "jest-transformer-svg": "^2.0.0", "lint-staged": "^13.1.0", "morgan": "^1.10.0", + "msw": "^0.24.1", "node-polyfill-webpack-plugin": "^2.0.1", "prettier": "^2.8.3", "react": "^16.13.1", "react-dom": "^16.13.1", + "serve-static": "^1.12.3", + "source-map-loader": "^4.0.1", + "ts-jest": "^26.3.0", "ts-loader": "^9.2.6", "ts-node": "^8.0.2", "tsc-alias": "^1.7.0", @@ -95,18 +117,6 @@ "webpack-node-externals": "^3.0.0" }, "devDependencies": { - "@babel/core": "~7.16.12", - "@babel/preset-env": "~7.16.11", - "@commitlint/cli": "^17.3.0", - "@commitlint/config-conventional": "^17.3.0", - "@material-ui/core": "^4.2.0", - "@material-ui/icons": "^4.2.1", - "@semantic-release/changelog": "^5.0.1", - "@semantic-release/commit-analyzer": "^8.0.1", - "@semantic-release/git": "^9.0.0", - "@semantic-release/github": "^7.0.5", - "@semantic-release/npm": "^7.0.5", - "@semantic-release/release-notes-generator": "^9.0.1", "@storybook/addon-actions": "^6.4.19", "@storybook/addon-essentials": "^6.4.19", "@storybook/addon-interactions": "^6.4.19", @@ -114,17 +124,7 @@ "@storybook/builder-webpack5": "^6.4.19", "@storybook/manager-webpack5": "^6.4.19", "@storybook/react": "^6.4.19", - "@storybook/testing-library": "^0.0.9", - "@testing-library/jest-dom": "^5.5.0", - "@testing-library/react": "^10.0.3", - "@testing-library/react-hooks": "^7.0.2", - "babel-loader": "^8.2.5", - "jest": "^26.0.0", - "jest-transformer-svg": "^2.0.0", - "msw": "^0.24.1", - "serve-static": "^1.12.3", - "source-map-loader": "^3.0.1", - "ts-jest": "^26.3.0" + "@storybook/testing-library": "^0.0.9" }, "resolutions": { "@babel/cli": "~7.16.0", diff --git a/packages/common/package.json b/packages/common/package.json index 24b427853..8dd8a2ee5 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -27,8 +27,11 @@ }, "scripts": { "clean": "rm -rf dist && rm -rf lib && rm -rf **.tsbuildinfo || true", + "build:watch": "run -T tsc-watch --noClear --signalEmittedFiles -p ./tsconfig.build.es.json --onSuccess \"yarn build:watch:success\"", + "build:watch:success": "yarn build:esm:alias && yalc push --force", "build": "yarn clean && yarn build:esm && yarn build:cjs", - "build:esm": "run -T tsc --module esnext --project ./tsconfig.build.es.json && run -T tsc-alias -p ./tsconfig.build.es.json", + "build:esm": "run -T tsc --module esnext --project ./tsconfig.build.es.json && yarn build:esm:alias", + "build:esm:alias": "run -T tsc-alias -p ./tsconfig.build.es.json", "build:cjs": "run -T tsc --project ./tsconfig.build.json && run -T tsc-alias -p ./tsconfig.build.json", "build:types": "run -T tsc --module esnext --project ./tsconfig.build.es.json --emitDeclarationOnly && run -T tsc-alias -p ./tsconfig.build.es.json", "test": "NODE_ENV=test jest" diff --git a/packages/components/package.json b/packages/components/package.json index 4efc1313f..888d42c5d 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -33,8 +33,11 @@ }, "scripts": { "clean": "rm -rf dist && rm -rf lib && rm -rf **.tsbuildinfo || true", + "build:watch": "run -T tsc-watch --noClear --signalEmittedFiles -p ./tsconfig.build.es.json --onSuccess \"yarn build:watch:success\"", + "build:watch:success": "yarn build:esm:alias && yalc push --force", "build": "yarn clean && yarn build:esm && yarn build:cjs", - "build:esm": "run -T tsc --module esnext --project ./tsconfig.build.es.json && run -T tsc-alias -p ./tsconfig.build.es.json", + "build:esm": "run -T tsc --module esnext --project ./tsconfig.build.es.json && yarn build:esm:alias", + "build:esm:alias": "run -T tsc-alias -p ./tsconfig.build.es.json", "build:cjs": "run -T tsc --project ./tsconfig.build.json && run -T tsc-alias -p ./tsconfig.build.json", "build:types": "run -T tsc --module esnext --project ./tsconfig.build.es.json --emitDeclarationOnly && run -T tsc-alias -p ./tsconfig.build.es.json", "test": "NODE_ENV=test jest" diff --git a/packages/console/package.json b/packages/console/package.json index 870ac6776..9ff71dbed 100644 --- a/packages/console/package.json +++ b/packages/console/package.json @@ -33,7 +33,7 @@ "debug": "NM_DEBUG_LEVEL=2 yarn", "clean": "rm -rf dist && rm -rf lib && rm -rf **.tsbuildinfo || true", "build:watch": "run -T tsc-watch --noClear --signalEmittedFiles -p ./tsconfig.build.es.json --onSuccess \"yarn build:watch:success\"", - "build:watch:success": "yarn build:esm:alias && yalc push", + "build:watch:success": "yarn build:esm:alias && yalc push --force", "build": "yarn clean && yarn build:esm && yarn build:cjs", "build:esm": "mkdir lib && cp -R src/assets ./lib && run -T tsc --module esnext --project ./tsconfig.build.es.json && yarn build:esm:alias", "build:esm:alias": "run -T tsc-alias -p ./tsconfig.build.es.json", diff --git a/packages/console/src/components/Executions/index.ts b/packages/console/src/components/Executions/index.ts new file mode 100644 index 000000000..bd30e9d40 --- /dev/null +++ b/packages/console/src/components/Executions/index.ts @@ -0,0 +1,13 @@ +export * from './types'; +export { type ExecutionDetailsRouteParams } from './ExecutionDetails/ExecutionDetails'; +export { ExecutionStatusBadge } from './ExecutionStatusBadge'; +export { formatRetryAttempt } from './TaskExecutionsList/utils'; +export { TaskExecutionDetails } from './TaskExecutionsList/TaskExecutionDetails'; +export { makeTaskExecutionListQuery } from './taskExecutionQueries'; +export { useWorkflowExecutionQuery } from './useWorkflowExecution'; +export { NodeExecutionDetailsContextProvider } from './contextProvider/NodeExecutionDetails'; +export { getNodeFrontendPhase } from './utils'; +export { useWorkflowExecutionData } from './useWorkflowExecution'; +export { useNodeExecutionContext } from './contextProvider/NodeExecutionDetails'; +export { ExecutionDetailsActions } from './ExecutionDetails/ExecutionDetailsActions'; +export { makeNodeExecutionQuery } from './nodeExecutionQueries'; diff --git a/packages/console/src/components/Navigation/index.ts b/packages/console/src/components/Navigation/index.ts index 9787696bf..d203a865f 100644 --- a/packages/console/src/components/Navigation/index.ts +++ b/packages/console/src/components/Navigation/index.ts @@ -1 +1,2 @@ export * from './UserInformation'; +export { NavBarContent } from './NavBarContent'; diff --git a/packages/console/src/components/hooks/index.ts b/packages/console/src/components/hooks/index.ts new file mode 100644 index 000000000..3f9cb2773 --- /dev/null +++ b/packages/console/src/components/hooks/index.ts @@ -0,0 +1,2 @@ +export { useNodeExecution } from './useNodeExecution'; +export { useConditionalQuery } from './useConditionalQuery'; diff --git a/packages/console/src/components/index.ts b/packages/console/src/components/index.ts index 46d6d87d4..9491639c3 100644 --- a/packages/console/src/components/index.ts +++ b/packages/console/src/components/index.ts @@ -1,21 +1,7 @@ -export * from './Navigation'; export * from './App/App'; +export * from './Navigation'; -export { NavBarContent } from './Navigation/NavBarContent'; -export { useNodeExecution } from './hooks/useNodeExecution'; -export { useConditionalQuery } from './hooks/useConditionalQuery'; +export * from './Executions'; -export * from './Executions/types'; -export { type ExecutionDetailsRouteParams } from './Executions/ExecutionDetails/ExecutionDetails'; -export { ExecutionStatusBadge } from './Executions/ExecutionStatusBadge'; -export { formatRetryAttempt } from './Executions/TaskExecutionsList/utils'; -export { TaskExecutionDetails } from './Executions/TaskExecutionsList/TaskExecutionDetails'; -export { makeTaskExecutionListQuery } from './Executions/taskExecutionQueries'; -export { useWorkflowExecutionQuery } from './Executions/useWorkflowExecution'; -export { NodeExecutionDetailsContextProvider } from './Executions/contextProvider/NodeExecutionDetails'; -export { getNodeFrontendPhase } from './Executions/utils'; -export { useWorkflowExecutionData } from './Executions/useWorkflowExecution'; -export { useNodeExecutionContext } from './Executions/contextProvider/NodeExecutionDetails'; -export { ExecutionDetailsActions } from './Executions/ExecutionDetails/ExecutionDetailsActions'; -export { makeNodeExecutionQuery } from './Executions/nodeExecutionQueries'; +export * from './hooks'; export * from './common'; diff --git a/packages/flyte-api/package.json b/packages/flyte-api/package.json index d51134565..df268c231 100644 --- a/packages/flyte-api/package.json +++ b/packages/flyte-api/package.json @@ -33,8 +33,11 @@ }, "scripts": { "clean": "rm -rf dist && rm -rf lib && rm -rf **.tsbuildinfo || true", + "build:watch": "run -T tsc-watch --noClear --signalEmittedFiles -p ./tsconfig.build.es.json --onSuccess \"yarn build:watch:success\"", + "build:watch:success": "yarn build:esm:alias && yalc push --force", "build": "yarn clean && yarn build:esm && yarn build:cjs", - "build:esm": "run -T tsc --module esnext --project ./tsconfig.build.es.json && run -T tsc-alias -p ./tsconfig.build.es.json", + "build:esm": "run -T tsc --module esnext --project ./tsconfig.build.es.json && yarn build:esm:alias", + "build:esm:alias": "run -T tsc-alias -p ./tsconfig.build.es.json", "build:cjs": "run -T tsc --project ./tsconfig.build.json && run -T tsc-alias -p ./tsconfig.build.json", "build:types": "run -T tsc --module esnext --project ./tsconfig.build.es.json --emitDeclarationOnly && run -T tsc-alias -p ./tsconfig.build.es.json", "push:update": "yarn clean && yarn build && yarn publish", diff --git a/packages/flyteidl-types/package.json b/packages/flyteidl-types/package.json index f9931cda3..d98a23575 100644 --- a/packages/flyteidl-types/package.json +++ b/packages/flyteidl-types/package.json @@ -33,8 +33,11 @@ }, "scripts": { "clean": "rm -rf dist && rm -rf lib && rm -rf **.tsbuildinfo || true", + "build:watch": "run -T tsc-watch --noClear --signalEmittedFiles -p ./tsconfig.build.es.json --onSuccess \"yarn build:watch:success\"", + "build:watch:success": "yarn build:esm:alias && yalc push --force", "build": "yarn clean && yarn build:esm && yarn build:cjs", - "build:esm": "run -T tsc --module esnext --project ./tsconfig.build.es.json && run -T tsc-alias -p ./tsconfig.build.es.json", + "build:esm": "run -T tsc --module esnext --project ./tsconfig.build.es.json && yarn build:esm:alias", + "build:esm:alias": "run -T tsc-alias -p ./tsconfig.build.es.json", "build:cjs": "run -T tsc --project ./tsconfig.build.json && run -T tsc-alias -p ./tsconfig.build.json", "build:types": "run -T tsc --module esnext --project ./tsconfig.build.es.json --emitDeclarationOnly && run -T tsc-alias -p ./tsconfig.build.es.json", "test": "NODE_ENV=test jest" diff --git a/packages/locale/package.json b/packages/locale/package.json index 13efbee62..9caa8602b 100644 --- a/packages/locale/package.json +++ b/packages/locale/package.json @@ -34,7 +34,8 @@ "scripts": { "clean": "rm -rf dist && rm -rf lib && rm -rf node_modules && rm -rf tsconfig.build.tsbuildinfo", "build": "yarn clean && yarn build:esm && yarn build:cjs", - "build:esm": "run -T tsc --module esnext --project ./tsconfig.build.es.json && run -T tsc-alias -p ./tsconfig.build.es.json", + "build:esm": "run -T tsc --module esnext --project ./tsconfig.build.es.json && yarn build:esm:alias", + "build:esm:alias": "run -T tsc-alias -p ./tsconfig.build.es.json", "build:cjs": "run -T tsc --project ./tsconfig.build.json && run -T tsc-alias -p ./tsconfig.build.json", "build:types": "run -T tsc --module esnext --project ./tsconfig.build.es.json --emitDeclarationOnly && run -T tsc-alias -p ./tsconfig.build.es.json", "test": "NODE_ENV=test jest" diff --git a/packages/ui-atoms/package.json b/packages/ui-atoms/package.json index de1597275..995116c92 100644 --- a/packages/ui-atoms/package.json +++ b/packages/ui-atoms/package.json @@ -24,8 +24,11 @@ ], "scripts": { "clean": "rm -rf dist && rm -rf lib && rm -rf **.tsbuildinfo || true", + "build:watch": "run -T tsc-watch --noClear --signalEmittedFiles -p ./tsconfig.build.es.json --onSuccess \"yarn build:watch:success\"", + "build:watch:success": "yarn build:esm:alias && yalc push --force", "build": "yarn clean && yarn build:esm && yarn build:cjs", - "build:esm": "run -T tsc --module esnext --project ./tsconfig.build.es.json && run -T tsc-alias -p ./tsconfig.build.es.json", + "build:esm": "run -T tsc --module esnext --project ./tsconfig.build.es.json && yarn build:esm:alias", + "build:esm:alias": "run -T tsc-alias -p ./tsconfig.build.es.json", "build:cjs": "run -T tsc --project ./tsconfig.build.json && run -T tsc-alias -p ./tsconfig.build.json", "build:types": "run -T tsc --module esnext --project ./tsconfig.build.es.json --emitDeclarationOnly && run -T tsc-alias -p ./tsconfig.build.es.json", "test": "NODE_ENV=test jest" diff --git a/yarn.lock b/yarn.lock index a867b1bde..37a604265 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6217,7 +6217,7 @@ __metadata: languageName: node linkType: hard -"abab@npm:^2.0.3, abab@npm:^2.0.5": +"abab@npm:^2.0.3, abab@npm:^2.0.5, abab@npm:^2.0.6": version: 2.0.6 resolution: "abab@npm:2.0.6" checksum: 6ffc1af4ff315066c62600123990d87551ceb0aafa01e6539da77b0f5987ac7019466780bf480f1787576d4385e3690c81ccc37cfda12819bf510b8ab47e5a3e @@ -11580,7 +11580,7 @@ __metadata: react: ^16.13.1 react-dom: ^16.13.1 serve-static: ^1.12.3 - source-map-loader: ^3.0.1 + source-map-loader: ^4.0.1 ts-jest: ^26.3.0 ts-loader: ^9.2.6 ts-node: ^8.0.2 @@ -20065,23 +20065,23 @@ __metadata: languageName: node linkType: hard -"source-map-js@npm:^1.0.1, source-map-js@npm:^1.0.2": +"source-map-js@npm:^1.0.2": version: 1.0.2 resolution: "source-map-js@npm:1.0.2" checksum: c049a7fc4deb9a7e9b481ae3d424cc793cb4845daa690bc5a05d428bf41bf231ced49b4cf0c9e77f9d42fdb3d20d6187619fc586605f5eabe995a316da8d377c languageName: node linkType: hard -"source-map-loader@npm:^3.0.1": - version: 3.0.2 - resolution: "source-map-loader@npm:3.0.2" +"source-map-loader@npm:^4.0.1": + version: 4.0.1 + resolution: "source-map-loader@npm:4.0.1" dependencies: - abab: ^2.0.5 + abab: ^2.0.6 iconv-lite: ^0.6.3 - source-map-js: ^1.0.1 + source-map-js: ^1.0.2 peerDependencies: - webpack: ^5.0.0 - checksum: d5a4e2ab190c93ae5cba68c247fbaa9fd560333c91060602b634c399a8a4b3205b8c07714c3bcdb0a11c6cc5476c06256bd8e824e71fbbb7981e8fad5cba4a00 + webpack: ^5.72.1 + checksum: 4ddca8b03dc61f406effd4bffe70de4b87fef48bae6f737017b2dabcbc7d609133325be1e73838e9265331de28039111d729fcbb8bce88a6018a816bef510eb1 languageName: node linkType: hard From 77932de867fde66d556b79932835b95996c19d28 Mon Sep 17 00:00:00 2001 From: james-union <105876962+james-union@users.noreply.github.com> Date: Mon, 27 Mar 2023 22:14:34 -0400 Subject: [PATCH 32/34] Add REJECT support for ApprovedCondition for GateNodes (#733) * fix: approveCondition reject Signed-off-by: James * fix: approve button Signed-off-by: James --------- Signed-off-by: James Signed-off-by: 4nalog <4nalog@protonmail.com> --- .../Launch/LaunchForm/LaunchFormActions.tsx | 22 +++++++++++++++++++ .../Launch/LaunchForm/ResumeSignalForm.tsx | 11 +++++++++- .../Launch/LaunchForm/launchMachine.ts | 18 +++++++++++++-- .../components/Launch/LaunchForm/strings.ts | 2 ++ .../Launch/LaunchForm/useResumeFormState.ts | 5 ++--- 5 files changed, 52 insertions(+), 6 deletions(-) diff --git a/packages/console/src/components/Launch/LaunchForm/LaunchFormActions.tsx b/packages/console/src/components/Launch/LaunchForm/LaunchFormActions.tsx index 1cce84b40..d71728dc3 100644 --- a/packages/console/src/components/Launch/LaunchForm/LaunchFormActions.tsx +++ b/packages/console/src/components/Launch/LaunchForm/LaunchFormActions.tsx @@ -15,6 +15,7 @@ export interface LaunchFormActionsProps { onClose(): void; isError: boolean; submitTitle: string; + rejectTitle?: string; } /** Renders the Submit/Cancel buttons for a LaunchForm */ export const LaunchFormActions: React.FC = ({ @@ -23,6 +24,7 @@ export const LaunchFormActions: React.FC = ({ onClose, isError, submitTitle, + rejectTitle, }) => { const styles = useStyles(); const submissionInFlight = state.matches(LaunchState.SUBMITTING); @@ -35,6 +37,13 @@ export const LaunchFormActions: React.FC = ({ const submit: React.FormEventHandler = event => { event.preventDefault(); + service.send({ type: 'SELECT_REJECT', value: false }); + service.send({ type: 'SUBMIT' }); + }; + + const reject: React.FormEventHandler = event => { + event.preventDefault(); + service.send({ type: 'SELECT_REJECT', value: true }); service.send({ type: 'SUBMIT' }); }; @@ -99,6 +108,19 @@ export const LaunchFormActions: React.FC = ({ > {t('cancel')} + {rejectTitle && ( + + )}