0
0
mirror of https://github.com/makeplane/plane synced 2024-06-14 14:31:34 +00:00
plane/apps/app/components/issues/sidebar-select/parent.tsx
Aaryan Khandelwal 6b4084287c
style: plane deploy ()
* chore: improve access field for comments for public boards ()

Co-authored-by: Bavisetti Narayan <72156168+NarayanBavisetti@users.noreply.github.com>

* chore: update user activity endpoint to return only workspace activities ()

* fix: n+1 in issue history and issue automation tasks ()

* fix: issue exports in self hosted instances ()

* fix: issue exports in self hosted instances

* dev: remove print logs

* dev: update url creation function

* fix: changed the presigned url for self hosted exports

---------

Co-authored-by: NarayanBavisetti <narayan3119@gmail.com>

* dev: remove gunicorn config ()

* feat: mark all read notifications ()

* feat: mark all read notifications

* fix: changed string to boolean

* fix: changed snoozed condition

* chore: project public board issue retrieve ()

* chore: project public board issue retrieve

* dev: project issues list endpoint

* fix: issue public retrieve endpoint

* fix: only external comments will show in deploy boards ()

* fix: issue votes ()

* fix: issue votes

* fix: added default as 1 in vote

* fix: issue vote migration file

* fix: access creation in comments ()

* dev: user timezone select option ()

* fix: start date filter not working on the platform ()

* feat: access selector for comment ()

* dev: access specifier for comment

* chore: change access order

* style: revamp of the issue details sidebar ()

* chore: update module status icons and colors ()

* chore: update module status icons and colors

* refactor: import statements

* fix: add default alue to module status

* chore: track public board comments and reaction users for public deploy boards ()

* chore: track project deploy board comment and reaction users for public deploy boards

* dev: remove tracking from project viewsets

* feat: user timezones ()

* dev: user timezones

* feat: user timezones

* fix: user created by stats ()

* fix: asset key validation ()

* fix: asset key validation

* chore: asset key validation in user assets

---------

Co-authored-by: Bavisetti Narayan <narayan@Bavisettis-MacBook-Pro.local>

* dev: revamp peek overview ()

* dev: mobx for issues store

* refactor: peek overview component

* chore: update open issue button

* fix: issue mutation after any crud action

* chore: remove peek overview from gantt

* chore: refactor code

* chore: tracking the history of issue reactions and votes. ()

* chore: tracking the issues reaction and vote history

* fix: changed the keywords for vote and reaction

* chore: added validation

* dev: revamp publish project modal ()

* dev: revamp publish project modal

* chore: sidebar dropdown text

* fix: bugs on the user profile page ()

* chore: return issue votes in public issue list endpoint ()

* style: list view

* [feat]: Tiptap table integration ()

* added basic table support

* fixed table position at bottom

* fixed image node deletion logic's regression issue

* added compatible styles

* enabled slash commands

* disabled slash command and bubble menu's node selector for table cells

* added dropcursor support to type below the table/image

* blocked image uploads for handledrop and paste actions

* style: kanban view

* style: tiptap table ()

* style: theming added

* chore: issue reactions and votes

---------

Co-authored-by: Nikhil <118773738+pablohashescobar@users.noreply.github.com>
Co-authored-by: Bavisetti Narayan <72156168+NarayanBavisetti@users.noreply.github.com>
Co-authored-by: NarayanBavisetti <narayan3119@gmail.com>
Co-authored-by: Bavisetti Narayan <narayan@Bavisettis-MacBook-Pro.local>
Co-authored-by: M. Palanikannan <73993394+Palanikannan1437@users.noreply.github.com>
2023-08-31 23:24:03 +05:30

58 lines
1.7 KiB
TypeScript

import React, { useState } from "react";
import { useRouter } from "next/router";
// components
import { ParentIssuesListModal } from "components/issues";
// types
import { IIssue, ISearchIssueResponse, UserAuth } from "types";
type Props = {
onChange: (value: string) => void;
issueDetails: IIssue | undefined;
disabled?: boolean;
};
export const SidebarParentSelect: React.FC<Props> = ({
onChange,
issueDetails,
disabled = false,
}) => {
const [isParentModalOpen, setIsParentModalOpen] = useState(false);
const [selectedParentIssue, setSelectedParentIssue] = useState<ISearchIssueResponse | null>(null);
const router = useRouter();
const { projectId, issueId } = router.query;
return (
<>
<ParentIssuesListModal
isOpen={isParentModalOpen}
handleClose={() => setIsParentModalOpen(false)}
onChange={(issue) => {
onChange(issue.id);
setSelectedParentIssue(issue);
}}
issueId={issueId as string}
projectId={projectId as string}
/>
<button
type="button"
className={`bg-custom-background-80 text-xs rounded px-2.5 py-0.5 ${
disabled ? "cursor-not-allowed" : "cursor-pointer "
}`}
onClick={() => setIsParentModalOpen(true)}
disabled={disabled}
>
{selectedParentIssue && issueDetails?.parent ? (
`${selectedParentIssue.project__identifier}-${selectedParentIssue.sequence_id}`
) : !selectedParentIssue && issueDetails?.parent ? (
`${issueDetails.parent_detail?.project_detail.identifier}-${issueDetails.parent_detail?.sequence_id}`
) : (
<span className="text-custom-text-200">Select issue</span>
)}
</button>
</>
);
};