mirror of
https://github.com/docmost/docmost.git
synced 2025-11-18 15:21:11 +10:00
frontend permissions
* rework backend workspace permissions
This commit is contained in:
@ -11,6 +11,7 @@ export interface FullEditorProps {
|
||||
slugId: string;
|
||||
title: string;
|
||||
spaceSlug: string;
|
||||
editable: boolean;
|
||||
}
|
||||
|
||||
export function FullEditor({
|
||||
@ -18,6 +19,7 @@ export function FullEditor({
|
||||
title,
|
||||
slugId,
|
||||
spaceSlug,
|
||||
editable,
|
||||
}: FullEditorProps) {
|
||||
return (
|
||||
<div className={classes.editor}>
|
||||
@ -26,8 +28,9 @@ export function FullEditor({
|
||||
slugId={slugId}
|
||||
title={title}
|
||||
spaceSlug={spaceSlug}
|
||||
editable={editable}
|
||||
/>
|
||||
<MemoizedPageEditor pageId={pageId} />
|
||||
<MemoizedPageEditor pageId={pageId} editable={editable} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@ -24,13 +24,10 @@ import { EditorBubbleMenu } from "@/features/editor/components/bubble-menu/bubbl
|
||||
|
||||
interface PageEditorProps {
|
||||
pageId: string;
|
||||
editable?: boolean;
|
||||
editable: boolean;
|
||||
}
|
||||
|
||||
export default function PageEditor({
|
||||
pageId,
|
||||
editable = true,
|
||||
}: PageEditorProps) {
|
||||
export default function PageEditor({ pageId, editable }: PageEditorProps) {
|
||||
const [token] = useAtom(authTokensAtom);
|
||||
const collaborationURL = useCollaborationUrl();
|
||||
const [currentUser] = useAtom(currentUserAtom);
|
||||
|
||||
@ -28,6 +28,7 @@ export interface TitleEditorProps {
|
||||
slugId: string;
|
||||
title: string;
|
||||
spaceSlug: string;
|
||||
editable: boolean;
|
||||
}
|
||||
|
||||
export function TitleEditor({
|
||||
@ -35,6 +36,7 @@ export function TitleEditor({
|
||||
slugId,
|
||||
title,
|
||||
spaceSlug,
|
||||
editable,
|
||||
}: TitleEditorProps) {
|
||||
const [debouncedTitleState, setDebouncedTitleState] = useState(null);
|
||||
const [debouncedTitle] = useDebouncedValue(debouncedTitleState, 1000);
|
||||
@ -57,6 +59,7 @@ export function TitleEditor({
|
||||
Text,
|
||||
Placeholder.configure({
|
||||
placeholder: "Untitled",
|
||||
showOnlyWhenEditable: false,
|
||||
}),
|
||||
History.configure({
|
||||
depth: 20,
|
||||
@ -72,6 +75,7 @@ export function TitleEditor({
|
||||
const currentTitle = editor.getText();
|
||||
setDebouncedTitleState(currentTitle);
|
||||
},
|
||||
editable: editable,
|
||||
content: title,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user