forked from github/plane
fix: bug fixes & UI improvements (#2884)
* chore: access restriction for api tokens * fix: on create module total issues undefined * fix: cycle board card typo * chore: fetch modules after creation * fix: peek module on delete * fix: peek cycle on delete * fix: cycle detail sidebar copy link toast * chore: router replace -> push
This commit is contained in:
parent
b2ac7b9ac6
commit
202ecd21df
@ -30,7 +30,7 @@ export const CycleDeleteModal: React.FC<ICycleDelete> = observer((props) => {
|
||||
// states
|
||||
const [loader, setLoader] = useState(false);
|
||||
const router = useRouter();
|
||||
const { cycleId } = router.query;
|
||||
const { cycleId, peekCycle } = router.query;
|
||||
|
||||
const formSubmit = async () => {
|
||||
setLoader(true);
|
||||
@ -57,7 +57,7 @@ export const CycleDeleteModal: React.FC<ICycleDelete> = observer((props) => {
|
||||
);
|
||||
});
|
||||
|
||||
if (cycleId) router.replace(`/${workspaceSlug}/projects/${projectId}/cycles`);
|
||||
if (cycleId || peekCycle) router.push(`/${workspaceSlug}/projects/${projectId}/cycles`);
|
||||
|
||||
handleClose();
|
||||
} catch (error) {
|
||||
|
@ -102,7 +102,8 @@ export const CycleDetailsSidebar: React.FC<Props> = observer((props) => {
|
||||
.then(() => {
|
||||
setToastAlert({
|
||||
type: "success",
|
||||
title: "Cycle link copied to clipboard",
|
||||
title: "Link Copied!",
|
||||
message: "Cycle link copied to clipboard.",
|
||||
});
|
||||
})
|
||||
.catch(() => {
|
||||
|
@ -24,7 +24,7 @@ export const DeleteModuleModal: React.FC<Props> = observer((props) => {
|
||||
const [isDeleteLoading, setIsDeleteLoading] = useState(false);
|
||||
|
||||
const router = useRouter();
|
||||
const { workspaceSlug, projectId, moduleId } = router.query;
|
||||
const { workspaceSlug, projectId, moduleId, peekModule } = router.query;
|
||||
|
||||
const { module: moduleStore } = useMobxStore();
|
||||
|
||||
@ -43,7 +43,7 @@ export const DeleteModuleModal: React.FC<Props> = observer((props) => {
|
||||
await moduleStore
|
||||
.deleteModule(workspaceSlug.toString(), projectId.toString(), data.id)
|
||||
.then(() => {
|
||||
if (moduleId) router.push(`/${workspaceSlug}/projects/${data.project}/modules`);
|
||||
if (moduleId || peekModule) router.push(`/${workspaceSlug}/projects/${data.project}/modules`);
|
||||
handleClose();
|
||||
setToastAlert({
|
||||
type: "success",
|
||||
|
@ -56,7 +56,7 @@ export const ModuleCardItem: React.FC<Props> = observer((props) => {
|
||||
const moduleStatus = MODULE_STATUS.find((status) => status.value === module.status);
|
||||
|
||||
const issueCount = module
|
||||
? moduleTotalIssues === 0
|
||||
? !moduleTotalIssues || moduleTotalIssues === 0
|
||||
? "0 Issue"
|
||||
: moduleTotalIssues === module.completed_issues
|
||||
? `${moduleTotalIssues} Issue${moduleTotalIssues > 1 ? "s" : ""}`
|
||||
|
@ -218,7 +218,7 @@ export class ModuleStore implements IModuleStore {
|
||||
this.loader = false;
|
||||
this.error = null;
|
||||
});
|
||||
|
||||
this.fetchModules(workspaceSlug, projectId);
|
||||
return response;
|
||||
} catch (error) {
|
||||
console.error("Failed to create module in module store", error);
|
||||
|
Loading…
Reference in New Issue
Block a user