mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
chore: estimate alerts
This commit is contained in:
parent
1d9a011797
commit
ec228ad02c
@ -2,7 +2,7 @@ import { FC, FormEvent, useState } from "react";
|
|||||||
import { observer } from "mobx-react";
|
import { observer } from "mobx-react";
|
||||||
import { Check, Info, X } from "lucide-react";
|
import { Check, Info, X } from "lucide-react";
|
||||||
import { TEstimatePointsObject, TEstimateSystemKeys } from "@plane/types";
|
import { TEstimatePointsObject, TEstimateSystemKeys } from "@plane/types";
|
||||||
import { Spinner, Tooltip } from "@plane/ui";
|
import { Spinner, TOAST_TYPE, Tooltip, setToast } from "@plane/ui";
|
||||||
// constants
|
// constants
|
||||||
import { EEstimateSystem } from "@/constants/estimates";
|
import { EEstimateSystem } from "@/constants/estimates";
|
||||||
// helpers
|
// helpers
|
||||||
@ -91,21 +91,34 @@ export const EstimatePointCreate: FC<TEstimatePointCreate> = observer((props) =>
|
|||||||
|
|
||||||
setLoader(false);
|
setLoader(false);
|
||||||
setError(undefined);
|
setError(undefined);
|
||||||
|
setToast({
|
||||||
|
type: TOAST_TYPE.SUCCESS,
|
||||||
|
title: "Estimate point updated",
|
||||||
|
message: "The estimate point has been updated successfully.",
|
||||||
|
});
|
||||||
handleClose();
|
handleClose();
|
||||||
} catch {
|
} catch {
|
||||||
setLoader(false);
|
setLoader(false);
|
||||||
setError("something went wrong. please try again later");
|
setError("We are unable to process your request, please try again.");
|
||||||
|
setToast({
|
||||||
|
type: TOAST_TYPE.ERROR,
|
||||||
|
title: "Estimate point failed to updated",
|
||||||
|
message: "We are unable to process your request, please try again.",
|
||||||
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
handleSuccess(estimateInputValue);
|
handleSuccess(estimateInputValue);
|
||||||
setError("Please fill the input field");
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
setLoader(false);
|
setLoader(false);
|
||||||
setError("please enter a valid estimate value");
|
setError(
|
||||||
|
[EEstimateSystem.POINTS, EEstimateSystem.TIME].includes(estimateType)
|
||||||
|
? "Estimate point needs to be a numeric value."
|
||||||
|
: "Estimate point needs to be a character value."
|
||||||
|
);
|
||||||
}
|
}
|
||||||
} else setError("Estimate point values cannot be repeated");
|
} else setError("Estimate value already exists.");
|
||||||
} else setError("Please fill the input field");
|
} else setError("Estimate value cannot be empty.");
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -2,7 +2,7 @@ import { FC, useState } from "react";
|
|||||||
import { observer } from "mobx-react";
|
import { observer } from "mobx-react";
|
||||||
import { MoveRight, Trash2, X } from "lucide-react";
|
import { MoveRight, Trash2, X } from "lucide-react";
|
||||||
import { TEstimatePointsObject } from "@plane/types";
|
import { TEstimatePointsObject } from "@plane/types";
|
||||||
import { Spinner } from "@plane/ui";
|
import { Spinner, TOAST_TYPE, setToast } from "@plane/ui";
|
||||||
// components
|
// components
|
||||||
import { EstimatePointDropdown } from "@/components/estimates/points";
|
import { EstimatePointDropdown } from "@/components/estimates/points";
|
||||||
// hooks
|
// hooks
|
||||||
@ -49,10 +49,20 @@ export const EstimatePointDelete: FC<TEstimatePointDelete> = observer((props) =>
|
|||||||
|
|
||||||
setLoader(false);
|
setLoader(false);
|
||||||
setError(undefined);
|
setError(undefined);
|
||||||
|
setToast({
|
||||||
|
type: TOAST_TYPE.SUCCESS,
|
||||||
|
title: "Estimate point updated",
|
||||||
|
message: "The estimate point has been updated successfully.",
|
||||||
|
});
|
||||||
handleClose();
|
handleClose();
|
||||||
} catch {
|
} catch {
|
||||||
setLoader(false);
|
setLoader(false);
|
||||||
setError("something went wrong. please try again later");
|
setError("something went wrong. please try again later");
|
||||||
|
setToast({
|
||||||
|
type: TOAST_TYPE.ERROR,
|
||||||
|
title: "Estimate point failed to updated",
|
||||||
|
message: "We are unable to process your request, please try again.",
|
||||||
|
});
|
||||||
}
|
}
|
||||||
else setError("please select option");
|
else setError("please select option");
|
||||||
};
|
};
|
||||||
|
@ -2,7 +2,7 @@ import { FC, FormEvent, useEffect, useState } from "react";
|
|||||||
import { observer } from "mobx-react";
|
import { observer } from "mobx-react";
|
||||||
import { Check, Info, X } from "lucide-react";
|
import { Check, Info, X } from "lucide-react";
|
||||||
import { TEstimatePointsObject, TEstimateSystemKeys } from "@plane/types";
|
import { TEstimatePointsObject, TEstimateSystemKeys } from "@plane/types";
|
||||||
import { Spinner, Tooltip } from "@plane/ui";
|
import { Spinner, TOAST_TYPE, Tooltip, setToast } from "@plane/ui";
|
||||||
// constants
|
// constants
|
||||||
import { EEstimateSystem } from "@/constants/estimates";
|
import { EEstimateSystem } from "@/constants/estimates";
|
||||||
// helpers
|
// helpers
|
||||||
@ -99,20 +99,33 @@ export const EstimatePointUpdate: FC<TEstimatePointUpdate> = observer((props) =>
|
|||||||
setLoader(false);
|
setLoader(false);
|
||||||
setError(undefined);
|
setError(undefined);
|
||||||
handleClose();
|
handleClose();
|
||||||
|
setToast({
|
||||||
|
type: TOAST_TYPE.SUCCESS,
|
||||||
|
title: "Estimate point updated",
|
||||||
|
message: "The estimate point has been updated successfully.",
|
||||||
|
});
|
||||||
} catch {
|
} catch {
|
||||||
setLoader(false);
|
setLoader(false);
|
||||||
setError("something went wrong. please try again later");
|
setError("We are unable to process your request, please try again.");
|
||||||
|
setToast({
|
||||||
|
type: TOAST_TYPE.ERROR,
|
||||||
|
title: "Estimate point failed to updated",
|
||||||
|
message: "We are unable to process your request, please try again.",
|
||||||
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
handleSuccess(estimateInputValue);
|
handleSuccess(estimateInputValue);
|
||||||
setError("Please fill the input field");
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
setLoader(false);
|
setLoader(false);
|
||||||
setError("please enter a valid estimate value");
|
setError(
|
||||||
|
[EEstimateSystem.POINTS, EEstimateSystem.TIME].includes(estimateType)
|
||||||
|
? "Estimate point needs to be a numeric value."
|
||||||
|
: "Estimate point needs to be a character value."
|
||||||
|
);
|
||||||
}
|
}
|
||||||
} else setError("Estimate point values cannot be repeated");
|
} else setError("Estimate value already exists.");
|
||||||
} else setError("Please fill the input field");
|
} else setError("Estimate value cannot be empty.");
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Loading…
Reference in New Issue
Block a user