forked from github/plane
feat: list and kanban issue alerts
This commit is contained in:
parent
32aef44e52
commit
937d04e88c
@ -173,9 +173,18 @@ export const SingleBoardIssue: React.FC<Props> = ({
|
|||||||
mutate(MODULE_ISSUES_WITH_PARAMS(moduleId as string, params));
|
mutate(MODULE_ISSUES_WITH_PARAMS(moduleId as string, params));
|
||||||
mutate(MODULE_DETAILS(moduleId as string));
|
mutate(MODULE_DETAILS(moduleId as string));
|
||||||
} else mutate(PROJECT_ISSUES_LIST_WITH_PARAMS(projectId as string, params));
|
} else mutate(PROJECT_ISSUES_LIST_WITH_PARAMS(projectId as string, params));
|
||||||
|
setToastAlert({
|
||||||
|
type: "info",
|
||||||
|
title: "Issue Updated Successfully",
|
||||||
|
});
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
|
setToastAlert({
|
||||||
|
type: "error",
|
||||||
|
title: "Error!",
|
||||||
|
message: "Something went wrong. Please try again.",
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
[
|
[
|
||||||
@ -209,15 +218,22 @@ export const SingleBoardIssue: React.FC<Props> = ({
|
|||||||
const handleCopyText = () => {
|
const handleCopyText = () => {
|
||||||
const originURL =
|
const originURL =
|
||||||
typeof window !== "undefined" && window.location.origin ? window.location.origin : "";
|
typeof window !== "undefined" && window.location.origin ? window.location.origin : "";
|
||||||
copyTextToClipboard(
|
copyTextToClipboard(`${originURL}/${workspaceSlug}/projects/${projectId}/issues/${issue.id}`)
|
||||||
`${originURL}/${workspaceSlug}/projects/${projectId}/issues/${issue.id}`
|
.then(() => {
|
||||||
).then(() => {
|
setToastAlert({
|
||||||
setToastAlert({
|
type: "info",
|
||||||
type: "success",
|
title: "Link Copied Successfully",
|
||||||
title: "Link Copied!",
|
iconType: "copy",
|
||||||
message: "Issue link copied to clipboard.",
|
});
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.log(error);
|
||||||
|
setToastAlert({
|
||||||
|
type: "error",
|
||||||
|
title: "Error!",
|
||||||
|
message: "Something went wrong. Please try again.",
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
@ -149,6 +149,18 @@ export const SingleListIssue: React.FC<Props> = ({
|
|||||||
mutate(MODULE_ISSUES_WITH_PARAMS(moduleId as string, params));
|
mutate(MODULE_ISSUES_WITH_PARAMS(moduleId as string, params));
|
||||||
mutate(MODULE_DETAILS(moduleId as string));
|
mutate(MODULE_DETAILS(moduleId as string));
|
||||||
} else mutate(PROJECT_ISSUES_LIST_WITH_PARAMS(projectId as string, params));
|
} else mutate(PROJECT_ISSUES_LIST_WITH_PARAMS(projectId as string, params));
|
||||||
|
setToastAlert({
|
||||||
|
type: "info",
|
||||||
|
title: "Issue Updated Successfully",
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.log(error);
|
||||||
|
setToastAlert({
|
||||||
|
type: "error",
|
||||||
|
title: "Error!",
|
||||||
|
message: "Something went wrong. Please try again.",
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
[
|
[
|
||||||
@ -168,15 +180,22 @@ export const SingleListIssue: React.FC<Props> = ({
|
|||||||
const handleCopyText = () => {
|
const handleCopyText = () => {
|
||||||
const originURL =
|
const originURL =
|
||||||
typeof window !== "undefined" && window.location.origin ? window.location.origin : "";
|
typeof window !== "undefined" && window.location.origin ? window.location.origin : "";
|
||||||
copyTextToClipboard(
|
copyTextToClipboard(`${originURL}/${workspaceSlug}/projects/${projectId}/issues/${issue.id}`)
|
||||||
`${originURL}/${workspaceSlug}/projects/${projectId}/issues/${issue.id}`
|
.then(() => {
|
||||||
).then(() => {
|
setToastAlert({
|
||||||
setToastAlert({
|
type: "info",
|
||||||
type: "success",
|
title: "Link Copied Successfully",
|
||||||
title: "Link Copied!",
|
iconType: "copy",
|
||||||
message: "Issue link copied to clipboard.",
|
});
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.log(error);
|
||||||
|
setToastAlert({
|
||||||
|
type: "error",
|
||||||
|
title: "Error!",
|
||||||
|
message: "Something went wrong. Please try again.",
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const isNotAllowed = userAuth.isGuest || userAuth.isViewer || isCompleted;
|
const isNotAllowed = userAuth.isGuest || userAuth.isViewer || isCompleted;
|
||||||
|
Loading…
Reference in New Issue
Block a user