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
1014 B
TypeScript
43 lines
1014 B
TypeScript
import { FC } from "react";
|
|
// components
|
|
import { LabelListItem } from "./label-list-item";
|
|
// hooks
|
|
import { useIssueDetail } from "hooks/store";
|
|
// types
|
|
import { TLabelOperations } from "./root";
|
|
|
|
type TLabelList = {
|
|
workspaceSlug: string;
|
|
projectId: string;
|
|
issueId: string;
|
|
labelOperations: TLabelOperations;
|
|
disabled: boolean;
|
|
};
|
|
|
|
export const LabelList: FC<TLabelList> = (props) => {
|
|
const { workspaceSlug, projectId, issueId, labelOperations, disabled } = props;
|
|
// hooks
|
|
const {
|
|
issue: { getIssueById },
|
|
} = useIssueDetail();
|
|
|
|
const issue = getIssueById(issueId);
|
|
const issueLabels = issue?.label_ids || undefined;
|
|
|
|
if (!issue || !issueLabels) return <></>;
|
|
return (
|
|
<>
|
|
{issueLabels.map((labelId) => (
|
|
<LabelListItem
|
|
workspaceSlug={workspaceSlug}
|
|
projectId={projectId}
|
|
issueId={issueId}
|
|
labelId={labelId}
|
|
labelOperations={labelOperations}
|
|
disabled={disabled}
|
|
/>
|
|
))}
|
|
</>
|
|
);
|
|
};
|