- nuke visible from the face of the earth with fire.

Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
Dave Richer
2024-01-12 17:25:25 -05:00
parent 7d6e61043e
commit ba32a71786
58 changed files with 227 additions and 229 deletions

View File

@@ -8872,13 +8872,13 @@
│ ├─ email: luis@luisrudge.net │ ├─ email: luis@luisrudge.net
│ ├─ path: /Users/pfic/Documents/Development/bodyshop/client/node_modules/postcss-flexbugs-fixes │ ├─ path: /Users/pfic/Documents/Development/bodyshop/client/node_modules/postcss-flexbugs-fixes
│ └─ licenseFile: /Users/pfic/Documents/Development/bodyshop/client/node_modules/postcss-flexbugs-fixes/LICENSE │ └─ licenseFile: /Users/pfic/Documents/Development/bodyshop/client/node_modules/postcss-flexbugs-fixes/LICENSE
├─ postcss-focus-visible@4.0.0 ├─ postcss-focus-open@4.0.0
│ ├─ licenses: CC0-1.0 │ ├─ licenses: CC0-1.0
│ ├─ repository: https://github.com/jonathantneal/postcss-focus-visible │ ├─ repository: https://github.com/jonathantneal/postcss-focus-open
│ ├─ publisher: Jonathan Neal │ ├─ publisher: Jonathan Neal
│ ├─ email: jonathantneal@hotmail.com │ ├─ email: jonathantneal@hotmail.com
│ ├─ path: /Users/pfic/Documents/Development/bodyshop/client/node_modules/postcss-focus-visible │ ├─ path: /Users/pfic/Documents/Development/bodyshop/client/node_modules/postcss-focus-open
│ └─ licenseFile: /Users/pfic/Documents/Development/bodyshop/client/node_modules/postcss-focus-visible/LICENSE.md │ └─ licenseFile: /Users/pfic/Documents/Development/bodyshop/client/node_modules/postcss-focus-open/LICENSE.md
├─ postcss-focus-within@3.0.0 ├─ postcss-focus-within@3.0.0
│ ├─ licenses: CC0-1.0 │ ├─ licenses: CC0-1.0
│ ├─ repository: https://github.com/jonathantneal/postcss-focus-within │ ├─ repository: https://github.com/jonathantneal/postcss-focus-within

View File

@@ -190,7 +190,7 @@ This package contains the following license and notice below:
# @firebase/logger # @firebase/logger
This package serves as the base of all logging in the JS SDK. Any logging that This package serves as the base of all logging in the JS SDK. Any logging that
is intended to be visible to Firebase end developers should go through this is intended to be open to Firebase end developers should go through this
module. module.
## Basic Usage ## Basic Usage
@@ -9375,7 +9375,7 @@ parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying. a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices" An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible to the extent that it includes a convenient and prominently open
feature that (1) displays an appropriate copyright notice, and (2) feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the extent that warranties are provided), that licensees may convey the

View File

@@ -1029,7 +1029,7 @@ The following NPM packages may be included in this product:
- postcss-dir-pseudo-class@5.0.0 - postcss-dir-pseudo-class@5.0.0
- postcss-double-position-gradients@1.0.0 - postcss-double-position-gradients@1.0.0
- postcss-env-function@2.0.2 - postcss-env-function@2.0.2
- postcss-focus-visible@4.0.0 - postcss-focus-open@4.0.0
- postcss-focus-within@3.0.0 - postcss-focus-within@3.0.0
- postcss-gap-properties@2.0.0 - postcss-gap-properties@2.0.0
- postcss-image-set-function@3.0.1 - postcss-image-set-function@3.0.1
@@ -1699,7 +1699,7 @@ This package contains the following license and notice below:
# @firebase/logger # @firebase/logger
This package serves as the base of all logging in the JS SDK. Any logging that This package serves as the base of all logging in the JS SDK. Any logging that
is intended to be visible to Firebase end developers should go through this is intended to be open to Firebase end developers should go through this
module. module.
## Basic Usage ## Basic Usage
@@ -24029,7 +24029,7 @@ parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying. a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices" An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible to the extent that it includes a convenient and prominently open
feature that (1) displays an appropriate copyright notice, and (2) feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the extent that warranties are provided), that licensees may convey the

View File

