mirror of
https://github.com/docmost/docmost.git
synced 2025-11-13 20:02:38 +10:00
fix: bug fixes (#397)
* Add more html page titles * Make tables responsive * fix react query keys * Add tooltip to sidebar toggle * fix: trim inputs * fix inputs
This commit is contained in:
@ -4,7 +4,6 @@ import {
|
|||||||
UnstyledButton,
|
UnstyledButton,
|
||||||
Badge,
|
Badge,
|
||||||
Table,
|
Table,
|
||||||
ScrollArea,
|
|
||||||
ActionIcon,
|
ActionIcon,
|
||||||
} from '@mantine/core';
|
} from '@mantine/core';
|
||||||
import {Link} from 'react-router-dom';
|
import {Link} from 'react-router-dom';
|
||||||
@ -18,6 +17,7 @@ import { getSpaceUrl } from '@/lib/config.ts';
|
|||||||
interface Props {
|
interface Props {
|
||||||
spaceId?: string;
|
spaceId?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function RecentChanges({spaceId}: Props) {
|
export default function RecentChanges({spaceId}: Props) {
|
||||||
const {data: pages, isLoading, isError} = useRecentChangesQuery(spaceId);
|
const {data: pages, isLoading, isError} = useRecentChangesQuery(spaceId);
|
||||||
|
|
||||||
@ -30,7 +30,7 @@ export default function RecentChanges({ spaceId }: Props) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return pages && pages.items.length > 0 ? (
|
return pages && pages.items.length > 0 ? (
|
||||||
<ScrollArea>
|
<Table.ScrollContainer minWidth={500}>
|
||||||
<Table highlightOnHover verticalSpacing="sm">
|
<Table highlightOnHover verticalSpacing="sm">
|
||||||
<Table.Tbody>
|
<Table.Tbody>
|
||||||
{pages.items.map((page) => (
|
{pages.items.map((page) => (
|
||||||
@ -67,7 +67,7 @@ export default function RecentChanges({ spaceId }: Props) {
|
|||||||
</Table.Td>
|
</Table.Td>
|
||||||
)}
|
)}
|
||||||
<Table.Td>
|
<Table.Td>
|
||||||
<Text c="dimmed" size="xs" fw={500}>
|
<Text c="dimmed" style={{whiteSpace: 'nowrap'}} size="xs" fw={500}>
|
||||||
{formattedDate(page.updatedAt)}
|
{formattedDate(page.updatedAt)}
|
||||||
</Text>
|
</Text>
|
||||||
</Table.Td>
|
</Table.Td>
|
||||||
@ -75,7 +75,7 @@ export default function RecentChanges({ spaceId }: Props) {
|
|||||||
))}
|
))}
|
||||||
</Table.Tbody>
|
</Table.Tbody>
|
||||||
</Table>
|
</Table>
|
||||||
</ScrollArea>
|
</Table.ScrollContainer>
|
||||||
) : (
|
) : (
|
||||||
<Text size="md" ta="center">
|
<Text size="md" ta="center">
|
||||||
No pages yet
|
No pages yet
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { Group, Text } from "@mantine/core";
|
import {Group, Text, Tooltip} from "@mantine/core";
|
||||||
import classes from "./app-header.module.css";
|
import classes from "./app-header.module.css";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import TopMenu from "@/components/layouts/global/top-menu.tsx";
|
import TopMenu from "@/components/layouts/global/top-menu.tsx";
|
||||||
@ -35,21 +35,26 @@ export function AppHeader() {
|
|||||||
<Group wrap="nowrap">
|
<Group wrap="nowrap">
|
||||||
{!isHomeRoute && (
|
{!isHomeRoute && (
|
||||||
<>
|
<>
|
||||||
|
<Tooltip label="Sidebar toggle">
|
||||||
|
|
||||||
<SidebarToggle
|
<SidebarToggle
|
||||||
aria-label="sidebar toggle"
|
aria-label="Sidebar toggle"
|
||||||
opened={mobileOpened}
|
opened={mobileOpened}
|
||||||
onClick={toggleMobile}
|
onClick={toggleMobile}
|
||||||
hiddenFrom="sm"
|
hiddenFrom="sm"
|
||||||
size="sm"
|
size="sm"
|
||||||
/>
|
/>
|
||||||
|
</Tooltip>
|
||||||
|
|
||||||
|
<Tooltip label="Sidebar toggle">
|
||||||
<SidebarToggle
|
<SidebarToggle
|
||||||
aria-label="sidebar toggle"
|
aria-label="Sidebar toggle"
|
||||||
opened={desktopOpened}
|
opened={desktopOpened}
|
||||||
onClick={toggleDesktop}
|
onClick={toggleDesktop}
|
||||||
visibleFrom="sm"
|
visibleFrom="sm"
|
||||||
size="sm"
|
size="sm"
|
||||||
/>
|
/>
|
||||||
|
</Tooltip>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|||||||
@ -1,15 +1,9 @@
|
|||||||
|
import React from "react";
|
||||||
import {
|
import {
|
||||||
IconLayoutSidebarRightCollapse,
|
IconLayoutSidebarRightCollapse,
|
||||||
IconLayoutSidebarRightExpand,
|
IconLayoutSidebarRightExpand
|
||||||
} from "@tabler/icons-react";
|
} from "@tabler/icons-react";
|
||||||
import {
|
import { ActionIcon, BoxProps, ElementProps, MantineColor, MantineSize } from "@mantine/core";
|
||||||
ActionIcon,
|
|
||||||
BoxProps,
|
|
||||||
ElementProps,
|
|
||||||
MantineColor,
|
|
||||||
MantineSize,
|
|
||||||
} from "@mantine/core";
|
|
||||||
import React from "react";
|
|
||||||
|
|
||||||
export interface SidebarToggleProps extends BoxProps, ElementProps<"button"> {
|
export interface SidebarToggleProps extends BoxProps, ElementProps<"button"> {
|
||||||
size?: MantineSize | `compact-${MantineSize}` | (string & {});
|
size?: MantineSize | `compact-${MantineSize}` | (string & {});
|
||||||
@ -17,13 +11,10 @@ export interface SidebarToggleProps extends BoxProps, ElementProps<"button"> {
|
|||||||
opened?: boolean;
|
opened?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function SidebarToggle({
|
const SidebarToggle = React.forwardRef<HTMLButtonElement, SidebarToggleProps>(
|
||||||
opened,
|
({ opened, size = "sm", ...others }, ref) => {
|
||||||
size = "sm",
|
|
||||||
...others
|
|
||||||
}: SidebarToggleProps) {
|
|
||||||
return (
|
return (
|
||||||
<ActionIcon size={size} {...others} variant="subtle" color="gray">
|
<ActionIcon size={size} {...others} variant="subtle" color="gray" ref={ref}>
|
||||||
{opened ? (
|
{opened ? (
|
||||||
<IconLayoutSidebarRightExpand />
|
<IconLayoutSidebarRightExpand />
|
||||||
) : (
|
) : (
|
||||||
@ -32,3 +23,6 @@ export default function SidebarToggle({
|
|||||||
</ActionIcon>
|
</ActionIcon>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
export default SidebarToggle;
|
||||||
|
|||||||
@ -19,7 +19,7 @@ import { useGetInvitationQuery } from "@/features/workspace/queries/workspace-qu
|
|||||||
import { useRedirectIfAuthenticated } from "@/features/auth/hooks/use-redirect-if-authenticated.ts";
|
import { useRedirectIfAuthenticated } from "@/features/auth/hooks/use-redirect-if-authenticated.ts";
|
||||||
|
|
||||||
const formSchema = z.object({
|
const formSchema = z.object({
|
||||||
name: z.string().min(2),
|
name: z.string().trim().min(1),
|
||||||
password: z.string().min(8),
|
password: z.string().min(8),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -15,8 +15,8 @@ import useAuth from "@/features/auth/hooks/use-auth";
|
|||||||
import classes from "@/features/auth/components/auth.module.css";
|
import classes from "@/features/auth/components/auth.module.css";
|
||||||
|
|
||||||
const formSchema = z.object({
|
const formSchema = z.object({
|
||||||
workspaceName: z.string().min(2).max(60),
|
workspaceName: z.string().trim().min(3).max(50),
|
||||||
name: z.string().min(2).max(60),
|
name: z.string().min(1).max(50),
|
||||||
email: z
|
email: z
|
||||||
.string()
|
.string()
|
||||||
.min(1, { message: "email is required" })
|
.min(1, { message: "email is required" })
|
||||||
|
|||||||
@ -7,7 +7,7 @@ import { useNavigate } from "react-router-dom";
|
|||||||
import { MultiUserSelect } from "@/features/group/components/multi-user-select.tsx";
|
import { MultiUserSelect } from "@/features/group/components/multi-user-select.tsx";
|
||||||
|
|
||||||
const formSchema = z.object({
|
const formSchema = z.object({
|
||||||
name: z.string().min(2).max(50),
|
name: z.string().trim().min(2).max(50),
|
||||||
description: z.string().max(500),
|
description: z.string().max(500),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -10,6 +10,7 @@ export default function GroupList() {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{data && (
|
{data && (
|
||||||
|
<Table.ScrollContainer minWidth={400}>
|
||||||
<Table highlightOnHover verticalSpacing="sm">
|
<Table highlightOnHover verticalSpacing="sm">
|
||||||
<Table.Thead>
|
<Table.Thead>
|
||||||
<Table.Tr>
|
<Table.Tr>
|
||||||
@ -32,13 +33,13 @@ export default function GroupList() {
|
|||||||
component={Link}
|
component={Link}
|
||||||
to={`/settings/groups/${group.id}`}
|
to={`/settings/groups/${group.id}`}
|
||||||
>
|
>
|
||||||
<Group gap="sm">
|
<Group gap="sm" wrap="nowrap">
|
||||||
<IconGroupCircle/>
|
<IconGroupCircle/>
|
||||||
<div>
|
<div>
|
||||||
<Text fz="sm" fw={500}>
|
<Text fz="sm" fw={500} lineClamp={1}>
|
||||||
{group.name}
|
{group.name}
|
||||||
</Text>
|
</Text>
|
||||||
<Text fz="xs" c="dimmed">
|
<Text fz="xs" c="dimmed" lineClamp={2}>
|
||||||
{group.description}
|
{group.description}
|
||||||
</Text>
|
</Text>
|
||||||
</div>
|
</div>
|
||||||
@ -53,6 +54,7 @@ export default function GroupList() {
|
|||||||
style={{
|
style={{
|
||||||
cursor: "pointer",
|
cursor: "pointer",
|
||||||
color: "var(--mantine-color-text)",
|
color: "var(--mantine-color-text)",
|
||||||
|
whiteSpace: "nowrap"
|
||||||
}}
|
}}
|
||||||
component={Link}
|
component={Link}
|
||||||
to={`/settings/groups/${group.id}`}
|
to={`/settings/groups/${group.id}`}
|
||||||
@ -64,6 +66,7 @@ export default function GroupList() {
|
|||||||
))}
|
))}
|
||||||
</Table.Tbody>
|
</Table.Tbody>
|
||||||
</Table>
|
</Table>
|
||||||
|
</Table.ScrollContainer>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -42,6 +42,7 @@ export default function GroupMembersList() {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{data && (
|
{data && (
|
||||||
|
<Table.ScrollContainer minWidth={500}>
|
||||||
<Table verticalSpacing="sm">
|
<Table verticalSpacing="sm">
|
||||||
<Table.Thead>
|
<Table.Thead>
|
||||||
<Table.Tr>
|
<Table.Tr>
|
||||||
@ -100,6 +101,7 @@ export default function GroupMembersList() {
|
|||||||
))}
|
))}
|
||||||
</Table.Tbody>
|
</Table.Tbody>
|
||||||
</Table>
|
</Table>
|
||||||
|
</Table.ScrollContainer>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -29,24 +29,22 @@ export function useGetGroupsQuery(
|
|||||||
|
|
||||||
export function useGroupQuery(groupId: string): UseQueryResult<IGroup, Error> {
|
export function useGroupQuery(groupId: string): UseQueryResult<IGroup, Error> {
|
||||||
return useQuery({
|
return useQuery({
|
||||||
queryKey: ['groups', groupId],
|
queryKey: ['group', groupId],
|
||||||
queryFn: () => getGroupById(groupId),
|
queryFn: () => getGroupById(groupId),
|
||||||
enabled: !!groupId,
|
enabled: !!groupId,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function useGroupMembersQuery(groupId: string) {
|
|
||||||
return useQuery({
|
|
||||||
queryKey: ['groupMembers', groupId],
|
|
||||||
queryFn: () => getGroupMembers(groupId),
|
|
||||||
enabled: !!groupId,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export function useCreateGroupMutation() {
|
export function useCreateGroupMutation() {
|
||||||
|
const queryClient = useQueryClient();
|
||||||
|
|
||||||
return useMutation<IGroup, Error, Partial<IGroup>>({
|
return useMutation<IGroup, Error, Partial<IGroup>>({
|
||||||
mutationFn: (data) => createGroup(data),
|
mutationFn: (data) => createGroup(data),
|
||||||
onSuccess: () => {
|
onSuccess: () => {
|
||||||
|
queryClient.invalidateQueries({
|
||||||
|
queryKey: ['groups'],
|
||||||
|
});
|
||||||
|
|
||||||
notifications.show({ message: 'Group created successfully' });
|
notifications.show({ message: 'Group created successfully' });
|
||||||
},
|
},
|
||||||
onError: () => {
|
onError: () => {
|
||||||
@ -96,6 +94,14 @@ export function useDeleteGroupMutation() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function useGroupMembersQuery(groupId: string) {
|
||||||
|
return useQuery({
|
||||||
|
queryKey: ['groupMembers', groupId],
|
||||||
|
queryFn: () => getGroupMembers(groupId),
|
||||||
|
enabled: !!groupId,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
export function useAddGroupMemberMutation() {
|
export function useAddGroupMemberMutation() {
|
||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
|
|
||||||
|
|||||||
@ -8,9 +8,10 @@ import { computeSpaceSlug } from "@/lib";
|
|||||||
import { getSpaceUrl } from "@/lib/config.ts";
|
import { getSpaceUrl } from "@/lib/config.ts";
|
||||||
|
|
||||||
const formSchema = z.object({
|
const formSchema = z.object({
|
||||||
name: z.string().min(2).max(50),
|
name: z.string().trim().min(2).max(50),
|
||||||
slug: z
|
slug: z
|
||||||
.string()
|
.string()
|
||||||
|
.trim()
|
||||||
.min(2)
|
.min(2)
|
||||||
.max(50)
|
.max(50)
|
||||||
.regex(
|
.regex(
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { Modal, Tabs, rem, Group, ScrollArea } from "@mantine/core";
|
import {Modal, Tabs, rem, Group, ScrollArea, Text} from "@mantine/core";
|
||||||
import SpaceMembersList from "@/features/space/components/space-members.tsx";
|
import SpaceMembersList from "@/features/space/components/space-members.tsx";
|
||||||
import AddSpaceMembersModal from "@/features/space/components/add-space-members-modal.tsx";
|
import AddSpaceMembersModal from "@/features/space/components/add-space-members-modal.tsx";
|
||||||
import React, {useMemo} from "react";
|
import React, {useMemo} from "react";
|
||||||
@ -40,11 +40,13 @@ export default function SpaceSettingsModal({
|
|||||||
<Modal.Overlay/>
|
<Modal.Overlay/>
|
||||||
<Modal.Content style={{overflow: "hidden"}}>
|
<Modal.Content style={{overflow: "hidden"}}>
|
||||||
<Modal.Header py={0}>
|
<Modal.Header py={0}>
|
||||||
<Modal.Title fw={500}>{space?.name}</Modal.Title>
|
<Modal.Title>
|
||||||
|
<Text fw={500} lineClamp={1}>{space?.name}</Text>
|
||||||
|
</Modal.Title>
|
||||||
<Modal.CloseButton/>
|
<Modal.CloseButton/>
|
||||||
</Modal.Header>
|
</Modal.Header>
|
||||||
<Modal.Body>
|
<Modal.Body>
|
||||||
<div style={{ height: rem("600px") }}>
|
<div style={{height: rem(600)}}>
|
||||||
<Tabs defaultValue="members">
|
<Tabs defaultValue="members">
|
||||||
<Tabs.List>
|
<Tabs.List>
|
||||||
<Tabs.Tab fw={500} value="general">
|
<Tabs.Tab fw={500} value="general">
|
||||||
@ -55,7 +57,6 @@ export default function SpaceSettingsModal({
|
|||||||
</Tabs.Tab>
|
</Tabs.Tab>
|
||||||
</Tabs.List>
|
</Tabs.List>
|
||||||
|
|
||||||
<ScrollArea h="600" w="100%" scrollbarSize={5}>
|
|
||||||
<Tabs.Panel value="general">
|
<Tabs.Panel value="general">
|
||||||
<SpaceDetails
|
<SpaceDetails
|
||||||
spaceId={space?.id}
|
spaceId={space?.id}
|
||||||
@ -82,7 +83,6 @@ export default function SpaceSettingsModal({
|
|||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
</Tabs.Panel>
|
</Tabs.Panel>
|
||||||
</ScrollArea>
|
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</div>
|
</div>
|
||||||
</Modal.Body>
|
</Modal.Body>
|
||||||
|
|||||||
@ -18,6 +18,7 @@ export default function SpaceList() {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{data && (
|
{data && (
|
||||||
|
<Table.ScrollContainer minWidth={400}>
|
||||||
<Table highlightOnHover verticalSpacing="sm">
|
<Table highlightOnHover verticalSpacing="sm">
|
||||||
<Table.Thead>
|
<Table.Thead>
|
||||||
<Table.Tr>
|
<Table.Tr>
|
||||||
@ -34,28 +35,31 @@ export default function SpaceList() {
|
|||||||
onClick={() => handleClick(space.id)}
|
onClick={() => handleClick(space.id)}
|
||||||
>
|
>
|
||||||
<Table.Td>
|
<Table.Td>
|
||||||
<Group gap="sm">
|
<Group gap="sm" wrap="nowrap">
|
||||||
<Avatar
|
<Avatar
|
||||||
color="initials"
|
color="initials"
|
||||||
variant="filled"
|
variant="filled"
|
||||||
name={space.name}
|
name={space.name}
|
||||||
/>
|
/>
|
||||||
<div>
|
<div>
|
||||||
<Text fz="sm" fw={500}>
|
<Text fz="sm" fw={500} lineClamp={1}>
|
||||||
{space.name}
|
{space.name}
|
||||||
</Text>
|
</Text>
|
||||||
<Text fz="xs" c="dimmed">
|
<Text fz="xs" c="dimmed" lineClamp={2}>
|
||||||
{space.description}
|
{space.description}
|
||||||
</Text>
|
</Text>
|
||||||
</div>
|
</div>
|
||||||
</Group>
|
</Group>
|
||||||
</Table.Td>
|
</Table.Td>
|
||||||
|
|
||||||
<Table.Td>{formatMemberCount(space.memberCount)}</Table.Td>
|
<Table.Td>
|
||||||
|
<Text size="sm" style={{whiteSpace: 'nowrap'}}>{formatMemberCount(space.memberCount)}</Text>
|
||||||
|
</Table.Td>
|
||||||
</Table.Tr>
|
</Table.Tr>
|
||||||
))}
|
))}
|
||||||
</Table.Tbody>
|
</Table.Tbody>
|
||||||
</Table>
|
</Table>
|
||||||
|
</Table.ScrollContainer>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{selectedSpaceId && (
|
{selectedSpaceId && (
|
||||||
|
|||||||
@ -18,10 +18,12 @@ import {
|
|||||||
import {formatMemberCount} from "@/lib";
|
import {formatMemberCount} from "@/lib";
|
||||||
|
|
||||||
type MemberType = "user" | "group";
|
type MemberType = "user" | "group";
|
||||||
|
|
||||||
interface SpaceMembersProps {
|
interface SpaceMembersProps {
|
||||||
spaceId: string;
|
spaceId: string;
|
||||||
readOnly?: boolean;
|
readOnly?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function SpaceMembersList({
|
export default function SpaceMembersList({
|
||||||
spaceId,
|
spaceId,
|
||||||
readOnly,
|
readOnly,
|
||||||
@ -93,6 +95,7 @@ export default function SpaceMembersList({
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{data && (
|
{data && (
|
||||||
|
<Table.ScrollContainer minWidth={500}>
|
||||||
<Table verticalSpacing={8}>
|
<Table verticalSpacing={8}>
|
||||||
<Table.Thead>
|
<Table.Thead>
|
||||||
<Table.Tr>
|
<Table.Tr>
|
||||||
@ -178,6 +181,7 @@ export default function SpaceMembersList({
|
|||||||
))}
|
))}
|
||||||
</Table.Tbody>
|
</Table.Tbody>
|
||||||
</Table>
|
</Table>
|
||||||
|
</Table.ScrollContainer>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -36,7 +36,7 @@ export function useGetSpacesQuery(
|
|||||||
|
|
||||||
export function useSpaceQuery(spaceId: string): UseQueryResult<ISpace, Error> {
|
export function useSpaceQuery(spaceId: string): UseQueryResult<ISpace, Error> {
|
||||||
return useQuery({
|
return useQuery({
|
||||||
queryKey: ['spaces', spaceId],
|
queryKey: ['space', spaceId],
|
||||||
queryFn: () => getSpaceById(spaceId),
|
queryFn: () => getSpaceById(spaceId),
|
||||||
enabled: !!spaceId,
|
enabled: !!spaceId,
|
||||||
staleTime: 5 * 60 * 1000,
|
staleTime: 5 * 60 * 1000,
|
||||||
@ -65,7 +65,7 @@ export function useGetSpaceBySlugQuery(
|
|||||||
spaceId: string
|
spaceId: string
|
||||||
): UseQueryResult<ISpace, Error> {
|
): UseQueryResult<ISpace, Error> {
|
||||||
return useQuery({
|
return useQuery({
|
||||||
queryKey: ['spaces', spaceId],
|
queryKey: ['space', spaceId],
|
||||||
queryFn: () => getSpaceById(spaceId),
|
queryFn: () => getSpaceById(spaceId),
|
||||||
enabled: !!spaceId,
|
enabled: !!spaceId,
|
||||||
staleTime: 5 * 60 * 1000,
|
staleTime: 5 * 60 * 1000,
|
||||||
@ -111,7 +111,7 @@ export function useDeleteSpaceMutation() {
|
|||||||
|
|
||||||
if (variables.slug) {
|
if (variables.slug) {
|
||||||
queryClient.removeQueries({
|
queryClient.removeQueries({
|
||||||
queryKey: ['spaces', variables.slug],
|
queryKey: ['space', variables.slug],
|
||||||
exact: true,
|
exact: true,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import React from "react";
|
|||||||
import {getUserRoleLabel} from "@/features/workspace/types/user-role-data.ts";
|
import {getUserRoleLabel} from "@/features/workspace/types/user-role-data.ts";
|
||||||
import InviteActionMenu from "@/features/workspace/components/members/components/invite-action-menu.tsx";
|
import InviteActionMenu from "@/features/workspace/components/members/components/invite-action-menu.tsx";
|
||||||
import {IconInfoCircle} from "@tabler/icons-react";
|
import {IconInfoCircle} from "@tabler/icons-react";
|
||||||
import { formattedDate } from "@/lib/time.ts";
|
import {formattedDate, timeAgo} from "@/lib/time.ts";
|
||||||
import useUserRole from "@/hooks/use-user-role.tsx";
|
import useUserRole from "@/hooks/use-user-role.tsx";
|
||||||
|
|
||||||
export default function WorkspaceInvitesTable() {
|
export default function WorkspaceInvitesTable() {
|
||||||
@ -21,6 +21,7 @@ export default function WorkspaceInvitesTable() {
|
|||||||
|
|
||||||
{data && (
|
{data && (
|
||||||
<>
|
<>
|
||||||
|
<Table.ScrollContainer minWidth={500}>
|
||||||
<Table verticalSpacing="sm">
|
<Table verticalSpacing="sm">
|
||||||
<Table.Thead>
|
<Table.Thead>
|
||||||
<Table.Tr>
|
<Table.Tr>
|
||||||
@ -46,7 +47,7 @@ export default function WorkspaceInvitesTable() {
|
|||||||
|
|
||||||
<Table.Td>{getUserRoleLabel(invitation.role)}</Table.Td>
|
<Table.Td>{getUserRoleLabel(invitation.role)}</Table.Td>
|
||||||
|
|
||||||
<Table.Td>{formattedDate(invitation.createdAt)}</Table.Td>
|
<Table.Td>{timeAgo(invitation.createdAt)}</Table.Td>
|
||||||
|
|
||||||
<Table.Td>
|
<Table.Td>
|
||||||
{isAdmin && (
|
{isAdmin && (
|
||||||
@ -57,6 +58,7 @@ export default function WorkspaceInvitesTable() {
|
|||||||
))}
|
))}
|
||||||
</Table.Tbody>
|
</Table.Tbody>
|
||||||
</Table>
|
</Table>
|
||||||
|
</Table.ScrollContainer>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
|
|||||||
@ -40,6 +40,7 @@ export default function WorkspaceMembersTable() {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{data && (
|
{data && (
|
||||||
|
<Table.ScrollContainer minWidth={500}>
|
||||||
<Table verticalSpacing="sm">
|
<Table verticalSpacing="sm">
|
||||||
<Table.Thead>
|
<Table.Thead>
|
||||||
<Table.Tr>
|
<Table.Tr>
|
||||||
@ -84,6 +85,7 @@ export default function WorkspaceMembersTable() {
|
|||||||
))}
|
))}
|
||||||
</Table.Tbody>
|
</Table.Tbody>
|
||||||
</Table>
|
</Table>
|
||||||
|
</Table.ScrollContainer>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -6,6 +6,10 @@ declare global {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getAppName(): string{
|
||||||
|
return 'Docmost';
|
||||||
|
}
|
||||||
|
|
||||||
export function getAppUrl(): string {
|
export function getAppUrl(): string {
|
||||||
//let appUrl = window.CONFIG?.APP_URL || process.env.APP_URL;
|
//let appUrl = window.CONFIG?.APP_URL || process.env.APP_URL;
|
||||||
|
|
||||||
|
|||||||
@ -1,11 +1,12 @@
|
|||||||
import { ForgotPasswordForm } from "@/features/auth/components/forgot-password-form";
|
import { ForgotPasswordForm } from "@/features/auth/components/forgot-password-form";
|
||||||
|
import { getAppName } from "@/lib/config";
|
||||||
import { Helmet } from "react-helmet-async";
|
import { Helmet } from "react-helmet-async";
|
||||||
|
|
||||||
export default function ForgotPassword() {
|
export default function ForgotPassword() {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Helmet>
|
<Helmet>
|
||||||
<title>Forgot Password - Docmost</title>
|
<title>Forgot Password - {getAppName()}</title>
|
||||||
</Helmet>
|
</Helmet>
|
||||||
<ForgotPasswordForm />
|
<ForgotPasswordForm />
|
||||||
</>
|
</>
|
||||||
|
|||||||
@ -1,11 +1,12 @@
|
|||||||
import { Helmet } from "react-helmet-async";
|
import { Helmet } from "react-helmet-async";
|
||||||
import { InviteSignUpForm } from "@/features/auth/components/invite-sign-up-form.tsx";
|
import { InviteSignUpForm } from "@/features/auth/components/invite-sign-up-form.tsx";
|
||||||
|
import {getAppName} from "@/lib/config.ts";
|
||||||
|
|
||||||
export default function InviteSignup() {
|
export default function InviteSignup() {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Helmet>
|
<Helmet>
|
||||||
<title>Invitation Signup - Docmost</title>
|
<title>Invitation Signuo - {getAppName()}</title>
|
||||||
</Helmet>
|
</Helmet>
|
||||||
<InviteSignUpForm />
|
<InviteSignUpForm />
|
||||||
</>
|
</>
|
||||||
|
|||||||
@ -1,11 +1,12 @@
|
|||||||
import { LoginForm } from "@/features/auth/components/login-form";
|
import { LoginForm } from "@/features/auth/components/login-form";
|
||||||
import { Helmet } from "react-helmet-async";
|
import { Helmet } from "react-helmet-async";
|
||||||
|
import {getAppName} from "@/lib/config.ts";
|
||||||
|
|
||||||
export default function LoginPage() {
|
export default function LoginPage() {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Helmet>
|
<Helmet>
|
||||||
<title>Login - Docmost</title>
|
<title>Login - {getAppName()}</title>
|
||||||
</Helmet>
|
</Helmet>
|
||||||
<LoginForm />
|
<LoginForm />
|
||||||
</>
|
</>
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import { Link, useSearchParams } from "react-router-dom";
|
|||||||
import { useVerifyUserTokenQuery } from "@/features/auth/queries/auth-query";
|
import { useVerifyUserTokenQuery } from "@/features/auth/queries/auth-query";
|
||||||
import { Button, Container, Group, Text } from "@mantine/core";
|
import { Button, Container, Group, Text } from "@mantine/core";
|
||||||
import APP_ROUTE from "@/lib/app-route";
|
import APP_ROUTE from "@/lib/app-route";
|
||||||
|
import {getAppName} from "@/lib/config.ts";
|
||||||
|
|
||||||
export default function PasswordReset() {
|
export default function PasswordReset() {
|
||||||
const [searchParams] = useSearchParams();
|
const [searchParams] = useSearchParams();
|
||||||
@ -21,7 +22,7 @@ export default function PasswordReset() {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Helmet>
|
<Helmet>
|
||||||
<title>Password Reset - Docmost</title>
|
<title>Password Reset - {getAppName()}</title>
|
||||||
</Helmet>
|
</Helmet>
|
||||||
<Container my={40}>
|
<Container my={40}>
|
||||||
<Text size="lg" ta="center">
|
<Text size="lg" ta="center">
|
||||||
@ -45,7 +46,7 @@ export default function PasswordReset() {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Helmet>
|
<Helmet>
|
||||||
<title>Password Reset - Docmost</title>
|
<title>Password Reset - {getAppName()}</title>
|
||||||
</Helmet>
|
</Helmet>
|
||||||
<PasswordResetForm resetToken={resetToken} />
|
<PasswordResetForm resetToken={resetToken} />
|
||||||
</>
|
</>
|
||||||
|
|||||||
@ -3,6 +3,7 @@ import { SetupWorkspaceForm } from "@/features/auth/components/setup-workspace-f
|
|||||||
import { Helmet } from "react-helmet-async";
|
import { Helmet } from "react-helmet-async";
|
||||||
import React, { useEffect } from "react";
|
import React, { useEffect } from "react";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
|
import {getAppName} from "@/lib/config.ts";
|
||||||
|
|
||||||
export default function SetupWorkspace() {
|
export default function SetupWorkspace() {
|
||||||
const {
|
const {
|
||||||
@ -32,7 +33,7 @@ export default function SetupWorkspace() {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Helmet>
|
<Helmet>
|
||||||
<title>Setup Workspace - Docmost</title>
|
<title>Setup Workspace - {getAppName()}</title>
|
||||||
</Helmet>
|
</Helmet>
|
||||||
<SetupWorkspaceForm />
|
<SetupWorkspaceForm />
|
||||||
</>
|
</>
|
||||||
|
|||||||
@ -1,9 +1,15 @@
|
|||||||
import {Container, Space} from "@mantine/core";
|
import {Container, Space} from "@mantine/core";
|
||||||
import HomeTabs from "@/features/home/components/home-tabs";
|
import HomeTabs from "@/features/home/components/home-tabs";
|
||||||
import SpaceGrid from "@/features/space/components/space-grid.tsx";
|
import SpaceGrid from "@/features/space/components/space-grid.tsx";
|
||||||
|
import {getAppName} from "@/lib/config.ts";
|
||||||
|
import {Helmet} from "react-helmet-async";
|
||||||
|
|
||||||
export default function Home() {
|
export default function Home() {
|
||||||
return (
|
return (
|
||||||
|
<>
|
||||||
|
<Helmet>
|
||||||
|
<title>Home - {getAppName()}</title>
|
||||||
|
</Helmet>
|
||||||
<Container size={"800"} pt="xl">
|
<Container size={"800"} pt="xl">
|
||||||
<SpaceGrid/>
|
<SpaceGrid/>
|
||||||
|
|
||||||
@ -11,5 +17,6 @@ export default function Home() {
|
|||||||
|
|
||||||
<HomeTabs/>
|
<HomeTabs/>
|
||||||
</Container>
|
</Container>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,10 +2,15 @@ import SettingsTitle from "@/components/settings/settings-title.tsx";
|
|||||||
import AccountTheme from "@/features/user/components/account-theme.tsx";
|
import AccountTheme from "@/features/user/components/account-theme.tsx";
|
||||||
import PageWidthPref from "@/features/user/components/page-width-pref.tsx";
|
import PageWidthPref from "@/features/user/components/page-width-pref.tsx";
|
||||||
import {Divider} from "@mantine/core";
|
import {Divider} from "@mantine/core";
|
||||||
|
import {getAppName} from "@/lib/config.ts";
|
||||||
|
import {Helmet} from "react-helmet-async";
|
||||||
|
|
||||||
export default function AccountPreferences() {
|
export default function AccountPreferences() {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
<Helmet>
|
||||||
|
<title>Preferences - {getAppName()}</title>
|
||||||
|
</Helmet>
|
||||||
<SettingsTitle title="Preferences"/>
|
<SettingsTitle title="Preferences"/>
|
||||||
<AccountTheme/>
|
<AccountTheme/>
|
||||||
<Divider my={"md"}/>
|
<Divider my={"md"}/>
|
||||||
|
|||||||
@ -4,10 +4,15 @@ import ChangePassword from "@/features/user/components/change-password";
|
|||||||
import { Divider } from "@mantine/core";
|
import { Divider } from "@mantine/core";
|
||||||
import AccountAvatar from "@/features/user/components/account-avatar";
|
import AccountAvatar from "@/features/user/components/account-avatar";
|
||||||
import SettingsTitle from "@/components/settings/settings-title.tsx";
|
import SettingsTitle from "@/components/settings/settings-title.tsx";
|
||||||
|
import {getAppName} from "@/lib/config.ts";
|
||||||
|
import {Helmet} from "react-helmet-async";
|
||||||
|
|
||||||
export default function AccountSettings() {
|
export default function AccountSettings() {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
<Helmet>
|
||||||
|
<title>My Profile - {getAppName()}</title>
|
||||||
|
</Helmet>
|
||||||
<SettingsTitle title="My Profile" />
|
<SettingsTitle title="My Profile" />
|
||||||
|
|
||||||
<AccountAvatar />
|
<AccountAvatar />
|
||||||
|
|||||||
@ -1,10 +1,15 @@
|
|||||||
import SettingsTitle from "@/components/settings/settings-title.tsx";
|
import SettingsTitle from "@/components/settings/settings-title.tsx";
|
||||||
import GroupMembersList from "@/features/group/components/group-members";
|
import GroupMembersList from "@/features/group/components/group-members";
|
||||||
import GroupDetails from "@/features/group/components/group-details";
|
import GroupDetails from "@/features/group/components/group-details";
|
||||||
|
import {getAppName} from "@/lib/config.ts";
|
||||||
|
import {Helmet} from "react-helmet-async";
|
||||||
|
|
||||||
export default function GroupInfo() {
|
export default function GroupInfo() {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
<Helmet>
|
||||||
|
<title>Manage Group - {getAppName()}</title>
|
||||||
|
</Helmet>
|
||||||
<SettingsTitle title="Manage Group"/>
|
<SettingsTitle title="Manage Group"/>
|
||||||
<GroupDetails/>
|
<GroupDetails/>
|
||||||
<GroupMembersList/>
|
<GroupMembersList/>
|
||||||
|
|||||||
@ -3,12 +3,17 @@ import SettingsTitle from "@/components/settings/settings-title.tsx";
|
|||||||
import { Group } from "@mantine/core";
|
import { Group } from "@mantine/core";
|
||||||
import CreateGroupModal from "@/features/group/components/create-group-modal";
|
import CreateGroupModal from "@/features/group/components/create-group-modal";
|
||||||
import useUserRole from "@/hooks/use-user-role.tsx";
|
import useUserRole from "@/hooks/use-user-role.tsx";
|
||||||
|
import {getAppName} from "@/lib/config.ts";
|
||||||
|
import {Helmet} from "react-helmet-async";
|
||||||
|
|
||||||
export default function Groups() {
|
export default function Groups() {
|
||||||
const { isAdmin } = useUserRole();
|
const { isAdmin } = useUserRole();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
<Helmet>
|
||||||
|
<title>Groups - {getAppName()}</title>
|
||||||
|
</Helmet>
|
||||||
<SettingsTitle title="Groups" />
|
<SettingsTitle title="Groups" />
|
||||||
|
|
||||||
<Group my="md" justify="flex-end">
|
<Group my="md" justify="flex-end">
|
||||||
|
|||||||
@ -3,12 +3,17 @@ import SpaceList from "@/features/space/components/space-list.tsx";
|
|||||||
import useUserRole from "@/hooks/use-user-role.tsx";
|
import useUserRole from "@/hooks/use-user-role.tsx";
|
||||||
import {Group} from "@mantine/core";
|
import {Group} from "@mantine/core";
|
||||||
import CreateSpaceModal from "@/features/space/components/create-space-modal.tsx";
|
import CreateSpaceModal from "@/features/space/components/create-space-modal.tsx";
|
||||||
|
import {getAppName} from "@/lib/config.ts";
|
||||||
|
import {Helmet} from "react-helmet-async";
|
||||||
|
|
||||||
export default function Spaces() {
|
export default function Spaces() {
|
||||||
const {isAdmin} = useUserRole();
|
const {isAdmin} = useUserRole();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
<Helmet>
|
||||||
|
<title>Spaces - {getAppName()}</title>
|
||||||
|
</Helmet>
|
||||||
<SettingsTitle title="Spaces"/>
|
<SettingsTitle title="Spaces"/>
|
||||||
|
|
||||||
<Group my="md" justify="flex-end">
|
<Group my="md" justify="flex-end">
|
||||||
|
|||||||
@ -6,6 +6,8 @@ import { useEffect, useState } from "react";
|
|||||||
import {useNavigate, useSearchParams} from "react-router-dom";
|
import {useNavigate, useSearchParams} from "react-router-dom";
|
||||||
import WorkspaceInvitesTable from "@/features/workspace/components/members/components/workspace-invites-table.tsx";
|
import WorkspaceInvitesTable from "@/features/workspace/components/members/components/workspace-invites-table.tsx";
|
||||||
import useUserRole from "@/hooks/use-user-role.tsx";
|
import useUserRole from "@/hooks/use-user-role.tsx";
|
||||||
|
import {getAppName} from "@/lib/config.ts";
|
||||||
|
import {Helmet} from "react-helmet-async";
|
||||||
|
|
||||||
export default function WorkspaceMembers() {
|
export default function WorkspaceMembers() {
|
||||||
const [segmentValue, setSegmentValue] = useState("members");
|
const [segmentValue, setSegmentValue] = useState("members");
|
||||||
@ -31,6 +33,9 @@ export default function WorkspaceMembers() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
<Helmet>
|
||||||
|
<title>Members - {getAppName()}</title>
|
||||||
|
</Helmet>
|
||||||
<SettingsTitle title="Members"/>
|
<SettingsTitle title="Members"/>
|
||||||
|
|
||||||
{/* <WorkspaceInviteSection /> */}
|
{/* <WorkspaceInviteSection /> */}
|
||||||
|
|||||||
@ -1,9 +1,14 @@
|
|||||||
import SettingsTitle from "@/components/settings/settings-title.tsx";
|
import SettingsTitle from "@/components/settings/settings-title.tsx";
|
||||||
import WorkspaceNameForm from "@/features/workspace/components/settings/components/workspace-name-form";
|
import WorkspaceNameForm from "@/features/workspace/components/settings/components/workspace-name-form";
|
||||||
|
import {getAppName} from "@/lib/config.ts";
|
||||||
|
import {Helmet} from "react-helmet-async";
|
||||||
|
|
||||||
export default function WorkspaceSettings() {
|
export default function WorkspaceSettings() {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
<Helmet>
|
||||||
|
<title>Workspace Settings - {getAppName()}</title>
|
||||||
|
</Helmet>
|
||||||
<SettingsTitle title="General"/>
|
<SettingsTitle title="General"/>
|
||||||
<WorkspaceNameForm/>
|
<WorkspaceNameForm/>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@ -2,14 +2,21 @@ import { Container } from "@mantine/core";
|
|||||||
import SpaceHomeTabs from "@/features/space/components/space-home-tabs.tsx";
|
import SpaceHomeTabs from "@/features/space/components/space-home-tabs.tsx";
|
||||||
import {useParams} from "react-router-dom";
|
import {useParams} from "react-router-dom";
|
||||||
import {useGetSpaceBySlugQuery} from "@/features/space/queries/space-query.ts";
|
import {useGetSpaceBySlugQuery} from "@/features/space/queries/space-query.ts";
|
||||||
|
import {getAppName} from "@/lib/config.ts";
|
||||||
|
import {Helmet} from "react-helmet-async";
|
||||||
|
|
||||||
export default function SpaceHome() {
|
export default function SpaceHome() {
|
||||||
const {spaceSlug} = useParams();
|
const {spaceSlug} = useParams();
|
||||||
const {data: space} = useGetSpaceBySlugQuery(spaceSlug);
|
const {data: space} = useGetSpaceBySlugQuery(spaceSlug);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<>
|
||||||
|
<Helmet>
|
||||||
|
<title>{space?.name || 'Overview'} - {getAppName()}</title>
|
||||||
|
</Helmet>
|
||||||
<Container size={"800"} pt="xl">
|
<Container size={"800"} pt="xl">
|
||||||
{space && <SpaceHomeTabs/>}
|
{space && <SpaceHomeTabs/>}
|
||||||
</Container>
|
</Container>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,23 +0,0 @@
|
|||||||
import { Title, Text, Stack } from '@mantine/core';
|
|
||||||
import { ThemeToggle } from '@/components/theme-toggle';
|
|
||||||
|
|
||||||
export function Welcome() {
|
|
||||||
return (
|
|
||||||
<Stack>
|
|
||||||
<Title ta="center" mt={100}>
|
|
||||||
<Text
|
|
||||||
inherit
|
|
||||||
variant="gradient"
|
|
||||||
component="span"
|
|
||||||
gradient={{ from: 'pink', to: 'yellow' }}
|
|
||||||
>
|
|
||||||
Welcome
|
|
||||||
</Text>
|
|
||||||
</Title>
|
|
||||||
<Text ta="center" size="lg" maw={580} mx="auto" mt="xl">
|
|
||||||
Welcome to something new and interesting.
|
|
||||||
</Text>
|
|
||||||
<ThemeToggle />
|
|
||||||
</Stack>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@ -1,15 +1,18 @@
|
|||||||
import { IsNotEmpty, IsString, MaxLength, MinLength } from 'class-validator';
|
import { IsNotEmpty, IsString, MaxLength, MinLength } from 'class-validator';
|
||||||
import { CreateUserDto } from './create-user.dto';
|
import { CreateUserDto } from './create-user.dto';
|
||||||
|
import {Transform, TransformFnParams} from "class-transformer";
|
||||||
|
|
||||||
export class CreateAdminUserDto extends CreateUserDto {
|
export class CreateAdminUserDto extends CreateUserDto {
|
||||||
@IsNotEmpty()
|
@IsNotEmpty()
|
||||||
@MinLength(3)
|
@MinLength(1)
|
||||||
@MaxLength(35)
|
@MaxLength(50)
|
||||||
|
@Transform(({ value }: TransformFnParams) => value?.trim())
|
||||||
name: string;
|
name: string;
|
||||||
|
|
||||||
@IsNotEmpty()
|
@IsNotEmpty()
|
||||||
@MinLength(4)
|
@MinLength(3)
|
||||||
@MaxLength(35)
|
@MaxLength(50)
|
||||||
@IsString()
|
@IsString()
|
||||||
|
@Transform(({ value }: TransformFnParams) => value?.trim())
|
||||||
workspaceName: string;
|
workspaceName: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,12 +6,14 @@ import {
|
|||||||
MaxLength,
|
MaxLength,
|
||||||
MinLength,
|
MinLength,
|
||||||
} from 'class-validator';
|
} from 'class-validator';
|
||||||
|
import {Transform, TransformFnParams} from "class-transformer";
|
||||||
|
|
||||||
export class CreateUserDto {
|
export class CreateUserDto {
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
@MinLength(2)
|
@MinLength(1)
|
||||||
@MaxLength(60)
|
@MaxLength(50)
|
||||||
@IsString()
|
@IsString()
|
||||||
|
@Transform(({ value }: TransformFnParams) => value?.trim())
|
||||||
name: string;
|
name: string;
|
||||||
|
|
||||||
@IsNotEmpty()
|
@IsNotEmpty()
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { IsString, MinLength } from 'class-validator';
|
import { IsString } from 'class-validator';
|
||||||
|
|
||||||
export class VerifyUserTokenDto {
|
export class VerifyUserTokenDto {
|
||||||
@IsString()
|
@IsString()
|
||||||
|
|||||||
@ -7,11 +7,13 @@ import {
|
|||||||
MaxLength,
|
MaxLength,
|
||||||
MinLength,
|
MinLength,
|
||||||
} from 'class-validator';
|
} from 'class-validator';
|
||||||
|
import {Transform, TransformFnParams} from "class-transformer";
|
||||||
|
|
||||||
export class CreateGroupDto {
|
export class CreateGroupDto {
|
||||||
@MinLength(2)
|
@MinLength(2)
|
||||||
@MaxLength(50)
|
@MaxLength(50)
|
||||||
@IsString()
|
@IsString()
|
||||||
|
@Transform(({ value }: TransformFnParams) => value?.trim())
|
||||||
name: string;
|
name: string;
|
||||||
|
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
|
|||||||
@ -5,11 +5,13 @@ import {
|
|||||||
MaxLength,
|
MaxLength,
|
||||||
MinLength,
|
MinLength,
|
||||||
} from 'class-validator';
|
} from 'class-validator';
|
||||||
|
import {Transform, TransformFnParams} from "class-transformer";
|
||||||
|
|
||||||
export class CreateSpaceDto {
|
export class CreateSpaceDto {
|
||||||
@MinLength(2)
|
@MinLength(2)
|
||||||
@MaxLength(50)
|
@MaxLength(50)
|
||||||
@IsString()
|
@IsString()
|
||||||
|
@Transform(({ value }: TransformFnParams) => value?.trim())
|
||||||
name: string;
|
name: string;
|
||||||
|
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
|
|||||||
@ -1,15 +1,17 @@
|
|||||||
import { IsOptional, IsString, MaxLength, MinLength } from 'class-validator';
|
import {IsAlphanumeric, IsOptional, IsString, MaxLength, MinLength} from 'class-validator';
|
||||||
|
import {Transform, TransformFnParams} from "class-transformer";
|
||||||
|
|
||||||
export class CreateWorkspaceDto {
|
export class CreateWorkspaceDto {
|
||||||
@MinLength(4)
|
@MinLength(4)
|
||||||
@MaxLength(64)
|
@MaxLength(64)
|
||||||
@IsString()
|
@IsString()
|
||||||
|
@Transform(({ value }: TransformFnParams) => value?.trim())
|
||||||
name: string;
|
name: string;
|
||||||
|
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
@MinLength(4)
|
@MinLength(4)
|
||||||
@MaxLength(30)
|
@MaxLength(30)
|
||||||
@IsString()
|
@IsAlphanumeric()
|
||||||
hostname?: string;
|
hostname?: string;
|
||||||
|
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
|
|||||||
Reference in New Issue
Block a user