fix: delete and restore for dynamic urls for minio hosted images fix… (#3452)
* feat: delete and restore for dynamic urls for minio hosted images fixed in spaces * feat: delete and restore images calls fixed for web
This commit is contained in:
parent
6a2be6afc4
commit
8d3ea5bb3e
15 changed files with 143 additions and 36 deletions
|
|
@ -14,6 +14,7 @@ import { Comment } from "types/issue";
|
|||
import { LiteTextEditorWithRef } from "@plane/lite-text-editor";
|
||||
// service
|
||||
import fileService from "services/file.service";
|
||||
import { RootStore } from "store/root";
|
||||
|
||||
const defaultValues: Partial<Comment> = {
|
||||
comment_html: "",
|
||||
|
|
@ -35,6 +36,9 @@ export const AddComment: React.FC<Props> = observer((props) => {
|
|||
} = useForm<Comment>({ defaultValues });
|
||||
|
||||
const router = useRouter();
|
||||
const { project }: RootStore = useMobxStore();
|
||||
const workspaceId = project.workspace?.id;
|
||||
|
||||
const { workspace_slug, project_slug } = router.query as { workspace_slug: string; project_slug: string };
|
||||
|
||||
const { user: userStore, issueDetails: issueDetailStore } = useMobxStore();
|
||||
|
|
@ -78,8 +82,8 @@ export const AddComment: React.FC<Props> = observer((props) => {
|
|||
}}
|
||||
cancelUploadImage={fileService.cancelUpload}
|
||||
uploadFile={fileService.getUploadFileFunction(workspace_slug as string)}
|
||||
deleteFile={fileService.deleteImage}
|
||||
restoreFile={fileService.restoreImage}
|
||||
deleteFile={fileService.getDeleteImageFunction(workspaceId as string)}
|
||||
restoreFile={fileService.getRestoreImageFunction(workspaceId as string)}
|
||||
ref={editorRef}
|
||||
value={
|
||||
!value || value === "" || (typeof value === "object" && Object.keys(value).length === 0)
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ import { Comment } from "types/issue";
|
|||
import fileService from "services/file.service";
|
||||
import useEditorSuggestions from "hooks/use-editor-suggestions";
|
||||
|
||||
import { RootStore } from "store/root";
|
||||
type Props = {
|
||||
workspaceSlug: string;
|
||||
comment: Comment;
|
||||
|
|
@ -24,6 +25,9 @@ type Props = {
|
|||
|
||||
export const CommentCard: React.FC<Props> = observer((props) => {
|
||||
const { comment, workspaceSlug } = props;
|
||||
const { project }: RootStore = useMobxStore();
|
||||
const workspaceId = project.workspace?.id;
|
||||
|
||||
// store
|
||||
const { user: userStore, issueDetails: issueDetailStore } = useMobxStore();
|
||||
// states
|
||||
|
|
@ -105,8 +109,8 @@ export const CommentCard: React.FC<Props> = observer((props) => {
|
|||
onEnterKeyPress={handleSubmit(handleCommentUpdate)}
|
||||
cancelUploadImage={fileService.cancelUpload}
|
||||
uploadFile={fileService.getUploadFileFunction(workspaceSlug)}
|
||||
deleteFile={fileService.deleteImage}
|
||||
restoreFile={fileService.restoreImage}
|
||||
deleteFile={fileService.getDeleteImageFunction(workspaceId as string)}
|
||||
restoreFile={fileService.getRestoreImageFunction(workspaceId as string)}
|
||||
ref={editorRef}
|
||||
value={value}
|
||||
debouncedUpdatesEnabled={false}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue