@@ -1,11 +1,11 @@
|
|||||||
import { useMutation } from "@apollo/client";
|
import {useMutation} from "@apollo/client";
|
||||||
import { Button, Card, Dropdown, TimePicker } from "antd";
|
import {Button, Card, Dropdown, TimePicker} from "antd";
|
||||||
import dayjs from "../../utils/day";
|
import dayjs from "../../utils/day";
|
||||||
import React, { useState } from "react";
|
import React, {useState} from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import {useTranslation} from "react-i18next";
|
||||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
import {logImEXEvent} from "../../firebase/firebase.utils";
|
||||||
import { UPDATE_JOB } from "../../graphql/jobs.queries";
|
import {UPDATE_JOB} from "../../graphql/jobs.queries";
|
||||||
import { DateFormatter } from "../../utils/DateFormatter";
|
import {DateFormatter} from "../../utils/DateFormatter";
|
||||||
import FormDatePicker from "../form-date-picker/form-date-picker.component";
|
import FormDatePicker from "../form-date-picker/form-date-picker.component";
|
||||||
|
|
||||||
export default function ProductionListDate({
|
export default function ProductionListDate({
|
||||||
@@ -13,13 +13,13 @@ export default function ProductionListDate({
|
|||||||
field,
|
field,
|
||||||
time,
|
time,
|
||||||
pastIndicator,
|
pastIndicator,
|
||||||
}) {
|
}) {
|
||||||
const [updateAlert] = useMutation(UPDATE_JOB);
|
const [updateAlert] = useMutation(UPDATE_JOB);
|
||||||
const [open, setOpen] = useState(false);
|
const [open, setOpen] = useState(false);
|
||||||
const { t } = useTranslation();
|
const {t} = useTranslation();
|
||||||
|
|
||||||
const handleChange = (date) => {
|
const handleChange = (date) => {
|
||||||
logImEXEvent("product_toggle_date", { field });
|
logImEXEvent("product_toggle_date", {field});
|
||||||
// if (date.isSame(record[field] && dayjs(record[field]))) {
|
// if (date.isSame(record[field] && dayjs(record[field]))) {
|
||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
@@ -56,16 +56,13 @@ export default function ProductionListDate({
|
|||||||
"production-completion-soon"));
|
"production-completion-soon"));
|
||||||
}
|
}
|
||||||
// TODO - Client Update = Why is the overlay a card?
|
// TODO - Client Update = Why is the overlay a card?
|
||||||
return (
|
|
||||||
<Dropdown
|
const overlayMenu = {
|
||||||
trigger={["click"]}
|
items: [
|
||||||
onOpenChange={(v) => setOpen(v)}
|
{
|
||||||
open={open}
|
key: 'overlayItem1',
|
||||||
style={{
|
label:
|
||||||
height: "19px",
|
<Card style={{padding: "1rem"}} onClick={(e) => e.stopPropagation()}>
|
||||||
}}
|
|
||||||
overlay={
|
|
||||||
<Card style={{ padding: "1rem" }} onClick={(e) => e.stopPropagation()}>
|
|
||||||
<FormDatePicker
|
<FormDatePicker
|
||||||
onClick={(e) => e.stopPropagation()}
|
onClick={(e) => e.stopPropagation()}
|
||||||
value={(record[field] && dayjs(record[field])) || null}
|
value={(record[field] && dayjs(record[field])) || null}
|
||||||
@@ -87,6 +84,18 @@ export default function ProductionListDate({
|
|||||||
</Button>
|
</Button>
|
||||||
</Card>
|
</Card>
|
||||||
}
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Dropdown
|
||||||
|
trigger={["click"]}
|
||||||
|
onOpenChange={(v) => setOpen(v)}
|
||||||
|
open={open}
|
||||||
|
style={{
|
||||||
|
height: "19px",
|
||||||
|
}}
|
||||||
|
menu={overlayMenu}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
onClick={() => setOpen(true)}
|
onClick={() => setOpen(true)}
|
||||||
|
|||||||
@@ -89,16 +89,11 @@ export function ProductionLastContacted({ currentUser, record }) {
|
|||||||
}
|
}
|
||||||
}, [open, form, record.date_last_contacted]);
|
}, [open, form, record.date_last_contacted]);
|
||||||
|
|
||||||
// TODO - Client Update - Why is this a card?
|
const overlayMenu = {
|
||||||
return (
|
items: [
|
||||||
<div>
|
{
|
||||||
<Dropdown
|
key: 'overlay-item-1',
|
||||||
//trigger={["click"]}
|
label:
|
||||||
open={open}
|
|
||||||
style={{
|
|
||||||
height: "19px",
|
|
||||||
}}
|
|
||||||
overlay={
|
|
||||||
<Card
|
<Card
|
||||||
style={{ padding: "1rem" }}
|
style={{ padding: "1rem" }}
|
||||||
onClick={(e) => e.stopPropagation()}
|
onClick={(e) => e.stopPropagation()}
|
||||||
@@ -130,6 +125,18 @@ export function ProductionLastContacted({ currentUser, record }) {
|
|||||||
</Form>
|
</Form>
|
||||||
</Card>
|
</Card>
|
||||||
}
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<Dropdown
|
||||||
|
//trigger={["click"]}
|
||||||
|
open={open}
|
||||||
|
style={{
|
||||||
|
height: "19px",
|
||||||
|
}}
|
||||||
|
menu={overlayMenu}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
onClick={() => setOpen(true)}
|
onClick={() => setOpen(true)}
|
||||||
|
|||||||
Reference in New Issue
Block a user