Revert "Unify workspace dropdowns; Update layouts (#458)"

This reverts commit 4bc8448a1d.
This commit is contained in:
gbuomprisco
2026-03-11 14:47:47 +08:00
parent 4bc8448a1d
commit 4912e402a3
530 changed files with 11182 additions and 14382 deletions

View File

@@ -1,4 +1,4 @@
import * as z from 'zod';
import { z } from 'zod';
export const AcceptInvitationSchema = z.object({
inviteToken: z.string().uuid(),

View File

@@ -1,4 +1,4 @@
import * as z from 'zod';
import { z } from 'zod';
/**
* @name RESERVED_NAMES_ARRAY
@@ -40,18 +40,20 @@ export function containsNonLatinCharacters(value: string): boolean {
* @description Schema for validating URL-friendly slugs
*/
export const SlugSchema = z
.string()
.string({
description: 'URL-friendly identifier for the team',
})
.min(2)
.max(50)
.regex(SLUG_REGEX, {
message: 'teams.invalidSlugError',
message: 'teams:invalidSlugError',
})
.refine(
(slug) => {
return !RESERVED_NAMES_ARRAY.includes(slug.toLowerCase());
},
{
message: 'teams.reservedNameError',
message: 'teams:reservedNameError',
},
);
@@ -60,7 +62,9 @@ export const SlugSchema = z
* @description Schema for team name - allows non-Latin characters
*/
export const TeamNameSchema = z
.string()
.string({
description: 'The name of the team account',
})
.min(2)
.max(50)
.refine(
@@ -68,7 +72,7 @@ export const TeamNameSchema = z
return !SPECIAL_CHARACTERS_REGEX.test(name);
},
{
message: 'teams.specialCharactersError',
message: 'teams:specialCharactersError',
},
)
.refine(
@@ -76,7 +80,7 @@ export const TeamNameSchema = z
return !RESERVED_NAMES_ARRAY.includes(name.toLowerCase());
},
{
message: 'teams.reservedNameError',
message: 'teams:reservedNameError',
},
);
@@ -89,11 +93,10 @@ export const CreateTeamSchema = z
.object({
name: TeamNameSchema,
// Transform empty strings to undefined before validation
slug: z
.string()
.optional()
.transform((val) => (val === '' ? undefined : val))
.pipe(SlugSchema.optional()),
slug: z.preprocess(
(val) => (val === '' ? undefined : val),
SlugSchema.optional(),
),
})
.refine(
(data) => {
@@ -104,7 +107,7 @@ export const CreateTeamSchema = z
return true;
},
{
message: 'teams.slugRequiredForNonLatinName',
message: 'teams:slugRequiredForNonLatinName',
path: ['slug'],
},
);

View File

@@ -1,4 +1,4 @@
import * as z from 'zod';
import { z } from 'zod';
export const DeleteInvitationSchema = z.object({
invitationId: z.number().int(),

View File

@@ -1,4 +1,4 @@
import * as z from 'zod';
import { z } from 'zod';
export const DeleteTeamAccountSchema = z.object({
accountId: z.string().uuid(),

View File

@@ -1,4 +1,4 @@
import * as z from 'zod';
import { z } from 'zod';
const InviteSchema = z.object({
email: z.string().email(),

View File

@@ -1,4 +1,4 @@
import * as z from 'zod';
import { z } from 'zod';
export const LeaveTeamAccountSchema = z.object({
accountId: z.string().uuid(),

View File

@@ -1,4 +1,4 @@
import * as z from 'zod';
import { z } from 'zod';
export const RemoveMemberSchema = z.object({
accountId: z.string().uuid(),

View File

@@ -1,4 +1,4 @@
import * as z from 'zod';
import { z } from 'zod';
export const RenewInvitationSchema = z.object({
invitationId: z.number().positive(),

View File

@@ -1,4 +1,4 @@
import * as z from 'zod';
import { z } from 'zod';
export const TransferOwnershipConfirmationSchema = z.object({
accountId: z.string().uuid(),
@@ -6,6 +6,6 @@ export const TransferOwnershipConfirmationSchema = z.object({
otp: z.string().min(6),
});
export type TransferOwnershipConfirmationData = z.output<
export type TransferOwnershipConfirmationData = z.infer<
typeof TransferOwnershipConfirmationSchema
>;

View File

@@ -1,4 +1,4 @@
import * as z from 'zod';
import { z } from 'zod';
export const UpdateInvitationSchema = z.object({
invitationId: z.number(),

View File

@@ -1,4 +1,4 @@
import * as z from 'zod';
import { z } from 'zod';
export const RoleSchema = z.object({
role: z.string().min(1),

View File

@@ -1,4 +1,4 @@
import * as z from 'zod';
import { z } from 'zod';
import {
SlugSchema,
@@ -23,7 +23,7 @@ export const TeamNameFormSchema = z
return true;
},
{
message: 'teams.slugRequiredForNonLatinName',
message: 'teams:slugRequiredForNonLatinName',
path: ['newSlug'],
},
);