Simplified profile page BOD-323
This commit is contained in:
@@ -10,12 +10,13 @@ export default function ChatConversationTitle({ conversation }) {
|
||||
<Space>
|
||||
<strong>{conversation && conversation.phone_num}</strong>
|
||||
<span>
|
||||
{conversation.job_conversations.map(
|
||||
(j) =>
|
||||
`${j.job.ownr_fn || ""} ${j.job.ownr_ln || ""} ${
|
||||
j.job.ownr_co_nm || ""
|
||||
} | `
|
||||
)}
|
||||
{conversation &&
|
||||
conversation.job_conversations.map(
|
||||
(j) =>
|
||||
`${j.job.ownr_fn || ""} ${j.job.ownr_ln || ""} ${
|
||||
j.job.ownr_co_nm || ""
|
||||
} | `
|
||||
)}
|
||||
</span>
|
||||
</Space>
|
||||
<div className="imex-flex-row imex-flex-row__margin">
|
||||
|
||||
@@ -39,7 +39,10 @@ export default function ChatTagRoContainer({ conversation }) {
|
||||
setVisible(false);
|
||||
};
|
||||
|
||||
const existingJobTags = conversation.job_conversations.map((i) => i.jobid);
|
||||
const existingJobTags =
|
||||
conversation &&
|
||||
conversation.job_conversations &&
|
||||
conversation.job_conversations.map((i) => i.jobid);
|
||||
|
||||
const roOptions = data
|
||||
? data.jobs.filter((job) => !existingJobTags.includes(job.id))
|
||||
|
||||
@@ -170,9 +170,18 @@ function InvoiceEnterModalContainer({
|
||||
(invoiceEnterModal.context.job &&
|
||||
invoiceEnterModal.context.job.id) ||
|
||||
null,
|
||||
federal_tax_rate: bodyshop.invoice_tax_rates.federal_tax_rate || 0,
|
||||
state_tax_rate: bodyshop.invoice_tax_rates.state_tax_rate || 0,
|
||||
local_tax_rate: bodyshop.invoice_tax_rates.local_tax_rate || 0,
|
||||
federal_tax_rate:
|
||||
(bodyshop.invoice_tax_rates &&
|
||||
bodyshop.invoice_tax_rates.federal_tax_rate) ||
|
||||
0,
|
||||
state_tax_rate:
|
||||
(bodyshop.invoice_tax_rates &&
|
||||
bodyshop.invoice_tax_rates.state_tax_rate) ||
|
||||
0,
|
||||
local_tax_rate:
|
||||
(bodyshop.invoice_tax_rates &&
|
||||
bodyshop.invoice_tax_rates.local_tax_rate) ||
|
||||
0,
|
||||
}}
|
||||
>
|
||||
<InvoiceFormContainer form={form} />
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import AlertComponent from "../alert/alert.component";
|
||||
import ProfileMyComponent from "../profile-my/profile-my.component";
|
||||
import ProfileShopsContainer from "../profile-shops/profile-shops.container";
|
||||
|
||||
export default function ProfileContent({ sidebarSelection }) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
switch (sidebarSelection.key) {
|
||||
case "profile":
|
||||
return <ProfileMyComponent />;
|
||||
case "shops":
|
||||
return <ProfileShopsContainer />;
|
||||
default:
|
||||
return (
|
||||
<AlertComponent message={t("profile.errors.state")} type="error" />
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Table, Button } from "antd";
|
||||
import { Table, Button, Typography } from "antd";
|
||||
export default function ProfileShopsComponent({
|
||||
loading,
|
||||
data,
|
||||
updateActiveShop
|
||||
updateActiveShop,
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
@@ -14,14 +14,14 @@ export default function ProfileShopsComponent({
|
||||
dataIndex: "shopname",
|
||||
key: "shopname",
|
||||
width: "25%",
|
||||
render: (text, record) => <span>{record.bodyshop.shopname}</span>
|
||||
render: (text, record) => <span>{record.bodyshop.shopname}</span>,
|
||||
},
|
||||
{
|
||||
title: t("associations.fields.active"),
|
||||
dataIndex: "active",
|
||||
key: "active",
|
||||
width: "25%",
|
||||
render: (text, record) => <span>{record.active ? "Yes" : "No"}</span>
|
||||
render: (text, record) => <span>{record.active ? "Yes" : "No"}</span>,
|
||||
},
|
||||
{
|
||||
title: t("associations.labels.actions"),
|
||||
@@ -36,15 +36,20 @@ export default function ProfileShopsComponent({
|
||||
</Button>
|
||||
)}
|
||||
</span>
|
||||
)
|
||||
}
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<Table
|
||||
title={() => (
|
||||
<Typography.Title level={4}>
|
||||
{t("profile.labels.activeshop")}
|
||||
</Typography.Title>
|
||||
)}
|
||||
loading={loading}
|
||||
size="small"
|
||||
columns={columns.map(item => ({ ...item }))}
|
||||
columns={columns.map((item) => ({ ...item }))}
|
||||
rowKey="id"
|
||||
dataSource={data}
|
||||
/>
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Layout, Menu } from "antd";
|
||||
import { UserOutlined, BankFilled } from "@ant-design/icons";
|
||||
|
||||
export default function ProfileSideBar({
|
||||
sidebarSelection,
|
||||
setSidebarSelection
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const onMenuClick = e => {
|
||||
setSidebarSelection({ ...sidebarSelection, key: e.key });
|
||||
};
|
||||
|
||||
return (
|
||||
<Layout.Sider>
|
||||
<Menu
|
||||
theme="dark"
|
||||
selectedKeys={sidebarSelection.key}
|
||||
onClick={onMenuClick}
|
||||
mode="inline"
|
||||
>
|
||||
<Menu.Item key="profile">
|
||||
<UserOutlined />
|
||||
<span>{t("menus.profilesidebar.profile")}</span>
|
||||
</Menu.Item>
|
||||
<Menu.Item key="shops">
|
||||
<BankFilled />
|
||||
<span>{t("menus.profilesidebar.shops")}</span>
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
</Layout.Sider>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user