mirror of
https://github.com/docmost/docmost.git
synced 2026-08-28 17:27:06 +08:00
feat: cloud and ee (#805)
* stripe init git submodules for enterprise modules * * Cloud billing UI - WIP * Proxy websockets in dev mode * Separate workspace login and creation for cloud * Other fixes * feat: billing (cloud) * * add domain service * prepare links from workspace hostname * WIP * Add exchange token generation * Validate JWT token type during verification * domain service * add SkipTransform decorator * * updates (server) * add new packages * new sso migration file * WIP * Fix hostname generation * WIP * WIP * Reduce input error font-size * set max password length * jwt package * license page - WIP * * License management UI * Move license key store to db * add reflector * SSO enforcement * * Add default plan * Add usePlan hook * * Fix auth container margin in mobile * Redirect login and home to select page in cloud * update .gitignore * Default to yearly * * Trial messaging * Handle ended trials * Don't set to readonly on collab disconnect (Cloud) * Refine trial (UI) * Fix bug caused by using jotai optics atom in AppHeader component * configurable database maximum pool * Close SSO form on save * wip * sync * Only show sign-in in cloud * exclude base api part from workspaceId check * close db connection beforeApplicationShutdown * Add health/live endpoint * clear cookie on hostname change * reset currentUser atom * Change text * return 401 if workspace does not match * feat: show user workspace list in cloud login page * sync * Add home path * Prefetch to speed up queries * * Add robots.txt * Disallow login and forgot password routes * wildcard user-agent * Fix space query cache * fix * fix * use space uuid for recent pages * prefetch billing plans * enhance license page * sync
This commit is contained in:
+11
-7
@@ -11,6 +11,7 @@ import { notifications } from "@mantine/notifications";
|
||||
import { useClipboard } from "@mantine/hooks";
|
||||
import { getInviteLink } from "@/features/workspace/services/workspace-service.ts";
|
||||
import useUserRole from "@/hooks/use-user-role.tsx";
|
||||
import { isCloud } from "@/lib/config.ts";
|
||||
|
||||
interface Props {
|
||||
invitationId: string;
|
||||
@@ -76,13 +77,16 @@ export default function InviteActionMenu({ invitationId }: Props) {
|
||||
</Menu.Target>
|
||||
|
||||
<Menu.Dropdown>
|
||||
<Menu.Item
|
||||
onClick={() => handleCopyLink(invitationId)}
|
||||
leftSection={<IconCopy size={16} />}
|
||||
disabled={!isAdmin}
|
||||
>
|
||||
{t("Copy link")}
|
||||
</Menu.Item>
|
||||
{!isCloud() && (
|
||||
<Menu.Item
|
||||
onClick={() => handleCopyLink(invitationId)}
|
||||
leftSection={<IconCopy size={16} />}
|
||||
disabled={!isAdmin}
|
||||
>
|
||||
{t("Copy link")}
|
||||
</Menu.Item>
|
||||
)}
|
||||
|
||||
<Menu.Item
|
||||
onClick={onResend}
|
||||
leftSection={<IconSend size={16} />}
|
||||
|
||||
+2
-1
@@ -9,12 +9,13 @@ export default function WorkspaceInviteSection() {
|
||||
const [currentUser] = useAtom(currentUserAtom);
|
||||
const [inviteLink, setInviteLink] = useState<string>("");
|
||||
|
||||
/*
|
||||
useEffect(() => {
|
||||
setInviteLink(
|
||||
`${window.location.origin}/invite/${currentUser.workspace.inviteCode}`,
|
||||
);
|
||||
}, [currentUser.workspace.inviteCode]);
|
||||
|
||||
*/
|
||||
return (
|
||||
<>
|
||||
<div>
|
||||
|
||||
+4
-10
@@ -1,8 +1,7 @@
|
||||
import { currentUserAtom } from "@/features/user/atoms/current-user-atom.ts";
|
||||
import { workspaceAtom } from "@/features/user/atoms/current-user-atom.ts";
|
||||
import { useAtom } from "jotai";
|
||||
import * as z from "zod";
|
||||
import { useState } from "react";
|
||||
import { focusAtom } from "jotai-optics";
|
||||
import { updateWorkspace } from "@/features/workspace/services/workspace-service.ts";
|
||||
import { IWorkspace } from "@/features/workspace/types/workspace.types.ts";
|
||||
import { TextInput, Button } from "@mantine/core";
|
||||
@@ -17,21 +16,16 @@ const formSchema = z.object({
|
||||
|
||||
type FormValues = z.infer<typeof formSchema>;
|
||||
|
||||
const workspaceAtom = focusAtom(currentUserAtom, (optic) =>
|
||||
optic.prop("workspace"),
|
||||
);
|
||||
|
||||
export default function WorkspaceNameForm() {
|
||||
const { t } = useTranslation();
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
const [currentUser] = useAtom(currentUserAtom);
|
||||
const [, setWorkspace] = useAtom(workspaceAtom);
|
||||
const [workspace, setWorkspace] = useAtom(workspaceAtom);
|
||||
const { isAdmin } = useUserRole();
|
||||
|
||||
const form = useForm<FormValues>({
|
||||
validate: zodResolver(formSchema),
|
||||
initialValues: {
|
||||
name: currentUser?.workspace?.name,
|
||||
name: workspace?.name,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -39,7 +33,7 @@ export default function WorkspaceNameForm() {
|
||||
setIsLoading(true);
|
||||
|
||||
try {
|
||||
const updatedWorkspace = await updateWorkspace(data);
|
||||
const updatedWorkspace = await updateWorkspace({ name: data.name });
|
||||
setWorkspace(updatedWorkspace);
|
||||
notifications.show({ message: t("Updated successfully") });
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user