fix: handled attachment upload filename size error in the issue detail (#3485)

* fix: handled attachment upload filename size error in the issue detail

* ui: profile detail sidebar border
This commit is contained in:
guru_sainath 2024-01-28 18:30:53 +05:30 committed by GitHub
parent 212f2b54f8
commit 532da80375
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 42 additions and 19 deletions

View file

@ -38,7 +38,6 @@ export const IssueAttachmentsDetail: FC<TIssueAttachmentsDetail> = (props) => {
const attachment = attachmentId && getAttachmentById(attachmentId);
if (!attachment) return <></>;
return (
<>
<IssueAttachmentDeleteModal

View file

@ -5,6 +5,8 @@ import { useDropzone } from "react-dropzone";
import { useApplication } from "hooks/store";
// constants
import { MAX_FILE_SIZE } from "constants/common";
// helpers
import { generateFileName } from "helpers/attachment.helper";
// types
import { TAttachmentOperations } from "./root";
@ -26,15 +28,17 @@ export const IssueAttachmentUpload: React.FC<Props> = observer((props) => {
const [isLoading, setIsLoading] = useState(false);
const onDrop = useCallback((acceptedFiles: File[]) => {
if (!acceptedFiles[0] || !workspaceSlug) return;
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", acceptedFiles[0]);
formData.append("asset", uploadedFile);
formData.append(
"attributes",
JSON.stringify({
name: acceptedFiles[0].name,
size: acceptedFiles[0].size,
name: uploadedFile.name,
size: uploadedFile.size,
})
);
setIsLoading(true);

View file

@ -60,7 +60,7 @@ export const ProfileSidebar = observer(() => {
];
return (
<div className="w-full flex-shrink-0 overflow-y-auto shadow-custom-shadow-sm md:h-full md:w-80">
<div className="w-full flex-shrink-0 overflow-y-auto shadow-custom-shadow-sm md:h-full md:w-80 border-l border-custom-border-100">
{userProjectsData ? (
<>
<div className="relative h-32">