chore: cycle store restructuring (#6405)
This commit is contained in:
parent
a908bf9edd
commit
8acea7f599
6 changed files with 7 additions and 3 deletions
|
|
@ -7,6 +7,7 @@ interface Props {
|
||||||
projectId: string;
|
projectId: string;
|
||||||
workspaceSlug: string;
|
workspaceSlug: string;
|
||||||
transferrableIssuesCount: number;
|
transferrableIssuesCount: number;
|
||||||
|
cycleName: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const EndCycleModal: React.FC<Props> = () => <></>;
|
export const EndCycleModal: React.FC<Props> = () => <></>;
|
||||||
|
|
|
||||||
1
web/ce/store/cycle/index.ts
Normal file
1
web/ce/store/cycle/index.ts
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
export type { ICycleStore } from "@/store/cycle.store";
|
||||||
|
|
@ -82,10 +82,10 @@ export const CycleListItemAction: FC<Props> = observer((props) => {
|
||||||
|
|
||||||
// derived values
|
// derived values
|
||||||
const cycleStatus = cycleDetails.status ? (cycleDetails.status.toLocaleLowerCase() as TCycleGroups) : "draft";
|
const cycleStatus = cycleDetails.status ? (cycleDetails.status.toLocaleLowerCase() as TCycleGroups) : "draft";
|
||||||
|
|
||||||
const showIssueCount = useMemo(() => cycleStatus === "draft" || cycleStatus === "upcoming", [cycleStatus]);
|
const showIssueCount = useMemo(() => cycleStatus === "draft" || cycleStatus === "upcoming", [cycleStatus]);
|
||||||
|
|
||||||
const showTransferIssues = cycleDetails.pending_issues > 0 && cycleStatus === "completed";
|
const showTransferIssues = routerProjectId && cycleDetails.pending_issues > 0 && cycleStatus === "completed";
|
||||||
|
|
||||||
const isEditingAllowed = allowPermissions(
|
const isEditingAllowed = allowPermissions(
|
||||||
[EUserPermissions.ADMIN, EUserPermissions.MEMBER],
|
[EUserPermissions.ADMIN, EUserPermissions.MEMBER],
|
||||||
|
|
|
||||||
|
|
@ -177,6 +177,7 @@ export const CycleQuickActions: React.FC<Props> = observer((props) => {
|
||||||
projectId={projectId}
|
projectId={projectId}
|
||||||
workspaceSlug={workspaceSlug}
|
workspaceSlug={workspaceSlug}
|
||||||
transferrableIssuesCount={cycleDetails.pending_issues}
|
transferrableIssuesCount={cycleDetails.pending_issues}
|
||||||
|
cycleName={cycleDetails.name}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import { useContext } from "react";
|
||||||
// mobx store
|
// mobx store
|
||||||
import { StoreContext } from "@/lib/store-context";
|
import { StoreContext } from "@/lib/store-context";
|
||||||
// types
|
// types
|
||||||
import { ICycleStore } from "@/store/cycle.store";
|
import { ICycleStore } from "@/plane-web/store/cycle";
|
||||||
|
|
||||||
export const useCycle = (): ICycleStore => {
|
export const useCycle = (): ICycleStore => {
|
||||||
const context = useContext(StoreContext);
|
const context = useContext(StoreContext);
|
||||||
|
|
|
||||||
1
web/ee/store/cycle/index.ts
Normal file
1
web/ee/store/cycle/index.ts
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
export * from "@/store/cycle.store";
|
||||||
Loading…
Add table
Add a link
Reference in a new issue