[WEB-924] chore: remove Add Issues button from completed cycles header. (#4153)

* [WEB-924] chore: remove `Add Issues` button from completed cycles header.

* fix: analytics button.
This commit is contained in:
Prateek Shourya 2024-04-10 13:02:56 +05:30 committed by GitHub
parent f805acbcef
commit 3c2b2e3ed6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -142,6 +142,7 @@ export const CycleIssuesHeader: React.FC = observer(() => {
// derived values // derived values
const cycleDetails = cycleId ? getCycleById(cycleId.toString()) : undefined; const cycleDetails = cycleId ? getCycleById(cycleId.toString()) : undefined;
const isCompletedCycle = cycleDetails?.status?.toLocaleLowerCase() === "completed";
const canUserCreateIssue = const canUserCreateIssue =
currentProjectRole && [EUserProjectRoles.ADMIN, EUserProjectRoles.MEMBER].includes(currentProjectRole); currentProjectRole && [EUserProjectRoles.ADMIN, EUserProjectRoles.MEMBER].includes(currentProjectRole);
@ -274,16 +275,18 @@ export const CycleIssuesHeader: React.FC = observer(() => {
<Button onClick={() => setAnalyticsModal(true)} variant="neutral-primary" size="sm"> <Button onClick={() => setAnalyticsModal(true)} variant="neutral-primary" size="sm">
Analytics Analytics
</Button> </Button>
<Button {!isCompletedCycle && (
onClick={() => { <Button
setTrackElement("Cycle issues page"); onClick={() => {
toggleCreateIssueModal(true, EIssuesStoreType.CYCLE); setTrackElement("Cycle issues page");
}} toggleCreateIssueModal(true, EIssuesStoreType.CYCLE);
size="sm" }}
prependIcon={<Plus />} size="sm"
> prependIcon={<Plus />}
Add Issue >
</Button> Add Issue
</Button>
)}
</> </>
)} )}
<button <button