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