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:
Lakhan Baheti 2023-11-27 12:15:10 +05:30 committed by GitHub
parent b2ac7b9ac6
commit 202ecd21df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 7 deletions

View File

@ -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) {

View File

@ -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(() => {

View File

@ -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",

View File

@ -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" : ""}`

View File

@ -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);