From 45bb287c00e83cacbb1501ce69273bb9b787d599 Mon Sep 17 00:00:00 2001 From: Nik Nasr Date: Thu, 21 Nov 2024 00:27:41 +0000 Subject: [PATCH 1/6] fix not updating arn role Signed-off-by: Nik Nasr --- .../src/lib/RegisterDeployment/AssumeARNRole.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libs/features/overview-route/src/lib/RegisterDeployment/AssumeARNRole.tsx b/libs/features/overview-route/src/lib/RegisterDeployment/AssumeARNRole.tsx index 357f62c1..59986d1b 100644 --- a/libs/features/overview-route/src/lib/RegisterDeployment/AssumeARNRole.tsx +++ b/libs/features/overview-route/src/lib/RegisterDeployment/AssumeARNRole.tsx @@ -1,11 +1,16 @@ import { FormFieldInput } from '@restate/ui/form-field'; +import { useRegisterDeploymentContext } from './Context'; export function AssumeARNRole() { + const { updateAssumeRoleArn, assumeRoleArn } = useRegisterDeploymentContext(); + return ( Assume role ARN From cbda10e43fac594631864a08cc2c094eac9e7ee1 Mon Sep 17 00:00:00 2001 From: Nik Nasr Date: Thu, 21 Nov 2024 09:42:28 +0000 Subject: [PATCH 2/6] update stale time in react query Signed-off-by: Nik Nasr --- libs/data-access/admin-api/src/lib/api/client.ts | 5 +++++ libs/data-access/admin-api/src/lib/api/hooks.ts | 3 +++ 2 files changed, 8 insertions(+) diff --git a/libs/data-access/admin-api/src/lib/api/client.ts b/libs/data-access/admin-api/src/lib/api/client.ts index 0903b111..df7b4d42 100644 --- a/libs/data-access/admin-api/src/lib/api/client.ts +++ b/libs/data-access/admin-api/src/lib/api/client.ts @@ -148,6 +148,8 @@ export function adminApi< queryFn: QueryFn; queryKey: QueryKey; meta: Record; + refetchOnMount?: boolean; + staleTime?: number; }; export function adminApi< Path extends keyof paths, @@ -187,6 +189,8 @@ export function adminApi< queryFn: QueryFn; queryKey: QueryKey; meta: Record; + refetchOnMount?: boolean; + staleTime?: number; } | { mutationFn: MutationFn; @@ -215,6 +219,7 @@ export function adminApi< ); return data; }, + refetchOnMount: true, }; } else { return { diff --git a/libs/data-access/admin-api/src/lib/api/hooks.ts b/libs/data-access/admin-api/src/lib/api/hooks.ts index 3b5425f8..c2f271a1 100644 --- a/libs/data-access/admin-api/src/lib/api/hooks.ts +++ b/libs/data-access/admin-api/src/lib/api/hooks.ts @@ -155,6 +155,7 @@ export function useServiceDetails( }); const results = useQuery({ + staleTime: 0, ...queryOptions, ...options, }); @@ -173,6 +174,7 @@ export function useDeploymentDetails( }); const results = useQuery({ + staleTime: 0, ...queryOptions, ...options, }); @@ -221,6 +223,7 @@ export function useServiceOpenApi( }); const results = useQuery({ + staleTime: 0, ...queryOptions, ...options, }); From 5267bd25658ccc465378d92b48fc5cf72d5dd6c0 Mon Sep 17 00:00:00 2001 From: Nik Nasr Date: Thu, 21 Nov 2024 09:45:42 +0000 Subject: [PATCH 3/6] update script Signed-off-by: Nik Nasr --- scripts/typecheck.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/typecheck.js b/scripts/typecheck.js index ff517865..2a05b639 100755 --- a/scripts/typecheck.js +++ b/scripts/typecheck.js @@ -3,6 +3,7 @@ const { execSync } = require('child_process'); const projects = execSync('pnpm nx show projects --affected --json'); +let isFailed = false; for (const project of JSON.parse(projects)) { const projectData = execSync(`pnpm nx show project ${project} --json`); const path = JSON.parse(projectData).root; @@ -14,7 +15,13 @@ for (const project of JSON.parse(projects)) { try { execSync(`pnpm tsc -p ${tsConfig}`, { stdio: 'inherit' }); - } catch (error) {} + } catch (error) { + isFailed = true; + } console.groupEnd(); } } + +if (isFailed) { + throw new Error('Type check has failed'); +} From 90b00c4b765b350a522626da7a4d5346b52a0ed5 Mon Sep 17 00:00:00 2001 From: Nik Nasr Date: Thu, 21 Nov 2024 09:49:25 +0000 Subject: [PATCH 4/6] fix type check Signed-off-by: Nik Nasr --- libs/data-access/admin-api/src/lib/api/client.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/data-access/admin-api/src/lib/api/client.ts b/libs/data-access/admin-api/src/lib/api/client.ts index df7b4d42..2925da85 100644 --- a/libs/data-access/admin-api/src/lib/api/client.ts +++ b/libs/data-access/admin-api/src/lib/api/client.ts @@ -86,7 +86,7 @@ export type QueryOptions< Method extends SupportedMethods > = UseQueryOptions< FetchResponse['data'], - FetchResponse['error'] + RestateError | Error >; type QueryFn< @@ -106,7 +106,7 @@ export type MutationOptions< Body extends OperationBody > = UseMutationOptions< FetchResponse['data'], - FetchResponse['error'], + RestateError | Error, { parameters?: Parameters; body?: Body; From 16ee466bb20af094d084eea613b1664f34c84cff Mon Sep 17 00:00:00 2001 From: Nik Nasr Date: Thu, 21 Nov 2024 09:52:18 +0000 Subject: [PATCH 5/6] fix type Signed-off-by: Nik Nasr --- .../src/lib/RegisterDeployment/Context.tsx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/libs/features/overview-route/src/lib/RegisterDeployment/Context.tsx b/libs/features/overview-route/src/lib/RegisterDeployment/Context.tsx index 6e8efc3b..5def13d6 100644 --- a/libs/features/overview-route/src/lib/RegisterDeployment/Context.tsx +++ b/libs/features/overview-route/src/lib/RegisterDeployment/Context.tsx @@ -18,6 +18,7 @@ import { import { useDialog } from '@restate/ui/dialog'; import { getEndpoint } from '../types'; import { showSuccessNotification } from '@restate/ui/notification'; +import { RestateError } from '@restate/util/errors'; type NavigateToAdvancedAction = { type: 'NavigateToAdvancedAction'; @@ -88,13 +89,7 @@ interface DeploymentRegistrationContextInterface { updateAssumeRoleArn?: (value: string) => void; updateUseHttp11Arn?: (value: boolean) => void; updateShouldForce?: (value: boolean) => void; - error: - | { - message: string; - restate_code?: string | null; - } - | null - | undefined; + error: RestateError | Error | null | undefined; } type State = Pick< From 936a6de01a99637c056fbdf07aff82e937db49d9 Mon Sep 17 00:00:00 2001 From: Nik Nasr Date: Thu, 21 Nov 2024 10:20:39 +0000 Subject: [PATCH 6/6] update button style Signed-off-by: Nik Nasr --- libs/features/overview-route/src/lib/Details/Service.tsx | 2 +- libs/features/overview-route/src/lib/RestateServer.tsx | 2 +- libs/features/overview-route/src/lib/ServicePlayground.tsx | 2 +- libs/ui/button/src/lib/Button.tsx | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/features/overview-route/src/lib/Details/Service.tsx b/libs/features/overview-route/src/lib/Details/Service.tsx index 60834937..a9e5d89e 100644 --- a/libs/features/overview-route/src/lib/Details/Service.tsx +++ b/libs/features/overview-route/src/lib/Details/Service.tsx @@ -179,7 +179,7 @@ function ServiceForm({ )} diff --git a/libs/features/overview-route/src/lib/RestateServer.tsx b/libs/features/overview-route/src/lib/RestateServer.tsx index 85b99868..583bac26 100644 --- a/libs/features/overview-route/src/lib/RestateServer.tsx +++ b/libs/features/overview-route/src/lib/RestateServer.tsx @@ -7,7 +7,7 @@ export function RestateServer({ }: PropsWithChildren<{ className?: string }>) { return (
-