Update Zod package, improve code formatting, and add awaiting indicators

This commit includes three main changes. First, it updates the Zod library from version 3.23.4 to 3.23.5 across all relevant packages. Second, code readability has been enhanced by formatting modifications in several TypeScript files. Lastly, the user feedback on certain operations such as creating a team or charging for a payment is strengthened, by displaying an awaiting indicator until the operation is complete.
This commit is contained in:
giancarlo
2024-04-30 13:16:51 +07:00
parent 437935e492
commit 2ff08a971d
35 changed files with 199 additions and 144 deletions

View File

@@ -22,7 +22,7 @@
"@kit/tailwind-config": "workspace:*",
"@kit/tsconfig": "workspace:*",
"@kit/ui": "workspace:*",
"zod": "^3.23.4"
"zod": "^3.23.5"
},
"eslintConfig": {
"root": true,

View File

@@ -35,7 +35,7 @@
"react": "18.3.1",
"react-hook-form": "^7.51.3",
"react-i18next": "^14.1.1",
"zod": "^3.23.4"
"zod": "^3.23.5"
},
"eslintConfig": {
"root": true,

View File

@@ -356,7 +356,7 @@ export function PlanPicker(
disabled={props.pending ?? !form.formState.isValid}
>
{props.pending ? (
t('processing')
t('redirectingToPayment')
) : (
<>
<If

View File

@@ -28,7 +28,7 @@
"@types/react": "^18.3.1",
"next": "14.2.3",
"react": "18.3.1",
"zod": "^3.23.4"
"zod": "^3.23.5"
},
"eslintConfig": {
"root": true,

View File

@@ -32,7 +32,7 @@
"date-fns": "^3.6.0",
"next": "14.2.3",
"react": "18.3.1",
"zod": "^3.23.4"
"zod": "^3.23.5"
},
"eslintConfig": {
"root": true,

View File

@@ -25,7 +25,7 @@
"@kit/tsconfig": "workspace:*",
"@kit/ui": "workspace:^",
"@types/node": "^20.12.7",
"zod": "^3.23.4"
"zod": "^3.23.5"
},
"eslintConfig": {
"root": true,

View File

@@ -24,7 +24,7 @@
"@kit/team-accounts": "workspace:^",
"@kit/tsconfig": "workspace:*",
"@supabase/supabase-js": "^2.42.7",
"zod": "^3.23.4"
"zod": "^3.23.5"
},
"eslintConfig": {
"root": true,

View File

@@ -45,7 +45,7 @@
"react-hook-form": "^7.51.3",
"react-i18next": "^14.1.1",
"sonner": "^1.4.41",
"zod": "^3.23.4"
"zod": "^3.23.5"
},
"prettier": "@kit/prettier-config",
"eslintConfig": {

View File

@@ -29,7 +29,7 @@
"react": "18.3.1",
"react-dom": "18.3.1",
"react-hook-form": "^7.51.3",
"zod": "^3.23.4"
"zod": "^3.23.5"
},
"exports": {
".": "./src/index.ts",

View File

@@ -36,7 +36,7 @@
"react-hook-form": "^7.51.3",
"react-i18next": "^14.1.1",
"sonner": "^1.4.41",
"zod": "^3.23.4"
"zod": "^3.23.5"
},
"prettier": "@kit/prettier-config",
"eslintConfig": {

View File

@@ -45,7 +45,7 @@
"react-hook-form": "^7.51.3",
"react-i18next": "^14.1.1",
"sonner": "^1.4.41",
"zod": "^3.23.4"
"zod": "^3.23.5"
},
"prettier": "@kit/prettier-config",
"eslintConfig": {

View File

@@ -120,15 +120,19 @@ function CreateOrganizationAccountForm(props: { onClose: () => void }) {
<div className={'flex justify-end space-x-2'}>
<Button
variant={'outline'}
disabled={pending}
type={'button'}
disabled={pending}
onClick={props.onClose}
>
<Trans i18nKey={'common:cancel'} />
</Button>
<Button data-test={'confirm-create-team-button'} disabled={pending}>
<Trans i18nKey={'teams:createTeamSubmitLabel'} />
{pending ? (
<Trans i18nKey={'teams:creatingTeam'} />
) : (
<Trans i18nKey={'teams:createTeamSubmitLabel'} />
)}
</Button>
</div>
</div>

View File

@@ -9,12 +9,12 @@ import { CreateTeamSchema } from '../../schema/create-team.schema';
import { createCreateTeamAccountService } from '../services/create-team-account.service';
export const createOrganizationAccountAction = enhanceAction(
async (params, user) => {
async ({ name }, user) => {
const client = getSupabaseServerActionClient();
const service = createCreateTeamAccountService(client);
const { data, error } = await service.createNewOrganizationAccount({
name: params.name,
name,
userId: user.id,
});

View File

@@ -22,7 +22,7 @@
"@kit/tailwind-config": "workspace:*",
"@kit/tsconfig": "workspace:*",
"@types/nodemailer": "6.4.14",
"zod": "^3.23.4"
"zod": "^3.23.5"
},
"eslintConfig": {
"root": true,

View File

@@ -27,7 +27,7 @@
"@kit/tsconfig": "workspace:*",
"@types/react": "^18.3.1",
"react": "18.3.1",
"zod": "^3.23.4"
"zod": "^3.23.5"
},
"eslintConfig": {
"root": true,

View File

@@ -23,7 +23,7 @@
"@kit/tsconfig": "workspace:*",
"@supabase/supabase-js": "^2.42.7",
"next": "14.2.3",
"zod": "^3.23.4"
"zod": "^3.23.5"
},
"eslintConfig": {
"root": true,

View File

@@ -32,7 +32,7 @@
"@types/react": "^18.3.1",
"next": "14.2.3",
"react": "18.3.1",
"zod": "^3.23.4"
"zod": "^3.23.5"
},
"eslintConfig": {
"root": true,

View File

@@ -56,7 +56,7 @@
"tailwindcss": "3.4.3",
"tailwindcss-animate": "^1.0.7",
"typescript": "^5.4.5",
"zod": "^3.23.4"
"zod": "^3.23.5"
},
"eslintConfig": {
"root": true,