From c37050bd5ad652efa088842bd7030021b9c6ed33 Mon Sep 17 00:00:00 2001 From: Carina Ursu Date: Thu, 9 Mar 2023 10:22:20 -0800 Subject: [PATCH] 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"