From d4f4dc7fc9696d991a3115ab658b632dfcef6bef Mon Sep 17 00:00:00 2001 From: Aleksandar Toplek Date: Thu, 16 Nov 2023 23:56:12 +0100 Subject: [PATCH 01/15] feat(doprocess): Added indexes for "foreign keys" --- web/apps/doprocess.app/drizzle.config.ts | 2 +- web/apps/doprocess.app/src/lib/db/schema.ts | 31 +++++++++++++++------ 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/web/apps/doprocess.app/drizzle.config.ts b/web/apps/doprocess.app/drizzle.config.ts index cbad2fb83a..ba9342272e 100644 --- a/web/apps/doprocess.app/drizzle.config.ts +++ b/web/apps/doprocess.app/drizzle.config.ts @@ -10,7 +10,7 @@ export default { out: './src/lib/db/migrations', driver: 'mysql2', dbCredentials: { - connectionString: connectionString, + uri: connectionString, }, breakpoints: true, } satisfies Config diff --git a/web/apps/doprocess.app/src/lib/db/schema.ts b/web/apps/doprocess.app/src/lib/db/schema.ts index 05fc660b1a..2a795b94e6 100644 --- a/web/apps/doprocess.app/src/lib/db/schema.ts +++ b/web/apps/doprocess.app/src/lib/db/schema.ts @@ -1,16 +1,18 @@ -import { datetime, int, json, mysqlTable, serial, text, varchar } from 'drizzle-orm/mysql-core'; +import { datetime, index, int, json, mysqlTable, serial, text, uniqueIndex, varchar } from 'drizzle-orm/mysql-core'; import { relations, sql } from 'drizzle-orm'; export const process = mysqlTable('process', { id: serial('id').primaryKey(), publicId: varchar('public_id', { length: 32 }).notNull().unique(), name: varchar('name', { length: 255 }).notNull(), - sharedWithUsers: json('shared_with_users').notNull(), + sharedWithUsers: json('shared_with_users').$type().notNull(), createdBy: varchar('created_by', { length: 255 }).notNull(), createdAt: datetime('created_at', { mode: 'date' }).notNull().default(sql`current_timestamp`), updatedBy: varchar('updated_by', { length: 255 }), updatedAt: datetime('updated_at', { mode: 'date' }), -}); +}, (table) => ({ + publicIdIdx: uniqueIndex('public_id_idx').on(table.publicId) +})); export type Process = typeof process.$inferSelect; @@ -24,7 +26,10 @@ export const processRun = mysqlTable('process_run', { createdAt: datetime('created_at', { mode: 'date' }).notNull().default(sql`current_timestamp`), updatedBy: varchar('updated_by', { length: 255 }), updatedAt: datetime('updated_at', { mode: 'date' }), -}); +}, (table) => ({ + processIdIdx: index('process_id_idx').on(table.processId), + publicIdIdx: index('public_id_idx').on(table.publicId), +})); export type ProcessRun = typeof processRun.$inferSelect; @@ -40,7 +45,10 @@ export const taskDefinition = mysqlTable('task_definition', { createdAt: datetime('created_at', { mode: 'date' }).notNull().default(sql`current_timestamp`), updatedBy: varchar('updated_by', { length: 255 }), updatedAt: datetime('updated_at', { mode: 'date' }), -}); +}, (table) => ({ + processIdIdx: index('process_id_idx').on(table.processId), + publicIdIdx: index('public_id_idx').on(table.publicId), +})); export type TaskDefinition = typeof taskDefinition.$inferSelect; @@ -49,12 +57,14 @@ export const document = mysqlTable('document', { publicId: varchar('public_id', { length: 32 }).notNull().unique(), name: text('name').notNull(), data: json('data'), - sharedWithUsers: json('shared_with_users').notNull(), + sharedWithUsers: json('shared_with_users').$type().notNull(), createdBy: varchar('created_by', { length: 255 }).notNull(), createdAt: datetime('created_at', { mode: 'date' }).notNull().default(sql`current_timestamp`), updatedBy: varchar('updated_by', { length: 255 }), updatedAt: datetime('updated_at', { mode: 'date' }), -}); +}, (table) => ({ + publicIdIdx: uniqueIndex('public_id_idx').on(table.publicId), +})); export type Document = typeof document.$inferSelect; @@ -80,7 +90,12 @@ export const task = mysqlTable('task', { createdAt: datetime('created_at', { mode: 'date' }).notNull().default(sql`current_timestamp`), updatedBy: varchar('changed_by', { length: 255 }), updatedAt: datetime('changed_at', { mode: 'date' }) -}); +}, (table) => ({ + processIdIdx: index('process_id_idx').on(table.processId), + runIdIdx: index('run_id_idx').on(table.runId), + taskDefinitionIdIdx: index('task_definition_id_idx').on(table.taskDefinitionId), + publicIdIdx: index('public_id_idx').on(table.publicId), +})); export type TaskState = 'new' | 'completed'; From b2faa6d121e24e021356db8e106587029fb51f2b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 16 Nov 2023 23:11:20 +0000 Subject: [PATCH 02/15] chore(deps): update dependency @playwright/test to v1.40.0 --- web/apps/app/package.json | 2 +- web/apps/blog/package.json | 2 +- web/apps/brandgrab/package.json | 2 +- web/apps/doprocess.app/package.json | 2 +- web/apps/slco/package.json | 2 +- web/apps/web/package.json | 2 +- web/pnpm-lock.yaml | 42 ++++++++++++++++------------- 7 files changed, 30 insertions(+), 24 deletions(-) diff --git a/web/apps/app/package.json b/web/apps/app/package.json index f43e5f4168..c0f2a50a84 100644 --- a/web/apps/app/package.json +++ b/web/apps/app/package.json @@ -72,7 +72,7 @@ "@axe-core/playwright": "4.8.1", "@ducanh2912/next-pwa": "9.7.2", "@next/bundle-analyzer": "14.0.3", - "@playwright/test": "1.39.0", + "@playwright/test": "1.40.0", "@signalco/eslint-config-signalco": "workspace:*", "@signalco/tsconfig": "workspace:*", "@total-typescript/ts-reset": "0.5.1", diff --git a/web/apps/blog/package.json b/web/apps/blog/package.json index 62fb85c8ec..61722c51a5 100644 --- a/web/apps/blog/package.json +++ b/web/apps/blog/package.json @@ -47,7 +47,7 @@ "@axe-core/playwright": "4.8.1", "@babel/core": "7.23.3", "@next/bundle-analyzer": "14.0.3", - "@playwright/test": "1.39.0", + "@playwright/test": "1.40.0", "@signalco/eslint-config-signalco": "workspace:*", "@signalco/tsconfig": "workspace:*", "@total-typescript/ts-reset": "0.5.1", diff --git a/web/apps/brandgrab/package.json b/web/apps/brandgrab/package.json index 3b35e80280..eecd148111 100644 --- a/web/apps/brandgrab/package.json +++ b/web/apps/brandgrab/package.json @@ -37,7 +37,7 @@ "@axe-core/playwright": "4.8.1", "@babel/core": "7.23.3", "@next/bundle-analyzer": "14.0.3", - "@playwright/test": "1.39.0", + "@playwright/test": "1.40.0", "@signalco/eslint-config-signalco": "workspace:*", "@signalco/tsconfig": "workspace:*", "@types/color": "3.0.6", diff --git a/web/apps/doprocess.app/package.json b/web/apps/doprocess.app/package.json index 511371f49d..3e8b4d2cce 100644 --- a/web/apps/doprocess.app/package.json +++ b/web/apps/doprocess.app/package.json @@ -54,7 +54,7 @@ "@babel/core": "7.23.3", "@ducanh2912/next-pwa": "9.7.2", "@next/bundle-analyzer": "14.0.3", - "@playwright/test": "1.39.0", + "@playwright/test": "1.40.0", "@signalco/eslint-config-signalco": "workspace:*", "@signalco/tsconfig": "workspace:*", "@total-typescript/ts-reset": "0.5.1", diff --git a/web/apps/slco/package.json b/web/apps/slco/package.json index fbd310d0f6..5659e5daaf 100644 --- a/web/apps/slco/package.json +++ b/web/apps/slco/package.json @@ -38,7 +38,7 @@ "@axe-core/playwright": "4.8.1", "@babel/core": "7.23.3", "@next/bundle-analyzer": "14.0.3", - "@playwright/test": "1.39.0", + "@playwright/test": "1.40.0", "@signalco/eslint-config-signalco": "workspace:*", "@signalco/tsconfig": "workspace:*", "@total-typescript/ts-reset": "0.5.1", diff --git a/web/apps/web/package.json b/web/apps/web/package.json index 336900557a..41c63d4ade 100644 --- a/web/apps/web/package.json +++ b/web/apps/web/package.json @@ -50,7 +50,7 @@ "@babel/core": "7.23.3", "@ducanh2912/next-pwa": "9.7.2", "@next/bundle-analyzer": "14.0.3", - "@playwright/test": "1.39.0", + "@playwright/test": "1.40.0", "@signalco/eslint-config-signalco": "workspace:*", "@signalco/tsconfig": "workspace:*", "@total-typescript/ts-reset": "0.5.1", diff --git a/web/pnpm-lock.yaml b/web/pnpm-lock.yaml index c95fcafc23..3669877ae3 100644 --- a/web/pnpm-lock.yaml +++ b/web/pnpm-lock.yaml @@ -175,8 +175,8 @@ importers: specifier: 14.0.3 version: 14.0.3 '@playwright/test': - specifier: 1.39.0 - version: 1.39.0 + specifier: 1.40.0 + version: 1.40.0 '@signalco/eslint-config-signalco': specifier: workspace:* version: link:../../packages/eslint-config-signalco @@ -341,8 +341,8 @@ importers: specifier: 14.0.3 version: 14.0.3 '@playwright/test': - specifier: 1.39.0 - version: 1.39.0 + specifier: 1.40.0 + version: 1.40.0 '@signalco/eslint-config-signalco': specifier: workspace:* version: link:../../packages/eslint-config-signalco @@ -453,8 +453,8 @@ importers: specifier: 14.0.3 version: 14.0.3 '@playwright/test': - specifier: 1.39.0 - version: 1.39.0 + specifier: 1.40.0 + version: 1.40.0 '@signalco/eslint-config-signalco': specifier: workspace:* version: link:../../packages/eslint-config-signalco @@ -632,8 +632,8 @@ importers: specifier: 14.0.3 version: 14.0.3 '@playwright/test': - specifier: 1.39.0 - version: 1.39.0 + specifier: 1.40.0 + version: 1.40.0 '@signalco/eslint-config-signalco': specifier: workspace:* version: link:../../packages/eslint-config-signalco @@ -744,8 +744,8 @@ importers: specifier: 14.0.3 version: 14.0.3 '@playwright/test': - specifier: 1.39.0 - version: 1.39.0 + specifier: 1.40.0 + version: 1.40.0 '@signalco/eslint-config-signalco': specifier: workspace:* version: link:../../packages/eslint-config-signalco @@ -989,8 +989,8 @@ importers: specifier: 14.0.3 version: 14.0.3 '@playwright/test': - specifier: 1.39.0 - version: 1.39.0 + specifier: 1.40.0 + version: 1.40.0 '@signalco/eslint-config-signalco': specifier: workspace:* version: link:../../packages/eslint-config-signalco @@ -5095,12 +5095,12 @@ packages: engines: {node: '>=16'} dev: false - /@playwright/test@1.39.0: - resolution: {integrity: sha512-3u1iFqgzl7zr004bGPYiN/5EZpRUSFddQBra8Rqll5N0/vfpqlP9I9EXqAoGacuAbX6c9Ulg/Cjqglp5VkK6UQ==} + /@playwright/test@1.40.0: + resolution: {integrity: sha512-PdW+kn4eV99iP5gxWNSDQCbhMaDVej+RXL5xr6t04nbKLCBwYtA046t7ofoczHOm8u6c+45hpDKQVZqtqwkeQg==} engines: {node: '>=16'} hasBin: true dependencies: - playwright: 1.39.0 + playwright: 1.40.0 dev: true /@pmmmwh/react-refresh-webpack-plugin@0.5.11(react-refresh@0.11.0)(webpack@5.89.0): @@ -15600,12 +15600,18 @@ packages: hasBin: true dev: true - /playwright@1.39.0: - resolution: {integrity: sha512-naE5QT11uC/Oiq0BwZ50gDmy8c8WLPRTEWuSSFVG2egBka/1qMoSqYQcROMT9zLwJ86oPofcTH2jBY/5wWOgIw==} + /playwright-core@1.40.0: + resolution: {integrity: sha512-fvKewVJpGeca8t0ipM56jkVSU6Eo0RmFvQ/MaCQNDYm+sdvKkMBBWTE1FdeMqIdumRaXXjZChWHvIzCGM/tA/Q==} + engines: {node: '>=16'} + hasBin: true + dev: true + + /playwright@1.40.0: + resolution: {integrity: sha512-gyHAgQjiDf1m34Xpwzaqb76KgfzYrhK7iih+2IzcOCoZWr/8ZqmdBw+t0RU85ZmfJMgtgAiNtBQ/KS2325INXw==} engines: {node: '>=16'} hasBin: true dependencies: - playwright-core: 1.39.0 + playwright-core: 1.40.0 optionalDependencies: fsevents: 2.3.2 dev: true From 1f898da32ec19dedd8635f64ecae664a1ad3911f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 17 Nov 2023 00:30:27 +0000 Subject: [PATCH 03/15] chore(deps): update mcr.microsoft.com/playwright docker tag to v1.40.0 --- .github/workflows/web-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/web-test.yml b/.github/workflows/web-test.yml index 589c988637..16ec03a873 100644 --- a/.github/workflows/web-test.yml +++ b/.github/workflows/web-test.yml @@ -24,7 +24,7 @@ jobs: TURBO_TEAM: signalco TURBO_REMOTE_ONLY: true container: - image: mcr.microsoft.com/playwright:v1.39.0-focal + image: mcr.microsoft.com/playwright:v1.40.0-focal steps: - uses: actions/checkout@v4 with: From 8be9682972aab3cb4e049c12c8975b06889c97e3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 17 Nov 2023 04:30:24 +0000 Subject: [PATCH 04/15] chore(deps): update dependency porcupine to v3.0.1 --- station/Signal.Beacon.Voice/Signal.Beacon.Voice.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/station/Signal.Beacon.Voice/Signal.Beacon.Voice.csproj b/station/Signal.Beacon.Voice/Signal.Beacon.Voice.csproj index 443dd46ab4..a69740b9f6 100644 --- a/station/Signal.Beacon.Voice/Signal.Beacon.Voice.csproj +++ b/station/Signal.Beacon.Voice/Signal.Beacon.Voice.csproj @@ -21,7 +21,7 @@ - + From 75fe8f25239eccc602d0dc8d706509622f52d6cc Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 17 Nov 2023 04:31:09 +0000 Subject: [PATCH 05/15] chore(deps): update dependency tsup to v7.3.0 --- web/packages/data/package.json | 2 +- web/packages/hooks/package.json | 2 +- web/packages/js/package.json | 2 +- web/packages/lexorder/package.json | 2 +- web/packages/ui-icons/package.json | 2 +- web/packages/ui/package.json | 2 +- web/pnpm-lock.yaml | 72 ++++++++++++------------------ 7 files changed, 35 insertions(+), 49 deletions(-) diff --git a/web/packages/data/package.json b/web/packages/data/package.json index 6b0ada397c..fbd5e6f3c3 100644 --- a/web/packages/data/package.json +++ b/web/packages/data/package.json @@ -22,7 +22,7 @@ "devDependencies": { "@signalco/tsconfig": "workspace:*", "rimraf": "5.0.5", - "tsup": "7.2.0", + "tsup": "7.3.0", "typescript": "5.2.2" } } diff --git a/web/packages/hooks/package.json b/web/packages/hooks/package.json index 56366db1e2..a2f79d8a31 100644 --- a/web/packages/hooks/package.json +++ b/web/packages/hooks/package.json @@ -27,7 +27,7 @@ "react": "18.2.0", "react-dom": "18.2.0", "rimraf": "5.0.5", - "tsup": "7.2.0", + "tsup": "7.3.0", "typescript": "5.2.2" }, "peerDependencies": { diff --git a/web/packages/js/package.json b/web/packages/js/package.json index 49066b1a29..850a578124 100644 --- a/web/packages/js/package.json +++ b/web/packages/js/package.json @@ -24,7 +24,7 @@ "react": "18.2.0", "react-dom": "18.2.0", "rimraf": "5.0.5", - "tsup": "7.2.0", + "tsup": "7.3.0", "typescript": "5.2.2" }, "peerDependencies": { diff --git a/web/packages/lexorder/package.json b/web/packages/lexorder/package.json index 6b3e618023..31cf3c05a3 100644 --- a/web/packages/lexorder/package.json +++ b/web/packages/lexorder/package.json @@ -21,7 +21,7 @@ "devDependencies": { "@signalco/tsconfig": "workspace:*", "rimraf": "5.0.5", - "tsup": "7.2.0", + "tsup": "7.3.0", "typescript": "5.2.2" } } \ No newline at end of file diff --git a/web/packages/ui-icons/package.json b/web/packages/ui-icons/package.json index de638fecf0..b2b62a5a65 100644 --- a/web/packages/ui-icons/package.json +++ b/web/packages/ui-icons/package.json @@ -25,7 +25,7 @@ "react": "18.2.0", "react-dom": "18.2.0", "rimraf": "5.0.5", - "tsup": "7.2.0", + "tsup": "7.3.0", "typescript": "5.2.2" }, "peerDependencies": { diff --git a/web/packages/ui/package.json b/web/packages/ui/package.json index ffeb996c05..c22c5e502f 100644 --- a/web/packages/ui/package.json +++ b/web/packages/ui/package.json @@ -32,7 +32,7 @@ "postcss-preset-env": "9.3.0", "rimraf": "5.0.5", "sass": "1.69.5", - "tsup": "7.2.0", + "tsup": "7.3.0", "typescript": "5.2.2" }, "dependencies": { diff --git a/web/pnpm-lock.yaml b/web/pnpm-lock.yaml index 3669877ae3..9125514f9f 100644 --- a/web/pnpm-lock.yaml +++ b/web/pnpm-lock.yaml @@ -167,7 +167,7 @@ importers: devDependencies: '@axe-core/playwright': specifier: 4.8.1 - version: 4.8.1(playwright-core@1.39.0) + version: 4.8.1(playwright-core@1.40.0) '@ducanh2912/next-pwa': specifier: 9.7.2 version: 9.7.2(next@14.0.3)(webpack@5.89.0) @@ -333,7 +333,7 @@ importers: devDependencies: '@axe-core/playwright': specifier: 4.8.1 - version: 4.8.1(playwright-core@1.39.0) + version: 4.8.1(playwright-core@1.40.0) '@babel/core': specifier: 7.23.3 version: 7.23.3 @@ -445,7 +445,7 @@ importers: devDependencies: '@axe-core/playwright': specifier: 4.8.1 - version: 4.8.1(playwright-core@1.39.0) + version: 4.8.1(playwright-core@1.40.0) '@babel/core': specifier: 7.23.3 version: 7.23.3 @@ -621,7 +621,7 @@ importers: devDependencies: '@axe-core/playwright': specifier: 4.8.1 - version: 4.8.1(playwright-core@1.39.0) + version: 4.8.1(playwright-core@1.40.0) '@babel/core': specifier: 7.23.3 version: 7.23.3 @@ -736,7 +736,7 @@ importers: devDependencies: '@axe-core/playwright': specifier: 4.8.1 - version: 4.8.1(playwright-core@1.39.0) + version: 4.8.1(playwright-core@1.40.0) '@babel/core': specifier: 7.23.3 version: 7.23.3 @@ -978,7 +978,7 @@ importers: devDependencies: '@axe-core/playwright': specifier: 4.8.1 - version: 4.8.1(playwright-core@1.39.0) + version: 4.8.1(playwright-core@1.40.0) '@babel/core': specifier: 7.23.3 version: 7.23.3 @@ -1058,8 +1058,8 @@ importers: specifier: 5.0.5 version: 5.0.5 tsup: - specifier: 7.2.0 - version: 7.2.0(postcss@8.4.31)(typescript@5.2.2) + specifier: 7.3.0 + version: 7.3.0(postcss@8.4.31)(typescript@5.2.2) typescript: specifier: 5.2.2 version: 5.2.2 @@ -1121,8 +1121,8 @@ importers: specifier: 5.0.5 version: 5.0.5 tsup: - specifier: 7.2.0 - version: 7.2.0(postcss@8.4.31)(typescript@5.2.2) + specifier: 7.3.0 + version: 7.3.0(postcss@8.4.31)(typescript@5.2.2) typescript: specifier: 5.2.2 version: 5.2.2 @@ -1142,8 +1142,8 @@ importers: specifier: 5.0.5 version: 5.0.5 tsup: - specifier: 7.2.0 - version: 7.2.0(postcss@8.4.31)(typescript@5.2.2) + specifier: 7.3.0 + version: 7.3.0(postcss@8.4.31)(typescript@5.2.2) typescript: specifier: 5.2.2 version: 5.2.2 @@ -1157,8 +1157,8 @@ importers: specifier: 5.0.5 version: 5.0.5 tsup: - specifier: 7.2.0 - version: 7.2.0(postcss@8.4.31)(typescript@5.2.2) + specifier: 7.3.0 + version: 7.3.0(postcss@8.4.31)(typescript@5.2.2) typescript: specifier: 5.2.2 version: 5.2.2 @@ -1271,8 +1271,8 @@ importers: specifier: 1.69.5 version: 1.69.5 tsup: - specifier: 7.2.0 - version: 7.2.0(postcss@8.4.31)(typescript@5.2.2) + specifier: 7.3.0 + version: 7.3.0(postcss@8.4.31)(typescript@5.2.2) typescript: specifier: 5.2.2 version: 5.2.2 @@ -1295,8 +1295,8 @@ importers: specifier: 5.0.5 version: 5.0.5 tsup: - specifier: 7.2.0 - version: 7.2.0(postcss@8.4.31)(typescript@5.2.2) + specifier: 7.3.0 + version: 7.3.0(postcss@8.4.31)(typescript@5.2.2) typescript: specifier: 5.2.2 version: 5.2.2 @@ -1352,13 +1352,13 @@ packages: default-browser-id: 3.0.0 dev: true - /@axe-core/playwright@4.8.1(playwright-core@1.39.0): + /@axe-core/playwright@4.8.1(playwright-core@1.40.0): resolution: {integrity: sha512-KC1X++UdRAwMLRvB+BIKFheyLHUnbJTL0t0Wbv6TJMozn2V2QyEtAcN6jyUiudtGiLUGhHCtj/eWorBnVZ4dAA==} peerDependencies: playwright-core: '>= 1.0.0' dependencies: axe-core: 4.8.2 - playwright-core: 1.39.0 + playwright-core: 1.40.0 dev: true /@babel/code-frame@7.22.13: @@ -9532,13 +9532,13 @@ packages: resolution: {integrity: sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ==} dev: true - /bundle-require@4.0.2(esbuild@0.18.20): + /bundle-require@4.0.2(esbuild@0.19.5): resolution: {integrity: sha512-jwzPOChofl67PSTW2SGubV9HBQAhhR2i6nskiOThauo9dzwDUgOWQScFVaJkjEfYX+UXiD+LEx8EblQMc2wIag==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} peerDependencies: esbuild: '>=0.17' dependencies: - esbuild: 0.18.20 + esbuild: 0.19.5 load-tsconfig: 0.2.5 dev: true @@ -15594,12 +15594,6 @@ packages: find-up: 6.3.0 dev: true - /playwright-core@1.39.0: - resolution: {integrity: sha512-+k4pdZgs1qiM+OUkSjx96YiKsXsmb59evFoqv8SKO067qBA+Z2s/dCzJij/ZhdQcs2zlTAgRKfeiiLm8PQ2qvw==} - engines: {node: '>=16'} - hasBin: true - dev: true - /playwright-core@1.40.0: resolution: {integrity: sha512-fvKewVJpGeca8t0ipM56jkVSU6Eo0RmFvQ/MaCQNDYm+sdvKkMBBWTE1FdeMqIdumRaXXjZChWHvIzCGM/tA/Q==} engines: {node: '>=16'} @@ -17224,14 +17218,6 @@ packages: fsevents: 2.3.3 dev: true - /rollup@3.29.4: - resolution: {integrity: sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw==} - engines: {node: '>=14.18.0', npm: '>=8.0.0'} - hasBin: true - optionalDependencies: - fsevents: 2.3.3 - dev: true - /rollup@4.4.1: resolution: {integrity: sha512-idZzrUpWSblPJX66i+GzrpjKE3vbYrlWirUHteoAbjKReZwa0cohAErOYA5efoMmNCdvG9yrJS+w9Kl6csaH4w==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} @@ -18448,14 +18434,14 @@ packages: /tslib@2.6.2: resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - /tsup@7.2.0(postcss@8.4.31)(typescript@5.2.2): - resolution: {integrity: sha512-vDHlczXbgUvY3rWvqFEbSqmC1L7woozbzngMqTtL2PGBODTtWlRwGDDawhvWzr5c1QjKe4OAKqJGfE1xeXUvtQ==} - engines: {node: '>=16.14'} + /tsup@7.3.0(postcss@8.4.31)(typescript@5.2.2): + resolution: {integrity: sha512-Ja1eaSRrE+QarmATlNO5fse2aOACYMBX+IZRKy1T+gpyH+jXgRrl5l4nHIQJQ1DoDgEjHDTw8cpE085UdBZuWQ==} + engines: {node: '>=18'} hasBin: true peerDependencies: '@swc/core': ^1 postcss: ^8.4.12 - typescript: '>=4.1.0' + typescript: '>=4.5.0' peerDependenciesMeta: '@swc/core': optional: true @@ -18464,18 +18450,18 @@ packages: typescript: optional: true dependencies: - bundle-require: 4.0.2(esbuild@0.18.20) + bundle-require: 4.0.2(esbuild@0.19.5) cac: 6.7.14 chokidar: 3.5.3 debug: 4.3.4 - esbuild: 0.18.20 + esbuild: 0.19.5 execa: 5.1.1 globby: 11.1.0 joycon: 3.1.1 postcss: 8.4.31 postcss-load-config: 4.0.1(postcss@8.4.31) resolve-from: 5.0.0 - rollup: 3.29.4 + rollup: 4.4.1 source-map: 0.8.0-beta.0 sucrase: 3.34.0 tree-kill: 1.2.2 From 9fbe758f2ca1370c79b2c1ad1acbf378c1174bcc Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 17 Nov 2023 14:17:33 +0000 Subject: [PATCH 06/15] fix(deps): update dependency @vvo/tzdb to v6.113.0 --- web/apps/app/package.json | 2 +- web/pnpm-lock.yaml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/web/apps/app/package.json b/web/apps/app/package.json index c0f2a50a84..4bdfd87754 100644 --- a/web/apps/app/package.json +++ b/web/apps/app/package.json @@ -42,7 +42,7 @@ "@tanstack/react-query-devtools": "5.8.4", "@tanstack/react-query-persist-client": "5.8.4", "@vercel/analytics": "1.1.1", - "@vvo/tzdb": "6.112.0", + "@vvo/tzdb": "6.113.0", "autoprefixer": "10.4.16", "classix": "2.1.35", "cobe": "0.6.3", diff --git a/web/pnpm-lock.yaml b/web/pnpm-lock.yaml index 9125514f9f..71f323ed31 100644 --- a/web/pnpm-lock.yaml +++ b/web/pnpm-lock.yaml @@ -90,8 +90,8 @@ importers: specifier: 1.1.1 version: 1.1.1 '@vvo/tzdb': - specifier: 6.112.0 - version: 6.112.0 + specifier: 6.113.0 + version: 6.113.0 autoprefixer: specifier: 10.4.16 version: 10.4.16(postcss@8.4.31) @@ -8656,8 +8656,8 @@ packages: - '@swc/helpers' dev: true - /@vvo/tzdb@6.112.0: - resolution: {integrity: sha512-N6FQ/bnx11+9PrBKVDmYZQrAZPUc3xriKIHPJj9hKRQ+ioHRosljPeuoC0MixX1U4a2MDimCfK/FVriO8U6DWg==} + /@vvo/tzdb@6.113.0: + resolution: {integrity: sha512-1cf8T5BWJ9oRbk0QN+ilnfAQhYKYEcnWwtTH+A/XGOst76e6Jz5GTvzQLZ5zfHVCD1mde2XzppGqc6N2zy913Q==} dev: false /@webassemblyjs/ast@1.11.6: From 005cb52ecbbbeedee3ac18a872bce54edc16a590 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 17 Nov 2023 18:40:48 +0000 Subject: [PATCH 07/15] chore(deps): update dependency drizzle-kit to v0.20.4 --- web/apps/doprocess.app/package.json | 2 +- web/pnpm-lock.yaml | 23 ++++++++++++----------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/web/apps/doprocess.app/package.json b/web/apps/doprocess.app/package.json index 3e8b4d2cce..0ed20ae9d8 100644 --- a/web/apps/doprocess.app/package.json +++ b/web/apps/doprocess.app/package.json @@ -64,7 +64,7 @@ "@types/react-dom": "18.2.15", "cross-env": "7.0.3", "dotenv": "16.3.1", - "drizzle-kit": "0.20.2", + "drizzle-kit": "0.20.4", "eslint": "8.53.0", "next-sitemap": "4.2.3", "postcss": "8.4.31", diff --git a/web/pnpm-lock.yaml b/web/pnpm-lock.yaml index 71f323ed31..492c15894b 100644 --- a/web/pnpm-lock.yaml +++ b/web/pnpm-lock.yaml @@ -662,8 +662,8 @@ importers: specifier: 16.3.1 version: 16.3.1 drizzle-kit: - specifier: 0.20.2 - version: 0.20.2 + specifier: 0.20.4 + version: 0.20.4 eslint: specifier: 8.53.0 version: 8.53.0 @@ -5069,7 +5069,7 @@ packages: resolution: {integrity: sha512-coUfuoMeIB7B8/NMekxaDzLhaYmp0HZNPEjYRm9goRou8UZIC3z21s0sL9AWoCw4EG876QyO3kYrc61WNF9B/w==} engines: {node: '>=8.0.0'} dependencies: - tslib: 2.4.1 + tslib: 2.6.2 dev: false /@peculiar/webcrypto@1.4.1: @@ -5079,7 +5079,7 @@ packages: '@peculiar/asn1-schema': 2.3.8 '@peculiar/json-schema': 1.1.12 pvtsutils: 1.3.5 - tslib: 2.4.1 + tslib: 2.6.2 webcrypto-core: 1.7.7 dev: false @@ -10847,7 +10847,7 @@ packages: resolution: {integrity: sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==} dependencies: no-case: 3.0.4 - tslib: 2.4.1 + tslib: 2.6.2 /dotenv-expand@10.0.0: resolution: {integrity: sha512-GopVGCpVS1UKH75VKHGuQFqS1Gusej0z4FyQkPdwjil2gNIv+LNsqBlboOzpJFZKVT95GkCyWJbBSdFEFUWI2A==} @@ -10871,8 +10871,8 @@ packages: wordwrap: 1.0.0 dev: true - /drizzle-kit@0.20.2: - resolution: {integrity: sha512-4iwjsIj2sY3B3MleKeyNzg/6myjXbTE/CBOXwfePoRVXayM3VwHGZboMkxUkmIQk6o7UAKRb2ODDpO24YNoL2g==} + /drizzle-kit@0.20.4: + resolution: {integrity: sha512-pfaryOMS4jtQ6PNIanggsXqZnl34nMeoFd6Mmc9mZA+amSym0izLTuOO3xnivPT2BDsDVOoPhrC47QzKij7fRA==} hasBin: true dependencies: '@drizzle-team/studio': 0.0.27 @@ -13716,7 +13716,7 @@ packages: /lower-case@2.0.2: resolution: {integrity: sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==} dependencies: - tslib: 2.4.1 + tslib: 2.6.2 /lru-cache@10.0.2: resolution: {integrity: sha512-Yj9mA8fPiVgOUpByoTZO5pNrcl5Yk37FcSHsUINpAsaBIEZIuqcCclDZJCVxqQShDsmYX8QG63svJiTbOATZwg==} @@ -14987,7 +14987,7 @@ packages: resolution: {integrity: sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==} dependencies: lower-case: 2.0.2 - tslib: 2.4.1 + tslib: 2.6.2 /node-abi@3.51.0: resolution: {integrity: sha512-SQkEP4hmNWjlniS5zdnfIXTk1x7Ome85RDzHlTbBtzE97Gfwz/Ipw4v/Ryk20DWIy3yCNVLVlGKApCnmvYoJbA==} @@ -17578,7 +17578,7 @@ packages: resolution: {integrity: sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==} dependencies: dot-case: 3.0.4 - tslib: 2.4.1 + tslib: 2.6.2 dev: false /snakecase-keys@3.2.1: @@ -18430,6 +18430,7 @@ packages: /tslib@2.4.1: resolution: {integrity: sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==} + dev: false /tslib@2.6.2: resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} @@ -19180,7 +19181,7 @@ packages: '@peculiar/json-schema': 1.1.12 asn1js: 3.0.5 pvtsutils: 1.3.5 - tslib: 2.4.1 + tslib: 2.6.2 dev: false /webidl-conversions@3.0.1: From 7a472e4f3553d20f972e3a649f178cb7bdaf826f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 17 Nov 2023 18:41:22 +0000 Subject: [PATCH 08/15] fix(deps): update dependency @pulumi/pulumi to v3.94.2 --- cloud/infrastructure/package.json | 2 +- cloud/infrastructure/pnpm-lock.yaml | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cloud/infrastructure/package.json b/cloud/infrastructure/package.json index 3dce751e0d..2d6f280345 100644 --- a/cloud/infrastructure/package.json +++ b/cloud/infrastructure/package.json @@ -26,6 +26,6 @@ "@pulumi/cloudflare": "5.15.0", "@pulumi/command": "0.9.2", "@pulumi/docker": "4.4.5", - "@pulumi/pulumi": "3.94.1" + "@pulumi/pulumi": "3.94.2" } } diff --git a/cloud/infrastructure/pnpm-lock.yaml b/cloud/infrastructure/pnpm-lock.yaml index b85b076651..8c3f5264e4 100644 --- a/cloud/infrastructure/pnpm-lock.yaml +++ b/cloud/infrastructure/pnpm-lock.yaml @@ -24,8 +24,8 @@ dependencies: specifier: 4.4.5 version: 4.4.5 '@pulumi/pulumi': - specifier: 3.94.1 - version: 3.94.1 + specifier: 3.94.2 + version: 3.94.2 devDependencies: '@types/node': @@ -70,7 +70,7 @@ packages: resolution: {integrity: sha512-YPNYtwEnKu23VDHNFu91xd/Ueu5zYONHcYwKDA5qTvtgZZ1nzrvPJgrO15KF0fLRVlGo7yckirDS26GpvBTe6w==} requiresBuild: true dependencies: - '@pulumi/pulumi': 3.94.1 + '@pulumi/pulumi': 3.94.2 transitivePeerDependencies: - supports-color dev: false @@ -365,7 +365,7 @@ packages: /@pulumi/aws@6.9.0: resolution: {integrity: sha512-c0ivz01YEuZesfroFSQJdjXivyltdvXBW8hcOhGCwAycjmHpDnXI0HSXk9aIkwxVrUBAW0MQYEa+QRHb5W2V1Q==} dependencies: - '@pulumi/pulumi': 3.94.1 + '@pulumi/pulumi': 3.94.2 builtin-modules: 3.0.0 mime: 2.6.0 read-package-tree: 5.3.1 @@ -377,7 +377,7 @@ packages: /@pulumi/azure-native@2.18.0: resolution: {integrity: sha512-mp6MlTmM1GRj1EXLk5cfwGTZtmAFFjb1taAjs53xHl7YLnW+wLd/Ff0Su+uvloLGUgV2JJIOjdaegQqcR1Aj+w==} dependencies: - '@pulumi/pulumi': 3.94.1 + '@pulumi/pulumi': 3.94.2 transitivePeerDependencies: - supports-color dev: false @@ -385,7 +385,7 @@ packages: /@pulumi/cloudflare@5.15.0: resolution: {integrity: sha512-h7jhFv4hTpdki5F5MwS6CVMUorfiragesGrnIl/YZtw2BZZL7hlFMODnJTZyq7RBVQcoMSigSvfOI8M404egKQ==} dependencies: - '@pulumi/pulumi': 3.94.1 + '@pulumi/pulumi': 3.94.2 transitivePeerDependencies: - supports-color dev: false @@ -394,7 +394,7 @@ packages: resolution: {integrity: sha512-9RaGDiy8jFCiaarj4EOrMW/fVCM/AgBigzwM6CKzlR49x8UFiRDmKrXfEVHb8r2P9IpC4IaAZf5VbNNAHwN/rA==} requiresBuild: true dependencies: - '@pulumi/pulumi': 3.94.1 + '@pulumi/pulumi': 3.94.2 transitivePeerDependencies: - supports-color dev: false @@ -402,14 +402,14 @@ packages: /@pulumi/docker@4.4.5: resolution: {integrity: sha512-Y3q/aI9HQEN3FwgGbTTURFaD+vQLlG5CXiHD4lnlbqt4USU9BhMeYpT6BbwHktFxnNil/8FYr2mX7X4MetQidg==} dependencies: - '@pulumi/pulumi': 3.94.1 + '@pulumi/pulumi': 3.94.2 semver: 5.7.2 transitivePeerDependencies: - supports-color dev: false - /@pulumi/pulumi@3.94.1: - resolution: {integrity: sha512-uftw2Ry9W0s6t5cAYWGPSIzB82n0dSuwUR21k8WaO9P56cO0aaUIdCxsORcNL4kI7+z7LJQOBVYcGNYVHvZeJQ==} + /@pulumi/pulumi@3.94.2: + resolution: {integrity: sha512-3EophVuj7XDtLrY2UcofO0GTgwbr6RCFG1mRC0X1jYImpMGUAP++DYfKMnDGTu9vAAW7h2kJb0s361aLAKunnQ==} engines: {node: '>=8.13.0 || >=10.10.0'} dependencies: '@grpc/grpc-js': 1.9.6 From 2603eadce681cff176d8df30772d239165cc926c Mon Sep 17 00:00:00 2001 From: Aleksandar Toplek Date: Fri, 17 Nov 2023 23:10:53 +0100 Subject: [PATCH 09/15] feat(doprocess): Task definitions reorder Closes #3867 --- .../api/processes/[id]/runs/[runId]/route.ts | 23 ++- .../[taskDefinitionId]/route.ts | 5 +- web/apps/doprocess.app/components/PageNav.tsx | 8 +- .../components/processes/tasks/TaskList.tsx | 97 +++++++++---- .../processes/tasks/TaskListItem.tsx | 131 +++++++++++------- .../components/shared/ListItem.tsx | 2 +- web/apps/doprocess.app/package.json | 4 + .../doprocess.app/src/helpers/queryHelpers.ts | 24 ++++ .../doprocess.app/src/hooks/useProcessRun.ts | 2 +- ...skCreate.ts => useProcessRunTaskUpsert.ts} | 24 +--- .../src/hooks/useProcessRunUpdate.ts | 3 +- .../doprocess.app/src/hooks/useProcessRuns.ts | 2 +- .../hooks/useProcessTaskDefinitionUpdate.ts | 30 +--- .../src/hooks/useProcessTaskDefinitions.ts | 2 +- .../src/lib/repo/processesRepository.ts | 15 ++ web/pnpm-lock.yaml | 31 +++-- 16 files changed, 268 insertions(+), 135 deletions(-) create mode 100644 web/apps/doprocess.app/src/helpers/queryHelpers.ts rename web/apps/doprocess.app/src/hooks/{useProcessRunTaskCreate.ts => useProcessRunTaskUpsert.ts} (54%) diff --git a/web/apps/doprocess.app/app/api/processes/[id]/runs/[runId]/route.ts b/web/apps/doprocess.app/app/api/processes/[id]/runs/[runId]/route.ts index 6da86528fe..62feae1422 100644 --- a/web/apps/doprocess.app/app/api/processes/[id]/runs/[runId]/route.ts +++ b/web/apps/doprocess.app/app/api/processes/[id]/runs/[runId]/route.ts @@ -1,4 +1,4 @@ -import { deleteProcessRun, getProcessIdByPublicId, getProcessRun, getProcessRunIdByPublicId } from '../../../../../../src/lib/repo/processesRepository'; +import { deleteProcessRun, getProcessIdByPublicId, getProcessRun, getProcessRunIdByPublicId, renameProcessRun } from '../../../../../../src/lib/repo/processesRepository'; import { ensureUserId } from '../../../../../../src/lib/auth/apiAuth'; import { requiredParamString } from '../../../../../../src/lib/api/apiParam'; @@ -28,6 +28,27 @@ export async function GET(_request: Request, { params }: { params: { id: string, return Response.json(processRunDto); } +export async function PUT(request: Request, { params }: { params: { id: string, runId: string } }) { + const processPublicId = requiredParamString(params.id); + const runPublicId = requiredParamString(params.runId); + + const { userId } = ensureUserId(); + + const processId = await getProcessIdByPublicId(processPublicId); + if (processId == null) + return new Response(null, { status: 404 }); + const runId = await getProcessRunIdByPublicId(processPublicId, runPublicId); + if (runId == null) + return new Response(null, { status: 404 }); + + const data = await request.json(); + if (data != null && typeof data === 'object' && 'name' in data && typeof data.name === 'string') { + await renameProcessRun(userId, processId, runId, data.name); + } + + return Response.json(null); +} + export async function DELETE(_request: Request, { params }: { params: { id: string, runId: string } }) { const processPublicId = requiredParamString(params.id); const runPublicId = requiredParamString(params.runId); diff --git a/web/apps/doprocess.app/app/api/processes/[id]/task-definitions/[taskDefinitionId]/route.ts b/web/apps/doprocess.app/app/api/processes/[id]/task-definitions/[taskDefinitionId]/route.ts index 0d39e70c0d..ae5e4a2203 100644 --- a/web/apps/doprocess.app/app/api/processes/[id]/task-definitions/[taskDefinitionId]/route.ts +++ b/web/apps/doprocess.app/app/api/processes/[id]/task-definitions/[taskDefinitionId]/route.ts @@ -1,4 +1,4 @@ -import { changeTaskDefinitionText, changeTaskDefinitionType, deleteTaskDefinition, getProcess, getProcessIdByPublicId, getTaskDefinition, getTaskDefinitionIdByPublicId } from '../../../../../../src/lib/repo/processesRepository'; +import { changeTaskDefinitionOrder, changeTaskDefinitionText, changeTaskDefinitionType, deleteTaskDefinition, getProcess, getProcessIdByPublicId, getTaskDefinition, getTaskDefinitionIdByPublicId } from '../../../../../../src/lib/repo/processesRepository'; import { documentCreate, documentGet } from '../../../../../../src/lib/repo/documentsRepository'; import { ensureUserId } from '../../../../../../src/lib/auth/apiAuth'; import { requiredParamString } from '../../../../../../src/lib/api/apiParam'; @@ -68,6 +68,9 @@ export async function PUT(request: Request, { params }: { params: { id: string, await changeTaskDefinitionType(userId, processId, taskDefinitionId, data.type, typeData); } + if ('order' in data && typeof data.order === 'string') { + await changeTaskDefinitionOrder(userId, processId, taskDefinitionId, data.order); + } } return Response.json(null); diff --git a/web/apps/doprocess.app/components/PageNav.tsx b/web/apps/doprocess.app/components/PageNav.tsx index 8e85f66bb0..4b03d36ed0 100644 --- a/web/apps/doprocess.app/components/PageNav.tsx +++ b/web/apps/doprocess.app/components/PageNav.tsx @@ -28,10 +28,14 @@ function NavMenu({ cta }: { cta?: boolean }) { ))} - + - + @@ -47,7 +47,7 @@ function NavMenu({ cta }: { cta?: boolean }) { {cta && ( diff --git a/web/apps/doprocess.app/components/processes/RunsList.tsx b/web/apps/doprocess.app/components/processes/RunsList.tsx deleted file mode 100644 index 773abe94e4..0000000000 --- a/web/apps/doprocess.app/components/processes/RunsList.tsx +++ /dev/null @@ -1,18 +0,0 @@ -'use client'; - -import { List } from '../shared/List'; -import { useProcessRuns } from '../../src/hooks/useProcessRuns'; -import { useProcessesRuns } from '../../src/hooks/useProcessesRuns'; -import { RunsListItem } from './RunsListItem'; - -export function RunsList({ processId }: { processId?: string }) { - const processRuns = useProcessRuns(processId); - const processesRuns = useProcessesRuns(!processId); - - return ( - processId ? processRuns : processesRuns} - itemRender={(item) => ()} - /> - ); -} diff --git a/web/apps/doprocess.app/components/processes/documents/DocumentsList.tsx b/web/apps/doprocess.app/components/processes/documents/DocumentsList.tsx index 1503faed68..35b4670c17 100644 --- a/web/apps/doprocess.app/components/processes/documents/DocumentsList.tsx +++ b/web/apps/doprocess.app/components/processes/documents/DocumentsList.tsx @@ -11,7 +11,7 @@ export function DocumentsList() { query={useDocuments} itemRender={(item) => ()} editable - itemCreateLabel="Create new document" + itemCreateLabel="New document" createForm={} /> ); diff --git a/web/apps/doprocess.app/components/processes/ProcessCreateForm.tsx b/web/apps/doprocess.app/components/processes/processes/ProcessCreateForm.tsx similarity index 91% rename from web/apps/doprocess.app/components/processes/ProcessCreateForm.tsx rename to web/apps/doprocess.app/components/processes/processes/ProcessCreateForm.tsx index c003d6774f..dc7d063012 100644 --- a/web/apps/doprocess.app/components/processes/ProcessCreateForm.tsx +++ b/web/apps/doprocess.app/components/processes/processes/ProcessCreateForm.tsx @@ -7,8 +7,8 @@ import { Tooltip } from '@signalco/ui/dist/Tooltip'; import { Stack } from '@signalco/ui/dist/Stack'; import { Input } from '@signalco/ui/dist/Input'; import { Button } from '@signalco/ui/dist/Button'; -import { KnownPages } from '../../src/knownPages'; -import { useProcessCreate } from '../../src/hooks/useProcessCreate'; +import { KnownPages } from '../../../src/knownPages'; +import { useProcessCreate } from '../../../src/hooks/useProcessCreate'; export function ProcessCreateForm({ redirect }: { redirect?: boolean }) { const router = useRouter(); diff --git a/web/apps/doprocess.app/components/processes/ProcessDetails.tsx b/web/apps/doprocess.app/components/processes/processes/ProcessDetails.tsx similarity index 93% rename from web/apps/doprocess.app/components/processes/ProcessDetails.tsx rename to web/apps/doprocess.app/components/processes/processes/ProcessDetails.tsx index 470eea849e..18697f08c9 100644 --- a/web/apps/doprocess.app/components/processes/ProcessDetails.tsx +++ b/web/apps/doprocess.app/components/processes/processes/ProcessDetails.tsx @@ -1,5 +1,5 @@ import { Stack } from '@signalco/ui/dist/Stack'; -import { TaskList } from './tasks/TaskList'; +import { TaskList } from '../tasks/TaskList'; import { ProcessDetailsHeader } from './ProcessDetailsHeader'; type ProcessDetailsProps = { diff --git a/web/apps/doprocess.app/components/processes/ProcessDetailsHeader.tsx b/web/apps/doprocess.app/components/processes/processes/ProcessDetailsHeader.tsx similarity index 94% rename from web/apps/doprocess.app/components/processes/ProcessDetailsHeader.tsx rename to web/apps/doprocess.app/components/processes/processes/ProcessDetailsHeader.tsx index 6726bd2b99..f03de3a7e1 100644 --- a/web/apps/doprocess.app/components/processes/ProcessDetailsHeader.tsx +++ b/web/apps/doprocess.app/components/processes/processes/ProcessDetailsHeader.tsx @@ -1,4 +1,5 @@ 'use client'; + import { useState } from 'react'; import { cx } from 'classix'; import { Delete, ListChecks, MoreHorizontal, Play } from '@signalco/ui-icons'; @@ -6,9 +7,9 @@ import { Skeleton } from '@signalco/ui/dist/Skeleton'; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from '@signalco/ui/dist/Menu'; import { Loadable } from '@signalco/ui/dist/Loadable'; import { IconButton } from '@signalco/ui/dist/IconButton'; -import { ListHeader } from '../shared/ListHeader'; -import { KnownPages } from '../../src/knownPages'; -import { useProcess } from '../../src/hooks/useProcess'; +import { ListHeader } from '../../shared/ListHeader'; +import { KnownPages } from '../../../src/knownPages'; +import { useProcess } from '../../../src/hooks/useProcess'; import { TypographyProcessRunName } from './TypographyProcessRunName'; import { TypographyProcessName } from './TypographyProcessName'; import { ProcessRunCreateModal } from './ProcessRunCreateModal'; @@ -38,7 +39,7 @@ export function ProcessDetailsHeader({ ? () : ()} actions={[ - (process && editable && !isRun) && , + (process && editable && !isRun) && , (editable) && ( & { processId: string; diff --git a/web/apps/doprocess.app/components/processes/ProcessRunCreateForm.tsx b/web/apps/doprocess.app/components/processes/processes/ProcessRunCreateForm.tsx similarity index 65% rename from web/apps/doprocess.app/components/processes/ProcessRunCreateForm.tsx rename to web/apps/doprocess.app/components/processes/processes/ProcessRunCreateForm.tsx index b22c90eb91..5e09b252bc 100644 --- a/web/apps/doprocess.app/components/processes/ProcessRunCreateForm.tsx +++ b/web/apps/doprocess.app/components/processes/processes/ProcessRunCreateForm.tsx @@ -1,21 +1,26 @@ 'use client'; -import { useState } from 'react'; + +import { useEffect, useState } from 'react'; import { useRouter } from 'next/navigation'; import { Play } from '@signalco/ui-icons'; import { Stack } from '@signalco/ui/dist/Stack'; import { Row } from '@signalco/ui/dist/Row'; import { Input } from '@signalco/ui/dist/Input'; import { Button } from '@signalco/ui/dist/Button'; -import { KnownPages } from '../../src/knownPages'; -import { useProcessRunCreate } from '../../src/hooks/useProcessRunCreate'; -import { ProcessDto } from '../../app/api/dtos/dtos'; +import { KnownPages } from '../../../src/knownPages'; +import { useProcessRunCreate } from '../../../src/hooks/useProcessRunCreate'; +import { useProcess } from '../../../src/hooks/useProcess'; -export function ProcessRunCreateForm({ process }: { process: ProcessDto; }) { - const { id: processId, name: processName } = process; +export function ProcessRunCreateForm({ processId, redirect }: { processId: string, redirect?: boolean }) { + const { data: process } = useProcess(processId); const router = useRouter(); const processRunCreate = useProcessRunCreate(); - const [name, setName] = useState(`${processName} - ${new Date().toLocaleString()} run`); + const [name, setName] = useState(`${process?.name} - ${new Date().toLocaleString()} run`); + + useEffect(() => { + setName(`${process?.name} - ${new Date().toLocaleString()} run`); + }, [process?.name]); const handleRunProcess = async () => { if (!name.length) { @@ -26,7 +31,7 @@ export function ProcessRunCreateForm({ process }: { process: ProcessDto; }) { processId: processId.toString(), name }); - if (result?.id) { + if (redirect && result?.id) { router.push(KnownPages.ProcessRun(processId, result.id)); } }; diff --git a/web/apps/doprocess.app/components/processes/ProcessRunCreateModal.tsx b/web/apps/doprocess.app/components/processes/processes/ProcessRunCreateModal.tsx similarity index 80% rename from web/apps/doprocess.app/components/processes/ProcessRunCreateModal.tsx rename to web/apps/doprocess.app/components/processes/processes/ProcessRunCreateModal.tsx index 95fedb3185..f09ccf1b2c 100644 --- a/web/apps/doprocess.app/components/processes/ProcessRunCreateModal.tsx +++ b/web/apps/doprocess.app/components/processes/processes/ProcessRunCreateModal.tsx @@ -7,14 +7,13 @@ import { Stack } from '@signalco/ui/dist/Stack'; import { Row } from '@signalco/ui/dist/Row'; import { Modal } from '@signalco/ui/dist/Modal'; import { IconButton } from '@signalco/ui/dist/IconButton'; -import { ProcessDto } from '../../app/api/dtos/dtos'; import { ProcessRunCreateForm } from './ProcessRunCreateForm'; type ProcessRunCreateModalProps = { - process: ProcessDto; + processId: string; }; -export function ProcessRunCreateModal({ process }: ProcessRunCreateModalProps) { +export function ProcessRunCreateModal({ processId }: ProcessRunCreateModalProps) { return ( @@ -26,7 +25,7 @@ export function ProcessRunCreateModal({ process }: ProcessRunCreateModalProps) { Run process - + ); diff --git a/web/apps/doprocess.app/components/processes/ProcessesList.tsx b/web/apps/doprocess.app/components/processes/processes/ProcessesList.tsx similarity index 72% rename from web/apps/doprocess.app/components/processes/ProcessesList.tsx rename to web/apps/doprocess.app/components/processes/processes/ProcessesList.tsx index cf5641727f..2b50e23a54 100644 --- a/web/apps/doprocess.app/components/processes/ProcessesList.tsx +++ b/web/apps/doprocess.app/components/processes/processes/ProcessesList.tsx @@ -1,7 +1,7 @@ 'use client'; -import { List } from '../shared/List'; -import { useProcesses } from '../../src/hooks/useProcesses'; +import { List } from '../../shared/List'; +import { useProcesses } from '../../../src/hooks/useProcesses'; import { ProcessesListItem } from './ProcessesListItem'; import { ProcessCreateForm } from './ProcessCreateForm'; @@ -11,7 +11,7 @@ export function ProcessesList() { query={useProcesses} itemRender={(item) => ()} editable - itemCreateLabel="Create new process" + itemCreateLabel="New process" createForm={} /> ); } diff --git a/web/apps/doprocess.app/components/processes/ProcessesListItem.tsx b/web/apps/doprocess.app/components/processes/processes/ProcessesListItem.tsx similarity index 75% rename from web/apps/doprocess.app/components/processes/ProcessesListItem.tsx rename to web/apps/doprocess.app/components/processes/processes/ProcessesListItem.tsx index 2715aaa301..eac4b8b305 100644 --- a/web/apps/doprocess.app/components/processes/ProcessesListItem.tsx +++ b/web/apps/doprocess.app/components/processes/processes/ProcessesListItem.tsx @@ -1,7 +1,7 @@ import { ListChecks, Navigate } from '@signalco/ui-icons'; -import { ListItem } from '../shared/ListItem'; -import { KnownPages } from '../../src/knownPages'; -import { ProcessDto } from '../../app/api/dtos/dtos'; +import { ListItem } from '../../shared/ListItem'; +import { KnownPages } from '../../../src/knownPages'; +import { ProcessDto } from '../../../app/api/dtos/dtos'; export type ProcessListItemProps = { process: ProcessDto; diff --git a/web/apps/doprocess.app/components/processes/ProcessesListView.tsx b/web/apps/doprocess.app/components/processes/processes/ProcessesListView.tsx similarity index 85% rename from web/apps/doprocess.app/components/processes/ProcessesListView.tsx rename to web/apps/doprocess.app/components/processes/processes/ProcessesListView.tsx index 8b79519865..afd96be588 100644 --- a/web/apps/doprocess.app/components/processes/ProcessesListView.tsx +++ b/web/apps/doprocess.app/components/processes/processes/ProcessesListView.tsx @@ -1,5 +1,5 @@ import { Stack } from '@signalco/ui/dist/Stack'; -import { ListHeader } from '../shared/ListHeader'; +import { ListHeader } from '../../shared/ListHeader'; import { ProcessesList } from './ProcessesList'; export function ProcessesListView() { diff --git a/web/apps/doprocess.app/components/processes/processes/RunsList.tsx b/web/apps/doprocess.app/components/processes/processes/RunsList.tsx new file mode 100644 index 0000000000..4b361988b5 --- /dev/null +++ b/web/apps/doprocess.app/components/processes/processes/RunsList.tsx @@ -0,0 +1,41 @@ +'use client'; + +import { Play } from '@signalco/ui-icons'; +import { Typography } from '@signalco/ui/dist/Typography'; +import { Stack } from '@signalco/ui/dist/Stack'; +import { NavigatingButton } from '@signalco/ui/dist/NavigatingButton'; +import { List } from '../../shared/List'; +import { KnownPages } from '../../../src/knownPages'; +import { useProcessRuns } from '../../../src/hooks/useProcessRuns'; +import { useProcessesRuns } from '../../../src/hooks/useProcessesRuns'; +import { RunsListItem } from './RunsListItem'; +import { ProcessRunCreateForm } from './ProcessRunCreateForm'; + +function RunsListEmptyPlaceholder() { + return ( + + + + No runs + You do not have any process runs yet. You can start by creating a process. + + Processes + + ); +} + +export function RunsList({ processId }: { processId?: string }) { + const processRuns = useProcessRuns(processId); + const processesRuns = useProcessesRuns(!processId); + + return ( + processId ? processRuns : processesRuns} + itemRender={(item) => ()} + editable={Boolean(processId)} + itemCreateLabel="New process run" + createForm={processId ? : undefined} + emptyPlaceholder={} + /> + ); +} diff --git a/web/apps/doprocess.app/components/processes/RunsListItem.tsx b/web/apps/doprocess.app/components/processes/processes/RunsListItem.tsx similarity index 84% rename from web/apps/doprocess.app/components/processes/RunsListItem.tsx rename to web/apps/doprocess.app/components/processes/processes/RunsListItem.tsx index 385b3fd2f3..3d3d609048 100644 --- a/web/apps/doprocess.app/components/processes/RunsListItem.tsx +++ b/web/apps/doprocess.app/components/processes/processes/RunsListItem.tsx @@ -1,8 +1,8 @@ import { ListChecks, Navigate, Play } from '@signalco/ui-icons'; import { Row } from '@signalco/ui/dist/Row'; -import { ListItem } from '../shared/ListItem'; -import { KnownPages } from '../../src/knownPages'; -import { ProcessRunDto } from '../../app/api/dtos/dtos'; +import { ListItem } from '../../shared/ListItem'; +import { KnownPages } from '../../../src/knownPages'; +import { ProcessRunDto } from '../../../app/api/dtos/dtos'; import { TypographyProcessName } from './TypographyProcessName'; export type RunsListItemProps = { diff --git a/web/apps/doprocess.app/components/processes/RunsListView.tsx b/web/apps/doprocess.app/components/processes/processes/RunsListView.tsx similarity index 94% rename from web/apps/doprocess.app/components/processes/RunsListView.tsx rename to web/apps/doprocess.app/components/processes/processes/RunsListView.tsx index ff496ecb9e..c31114d255 100644 --- a/web/apps/doprocess.app/components/processes/RunsListView.tsx +++ b/web/apps/doprocess.app/components/processes/processes/RunsListView.tsx @@ -3,7 +3,7 @@ import { Typography } from '@signalco/ui/dist/Typography'; import { Stack } from '@signalco/ui/dist/Stack'; import { useSearchParam } from '@signalco/hooks/dist/useSearchParam'; -import { ListHeader } from '../shared/ListHeader'; +import { ListHeader } from '../../shared/ListHeader'; import { TypographyProcessName } from './TypographyProcessName'; import { RunsList } from './RunsList'; diff --git a/web/apps/doprocess.app/components/processes/TypographyProcessName.tsx b/web/apps/doprocess.app/components/processes/processes/TypographyProcessName.tsx similarity index 92% rename from web/apps/doprocess.app/components/processes/TypographyProcessName.tsx rename to web/apps/doprocess.app/components/processes/processes/TypographyProcessName.tsx index 1bdfe1cd7d..f77f909f79 100644 --- a/web/apps/doprocess.app/components/processes/TypographyProcessName.tsx +++ b/web/apps/doprocess.app/components/processes/processes/TypographyProcessName.tsx @@ -3,8 +3,8 @@ import { TypographyEditable, TypographyEditableProps } from '@signalco/ui/dist/TypographyEditable'; import { Typography } from '@signalco/ui/dist/Typography'; import { Loadable } from '@signalco/ui/dist/Loadable'; -import { useProcessUpdate } from '../../src/hooks/useProcessUpdate'; -import { useProcess } from '../../src/hooks/useProcess'; +import { useProcessUpdate } from '../../../src/hooks/useProcessUpdate'; +import { useProcess } from '../../../src/hooks/useProcess'; export type TypographyProcessNameProps = Omit & { id: string | undefined; diff --git a/web/apps/doprocess.app/components/processes/TypographyProcessRunName.tsx b/web/apps/doprocess.app/components/processes/processes/TypographyProcessRunName.tsx similarity index 92% rename from web/apps/doprocess.app/components/processes/TypographyProcessRunName.tsx rename to web/apps/doprocess.app/components/processes/processes/TypographyProcessRunName.tsx index edb9ee25cb..2ff69f8a0b 100644 --- a/web/apps/doprocess.app/components/processes/TypographyProcessRunName.tsx +++ b/web/apps/doprocess.app/components/processes/processes/TypographyProcessRunName.tsx @@ -3,8 +3,8 @@ import { TypographyEditable, TypographyEditableProps } from '@signalco/ui/dist/TypographyEditable'; import { Typography } from '@signalco/ui/dist/Typography'; import { Loadable } from '@signalco/ui/dist/Loadable'; -import { useProcessRunUpdate } from '../../src/hooks/useProcessRunUpdate'; -import { useProcessRun } from '../../src/hooks/useProcessRun'; +import { useProcessRunUpdate } from '../../../src/hooks/useProcessRunUpdate'; +import { useProcessRun } from '../../../src/hooks/useProcessRun'; export type TypographyProcessRunNameProps = Omit & { id: string | undefined; diff --git a/web/apps/doprocess.app/components/shared/List.tsx b/web/apps/doprocess.app/components/shared/List.tsx index 4ee2938b64..bdae1a5a4b 100644 --- a/web/apps/doprocess.app/components/shared/List.tsx +++ b/web/apps/doprocess.app/components/shared/List.tsx @@ -19,9 +19,10 @@ type ListProps = { itemCreateLabel?: string; itemRender?: (item: T) => ReactElement; createForm?: ReactNode; + emptyPlaceholder?: ReactNode; }; -export function List({ query, itemRender, editable, itemCreateLabel, createForm }: ListProps) { +export function List({ query, itemRender, editable, itemCreateLabel, createForm, emptyPlaceholder }: ListProps) { const { data, isLoading, error } = query(); const [showCreateModal, setShowCreateModal] = useState(false); @@ -57,10 +58,16 @@ export function List({ query, itemRender, editable, itemCreateLabel, createFo ) : ( <> {!data?.length && ( - + <> + {emptyPlaceholder ? ( + emptyPlaceholder + ) : ( + + )} + )} )} diff --git a/web/packages/ui/src/TypographyEditable/TypographyEditable.tsx b/web/packages/ui/src/TypographyEditable/TypographyEditable.tsx index f265d517d1..68513e8cb6 100644 --- a/web/packages/ui/src/TypographyEditable/TypographyEditable.tsx +++ b/web/packages/ui/src/TypographyEditable/TypographyEditable.tsx @@ -60,7 +60,7 @@ export function TypographyEditable({ children, className, onChange, onEditingCha {...rest}> {children || placeholder} {!hideEditIcon && ( - + )} );