Merge pull request #195 from makeplane/sync/ce-ee

sync: merge conflicts need to be resolved
This commit is contained in:
sriram veeraghanta
2024-05-02 19:24:44 +05:30
committed by GitHub
4 changed files with 25 additions and 21 deletions

View File

@@ -27,7 +27,7 @@ class WorkspaceCyclesEndpoint(BaseAPIView):
.select_related("project")
.select_related("workspace")
.select_related("owned_by")
.filter(archived_at__isnull=False)
.filter(archived_at__isnull=True)
.annotate(
total_issues=Count(
"issue_cycle",

View File

@@ -30,7 +30,7 @@ class WorkspaceModulesEndpoint(BaseAPIView):
.select_related("workspace")
.select_related("lead")
.prefetch_related("members")
.filter(archived_at__isnull=False)
.filter(archived_at__isnull=True)
.prefetch_related(
Prefetch(
"link_module",

View File

@@ -1,11 +1,11 @@
import { useCallback, useState } from "react";
import { observer } from "mobx-react-lite";
import { useDropzone } from "react-dropzone";
// hooks
// constants
import { MAX_FILE_SIZE } from "@/constants/common";
// helpers
import { generateFileName } from "@/helpers/attachment.helper";
// hooks
import { useApplication } from "@/hooks/store";
// types
import { TAttachmentOperations } from "./root";
@@ -27,24 +27,28 @@ export const IssueAttachmentUpload: React.FC<Props> = observer((props) => {
// states
const [isLoading, setIsLoading] = useState(false);
const onDrop = useCallback((acceptedFiles: File[]) => {
const currentFile: File = acceptedFiles[0];
if (!currentFile || !workspaceSlug) return;
const onDrop = useCallback(
(acceptedFiles: File[]) => {
const currentFile: File = acceptedFiles[0];
if (!currentFile || !workspaceSlug) return;
const uploadedFile: File = new File([currentFile], generateFileName(currentFile.name), { type: currentFile.type });
const formData = new FormData();
formData.append("asset", uploadedFile);
formData.append(
"attributes",
JSON.stringify({
name: uploadedFile.name,
size: uploadedFile.size,
})
);
setIsLoading(true);
handleAttachmentOperations.create(formData).finally(() => setIsLoading(false));
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
const uploadedFile: File = new File([currentFile], generateFileName(currentFile.name), {
type: currentFile.type,
});
const formData = new FormData();
formData.append("asset", uploadedFile);
formData.append(
"attributes",
JSON.stringify({
name: uploadedFile.name,
size: uploadedFile.size,
})
);
setIsLoading(true);
handleAttachmentOperations.create(formData).finally(() => setIsLoading(false));
},
[handleAttachmentOperations, workspaceSlug]
);
const { getRootProps, getInputProps, isDragActive, isDragReject, fileRejections } = useDropzone({
onDrop,

View File

@@ -95,7 +95,7 @@ export const IssueAttachmentRoot: FC<TIssueAttachmentRoot> = (props) => {
}
},
}),
[workspaceSlug, projectId, issueId, createAttachment, removeAttachment]
[captureIssueEvent, workspaceSlug, projectId, issueId, createAttachment, removeAttachment]
);
return (