Merge pull request #1097 from makeplane/fix/cycle_view

fix: cycle view & create label modal
This commit is contained in:
guru_sainath 2023-05-20 22:43:55 +05:30 committed by GitHub
commit af13a1b00a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 27 deletions

View File

@ -104,14 +104,6 @@ export const CompletedCycles: React.FC<CompletedCyclesListProps> = ({
))} ))}
</div> </div>
)} )}
{cycleView === "gantt" && (
<EmptyState
type="cycle"
title="Create New Cycle"
description="Sprint more effectively with Cycles by confining your project to a fixed amount of time. Create new cycle now."
imgURL={emptyCycle}
/>
)}
</div> </div>
) : ( ) : (
<EmptyState <EmptyState

View File

@ -89,9 +89,9 @@ export const CyclesView: React.FC<Props> = ({
<button <button
type="button" type="button"
className={`grid h-7 w-7 place-items-center rounded p-1 outline-none duration-300 hover:bg-brand-surface-2 ${ className={`grid h-7 w-7 place-items-center rounded p-1 outline-none duration-300 hover:bg-brand-surface-2 ${
cyclesView === "grid" ? "bg-brand-surface-2" : "" cyclesView === "board" ? "bg-brand-surface-2" : ""
}`} }`}
onClick={() => setCyclesView("grid")} onClick={() => setCyclesView("board")}
> >
<Squares2X2Icon className="h-4 w-4 text-brand-secondary" /> <Squares2X2Icon className="h-4 w-4 text-brand-secondary" />
</button> </button>
@ -100,7 +100,10 @@ export const CyclesView: React.FC<Props> = ({
className={`grid h-7 w-7 place-items-center rounded outline-none duration-300 hover:bg-brand-surface-2 ${ className={`grid h-7 w-7 place-items-center rounded outline-none duration-300 hover:bg-brand-surface-2 ${
cyclesView === "gantt_chart" ? "bg-brand-surface-2" : "" cyclesView === "gantt_chart" ? "bg-brand-surface-2" : ""
}`} }`}
onClick={() => setCyclesView("gantt_chart")} onClick={() => {
setCyclesView("gantt_chart");
setCycleTab("All");
}}
> >
<span className="material-symbols-rounded text-brand-secondary text-[18px] rotate-90"> <span className="material-symbols-rounded text-brand-secondary text-[18px] rotate-90">
waterfall_chart waterfall_chart
@ -111,6 +114,7 @@ export const CyclesView: React.FC<Props> = ({
<Tab.Group <Tab.Group
as={React.Fragment} as={React.Fragment}
defaultIndex={currentTabValue(cycleTab)} defaultIndex={currentTabValue(cycleTab)}
selectedIndex={currentTabValue(cycleTab)}
onChange={(i) => { onChange={(i) => {
switch (i) { switch (i) {
case 0: case 0:
@ -123,7 +127,6 @@ export const CyclesView: React.FC<Props> = ({
return setCycleTab("Completed"); return setCycleTab("Completed");
case 4: case 4:
return setCycleTab("Drafts"); return setCycleTab("Drafts");
default: default:
return setCycleTab("All"); return setCycleTab("All");
} }
@ -132,7 +135,10 @@ export const CyclesView: React.FC<Props> = ({
<div className="flex justify-between"> <div className="flex justify-between">
<Tab.List as="div" className="flex flex-wrap items-center justify-start gap-4 text-base"> <Tab.List as="div" className="flex flex-wrap items-center justify-start gap-4 text-base">
{["All", "Active", "Upcoming", "Completed", "Drafts"].map((tab, index) => { {["All", "Active", "Upcoming", "Completed", "Drafts"].map((tab, index) => {
if (cyclesView === "gantt_chart" && (tab === "Active" || tab === "Drafts")) if (
cyclesView === "gantt_chart" &&
(tab === "Active" || tab === "Drafts" || tab === "Completed")
)
return null; return null;
return ( return (
@ -162,7 +168,7 @@ export const CyclesView: React.FC<Props> = ({
type="current" type="current"
/> />
)} )}
{cyclesView === "grid" && ( {cyclesView === "board" && (
<AllCyclesBoard <AllCyclesBoard
cycles={cyclesCompleteList} cycles={cyclesCompleteList}
setCreateUpdateCycleModal={setCreateUpdateCycleModal} setCreateUpdateCycleModal={setCreateUpdateCycleModal}

View File

@ -156,19 +156,21 @@ export const CreateLabelModal: React.FC<Props> = ({ isOpen, projectId, handleClo
</> </>
)} )}
</Popover> </Popover>
<Input <div className="flex w-full flex-col gap-0.5 justify-center">
type="text" <Input
id="name" type="text"
name="name" id="name"
placeholder="Label title" name="name"
autoComplete="off" placeholder="Label title"
error={errors.name} autoComplete="off"
register={register} error={errors.name}
width="full" register={register}
validations={{ width="full"
required: "Name is required", validations={{
}} required: "Label title is required",
/> }}
/>
</div>
</div> </div>
</div> </div>
<div className="mt-5 flex justify-end gap-2"> <div className="mt-5 flex justify-end gap-2">