@@ -48,7 +48,7 @@ export function BillDetailEditcontainer({setPartsOrderContext, insertAuditTrail,
const {t} = useTranslation(); const {t} = useTranslation();
const [form] = Form.useForm(); const [form] = Form.useForm();
const [visible, setVisible] = useState(false); const [open, setOpen] = useState(false);
const [updateLoading, setUpdateLoading] = useState(false); const [updateLoading, setUpdateLoading] = useState(false);
const [update_bill] = useMutation(UPDATE_BILL); const [update_bill] = useMutation(UPDATE_BILL);
const [insertBillLine] = useMutation(INSERT_NEW_BILL_LINES); const [insertBillLine] = useMutation(INSERT_NEW_BILL_LINES);
@@ -71,7 +71,7 @@ export function BillDetailEditcontainer({setPartsOrderContext, insertAuditTrail,
form.getFieldValue("billlines").filter((b) => b.deductedfromlbr).length > form.getFieldValue("billlines").filter((b) => b.deductedfromlbr).length >
0 0
) )
setVisible(true); setOpen(true);
else { else {
form.submit(); form.submit();
} }
@@ -154,7 +154,7 @@ export function BillDetailEditcontainer({setPartsOrderContext, insertAuditTrail,
await refetch(); await refetch();
form.setFieldsValue(transformData(data)); form.setFieldsValue(transformData(data));
form.resetFields(); form.resetFields();
setVisible(false); setOpen(false);
setUpdateLoading(false); setUpdateLoading(false);
}; };
@@ -178,9 +178,9 @@ export function BillDetailEditcontainer({setPartsOrderContext, insertAuditTrail,
<BillDetailEditReturn data={data} /> <BillDetailEditReturn data={data} />
<BillPrintButton billid={search.billid} /> <BillPrintButton billid={search.billid} />
<Popconfirm <Popconfirm
open={visible} open={open}
onConfirm={() => form.submit()} onConfirm={() => form.submit()}
onCancel={() => setVisible(false)} onCancel={() => setOpen(false)}
okButtonProps={{ loading: updateLoading }} okButtonProps={{ loading: updateLoading }}
title={t("bills.labels.editadjwarning")} title={t("bills.labels.editadjwarning")}
> >

View File

@@ -36,7 +36,7 @@ export function BillDetailEditReturn({
const history = useNavigate(); const history = useNavigate();
const { t } = useTranslation(); const { t } = useTranslation();
const [form] = Form.useForm(); const [form] = Form.useForm();
const [visible, setVisible] = useState(false); const [open, setOpen] = useState(false);
const handleFinish = ({ billlines }) => { const handleFinish = ({ billlines }) => {
const selectedLines = billlines.filter((l) => l.selected).map((l) => l.id); const selectedLines = billlines.filter((l) => l.selected).map((l) => l.id);
@@ -68,17 +68,17 @@ export function BillDetailEditReturn({
delete search.billid; delete search.billid;
history({ search: queryString.stringify(search) }); history({ search: queryString.stringify(search) });
setVisible(false); setOpen(false);
}; };
useEffect(() => { useEffect(() => {
if (visible === false) form.resetFields(); if (open === false) form.resetFields();
}, [visible, form]); }, [open, form]);
return ( return (
<> <>
<Modal <Modal
open={visible} open={open}
onCancel={() => setVisible(false)} onCancel={() => setOpen(false)}
destroyOnClose destroyOnClose
title={t("bills.actions.return")} title={t("bills.actions.return")}
onOk={() => form.submit()} onOk={() => form.submit()}
@@ -175,7 +175,7 @@ export function BillDetailEditReturn({
<Button <Button
disabled={data.bills_by_pk.is_credit_memo || disabled} disabled={data.bills_by_pk.is_credit_memo || disabled}
onClick={() => { onClick={() => {
setVisible(true); setOpen(true);
}} }}
> >
{t("bills.actions.return")} {t("bills.actions.return")}

View File

@@ -346,18 +346,18 @@ function BillEnterModalContainer({
}, [enterAgain, form]); }, [enterAgain, form]);
useEffect(() => { useEffect(() => {
if (billEnterModal.visible) { if (billEnterModal.open) {
form.setFieldsValue(formValues); form.setFieldsValue(formValues);
} else { } else {
form.resetFields(); form.resetFields();
} }
}, [billEnterModal.visible, form, formValues]); }, [billEnterModal.open, form, formValues]);
return ( return (
<Modal <Modal
title={t("bills.labels.new")} title={t("bills.labels.new")}
width={"98%"} width={"98%"}
open={billEnterModal.visible} open={billEnterModal.open}
okText={t("general.actions.save")} okText={t("general.actions.save")}
keyboard="false" keyboard="false"
onOk={() => form.submit()} onOk={() => form.submit()}

View File

@@ -25,7 +25,7 @@ export function ContractsFindModalContainer({
}) { }) {
const { t } = useTranslation(); const { t } = useTranslation();
const { visible } = caBcEtfTableModal; const { open } = caBcEtfTableModal;
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const [form] = Form.useForm(); const [form] = Form.useForm();
const EtfTemplate = TemplateList("special").ca_bc_etf_table; const EtfTemplate = TemplateList("special").ca_bc_etf_table;
@@ -63,14 +63,14 @@ export function ContractsFindModalContainer({
}; };
useEffect(() => { useEffect(() => {
if (visible) { if (open) {
form.resetFields(); form.resetFields();
} }
}, [visible, form]); }, [open, form]);
return ( return (
<Modal <Modal
open={visible} open={open}
width="70%" width="70%"
title={t("payments.labels.findermodal")} title={t("payments.labels.findermodal")}
onCancel={() => toggleModalVisible()} onCancel={() => toggleModalVisible()}

View File

@@ -22,7 +22,7 @@ function CardPaymentModalContainer({
toggleModalVisible, toggleModalVisible,
bodyshop, bodyshop,
}) { }) {
const { visible } = cardPaymentModal; const { open } = cardPaymentModal;
const { t } = useTranslation(); const { t } = useTranslation();
const handleCancel = () => { const handleCancel = () => {
@@ -35,7 +35,7 @@ function CardPaymentModalContainer({
return ( return (
<Modal <Modal
open={visible} open={open}
onOk={handleOK} onOk={handleOK}
onCancel={handleCancel} onCancel={handleCancel}
footer={[ footer={[

View File

@@ -27,7 +27,7 @@ export function ChatMediaSelector({
conversation, conversation,
}) { }) {
const { t } = useTranslation(); const { t } = useTranslation();
const [visible, setVisible] = useState(false); const [open, setOpen] = useState(false);
const { loading, error, data } = useQuery(GET_DOCUMENTS_BY_JOB, { const { loading, error, data } = useQuery(GET_DOCUMENTS_BY_JOB, {
fetchPolicy: "network-only", fetchPolicy: "network-only",
@@ -39,13 +39,13 @@ export function ChatMediaSelector({
}, },
skip: skip:
!visible || !open ||
!conversation.job_conversations || !conversation.job_conversations ||
conversation.job_conversations.length === 0, conversation.job_conversations.length === 0,
}); });
const handleVisibleChange = (visible) => { const handleVisibleChange = (change) => {
setVisible(visible); setOpen(change);
}; };
useEffect(() => { useEffect(() => {
@@ -65,7 +65,7 @@ export function ChatMediaSelector({
externalMediaState={[selectedMedia, setSelectedMedia]} externalMediaState={[selectedMedia, setSelectedMedia]}
/> />
)} )}
{bodyshop.uselocalmediaserver && visible && ( {bodyshop.uselocalmediaserver && open && (
<JobDocumentsLocalGalleryExternal <JobDocumentsLocalGalleryExternal
externalMediaState={[selectedMedia, setSelectedMedia]} externalMediaState={[selectedMedia, setSelectedMedia]}
jobId={ jobId={
@@ -88,7 +88,7 @@ export function ChatMediaSelector({
} }
title={t("messaging.labels.selectmedia")} title={t("messaging.labels.selectmedia")}
trigger="click" trigger="click"
open={visible} open={open}
onOpenChange={handleVisibleChange} onOpenChange={handleVisibleChange}
> >
<Badge count={selectedMedia.filter((s) => s.isSelected).length}> <Badge count={selectedMedia.filter((s) => s.isSelected).length}>

View File

@@ -9,7 +9,7 @@ export default function ChatTagRoComponent({
loading, loading,
handleSearch, handleSearch,
handleInsertTag, handleInsertTag,
setVisible, setOpen,
}) { }) {
const { t } = useTranslation(); const { t } = useTranslation();
@@ -38,7 +38,7 @@ export default function ChatTagRoComponent({
{loading ? ( {loading ? (
<LoadingOutlined /> <LoadingOutlined />
) : ( ) : (
<CloseCircleOutlined onClick={() => setVisible(false)} /> <CloseCircleOutlined onClick={() => setOpen(false)} />
)} )}
</Space> </Space>
); );

View File

@@ -11,7 +11,7 @@ import ChatTagRo from "./chat-tag-ro.component";
export default function ChatTagRoContainer({ conversation }) { export default function ChatTagRoContainer({ conversation }) {
const { t } = useTranslation(); const { t } = useTranslation();
const [visible, setVisible] = useState(false); const [open, setOpen] = useState(false);
const [loadRo, { loading, data }] = useLazyQuery(SEARCH_FOR_JOBS); const [loadRo, { loading, data }] = useLazyQuery(SEARCH_FOR_JOBS);
@@ -33,7 +33,7 @@ export default function ChatTagRoContainer({ conversation }) {
const handleInsertTag = (value, option) => { const handleInsertTag = (value, option) => {
logImEXEvent("messaging_add_job_tag"); logImEXEvent("messaging_add_job_tag");
insertTag({ variables: { jobId: option.key } }); insertTag({ variables: { jobId: option.key } });
setVisible(false); setOpen(false);
}; };
const existingJobTags = const existingJobTags =
@@ -47,16 +47,16 @@ export default function ChatTagRoContainer({ conversation }) {
return ( return (
<div> <div>
{visible ? ( {open ? (
<ChatTagRo <ChatTagRo
loading={loading} loading={loading}
roOptions={roOptions} roOptions={roOptions}
handleSearch={handleSearch} handleSearch={handleSearch}
handleInsertTag={handleInsertTag} handleInsertTag={handleInsertTag}
setVisible={setVisible} setOpen={setOpen}
/> />
) : ( ) : (
<Tag onClick={() => setVisible(true)}> <Tag onClick={() => setOpen(true)}>
<PlusOutlined /> <PlusOutlined />
{t("messaging.actions.link")} {t("messaging.actions.link")}
</Tag> </Tag>

View File

@@ -38,7 +38,7 @@ export function ContractConvertToRo({
disabled, disabled,
}) { }) {
const { t } = useTranslation(); const { t } = useTranslation();
const [visible, setVisible] = useState(false); const [open, setOpen] = useState(false);
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const [insertJob] = useMutation(INSERT_NEW_JOB); const [insertJob] = useMutation(INSERT_NEW_JOB);
const history = useNavigate(); const history = useNavigate();
@@ -306,7 +306,7 @@ export function ContractConvertToRo({
}); });
} }
setVisible(false); setOpen(false);
setLoading(false); setLoading(false);
}; };
@@ -380,7 +380,7 @@ export function ContractConvertToRo({
<Button type="primary" htmlType="submit" loading={loading}> <Button type="primary" htmlType="submit" loading={loading}>
{t("contracts.actions.convertoro")} {t("contracts.actions.convertoro")}
</Button> </Button>
<Button onClick={() => setVisible(false)}> <Button onClick={() => setOpen(false)}>
{t("general.actions.close")} {t("general.actions.close")}
</Button> </Button>
</Space> </Space>
@@ -390,9 +390,9 @@ export function ContractConvertToRo({
return ( return (
<div> <div>
<Popover content={popContent} open={visible}> <Popover content={popContent} open={open}>
<Button <Button
onClick={() => setVisible(true)} onClick={() => setOpen(true)}
loading={loading} loading={loading}
disabled={!contract.dailyrate || !contract.actualreturn || disabled} disabled={!contract.dailyrate || !contract.actualreturn || disabled}
> >

View File

@@ -31,7 +31,7 @@ export function ContractsFindModalContainer({
}) { }) {
const { t } = useTranslation(); const { t } = useTranslation();
const { visible } = contractFinderModal; const { open } = contractFinderModal;
const [form] = Form.useForm(); const [form] = Form.useForm();
@@ -52,14 +52,14 @@ export function ContractsFindModalContainer({
}; };
useEffect(() => { useEffect(() => {
if (visible) { if (open) {
form.resetFields(); form.resetFields();
} }
}, [visible, form]); }, [open, form]);
return ( return (
<Modal <Modal
open={visible} open={open}
width="70%" width="70%"
title={t("contracts.labels.findermodal")} title={t("contracts.labels.findermodal")}
onCancel={() => toggleModalVisible()} onCancel={() => toggleModalVisible()}

View File

@@ -26,7 +26,7 @@ export function CCReturnModalContainer({
bodyshop, bodyshop,
}) { }) {
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const { visible, context, actions } = courtesyCarReturnModal; const { open, context, actions } = courtesyCarReturnModal;
const { t } = useTranslation(); const { t } = useTranslation();
const [form] = Form.useForm(); const [form] = Form.useForm();
const [updateContract] = useMutation(RETURN_CONTRACT); const [updateContract] = useMutation(RETURN_CONTRACT);
@@ -64,7 +64,7 @@ export function CCReturnModalContainer({
return ( return (
<Modal <Modal
title={t("courtesycars.labels.return")} title={t("courtesycars.labels.return")}
open={visible} open={open}
onCancel={() => toggleModalVisible()} onCancel={() => toggleModalVisible()}
width={"90%"} width={"90%"}
okText={t("general.actions.save")} okText={t("general.actions.save")}

View File

@@ -6,13 +6,13 @@ export default function DataLabel({
hideIfNull, hideIfNull,
children, children,
vertical, vertical,
visible = true, open = true,
valueStyle = {}, valueStyle = {},
valueClassName, valueClassName,
onValueClick, onValueClick,
...props ...props
}) { }) {
if (!visible || (hideIfNull && !!!children)) return null; if (!open || (hideIfNull && !!!children)) return null;
return ( return (
<div {...props} style={{ display: "flex" }}> <div {...props} style={{ display: "flex" }}>

View File

@@ -18,7 +18,7 @@ const mapDispatchToProps = (dispatch) => ({
export default connect(mapStateToProps, mapDispatchToProps)(DmsCdkVehicles); export default connect(mapStateToProps, mapDispatchToProps)(DmsCdkVehicles);
export function DmsCdkVehicles({ bodyshop, form, socket, job }) { export function DmsCdkVehicles({ bodyshop, form, socket, job }) {
const [visible, setVisible] = useState(false); const [open, setOpen] = useState(false);
const [selectedModel, setSelectedModel] = useState(null); const [selectedModel, setSelectedModel] = useState(null);
const { t } = useTranslation(); const { t } = useTranslation();
@@ -51,14 +51,14 @@ export function DmsCdkVehicles({ bodyshop, form, socket, job }) {
<> <>
<Modal <Modal
width={"90%"} width={"90%"}
open={visible} open={open}
onCancel={() => setVisible(false)} onCancel={() => setOpen(false)}
onOk={() => { onOk={() => {
form.setFieldsValue({ form.setFieldsValue({
dms_make: selectedModel.makecode, dms_make: selectedModel.makecode,
dms_model: selectedModel.modelcode, dms_model: selectedModel.modelcode,
}); });
setVisible(false); setOpen(false);
}} }}
> >
{error && <AlertComponent error={error.message} />} {error && <AlertComponent error={error.message} />}
@@ -90,7 +90,7 @@ export function DmsCdkVehicles({ bodyshop, form, socket, job }) {
</Modal> </Modal>
<Button <Button
onClick={() => { onClick={() => {
setVisible(true); setOpen(true);
callSearch({ callSearch({
variables: { variables: {
search: job && job.v_model_desc && job.v_model_desc.substr(0, 3), search: job && job.v_model_desc && job.v_model_desc.substr(0, 3),

View File

@@ -21,29 +21,29 @@ export default connect(
export function DmsCustomerSelector({ bodyshop }) { export function DmsCustomerSelector({ bodyshop }) {
const { t } = useTranslation(); const { t } = useTranslation();
const [customerList, setcustomerList] = useState([]); const [customerList, setcustomerList] = useState([]);
const [visible, setVisible] = useState(false); const [open, setOpen] = useState(false);
const [selectedCustomer, setSelectedCustomer] = useState(null); const [selectedCustomer, setSelectedCustomer] = useState(null);
const [dmsType, setDmsType] = useState("cdk"); const [dmsType, setDmsType] = useState("cdk");
socket.on("cdk-select-customer", (customerList, callback) => { socket.on("cdk-select-customer", (customerList, callback) => {
setVisible(true); setOpen(true);
setDmsType("cdk"); setDmsType("cdk");
setcustomerList(customerList); setcustomerList(customerList);
}); });
socket.on("pbs-select-customer", (customerList, callback) => { socket.on("pbs-select-customer", (customerList, callback) => {
setVisible(true); setOpen(true);
setDmsType("pbs"); setDmsType("pbs");
setcustomerList(customerList); setcustomerList(customerList);
}); });
const onUseSelected = () => { const onUseSelected = () => {
setVisible(false); setOpen(false);
socket.emit(`${dmsType}-selected-customer`, selectedCustomer); socket.emit(`${dmsType}-selected-customer`, selectedCustomer);
setSelectedCustomer(null); setSelectedCustomer(null);
}; };
const onUseGeneric = () => { const onUseGeneric = () => {
setVisible(false); setOpen(false);
socket.emit( socket.emit(
`${dmsType}-selected-customer`, `${dmsType}-selected-customer`,
bodyshop.cdk_configuration.generic_customer_number bodyshop.cdk_configuration.generic_customer_number
@@ -52,7 +52,7 @@ export function DmsCustomerSelector({ bodyshop }) {
}; };
const onCreateNew = () => { const onCreateNew = () => {
setVisible(false); setOpen(false);
socket.emit(`${dmsType}-selected-customer`, null); socket.emit(`${dmsType}-selected-customer`, null);
setSelectedCustomer(null); setSelectedCustomer(null);
}; };
@@ -114,7 +114,7 @@ export function DmsCustomerSelector({ bodyshop }) {
}, },
]; ];
if (!visible) return null; if (!open) return null;
return ( return (
<Col span={24}> <Col span={24}>
<Table <Table

View File

@@ -36,7 +36,7 @@ export function InventoryUpsertModalContainer({
const [insertInventory] = useMutation(INSERT_INVENTORY_LINE); const [insertInventory] = useMutation(INSERT_INVENTORY_LINE);
const [updateInventoryLine] = useMutation(UPDATE_INVENTORY_LINE); const [updateInventoryLine] = useMutation(UPDATE_INVENTORY_LINE);
const { visible, context, actions } = inventoryUpsertModal; const { open, context, actions } = inventoryUpsertModal;
const { existingInventory } = context; const { existingInventory } = context;
const { refetch } = actions; const { refetch } = actions;
@@ -44,12 +44,12 @@ export function InventoryUpsertModalContainer({
useEffect(() => { useEffect(() => {
//Required to prevent infinite looping. //Required to prevent infinite looping.
if (existingInventory && visible) { if (existingInventory && open) {
form.setFieldsValue(existingInventory); form.setFieldsValue(existingInventory);
} else if (!existingInventory && visible) { } else if (!existingInventory && open) {
form.resetFields(); form.resetFields();
} }
}, [existingInventory, form, visible]); }, [existingInventory, form, open]);
const handleFinish = async (formValues) => { const handleFinish = async (formValues) => {
const values = formValues; const values = formValues;
@@ -103,7 +103,7 @@ export function InventoryUpsertModalContainer({
? t("inventory.actions.edit") ? t("inventory.actions.edit")
: t("inventory.actions.new") : t("inventory.actions.new")
} }
open={visible} open={open}
okText={t("general.actions.save")} okText={t("general.actions.save")}
onOk={() => { onOk={() => {
form.submit(); form.submit();

View File

@@ -57,7 +57,7 @@ export function ScheduleEventComponent({
setScheduleContext, setScheduleContext,
}) { }) {
const { t } = useTranslation(); const { t } = useTranslation();
const [visible, setVisible] = useState(false); const [open, setOpen] = useState(false);
const history = useNavigate(); const history = useNavigate();
const searchParams = queryString.parse(useLocation().search); const searchParams = queryString.parse(useLocation().search);
const [updateAppointment] = useMutation(UPDATE_APPOINTMENT); const [updateAppointment] = useMutation(UPDATE_APPOINTMENT);
@@ -223,7 +223,7 @@ export function ScheduleEventComponent({
time: dayjs(event.start).format("HH:mm a"), time: dayjs(event.start).format("HH:mm a"),
}) })
); );
setVisible(false); setOpen(false);
} else { } else {
notification["error"]({ notification["error"]({
message: t("messaging.error.invalidphone"), message: t("messaging.error.invalidphone"),
@@ -290,7 +290,7 @@ export function ScheduleEventComponent({
<Button <Button
disabled={event.arrived} disabled={event.arrived}
onClick={() => { onClick={() => {
setVisible(false); setOpen(false);
setScheduleContext({ setScheduleContext({
actions: { refetch: refetch }, actions: { refetch: refetch },
context: { context: {
@@ -366,8 +366,8 @@ export function ScheduleEventComponent({
return ( return (
<Popover <Popover
open={visible} open={open}
onOpenChange={(vis) => !event.vacation && setVisible(vis)} onOpenChange={(vis) => !event.vacation && setOpen(vis)}
trigger="click" trigger="click"
content={event.block ? blockContent : popoverContent} content={event.block ? blockContent : popoverContent}
style={{ style={{

View File

@@ -23,23 +23,23 @@ export function JobCostingModalContainer({
}) { }) {
const { t } = useTranslation(); const { t } = useTranslation();
const [costingData, setCostingData] = useState(null); const [costingData, setCostingData] = useState(null);
const { visible, context } = jobCostingModal; const { open, context } = jobCostingModal;
const { jobId } = context; const { jobId } = context;
useEffect(() => { useEffect(() => {
async function getData() { async function getData() {
if (jobId && visible) { if (jobId && open) {
const { data } = await axios.post("/job/costing", { jobid: jobId }); const { data } = await axios.post("/job/costing", { jobid: jobId });
setCostingData(data); setCostingData(data);
} }
} }
getData(); getData();
}, [jobId, visible]); }, [jobId, open]);
return ( return (
<Modal <Modal
open={visible} open={open}
title={t("jobs.labels.jobcosting")} title={t("jobs.labels.jobcosting")}
onOk={() => { onOk={() => {
toggleModalVisible(); toggleModalVisible();

View File

@@ -17,7 +17,7 @@ export default function JobDetailCardsInsuranceComponent({ loading, data }) {
</DataLabel> </DataLabel>
<DataLabel <DataLabel
label={t("jobs.labels.cards.filehandler")} label={t("jobs.labels.cards.filehandler")}
visible={data.ins_ct_fn && data.ins_ct_ln}> open={data.ins_ct_fn && data.ins_ct_ln}>
{data.ins_ea ? ( {data.ins_ea ? (
<a href={`mailto:${data.ins_ea}`}> <a href={`mailto:${data.ins_ea}`}>
<div>{`${data.ins_ct_fn || ""} ${data.ins_ct_ln || ""}`}</div> <div>{`${data.ins_ct_fn || ""} ${data.ins_ct_ln || ""}`}</div>
@@ -28,7 +28,7 @@ export default function JobDetailCardsInsuranceComponent({ loading, data }) {
</DataLabel> </DataLabel>
<DataLabel <DataLabel
label={t("jobs.labels.cards.estimator")} label={t("jobs.labels.cards.estimator")}
visible={data.est_ct_fn && data.est_ct_ln}> open={data.est_ct_fn && data.est_ct_ln}>
{data.ins_ea ? ( {data.ins_ea ? (
<a href={`mailto:${data.est_ea}`}> <a href={`mailto:${data.est_ea}`}>
<div>{`${data.est_ct_fn || ""} ${data.est_ct_ln || ""}`}</div> <div>{`${data.est_ct_fn || ""} ${data.est_ct_ln || ""}`}</div>

View File

@@ -22,7 +22,7 @@ export default connect(
export function JobLinesUpsertModalComponent({ export function JobLinesUpsertModalComponent({
bodyshop, bodyshop,
visible, open,
jobLine, jobLine,
handleCancel, handleCancel,
handleFinish, handleFinish,
@@ -33,7 +33,7 @@ export function JobLinesUpsertModalComponent({
useEffect(() => { useEffect(() => {
form.resetFields(); form.resetFields();
}, [visible, form]); }, [open, form]);
const { treatments: {Allow_Negative_Jobline_Price, Autohouse_Detail_line} } = useSplitTreatments({ const { treatments: {Allow_Negative_Jobline_Price, Autohouse_Detail_line} } = useSplitTreatments({
@@ -50,7 +50,7 @@ export function JobLinesUpsertModalComponent({
: t("joblines.labels.new") : t("joblines.labels.new")
} }
forceRender forceRender
open={visible} open={open}
width="60%" width="60%"
okText={t("general.actions.save")} okText={t("general.actions.save")}
onOk={() => form.submit()} onOk={() => form.submit()}

View File

@@ -133,7 +133,7 @@ function JobLinesUpsertModalContainer({
return ( return (
<JobLinesUpdsertModal <JobLinesUpdsertModal
visible={jobLineEditModal.visible} open={jobLineEditModal.open}
jobLine={jobLineEditModal.context} jobLine={jobLineEditModal.context}
handleFinish={handleFinish} handleFinish={handleFinish}
handleCancel={handleCancel} handleCancel={handleCancel}

View File

@@ -24,12 +24,12 @@ function JobReconciliationModalContainer({
toggleModalVisible, toggleModalVisible,
}) { }) {
const { t } = useTranslation(); const { t } = useTranslation();
const { context, visible } = reconciliationModal; const { context, open } = reconciliationModal;
const { job } = context; const { job } = context;
const { loading, error, data } = useQuery(GET_JOB_RECONCILIATION_BY_PK, { const { loading, error, data } = useQuery(GET_JOB_RECONCILIATION_BY_PK, {
variables: { id: job && job.id }, variables: { id: job && job.id },
skip: !(job && job.id) || !visible, skip: !(job && job.id) || !open,
fetchPolicy: "network-only", fetchPolicy: "network-only",
nextFetchPolicy: "network-only", nextFetchPolicy: "network-only",
}); });
@@ -42,7 +42,7 @@ function JobReconciliationModalContainer({
<Modal <Modal
title={t("jobs.labels.reconciliationheader")} title={t("jobs.labels.reconciliationheader")}
width={"95%"} width={"95%"}
open={visible} open={open}
okText={t("general.actions.close")} okText={t("general.actions.close")}
onOk={handleCancel} onOk={handleCancel}
onCancel={handleCancel} onCancel={handleCancel}

View File

@@ -379,7 +379,7 @@ export function JobsAvailableContainer({bodyshop, currentUser, insertAuditTrail,
setPartsQueueToggle={setPartsQueueToggle} setPartsQueueToggle={setPartsQueueToggle}
selectedOwner={selectedOwner} selectedOwner={selectedOwner}
setSelectedOwner={setSelectedOwner} setSelectedOwner={setSelectedOwner}
visible={ownerModalVisible} open={ownerModalVisible}
onOk={onOwnerFindModalOk} onOk={onOwnerFindModalOk}
onCancel={onOwnerModalCancel} onCancel={onOwnerModalCancel}
@@ -390,7 +390,7 @@ export function JobsAvailableContainer({bodyshop, currentUser, insertAuditTrail,
selectedJob={selectedJob} selectedJob={selectedJob}
setSelectedJob={setSelectedJob} setSelectedJob={setSelectedJob}
importOptionsState={importOptionsState} importOptionsState={importOptionsState}
visible={jobModalVisible} open={jobModalVisible}
onOk={onJobFindModalOk} onOk={onJobFindModalOk}
onCancel={onJobModalCancel} onCancel={onJobModalCancel}
modalSearchState={modalSearchState} modalSearchState={modalSearchState}

View File

@@ -37,7 +37,7 @@ export function JobsConvertButton({
insertAuditTrail, insertAuditTrail,
parentFormIsFieldsTouched, parentFormIsFieldsTouched,
}) { }) {
const [visible, setVisible] = useState(false); const [open, setOpen] = useState(false);
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const [mutationConvertJob] = useMutation(CONVERT_JOB_TO_RO); const [mutationConvertJob] = useMutation(CONVERT_JOB_TO_RO);
const { t } = useTranslation(); const { t } = useTranslation();
@@ -80,7 +80,7 @@ export function JobsConvertButton({
), ),
}); });
setVisible(false); setOpen(false);
} }
setLoading(false); setLoading(false);
}; };
@@ -246,7 +246,7 @@ export function JobsConvertButton({
<Button type="primary" danger onClick={() => form.submit()} loading={loading}> <Button type="primary" danger onClick={() => form.submit()} loading={loading}>
{t("jobs.actions.convert")} {t("jobs.actions.convert")}
</Button> </Button>
<Button onClick={() => setVisible(false)}> <Button onClick={() => setOpen(false)}>
{t("general.actions.close")} {t("general.actions.close")}
</Button> </Button>
</Space> </Space>
@@ -257,7 +257,7 @@ export function JobsConvertButton({
if (job.converted) return <></>; if (job.converted) return <></>;
return ( return (
<Popover open={visible} content={popMenu}> <Popover open={open} content={popMenu}>
<Button <Button
key="convert" key="convert"
type="primary" type="primary"
@@ -266,7 +266,7 @@ export function JobsConvertButton({
disabled={job.converted || jobRO} disabled={job.converted || jobRO}
loading={loading} loading={loading}
onClick={() => { onClick={() => {
setVisible(true); setOpen(true);
form.setFieldsValue({ form.setFieldsValue({
driveable: true, driveable: true,
towin: false, towin: false,

View File

@@ -35,7 +35,7 @@ export function JobsDocumentsGalleryReassign({
]; ];
}, [galleryImages]); }, [galleryImages]);
const client = useApolloClient(); const client = useApolloClient();
const [visible, setVisible] = useState(false); const [open, setOpen] = useState(false);
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
// const updateImage = async (i, jobid) => { // const updateImage = async (i, jobid) => {
@@ -126,7 +126,7 @@ export function JobsDocumentsGalleryReassign({
message: t("documents.successes.updated"), message: t("documents.successes.updated"),
}); });
} }
setVisible(false); setOpen(false);
setLoading(false); setLoading(false);
}; };
@@ -151,7 +151,7 @@ export function JobsDocumentsGalleryReassign({
<Button type="primary" onClick={() => form.submit()}> <Button type="primary" onClick={() => form.submit()}>
{t("general.actions.submit")} {t("general.actions.submit")}
</Button> </Button>
<Button onClick={() => setVisible(false)}> <Button onClick={() => setOpen(false)}>
{t("general.actions.cancel")} {t("general.actions.cancel")}
</Button> </Button>
</Space> </Space>
@@ -159,10 +159,10 @@ export function JobsDocumentsGalleryReassign({
); );
return ( return (
<Popover content={popContent} open={visible}> <Popover content={popContent} open={open}>
<Button <Button
disabled={selectedImages.length < 1} disabled={selectedImages.length < 1}
onClick={() => setVisible(true)} onClick={() => setOpen(true)}
loading={loading} loading={loading}
> >
{t("documents.actions.reassign")} {t("documents.actions.reassign")}

View File

@@ -32,7 +32,7 @@ export function JobsDocumentsLocalGalleryReassign({
const { t } = useTranslation(); const { t } = useTranslation();
const [form] = Form.useForm(); const [form] = Form.useForm();
const [visible, setVisible] = useState(false); const [open, setOpen] = useState(false);
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const handleFinish = async ({ jobid: newJobid }) => { const handleFinish = async ({ jobid: newJobid }) => {
@@ -50,7 +50,7 @@ export function JobsDocumentsLocalGalleryReassign({
); );
getJobMedia(jobid); getJobMedia(jobid);
setVisible(false); setOpen(false);
setLoading(false); setLoading(false);
}; };
@@ -75,7 +75,7 @@ export function JobsDocumentsLocalGalleryReassign({
<Button type="primary" onClick={() => form.submit()}> <Button type="primary" onClick={() => form.submit()}>
{t("general.actions.submit")} {t("general.actions.submit")}
</Button> </Button>
<Button onClick={() => setVisible(false)}> <Button onClick={() => setOpen(false)}>
{t("general.actions.cancel")} {t("general.actions.cancel")}
</Button> </Button>
</Space> </Space>
@@ -83,10 +83,10 @@ export function JobsDocumentsLocalGalleryReassign({
); );
return ( return (
<Popover content={popContent} open={visible}> <Popover content={popContent} open={open}>
<Button <Button
//disabled={selectedImages.length < 1} //disabled={selectedImages.length < 1}
onClick={() => setVisible(true)} onClick={() => setOpen(true)}
loading={loading} loading={loading}
> >
{t("documents.actions.reassign")} {t("documents.actions.reassign")}

View File

@@ -34,7 +34,7 @@ export default connect(
variables: { variables: {
statuses: bodyshop.md_ro_statuses.active_statuses || ["Open"], statuses: bodyshop.md_ro_statuses.active_statuses || ["Open"],
}, },
skip: !modalProps.visible, skip: !modalProps.open,
fetchPolicy: "network-only", fetchPolicy: "network-only",
nextFetchPolicy: "network-only", nextFetchPolicy: "network-only",
}); });

View File

@@ -37,7 +37,7 @@ export function LaborAllocationsAdjustmentEdit({
refetchQueryNames, refetchQueryNames,
}) { }) {
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const [visible, setVisible] = useState(false); const [open, setOpen] = useState(false);
const [updateAdjustments] = useMutation(UPDATE_JOB); const [updateAdjustments] = useMutation(UPDATE_JOB);
const [form] = Form.useForm(); const [form] = Form.useForm();
@@ -79,7 +79,7 @@ export function LaborAllocationsAdjustmentEdit({
}); });
} }
setLoading(false); setLoading(false);
setVisible(false); setOpen(false);
}; };
const overlay = ( const overlay = (
@@ -171,8 +171,8 @@ export function LaborAllocationsAdjustmentEdit({
return ( return (
<Popover <Popover
open={visible} open={open}
onOpenChange={(vis) => setVisible(vis)} onOpenChange={(vis) => setOpen(vis)}
content={overlay} content={overlay}
trigger="click" trigger="click"
> >

View File

@@ -33,7 +33,7 @@ export function NoteUpsertModalContainer({
const [insertNote] = useMutation(INSERT_NEW_NOTE); const [insertNote] = useMutation(INSERT_NEW_NOTE);
const [updateNote] = useMutation(UPDATE_NOTE); const [updateNote] = useMutation(UPDATE_NOTE);
const { visible, context, actions } = noteUpsertModal; const { open, context, actions } = noteUpsertModal;
const { jobId, existingNote, text } = context; const { jobId, existingNote, text } = context;
const { refetch } = actions; const { refetch } = actions;
@@ -41,16 +41,16 @@ export function NoteUpsertModalContainer({
useEffect(() => { useEffect(() => {
//Required to prevent infinite looping. //Required to prevent infinite looping.
if (existingNote && visible) { if (existingNote && open) {
form.setFieldsValue(existingNote); form.setFieldsValue(existingNote);
} else if (!existingNote && visible) { } else if (!existingNote && open) {
form.resetFields(); form.resetFields();
if (text) { if (text) {
form.setFieldValue("text", text); form.setFieldValue("text", text);
} }
} }
}, [existingNote, form, visible, text]); }, [existingNote, form, open, text]);
const handleFinish = async (formValues) => { const handleFinish = async (formValues) => {
const { relatedros, ...values } = formValues; const { relatedros, ...values } = formValues;
@@ -122,7 +122,7 @@ export function NoteUpsertModalContainer({
return ( return (
<Modal <Modal
title={existingNote ? t("notes.actions.edit") : t("notes.actions.new")} title={existingNote ? t("notes.actions.edit") : t("notes.actions.new")}
open={visible} open={open}
okText={t("general.actions.save")} okText={t("general.actions.save")}
onOk={() => { onOk={() => {
form.submit(); form.submit();

View File

@@ -50,7 +50,7 @@ export function PartsOrderModalContainer({partsOrderModal,toggleModalVisible,cur
splitKey: bodyshop.imexshopid, splitKey: bodyshop.imexshopid,
}); });
const {visible, context, actions} = partsOrderModal; const {open, context, actions} = partsOrderModal;
const { const {
jobId, jobId,
linesToOrder, linesToOrder,
@@ -68,7 +68,7 @@ export function PartsOrderModalContainer({partsOrderModal,toggleModalVisible,cur
const sendType = sendTypeState[0]; const sendType = sendTypeState[0];
const {loading, error, data} = useQuery(QUERY_ALL_VENDORS_FOR_ORDER, { const {loading, error, data} = useQuery(QUERY_ALL_VENDORS_FOR_ORDER, {
skip: !visible, skip: !open,
variables: {jobId: jobId}, variables: {jobId: jobId},
fetchPolicy: "network-only", fetchPolicy: "network-only",
nextFetchPolicy: "network-only", nextFetchPolicy: "network-only",
@@ -328,14 +328,14 @@ export function PartsOrderModalContainer({partsOrderModal,toggleModalVisible,cur
}; };
useEffect(() => { useEffect(() => {
if (visible && !!linesToOrder) { if (open && !!linesToOrder) {
form.resetFields(); form.resetFields();
} }
}, [visible, linesToOrder, form]); }, [open, linesToOrder, form]);
return ( return (
<Modal <Modal
open={visible} open={open}
title={ title={
isReturn isReturn
? `${t("parts_orders.labels.returnpartsorder")} ${invoiceNumber}` ? `${t("parts_orders.labels.returnpartsorder")} ${invoiceNumber}`

View File

@@ -32,7 +32,7 @@ export function PartsReceiveModalContainer({
}) { }) {
const { t } = useTranslation(); const { t } = useTranslation();
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const { visible, context, actions } = partsReceiveModal; const { open, context, actions } = partsReceiveModal;
const { partsorderlines } = context; const { partsorderlines } = context;
const { refetch } = actions; const { refetch } = actions;
@@ -85,14 +85,14 @@ export function PartsReceiveModalContainer({
}; };
useEffect(() => { useEffect(() => {
if (visible && !!partsorderlines) { if (open && !!partsorderlines) {
form.resetFields(); form.resetFields();
} }
}, [visible, partsorderlines, form]); }, [open, partsorderlines, form]);
return ( return (
<Modal <Modal
open={visible} open={open}
title={t("parts_orders.labels.receive")} title={t("parts_orders.labels.receive")}
onCancel={() => toggleModalVisible()} onCancel={() => toggleModalVisible()}
onOk={() => form.submit()} onOk={() => form.submit()}

View File

@@ -34,7 +34,7 @@ export function BillMarkSelectedExported({
}) { }) {
const { t } = useTranslation(); const { t } = useTranslation();
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const [visible, setVisible] = useState(false); const [open, setOpen] = useState(false);
const [insertExportLog] = useMutation(INSERT_EXPORT_LOG); const [insertExportLog] = useMutation(INSERT_EXPORT_LOG);
const [updateBill] = useMutation(gql` const [updateBill] = useMutation(gql`
mutation UPDATE_BILL($billIds: [uuid!]!) { mutation UPDATE_BILL($billIds: [uuid!]!) {
@@ -85,21 +85,21 @@ export function BillMarkSelectedExported({
completedCallback && completedCallback([]); completedCallback && completedCallback([]);
setLoading(false); setLoading(false);
refetch && refetch(); refetch && refetch();
setVisible(false); setOpen(false);
}; };
return ( return (
<Popconfirm <Popconfirm
open={visible} open={open}
title={t("general.labels.areyousure")} title={t("general.labels.areyousure")}
onCancel={() => setVisible(false)} onCancel={() => setOpen(false)}
onConfirm={handleUpdate} onConfirm={handleUpdate}
disabled={disabled} disabled={disabled}
> >
<Button <Button
loading={loading} loading={loading}
disabled={disabled} disabled={disabled}
onClick={() => setVisible(true)} onClick={() => setOpen(true)}
> >
{t("bills.labels.markexported")} {t("bills.labels.markexported")}
</Button> </Button>

View File

@@ -34,7 +34,7 @@ export function PaymentMarkSelectedExported({
}) { }) {
const { t } = useTranslation(); const { t } = useTranslation();
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const [visible, setVisible] = useState(false); const [open, setOpen] = useState(false);
const [insertExportLog] = useMutation(INSERT_EXPORT_LOG); const [insertExportLog] = useMutation(INSERT_EXPORT_LOG);
const [updatePayments] = useMutation(gql` const [updatePayments] = useMutation(gql`
@@ -88,21 +88,21 @@ export function PaymentMarkSelectedExported({
completedCallback && completedCallback([]); completedCallback && completedCallback([]);
setLoading(false); setLoading(false);
refetch && refetch(); refetch && refetch();
setVisible(false); setOpen(false);
}; };
return ( return (
<Popconfirm <Popconfirm
open={visible} open={open}
title={t("general.labels.areyousure")} title={t("general.labels.areyousure")}
onCancel={() => setVisible(false)} onCancel={() => setOpen(false)}
onConfirm={handleUpdate} onConfirm={handleUpdate}
disabled={disabled} disabled={disabled}
> >
<Button <Button
loading={loading} loading={loading}
disabled={disabled} disabled={disabled}
onClick={() => setVisible(true)} onClick={() => setOpen(true)}
> >
{t("bills.labels.markexported")} {t("bills.labels.markexported")}
</Button> </Button>

View File

@@ -46,7 +46,7 @@ function PaymentModalContainer({
const [updatePayment] = useMutation(UPDATE_PAYMENT); const [updatePayment] = useMutation(UPDATE_PAYMENT);
const { t } = useTranslation(); const { t } = useTranslation();
const { context, actions, visible } = paymentModal; const { context, actions, open } = paymentModal;
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
@@ -130,12 +130,12 @@ function PaymentModalContainer({
}; };
useEffect(() => { useEffect(() => {
if (visible) { if (open) {
form.resetFields(); form.resetFields();
form.resetFields(); form.resetFields();
form.setFieldsValue(context); form.setFieldsValue(context);
} }
}, [visible, form, context]); }, [open, form, context]);
useEffect(() => { useEffect(() => {
if (enterAgain) form.submit(); if (enterAgain) form.submit();
@@ -148,7 +148,7 @@ function PaymentModalContainer({
? t("payments.labels.new") ? t("payments.labels.new")
: t("payments.labels.edit") : t("payments.labels.edit")
} }
open={visible} open={open}
destroyOnClose destroyOnClose
okText={t("general.actions.save")} okText={t("general.actions.save")}
onOk={() => form.submit()} onOk={() => form.submit()}

View File

@@ -36,7 +36,7 @@ export function PaymentsGenerateLink({
const { t } = useTranslation(); const { t } = useTranslation();
const [form] = Form.useForm(); const [form] = Form.useForm();
const [visible, setVisible] = useState(false); const [open, setOpen] = useState(false);
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const [paymentLink, setPaymentLink] = useState(null); const [paymentLink, setPaymentLink] = useState(null);
@@ -69,7 +69,7 @@ export function PaymentsGenerateLink({
//Add in confirmation & errors. //Add in confirmation & errors.
if (callback) callback(); if (callback) callback();
// setVisible(false); // setOpen(false);
setLoading(false); setLoading(false);
}; };
@@ -137,7 +137,7 @@ export function PaymentsGenerateLink({
onClick={() => { onClick={() => {
form.resetFields(); form.resetFields();
setPaymentLink(null); setPaymentLink(null);
setVisible(false); setOpen(false);
}} }}
> >
{t("general.actions.cancel")} {t("general.actions.cancel")}
@@ -147,8 +147,8 @@ export function PaymentsGenerateLink({
); );
return ( return (
<Popover content={popContent} open={visible}> <Popover content={popContent} open={open}>
<Button onClick={() => setVisible(true)} loading={loading}> <Button onClick={() => setOpen(true)} loading={loading}>
{t("payments.actions.generatepaymentlink")} {t("payments.actions.generatepaymentlink")}
</Button> </Button>
</Popover> </Popover>

View File

@@ -22,13 +22,13 @@ export function PrintCenterModalContainer({
}) { }) {
const { t } = useTranslation(); const { t } = useTranslation();
const { visible, context } = printCenterModal; const { open, context } = printCenterModal;
//const { type } = context; //const { type } = context;
// const { refetch } = actions; // const { refetch } = actions;
return ( return (
<Modal <Modal
open={visible} open={open}
onOk={() => toggleModalVisible()} onOk={() => toggleModalVisible()}
onCancel={() => toggleModalVisible()} onCancel={() => toggleModalVisible()}
cancelButtonProps={{ style: { display: "none" } }} cancelButtonProps={{ style: { display: "none" } }}

View File

@@ -17,7 +17,7 @@ export default function ProductionBoardKanbanCardSettings({
associationSettings, associationSettings,
}) { }) {
const [form] = Form.useForm(); const [form] = Form.useForm();
const [visible, setVisible] = useState(false); const [open, setOpen] = useState(false);
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const [updateKbSettings] = useMutation(UPDATE_KANBAN_SETTINGS); const [updateKbSettings] = useMutation(UPDATE_KANBAN_SETTINGS);
@@ -25,7 +25,7 @@ export default function ProductionBoardKanbanCardSettings({
form.setFieldsValue( form.setFieldsValue(
associationSettings && associationSettings.kanban_settings associationSettings && associationSettings.kanban_settings
); );
}, [form, associationSettings, visible]); }, [form, associationSettings, open]);
const { t } = useTranslation(); const { t } = useTranslation();
@@ -45,7 +45,7 @@ export default function ProductionBoardKanbanCardSettings({
}), }),
}); });
} }
setVisible(false); setOpen(false);
setLoading(false); setLoading(false);
}; };
@@ -173,8 +173,8 @@ export default function ProductionBoardKanbanCardSettings({
</div> </div>
); );
return ( return (
<Popover content={overlay} open={visible} placement="topRight"> <Popover content={overlay} open={open} placement="topRight">
<Button loading={loading} onClick={() => setVisible(true)}> <Button loading={loading} onClick={() => setOpen(true)}>
{t("production.labels.cardsettings")} {t("production.labels.cardsettings")}
</Button> </Button>
</Popover> </Popover>

View File

@@ -10,13 +10,13 @@ export default function ProductionListColumnComment({ record }) {
const [note, setNote] = useState(record.comment || ""); const [note, setNote] = useState(record.comment || "");
const [visible, setVisible] = useState(false); const [open, setOpen] = useState(false);
const [updateAlert] = useMutation(UPDATE_JOB); const [updateAlert] = useMutation(UPDATE_JOB);
const handleSaveNote = (e) => { const handleSaveNote = (e) => {
e.stopPropagation(); e.stopPropagation();
setVisible(false); setOpen(false);
updateAlert({ updateAlert({
variables: { variables: {
jobId: record.id, jobId: record.id,
@@ -34,15 +34,15 @@ export default function ProductionListColumnComment({ record }) {
setNote(e.target.value); setNote(e.target.value);
}; };
const handleVisibleChange = (flag) => { const handleOpenChange = (flag) => {
setVisible(flag); setOpen(flag);
if (flag) setNote(record.comment || ""); if (flag) setNote(record.comment || "");
}; };
return ( return (
<Popover <Popover
onOpenChange={handleVisibleChange} onOpenChange={handleOpenChange}
open={visible} open={open}
content={ content={
<div style={{ width: "30em" }}> <div style={{ width: "30em" }}>
<Input.TextArea <Input.TextArea

View File

@@ -15,7 +15,7 @@ export default function ProductionListDate({
pastIndicator, pastIndicator,
}) { }) {
const [updateAlert] = useMutation(UPDATE_JOB); const [updateAlert] = useMutation(UPDATE_JOB);
const [visible, setVisible] = useState(false); const [open, setOpen] = useState(false);
const { t } = useTranslation(); const { t } = useTranslation();
const handleChange = (date) => { const handleChange = (date) => {
@@ -41,7 +41,7 @@ export default function ProductionListDate({
}).then(() => { }).then(() => {
if (record.refetch) record.refetch(); if (record.refetch) record.refetch();
if (!time) { if (!time) {
setVisible(false); setOpen(false);
} }
}); });
}; };
@@ -59,8 +59,8 @@ export default function ProductionListDate({
return ( return (
<Dropdown <Dropdown
trigger={["click"]} trigger={["click"]}
onOpenChange={(v) => setVisible(v)} onOpenChange={(v) => setOpen(v)}
open={visible} open={open}
style={{ style={{
height: "19px", height: "19px",
}} }}
@@ -82,14 +82,14 @@ export default function ProductionListDate({
format="hh:mm a" format="hh:mm a"
/> />
)} )}
<Button onClick={() => setVisible(false)}> <Button onClick={() => setOpen(false)}>
{t("general.actions.close")} {t("general.actions.close")}
</Button> </Button>
</Card> </Card>
} }
> >
<div <div
onClick={() => setVisible(true)} onClick={() => setOpen(true)}
style={{ style={{
height: "19px", height: "19px",
}} }}

View File

@@ -26,7 +26,7 @@ export default connect(
export function ProductionLastContacted({ currentUser, record }) { export function ProductionLastContacted({ currentUser, record }) {
const [updateAlert] = useMutation(UPDATE_JOB); const [updateAlert] = useMutation(UPDATE_JOB);
const [insertNote] = useMutation(INSERT_NEW_NOTE); const [insertNote] = useMutation(INSERT_NEW_NOTE);
const [visible, setVisible] = useState(false); const [open, setOpen] = useState(false);
const { t } = useTranslation(); const { t } = useTranslation();
const [form] = Form.useForm(); const [form] = Form.useForm();
const handleFinish = async ({ const handleFinish = async ({
@@ -76,25 +76,25 @@ export function ProductionLastContacted({ currentUser, record }) {
} }
if (record.refetch) record.refetch(); if (record.refetch) record.refetch();
setVisible(false); setOpen(false);
}; };
useEffect(() => { useEffect(() => {
if (visible) { if (open) {
form.setFieldsValue({ form.setFieldsValue({
note: null, note: null,
date_last_contacted: date_last_contacted:
record.date_last_contacted && dayjs(record.date_last_contacted), record.date_last_contacted && dayjs(record.date_last_contacted),
}); });
} }
}, [visible, form, record.date_last_contacted]); }, [open, form, record.date_last_contacted]);
// TODO - Client Update - Why is this a card? // TODO - Client Update - Why is this a card?
return ( return (
<div> <div>
<Dropdown <Dropdown
//trigger={["click"]} //trigger={["click"]}
open={visible} open={open}
style={{ style={{
height: "19px", height: "19px",
}} }}
@@ -123,7 +123,7 @@ export function ProductionLastContacted({ currentUser, record }) {
<Button type="primary" htmlType="submit"> <Button type="primary" htmlType="submit">
{t("general.actions.save")} {t("general.actions.save")}
</Button> </Button>
<Button onClick={() => setVisible(false)}> <Button onClick={() => setOpen(false)}>
{t("general.actions.close")} {t("general.actions.close")}
</Button> </Button>
</Space> </Space>
@@ -132,7 +132,7 @@ export function ProductionLastContacted({ currentUser, record }) {
} }
> >
<div <div
onClick={() => setVisible(true)} onClick={() => setOpen(true)}
style={{ style={{
height: "19px", height: "19px",
}} }}

View File

@@ -24,14 +24,14 @@ function ProductionListColumnProductionNote({ record, setNoteUpsertContext }) {
(record.production_vars && record.production_vars.note) || "" (record.production_vars && record.production_vars.note) || ""
); );
const [visible, setVisible] = useState(false); const [open, setOpen] = useState(false);
const [updateAlert] = useMutation(UPDATE_JOB); const [updateAlert] = useMutation(UPDATE_JOB);
const handleSaveNote = (e) => { const handleSaveNote = (e) => {
logImEXEvent("production_add_note"); logImEXEvent("production_add_note");
e.stopPropagation(); e.stopPropagation();
setVisible(false); setOpen(false);
updateAlert({ updateAlert({
variables: { variables: {
jobId: record.id, jobId: record.id,
@@ -52,16 +52,16 @@ function ProductionListColumnProductionNote({ record, setNoteUpsertContext }) {
setNote(e.target.value); setNote(e.target.value);
}; };
const handleVisibleChange = (flag) => { const handleOpenChange = (flag) => {
setVisible(flag); setOpen(flag);
if (flag) if (flag)
setNote((record.production_vars && record.production_vars.note) || ""); setNote((record.production_vars && record.production_vars.note) || "");
}; };
return ( return (
<Popover <Popover
onOpenChange={handleVisibleChange} onOpenChange={handleOpenChange}
open={visible} open={open}
content={ content={
<div style={{ width: "30em" }}> <div style={{ width: "30em" }}>
<Input.TextArea <Input.TextArea
@@ -79,7 +79,7 @@ function ProductionListColumnProductionNote({ record, setNoteUpsertContext }) {
</Button> </Button>
<Button <Button
onClick={() => { onClick={() => {
setVisible(false); setOpen(false);
setNoteUpsertContext({ setNoteUpsertContext({
context: { context: {
jobId: record.id, jobId: record.id,

View File

@@ -23,7 +23,7 @@ export function ProductionListSaveConfigButton({
}) { }) {
const [updateShop] = useMutation(UPDATE_SHOP); const [updateShop] = useMutation(UPDATE_SHOP);
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const [visible, setVisible] = useState(false); const [open, setOpen] = useState(false);
const [form] = Form.useForm(); const [form] = Form.useForm();
const { t } = useTranslation(); const { t } = useTranslation();
@@ -61,7 +61,7 @@ export function ProductionListSaveConfigButton({
}); });
} }
form.resetFields(); form.resetFields();
setVisible(false); setOpen(false);
setLoading(false); setLoading(false);
}; };
const popMenu = ( const popMenu = (
@@ -79,7 +79,7 @@ export function ProductionListSaveConfigButton({
<Button type="primary" danger onClick={() => form.submit()} loading={loading}> <Button type="primary" danger onClick={() => form.submit()} loading={loading}>
{t("general.actions.save")} {t("general.actions.save")}
</Button> </Button>
<Button onClick={() => setVisible(false)}> <Button onClick={() => setOpen(false)}>
{t("general.actions.close")} {t("general.actions.close")}
</Button> </Button>
</Space> </Space>
@@ -88,8 +88,8 @@ export function ProductionListSaveConfigButton({
); );
return ( return (
<Popover open={visible} content={popMenu}> <Popover open={open} content={popMenu}>
<Button loading={loading} onClick={() => setVisible(true)}> <Button loading={loading} onClick={() => setOpen(true)}>
{t("production.actions.saveconfig")} {t("production.actions.saveconfig")}
</Button> </Button>
</Popover> </Popover>

View File

@@ -46,12 +46,12 @@ export function ReportCenterModalComponent({ reportCenterModal }) {
const ReportsList = Object.keys(Templates).map((key) => { const ReportsList = Object.keys(Templates).map((key) => {
return Templates[key]; return Templates[key];
}); });
const { visible } = reportCenterModal; const { open } = reportCenterModal;
const [callVendorQuery, { data: vendorData, called: vendorCalled }] = const [callVendorQuery, { data: vendorData, called: vendorCalled }] =
useLazyQuery(QUERY_ALL_VENDORS, { useLazyQuery(QUERY_ALL_VENDORS, {
skip: !( skip: !(
visible && open &&
Templates[form.getFieldValue("key")] && Templates[form.getFieldValue("key")] &&
Templates[form.getFieldValue("key")].idtype Templates[form.getFieldValue("key")].idtype
), ),
@@ -60,7 +60,7 @@ export function ReportCenterModalComponent({ reportCenterModal }) {
const [callEmployeeQuery, { data: employeeData, called: employeeCalled }] = const [callEmployeeQuery, { data: employeeData, called: employeeCalled }] =
useLazyQuery(QUERY_ACTIVE_EMPLOYEES, { useLazyQuery(QUERY_ACTIVE_EMPLOYEES, {
skip: !( skip: !(
visible && open &&
Templates[form.getFieldValue("key")] && Templates[form.getFieldValue("key")] &&
Templates[form.getFieldValue("key")].idtype Templates[form.getFieldValue("key")].idtype
), ),

View File

@@ -22,11 +22,11 @@ export function ReportCenterModalContainer({
}) { }) {
const { t } = useTranslation(); const { t } = useTranslation();
const { visible } = reportCenterModal; const { open } = reportCenterModal;
return ( return (
<Modal <Modal
open={visible} open={open}
title={t("printcenter.labels.reportcentermodal")} title={t("printcenter.labels.reportcentermodal")}
onOk={() => toggleModalVisible()} onOk={() => toggleModalVisible()}
onCancel={() => toggleModalVisible()} onCancel={() => toggleModalVisible()}

View File

@@ -45,7 +45,7 @@ export function ScheduleJobModalContainer({
currentUser, currentUser,
insertAuditTrail, insertAuditTrail,
}) { }) {
const { visible, context, actions } = scheduleModal; const { open, context, actions } = scheduleModal;
const { jobId, job, previousEvent } = context; const { jobId, job, previousEvent } = context;
const { refetch } = actions; const { refetch } = actions;
@@ -73,7 +73,7 @@ export function ScheduleJobModalContainer({
variables: { jobid: jobId }, variables: { jobid: jobId },
fetchPolicy: "network-only", fetchPolicy: "network-only",
nextFetchPolicy: "network-only", nextFetchPolicy: "network-only",
skip: !visible || !!!jobId, skip: !open || !!!jobId,
}); });
useEffect(() => { useEffect(() => {
@@ -206,7 +206,7 @@ export function ScheduleJobModalContainer({
return ( return (
<Modal <Modal
open={visible} open={open}
onCancel={() => toggleModalVisible()} onCancel={() => toggleModalVisible()}
onOk={() => form.submit()} onOk={() => form.submit()}
width={"90%"} width={"90%"}

View File

@@ -6,7 +6,7 @@ import { UPDATE_SCOREBOARD_ENTRY } from "../../graphql/scoreboard.queries";
import FormDatePicker from "../form-date-picker/form-date-picker.component"; import FormDatePicker from "../form-date-picker/form-date-picker.component";
export default function ScoreboardEntryEdit({ entry }) { export default function ScoreboardEntryEdit({ entry }) {
const [visible, setVisible] = useState(false); const [open, setOpen] = useState(false);
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const { t } = useTranslation(); const { t } = useTranslation();
const [updateScoreboardentry] = useMutation(UPDATE_SCOREBOARD_ENTRY); const [updateScoreboardentry] = useMutation(UPDATE_SCOREBOARD_ENTRY);
@@ -28,7 +28,7 @@ export default function ScoreboardEntryEdit({ entry }) {
notification["success"]({ notification["success"]({
message: t("scoreboard.successes.updated"), message: t("scoreboard.successes.updated"),
}); });
setVisible(false); setOpen(false);
} }
setLoading(false); setLoading(false);
}; };
@@ -81,7 +81,7 @@ export default function ScoreboardEntryEdit({ entry }) {
<Button type="primary" loading={loading} htmlType="submit"> <Button type="primary" loading={loading} htmlType="submit">
{t("general.actions.save")} {t("general.actions.save")}
</Button> </Button>
<Button onClick={() => setVisible(false)}> <Button onClick={() => setOpen(false)}>
{t("general.actions.cancel")} {t("general.actions.cancel")}
</Button> </Button>
</Form> </Form>
@@ -92,11 +92,11 @@ export default function ScoreboardEntryEdit({ entry }) {
return ( return (
<div> <div>
<Dropdown open={visible} overlay={popContent}> <Dropdown open={open} overlay={popContent}>
<Button <Button
onClick={(e) => { onClick={(e) => {
e.stopPropagation(); e.stopPropagation();
setVisible(true); setOpen(true);
}} }}
> >
{t("scoreboard.actions.edit")} {t("scoreboard.actions.edit")}

View File

@@ -14,7 +14,7 @@ import {pageLimit} from "../../utils/config";
export default function ScoreboardJobsList({ scoreBoardlist }) { export default function ScoreboardJobsList({ scoreBoardlist }) {
const { t } = useTranslation(); const { t } = useTranslation();
const [state, setState] = useState({ const [state, setState] = useState({
visible: false, open: false,
search: "", search: "",
current: 1, current: 1,
pageSize: pageLimit, pageSize: pageLimit,
@@ -25,7 +25,7 @@ export default function ScoreboardJobsList({ scoreBoardlist }) {
{ {
fetchPolicy: "network-only", fetchPolicy: "network-only",
nextFetchPolicy: "network-only", nextFetchPolicy: "network-only",
skip: !state.visible, skip: !state.open,
variables: { variables: {
search: state.search !== "" ? `%${state.search}%` : null, search: state.search !== "" ? `%${state.search}%` : null,
offset: state.current ? (state.current - 1) * state.pageSize : 0, offset: state.current ? (state.current - 1) * state.pageSize : 0,
@@ -101,14 +101,14 @@ export default function ScoreboardJobsList({ scoreBoardlist }) {
return ( return (
<> <>
<Modal <Modal
open={state.visible} open={state.open}
destroyOnClose destroyOnClose
width="80%" width="80%"
cancelButtonProps={{ style: { display: "none" } }} cancelButtonProps={{ style: { display: "none" } }}
onCancel={() => onCancel={() =>
setState((state) => ({ setState((state) => ({
...state, ...state,
visible: false, open: false,
current: 1, current: 1,
search: "", search: "",
})) }))
@@ -157,7 +157,7 @@ export default function ScoreboardJobsList({ scoreBoardlist }) {
</Card> </Card>
</Modal> </Modal>
<Button <Button
onClick={() => setState((state) => ({ ...state, visible: true }))} onClick={() => setState((state) => ({ ...state, open: true }))}
> >
{t("scoreboard.labels.entries")} {t("scoreboard.labels.entries")}
</Button> </Button>

View File

@@ -11,8 +11,8 @@ import { TemplateList } from "../../utils/TemplateConstants";
import ShopTemplateAdd from "../shop-template-add/shop-template-add.component"; import ShopTemplateAdd from "../shop-template-add/shop-template-add.component";
import ShopTemplateDeleteComponent from "../shop-template-delete/shop-template-delete.component"; import ShopTemplateDeleteComponent from "../shop-template-delete/shop-template-delete.component";
export default function ShopTemplatesListContainer({ visibleState }) { export default function ShopTemplatesListContainer({ openState }) {
const [visible, setVisible] = visibleState; const [open, setOpen] = openState;
const { loading, error, data, refetch } = useQuery(QUERY_CUSTOM_TEMPLATES, { const { loading, error, data, refetch } = useQuery(QUERY_CUSTOM_TEMPLATES, {
fetchPolicy: "network-only", fetchPolicy: "network-only",
nextFetchPolicy: "network-only", nextFetchPolicy: "network-only",
@@ -38,8 +38,8 @@ export default function ShopTemplatesListContainer({ visibleState }) {
(<Drawer (<Drawer
placement="left" placement="left"
width="25%" width="25%"
open={visible} open={open}
onClose={() => setVisible(false)} onClose={() => setOpen(false)}
> >
<div> <div>
<div>{t("bodyshop.labels.customtemplates")}</div> <div>{t("bodyshop.labels.customtemplates")}</div>

View File

@@ -7,11 +7,11 @@ import { UPDATE_ASSOCIATION } from "../../graphql/user.queries";
export default function ShopUsersAuthEdit({ association }) { export default function ShopUsersAuthEdit({ association }) {
const { t } = useTranslation(); const { t } = useTranslation();
const [updateAssociation] = useMutation(UPDATE_ASSOCIATION); const [updateAssociation] = useMutation(UPDATE_ASSOCIATION);
const [visible, setVisible] = useState(false); const [open, setOpen] = useState(false);
const [value, setValue] = useState(association.authlevel); const [value, setValue] = useState(association.authlevel);
const handleSave = async () => { const handleSave = async () => {
setVisible(false); setOpen(false);
const result = await updateAssociation({ const result = await updateAssociation({
variables: { variables: {
assocId: association.id, assocId: association.id,
@@ -30,7 +30,7 @@ export default function ShopUsersAuthEdit({ association }) {
return ( return (
<div> <div>
{visible && ( {open && (
<div> <div>
<InputNumber <InputNumber
min={0} min={0}
@@ -41,10 +41,8 @@ export default function ShopUsersAuthEdit({ association }) {
/> />
</div> </div>
)} )}
{!visible && ( {!open && (
<div <div style={{ cursor: "pointer" }}>
style={{ cursor: "pointer" }} //onClick={() => setVisible(true)}
>
{association.authlevel || t("general.labels.na")} {association.authlevel || t("general.labels.na")}
</div> </div>
)} )}

View File

@@ -37,7 +37,7 @@ export function TimeTicketModalContainer({
const [updateTicket] = useMutation(UPDATE_TIME_TICKET); const [updateTicket] = useMutation(UPDATE_TIME_TICKET);
const { data: EmployeeAutoCompleteData } = useQuery(QUERY_ACTIVE_EMPLOYEES, { const { data: EmployeeAutoCompleteData } = useQuery(QUERY_ACTIVE_EMPLOYEES, {
skip: !timeTicketModal.visible, skip: !timeTicketModal.open,
fetchPolicy: "network-only", fetchPolicy: "network-only",
nextFetchPolicy: "network-only", nextFetchPolicy: "network-only",
}); });
@@ -127,8 +127,8 @@ export function TimeTicketModalContainer({
}, [enterAgain, form]); }, [enterAgain, form]);
useEffect(() => { useEffect(() => {
if (timeTicketModal.visible) form.resetFields(); if (timeTicketModal.open) form.resetFields();
}, [timeTicketModal.visible, form]); }, [timeTicketModal.open, form]);
const handleFieldsChange = (changedFields, allFields) => { const handleFieldsChange = (changedFields, allFields) => {
if (!!changedFields.employeeid && !!EmployeeAutoCompleteData) { if (!!changedFields.employeeid && !!EmployeeAutoCompleteData) {
@@ -169,7 +169,7 @@ export function TimeTicketModalContainer({
: t("timetickets.labels.new") : t("timetickets.labels.new")
} }
width={"90%"} width={"90%"}
open={timeTicketModal.visible} open={timeTicketModal.open}
forceRender forceRender
onCancel={handleCancel} onCancel={handleCancel}
afterClose={() => form.resetFields()} afterClose={() => form.resetFields()}

View File

@@ -42,7 +42,7 @@
// return ( // return (
// <RbacWrapper action="shop:templates"> // <RbacWrapper action="shop:templates">
// <div> // <div>
// <ShopTemplatesListContainer visibleState={drawerVisibility} /> // <ShopTemplatesListContainer openState={drawerVisibility} />
// <Button onClick={() => drawerVisibility[1](true)}>Show List</Button> // <Button onClick={() => drawerVisibility[1](true)}>Show List</Button>
// <ShopTemplateEditor /> // <ShopTemplateEditor />
// </div> // </div>

View File

@@ -10,7 +10,7 @@ const INITIAL_STATE = {
template: { name: null, variables: {} }, template: { name: null, variables: {} },
}, },
visible: false, open: false,
error: null, error: null,
}; };
@@ -19,13 +19,13 @@ const emailReducer = (state = INITIAL_STATE, action) => {
case EmailActionTypes.TOGGLE_EMAIL_OVERLAY_VISIBLE: case EmailActionTypes.TOGGLE_EMAIL_OVERLAY_VISIBLE:
return { return {
...state, ...state,
visible: !state.visible, open: !state.open,
}; };
case EmailActionTypes.SET_EMAIL_OPTIONS: case EmailActionTypes.SET_EMAIL_OPTIONS:
return { return {
...state, ...state,
emailConfig: { ...action.payload }, emailConfig: { ...action.payload },
visible: true, open: true,
}; };
default: default:
return state; return state;

View File

@@ -4,7 +4,7 @@ const selectEmail = (state) => state.email;
export const selectEmailVisible = createSelector( export const selectEmailVisible = createSelector(
[selectEmail], [selectEmail],
(email) => email.visible (email) => email.open
); );
export const selectEmailConfig = createSelector( export const selectEmailConfig = createSelector(

View File

@@ -1,7 +1,7 @@
import MessagingActionTypes from "./messaging.types"; import MessagingActionTypes from "./messaging.types";
const INITIAL_STATE = { const INITIAL_STATE = {
visible: false, open: false,
selectedConversationId: null, selectedConversationId: null,
isSending: false, isSending: false,
error: null, error: null,
@@ -16,7 +16,7 @@ const messagingReducer = (state = INITIAL_STATE, action) => {
case MessagingActionTypes.TOGGLE_CHAT_VISIBLE: case MessagingActionTypes.TOGGLE_CHAT_VISIBLE:
return { return {
...state, ...state,
visible: !state.visible, open: !state.open,
}; };
case MessagingActionTypes.OPEN_CHAT_BY_PHONE: case MessagingActionTypes.OPEN_CHAT_BY_PHONE:
return { return {
@@ -26,7 +26,7 @@ const messagingReducer = (state = INITIAL_STATE, action) => {
case MessagingActionTypes.SET_SELECTED_CONVERSATION: case MessagingActionTypes.SET_SELECTED_CONVERSATION:
return { return {
...state, ...state,
visible: true, open: true,
searchingForConversation: false, searchingForConversation: false,
selectedConversationId: action.payload, selectedConversationId: action.payload,
}; };

View File

@@ -4,7 +4,7 @@ const selectMessaging = (state) => state.messaging;
export const selectChatVisible = createSelector( export const selectChatVisible = createSelector(
[selectMessaging], [selectMessaging],
(messaging) => messaging.visible (messaging) => messaging.open
); );
export const selectIsSending = createSelector( export const selectIsSending = createSelector(

View File

@@ -1,7 +1,7 @@
import ModalsActionTypes from "./modals.types"; import ModalsActionTypes from "./modals.types";
const baseModal = { const baseModal = {
visible: false, open: false,
context: {}, context: {},
actions: { actions: {
refetch: null, refetch: null,
@@ -35,7 +35,7 @@ const modalsReducer = (state = INITIAL_STATE, action) => {
...state, ...state,
[action.payload]: { [action.payload]: {
...state[action.payload], ...state[action.payload],
visible: !state[action.payload].visible, open: !state[action.payload].open,
}, },
}; };
case ModalsActionTypes.SET_MODAL_CONTEXT: case ModalsActionTypes.SET_MODAL_CONTEXT:
@@ -44,7 +44,7 @@ const modalsReducer = (state = INITIAL_STATE, action) => {
[action.payload.modal]: { [action.payload.modal]: {
...state[action.payload.modal], ...state[action.payload.modal],
...action.payload.context, ...action.payload.context,
visible: true, open: true,
}, },
}; };
default: default: