mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
[WEB-658] fix: multiple toast alerts on adding existing issues (#3889)
* fix: enums export in the types package * chore: remove NestedKeyOf type * fix: multiple toast alerts on adding existing issues * chore: added success toast alerts
This commit is contained in:
parent
e4f48d6878
commit
c08d6987d0
@ -66,12 +66,6 @@ export const ExistingIssuesListModal: React.FC<Props> = (props) => {
|
|||||||
await handleOnSubmit(selectedIssues).finally(() => setIsSubmitting(false));
|
await handleOnSubmit(selectedIssues).finally(() => setIsSubmitting(false));
|
||||||
|
|
||||||
handleClose();
|
handleClose();
|
||||||
|
|
||||||
setToast({
|
|
||||||
type: TOAST_TYPE.SUCCESS,
|
|
||||||
title: "Success",
|
|
||||||
message: `Issue${selectedIssues.length > 1 ? "s" : ""} added successfully`,
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
@ -59,13 +59,22 @@ export const CycleEmptyState: React.FC<Props> = observer((props) => {
|
|||||||
|
|
||||||
const issueIds = data.map((i) => i.id);
|
const issueIds = data.map((i) => i.id);
|
||||||
|
|
||||||
await issues.addIssueToCycle(workspaceSlug.toString(), projectId, cycleId.toString(), issueIds).catch(() => {
|
await issues
|
||||||
setToast({
|
.addIssueToCycle(workspaceSlug.toString(), projectId, cycleId.toString(), issueIds)
|
||||||
type: TOAST_TYPE.ERROR,
|
.then(() =>
|
||||||
title: "Error!",
|
setToast({
|
||||||
message: "Selected issues could not be added to the cycle. Please try again.",
|
type: TOAST_TYPE.SUCCESS,
|
||||||
});
|
title: "Success!",
|
||||||
});
|
message: "Issues added to the cycle successfully.",
|
||||||
|
})
|
||||||
|
)
|
||||||
|
.catch(() =>
|
||||||
|
setToast({
|
||||||
|
type: TOAST_TYPE.ERROR,
|
||||||
|
title: "Error!",
|
||||||
|
message: "Selected issues could not be added to the cycle. Please try again.",
|
||||||
|
})
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const emptyStateDetail = CYCLE_EMPTY_STATE_DETAILS["no-issues"];
|
const emptyStateDetail = CYCLE_EMPTY_STATE_DETAILS["no-issues"];
|
||||||
|
@ -59,6 +59,13 @@ export const ModuleEmptyState: React.FC<Props> = observer((props) => {
|
|||||||
const issueIds = data.map((i) => i.id);
|
const issueIds = data.map((i) => i.id);
|
||||||
await issues
|
await issues
|
||||||
.addIssuesToModule(workspaceSlug.toString(), projectId?.toString(), moduleId.toString(), issueIds)
|
.addIssuesToModule(workspaceSlug.toString(), projectId?.toString(), moduleId.toString(), issueIds)
|
||||||
|
.then(() =>
|
||||||
|
setToast({
|
||||||
|
type: TOAST_TYPE.SUCCESS,
|
||||||
|
title: "Success!",
|
||||||
|
message: "Issues added to the module successfully.",
|
||||||
|
})
|
||||||
|
)
|
||||||
.catch(() =>
|
.catch(() =>
|
||||||
setToast({
|
setToast({
|
||||||
type: TOAST_TYPE.ERROR,
|
type: TOAST_TYPE.ERROR,
|
||||||
|
@ -65,7 +65,13 @@ export const HeaderGroupByCard: FC<IHeaderGroupByCard> = observer((props) => {
|
|||||||
const issues = data.map((i) => i.id);
|
const issues = data.map((i) => i.id);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
addIssuesToView && addIssuesToView(issues);
|
await addIssuesToView?.(issues);
|
||||||
|
|
||||||
|
setToast({
|
||||||
|
type: TOAST_TYPE.SUCCESS,
|
||||||
|
title: "Success!",
|
||||||
|
message: "Issues added to the cycle successfully.",
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setToast({
|
setToast({
|
||||||
type: TOAST_TYPE.ERROR,
|
type: TOAST_TYPE.ERROR,
|
||||||
|
@ -47,7 +47,13 @@ export const HeaderGroupByCard = observer(
|
|||||||
const issues = data.map((i) => i.id);
|
const issues = data.map((i) => i.id);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
addIssuesToView && addIssuesToView(issues);
|
await addIssuesToView?.(issues);
|
||||||
|
|
||||||
|
setToast({
|
||||||
|
type: TOAST_TYPE.SUCCESS,
|
||||||
|
title: "Success!",
|
||||||
|
message: "Issues added to the cycle successfully.",
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setToast({
|
setToast({
|
||||||
type: TOAST_TYPE.ERROR,
|
type: TOAST_TYPE.ERROR,
|
||||||
|
Loading…
Reference in New Issue
Block a user