mirror of
https://github.com/docmost/docmost.git
synced 2026-06-10 18:16:57 +08:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c7beaa3742 | |||
| 4a228e5a51 | |||
| edff375476 | |||
| 95016b2bfc | |||
| ca83712364 | |||
| 39550fe906 |
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "client",
|
"name": "client",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.22.0",
|
"version": "0.22.1",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "tsc && vite build",
|
"build": "tsc && vite build",
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { Group, Text } from "@mantine/core";
|
import { Group, Text } from "@mantine/core";
|
||||||
import { CustomAvatar } from "@/components/ui/custom-avatar.tsx";
|
import { CustomAvatar } from "@/components/ui/custom-avatar.tsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { User } from "server/dist/database/types/entity.types";
|
import { IUser } from '@/features/user/types/user.types.ts';
|
||||||
|
|
||||||
interface UserInfoProps {
|
interface UserInfoProps {
|
||||||
user: User;
|
user: Partial<IUser>;
|
||||||
size?: string;
|
size?: string;
|
||||||
}
|
}
|
||||||
export function UserInfo({ user, size }: UserInfoProps) {
|
export function UserInfo({ user, size }: UserInfoProps) {
|
||||||
|
|||||||
@@ -41,11 +41,16 @@ function CommentListWithTabs() {
|
|||||||
const spaceRules = space?.membership?.permissions;
|
const spaceRules = space?.membership?.permissions;
|
||||||
const spaceAbility = useSpaceAbility(spaceRules);
|
const spaceAbility = useSpaceAbility(spaceRules);
|
||||||
|
|
||||||
|
|
||||||
const canComment: boolean = spaceAbility.can(
|
const canComment: boolean = spaceAbility.can(
|
||||||
SpaceCaslAction.Manage,
|
SpaceCaslAction.Manage,
|
||||||
SpaceCaslSubject.Page
|
SpaceCaslSubject.Page
|
||||||
);
|
);
|
||||||
|
|
||||||
|
console.log(spaceAbility)
|
||||||
|
|
||||||
|
console.log('can comment', canComment);
|
||||||
|
|
||||||
// Separate active and resolved comments
|
// Separate active and resolved comments
|
||||||
const { activeComments, resolvedComments } = useMemo(() => {
|
const { activeComments, resolvedComments } = useMemo(() => {
|
||||||
if (!comments?.items) {
|
if (!comments?.items) {
|
||||||
@@ -179,6 +184,17 @@ function CommentListWithTabs() {
|
|||||||
userSpaceRole={space?.membership?.role}
|
userSpaceRole={space?.membership?.role}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{canComment && (
|
||||||
|
<>
|
||||||
|
<Divider my={4} />
|
||||||
|
<CommentEditorWithActions
|
||||||
|
commentId={comment.id}
|
||||||
|
onSave={handleAddReply}
|
||||||
|
isLoading={isLoading}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</Paper>
|
</Paper>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "server",
|
"name": "server",
|
||||||
"version": "0.22.0",
|
"version": "0.22.1",
|
||||||
"description": "",
|
"description": "",
|
||||||
"author": "",
|
"author": "",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
|||||||
@@ -261,35 +261,7 @@ export class PageService {
|
|||||||
|
|
||||||
if (isDuplicateInSameSpace) {
|
if (isDuplicateInSameSpace) {
|
||||||
// For duplicate in same space, position right after the original page
|
// For duplicate in same space, position right after the original page
|
||||||
let siblingQuery = this.db
|
nextPosition = generateJitteredKeyBetween(rootPage.position, null);
|
||||||
.selectFrom('pages')
|
|
||||||
.select(['position'])
|
|
||||||
.where('spaceId', '=', rootPage.spaceId)
|
|
||||||
.where('position', '>', rootPage.position);
|
|
||||||
|
|
||||||
if (rootPage.parentPageId) {
|
|
||||||
siblingQuery = siblingQuery.where(
|
|
||||||
'parentPageId',
|
|
||||||
'=',
|
|
||||||
rootPage.parentPageId,
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
siblingQuery = siblingQuery.where('parentPageId', 'is', null);
|
|
||||||
}
|
|
||||||
|
|
||||||
const nextSibling = await siblingQuery
|
|
||||||
.orderBy('position', 'asc')
|
|
||||||
.limit(1)
|
|
||||||
.executeTakeFirst();
|
|
||||||
|
|
||||||
if (nextSibling) {
|
|
||||||
nextPosition = generateJitteredKeyBetween(
|
|
||||||
rootPage.position,
|
|
||||||
nextSibling.position,
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
nextPosition = generateJitteredKeyBetween(rootPage.position, null);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
// For copy to different space, position at the end
|
// For copy to different space, position at the end
|
||||||
nextPosition = await this.nextPagePosition(spaceId);
|
nextPosition = await this.nextPagePosition(spaceId);
|
||||||
@@ -434,25 +406,35 @@ export class PageService {
|
|||||||
attachment.id,
|
attachment.id,
|
||||||
newAttachmentId,
|
newAttachmentId,
|
||||||
);
|
);
|
||||||
await this.storageService.copy(attachment.filePath, newPathFile);
|
|
||||||
await this.db
|
try {
|
||||||
.insertInto('attachments')
|
await this.storageService.copy(attachment.filePath, newPathFile);
|
||||||
.values({
|
|
||||||
id: newAttachmentId,
|
await this.db
|
||||||
type: attachment.type,
|
.insertInto('attachments')
|
||||||
filePath: newPathFile,
|
.values({
|
||||||
fileName: attachment.fileName,
|
id: newAttachmentId,
|
||||||
fileSize: attachment.fileSize,
|
type: attachment.type,
|
||||||
mimeType: attachment.mimeType,
|
filePath: newPathFile,
|
||||||
fileExt: attachment.fileExt,
|
fileName: attachment.fileName,
|
||||||
creatorId: attachment.creatorId,
|
fileSize: attachment.fileSize,
|
||||||
workspaceId: attachment.workspaceId,
|
mimeType: attachment.mimeType,
|
||||||
pageId: newPageId,
|
fileExt: attachment.fileExt,
|
||||||
spaceId: spaceId,
|
creatorId: attachment.creatorId,
|
||||||
})
|
workspaceId: attachment.workspaceId,
|
||||||
.execute();
|
pageId: newPageId,
|
||||||
|
spaceId: spaceId,
|
||||||
|
})
|
||||||
|
.execute();
|
||||||
|
} catch (err) {
|
||||||
|
this.logger.error(
|
||||||
|
`Duplicate page: failed to copy attachment ${attachment.id}`,
|
||||||
|
err,
|
||||||
|
);
|
||||||
|
// Continue with other attachments even if one fails
|
||||||
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.logger.log(err);
|
this.logger.error(err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ export class TrashCleanupService {
|
|||||||
@Interval('trash-cleanup', 24 * 60 * 60 * 1000) // every 24 hours
|
@Interval('trash-cleanup', 24 * 60 * 60 * 1000) // every 24 hours
|
||||||
async cleanupOldTrash() {
|
async cleanupOldTrash() {
|
||||||
try {
|
try {
|
||||||
this.logger.log('Starting trash cleanup job');
|
this.logger.debug('Starting trash cleanup job');
|
||||||
|
|
||||||
const retentionDate = new Date();
|
const retentionDate = new Date();
|
||||||
retentionDate.setDate(retentionDate.getDate() - this.RETENTION_DAYS);
|
retentionDate.setDate(retentionDate.getDate() - this.RETENTION_DAYS);
|
||||||
|
|||||||
+1
-1
Submodule apps/server/src/ee updated: 576cf4fa42...d39ddc4b5e
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "docmost",
|
"name": "docmost",
|
||||||
"homepage": "https://docmost.com",
|
"homepage": "https://docmost.com",
|
||||||
"version": "0.22.0",
|
"version": "0.22.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "nx run-many -t build",
|
"build": "nx run-many -t build",
|
||||||
|
|||||||
Reference in New Issue
Block a user