forked from github/plane
Merge pull request #1097 from makeplane/fix/cycle_view
fix: cycle view & create label modal
This commit is contained in:
commit
af13a1b00a
@ -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
|
||||||
|
@ -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}
|
||||||
|
@ -156,6 +156,7 @@ export const CreateLabelModal: React.FC<Props> = ({ isOpen, projectId, handleClo
|
|||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</Popover>
|
</Popover>
|
||||||
|
<div className="flex w-full flex-col gap-0.5 justify-center">
|
||||||
<Input
|
<Input
|
||||||
type="text"
|
type="text"
|
||||||
id="name"
|
id="name"
|
||||||
@ -166,11 +167,12 @@ export const CreateLabelModal: React.FC<Props> = ({ isOpen, projectId, handleClo
|
|||||||
register={register}
|
register={register}
|
||||||
width="full"
|
width="full"
|
||||||
validations={{
|
validations={{
|
||||||
required: "Name is required",
|
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">
|
||||||
<SecondaryButton onClick={onClose}>Cancel</SecondaryButton>
|
<SecondaryButton onClick={onClose}>Cancel</SecondaryButton>
|
||||||
<PrimaryButton type="submit" loading={isSubmitting}>
|
<PrimaryButton type="submit" loading={isSubmitting}>
|
||||||
|
Loading…
Reference in New Issue
Block a user