Fixed up job details lines table + jobs totals page.

This commit is contained in:
Patrick Fic
2020-06-11 14:09:12 -07:00
parent 886c7e9cb9
commit 4e5c305f95
20 changed files with 562 additions and 517 deletions

View File

@@ -4,10 +4,11 @@ import { MdRemoveCircleOutline } from "react-icons/md";
export default function AllocationsLabelComponent({ allocation, handleClick }) {
return (
<div style={{ display: "flex" }}>
<div style={{ display: "flex", alignItems: "center" }}>
<span>
{`${allocation.employee.first_name || ""} ${allocation.employee
.last_name || ""} (${allocation.hours || ""})`}
{`${allocation.employee.first_name || ""} ${
allocation.employee.last_name || ""
} (${allocation.hours || ""})`}
</span>
<Icon
style={{ color: "red", padding: "0px 4px" }}

View File

@@ -8,19 +8,21 @@ import { useTranslation } from "react-i18next";
export default function AllocationsLabelContainer({ allocation, refetch }) {
const [deleteAllocation] = useMutation(DELETE_ALLOCATION);
const { t } = useTranslation();
const handleClick = e => {
const handleClick = (e) => {
e.preventDefault();
deleteAllocation({ variables: { id: allocation.id } })
.then(r => {
.then((r) => {
notification["success"]({
message: t("allocations.successes.deleted")
message: t("allocations.successes.deleted"),
});
if (refetch) refetch();
})
.catch(error => {
.catch((error) => {
notification["error"]({ message: t("allocations.errors.deleting") });
});
};
return (
<AllocationsLabelComponent
allocation={allocation}