mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
2cd5dbcd02
* fix: handled undefined issue_id in list layout * chore: updated label select dropdown in the issue detail * fix: peekoverview issue is resolved * chore: user role validation for issue details. * fix: Link, Attachement, parent mutation * build-error: build error resolved in peekoverview * chore: user role validation for issue details. * chore: user role validation for `issue description`, `parent`, `relation` and `subscription`. * chore: issue subscription mutation * chore: user role validation for `labels` in issue details. --------- Co-authored-by: Prateek Shourya <prateekshourya29@gmail.com>
43 lines
1.2 KiB
TypeScript
43 lines
1.2 KiB
TypeScript
import { FC } from "react";
|
|
import { observer } from "mobx-react-lite";
|
|
// hooks
|
|
import { useIssueDetail } from "hooks/store";
|
|
// components
|
|
import { IssueAttachmentsDetail } from "./attachment-detail";
|
|
// types
|
|
import { TAttachmentOperations } from "./root";
|
|
|
|
type TAttachmentOperationsRemoveModal = Exclude<TAttachmentOperations, "create">;
|
|
|
|
type TIssueAttachmentsList = {
|
|
issueId: string;
|
|
handleAttachmentOperations: TAttachmentOperationsRemoveModal;
|
|
disabled?: boolean;
|
|
};
|
|
|
|
export const IssueAttachmentsList: FC<TIssueAttachmentsList> = observer((props) => {
|
|
const { issueId, handleAttachmentOperations, disabled } = props;
|
|
// store hooks
|
|
const {
|
|
attachment: { getAttachmentsByIssueId },
|
|
} = useIssueDetail();
|
|
|
|
const issueAttachments = getAttachmentsByIssueId(issueId);
|
|
|
|
if (!issueAttachments) return <></>;
|
|
|
|
return (
|
|
<>
|
|
{issueAttachments &&
|
|
issueAttachments.length > 0 &&
|
|
issueAttachments.map((attachmentId) => (
|
|
<IssueAttachmentsDetail
|
|
attachmentId={attachmentId}
|
|
disabled={disabled}
|
|
handleAttachmentOperations={handleAttachmentOperations}
|
|
/>
|
|
))}
|
|
</>
|
|
);
|
|
});
|