Simplified profile page BOD-323
This commit is contained in:
@@ -19586,6 +19586,32 @@
|
|||||||
</concept_node>
|
</concept_node>
|
||||||
</children>
|
</children>
|
||||||
</folder_node>
|
</folder_node>
|
||||||
|
<folder_node>
|
||||||
|
<name>labels</name>
|
||||||
|
<children>
|
||||||
|
<concept_node>
|
||||||
|
<name>activeshop</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
|
</children>
|
||||||
|
</folder_node>
|
||||||
</children>
|
</children>
|
||||||
</folder_node>
|
</folder_node>
|
||||||
<folder_node>
|
<folder_node>
|
||||||
@@ -21464,6 +21490,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>profile</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
<concept_node>
|
<concept_node>
|
||||||
<name>schedule</name>
|
<name>schedule</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
|
|||||||
@@ -10,12 +10,13 @@ export default function ChatConversationTitle({ conversation }) {
|
|||||||
<Space>
|
<Space>
|
||||||
<strong>{conversation && conversation.phone_num}</strong>
|
<strong>{conversation && conversation.phone_num}</strong>
|
||||||
<span>
|
<span>
|
||||||
{conversation.job_conversations.map(
|
{conversation &&
|
||||||
(j) =>
|
conversation.job_conversations.map(
|
||||||
`${j.job.ownr_fn || ""} ${j.job.ownr_ln || ""} ${
|
(j) =>
|
||||||
j.job.ownr_co_nm || ""
|
`${j.job.ownr_fn || ""} ${j.job.ownr_ln || ""} ${
|
||||||
} | `
|
j.job.ownr_co_nm || ""
|
||||||
)}
|
} | `
|
||||||
|
)}
|
||||||
</span>
|
</span>
|
||||||
</Space>
|
</Space>
|
||||||
<div className="imex-flex-row imex-flex-row__margin">
|
<div className="imex-flex-row imex-flex-row__margin">
|
||||||
|
|||||||
@@ -39,7 +39,10 @@ export default function ChatTagRoContainer({ conversation }) {
|
|||||||
setVisible(false);
|
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
|
const roOptions = data
|
||||||
? data.jobs.filter((job) => !existingJobTags.includes(job.id))
|
? data.jobs.filter((job) => !existingJobTags.includes(job.id))
|
||||||
|
|||||||
@@ -170,9 +170,18 @@ function InvoiceEnterModalContainer({
|
|||||||
(invoiceEnterModal.context.job &&
|
(invoiceEnterModal.context.job &&
|
||||||
invoiceEnterModal.context.job.id) ||
|
invoiceEnterModal.context.job.id) ||
|
||||||
null,
|
null,
|
||||||
federal_tax_rate: bodyshop.invoice_tax_rates.federal_tax_rate || 0,
|
federal_tax_rate:
|
||||||
state_tax_rate: bodyshop.invoice_tax_rates.state_tax_rate || 0,
|
(bodyshop.invoice_tax_rates &&
|
||||||
local_tax_rate: bodyshop.invoice_tax_rates.local_tax_rate || 0,
|
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} />
|
<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 React from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { Table, Button } from "antd";
|
import { Table, Button, Typography } from "antd";
|
||||||
export default function ProfileShopsComponent({
|
export default function ProfileShopsComponent({
|
||||||
loading,
|
loading,
|
||||||
data,
|
data,
|
||||||
updateActiveShop
|
updateActiveShop,
|
||||||
}) {
|
}) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
@@ -14,14 +14,14 @@ export default function ProfileShopsComponent({
|
|||||||
dataIndex: "shopname",
|
dataIndex: "shopname",
|
||||||
key: "shopname",
|
key: "shopname",
|
||||||
width: "25%",
|
width: "25%",
|
||||||
render: (text, record) => <span>{record.bodyshop.shopname}</span>
|
render: (text, record) => <span>{record.bodyshop.shopname}</span>,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t("associations.fields.active"),
|
title: t("associations.fields.active"),
|
||||||
dataIndex: "active",
|
dataIndex: "active",
|
||||||
key: "active",
|
key: "active",
|
||||||
width: "25%",
|
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"),
|
title: t("associations.labels.actions"),
|
||||||
@@ -36,15 +36,20 @@ export default function ProfileShopsComponent({
|
|||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
</span>
|
</span>
|
||||||
)
|
),
|
||||||
}
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Table
|
<Table
|
||||||
|
title={() => (
|
||||||
|
<Typography.Title level={4}>
|
||||||
|
{t("profile.labels.activeshop")}
|
||||||
|
</Typography.Title>
|
||||||
|
)}
|
||||||
loading={loading}
|
loading={loading}
|
||||||
size="small"
|
size="small"
|
||||||
columns={columns.map(item => ({ ...item }))}
|
columns={columns.map((item) => ({ ...item }))}
|
||||||
rowKey="id"
|
rowKey="id"
|
||||||
dataSource={data}
|
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>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -8,22 +8,24 @@ import ManagePage from "./manage.page.component";
|
|||||||
import LoadingSpinner from "../../components/loading-spinner/loading-spinner.component";
|
import LoadingSpinner from "../../components/loading-spinner/loading-spinner.component";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
const mapDispatchToProps = dispatch => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
setBodyshop: bs => dispatch(setBodyshop(bs))
|
setBodyshop: (bs) => dispatch(setBodyshop(bs)),
|
||||||
});
|
});
|
||||||
|
|
||||||
function ManagePageContainer({ match, setBodyshop }) {
|
function ManagePageContainer({ match, setBodyshop }) {
|
||||||
const { loading, error, data } = useQuery(QUERY_BODYSHOP, {
|
const { loading, error, data } = useQuery(QUERY_BODYSHOP, {
|
||||||
fetchPolicy: "network-only"
|
fetchPolicy: "network-only",
|
||||||
});
|
});
|
||||||
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (data) setBodyshop(data.bodyshops[0]);
|
if (data) setBodyshop(data.bodyshops[0]);
|
||||||
}, [data, setBodyshop]);
|
}, [data, setBodyshop]);
|
||||||
|
|
||||||
if (loading)
|
if (loading)
|
||||||
return <LoadingSpinner message={t("general.labels.loadingshop")} />;
|
return <LoadingSpinner message={t("general.labels.loadingshop")} />;
|
||||||
if (error) return <AlertComponent message={error.message} type='error' />;
|
if (error) return <AlertComponent message={error.message} type="error" />;
|
||||||
return <ManagePage match={match} />;
|
return <ManagePage match={match} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,22 @@
|
|||||||
import React, { useEffect } from "react";
|
import React, { useEffect } from "react";
|
||||||
import ProfilePage from "./profile.page";
|
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
export default function ProfileContainerPage() {
|
import { connect } from "react-redux";
|
||||||
|
import { setBreadcrumbs } from "../../redux/application/application.actions";
|
||||||
|
import ProfilePage from "./profile.page";
|
||||||
|
|
||||||
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
|
setBreadcrumbs: (breadcrumbs) => dispatch(setBreadcrumbs(breadcrumbs)),
|
||||||
|
});
|
||||||
|
|
||||||
|
export function ProfileContainerPage({ setBreadcrumbs }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
setBreadcrumbs([
|
||||||
|
{ link: "/manage/profile", label: t("titles.bc.profile") },
|
||||||
|
]);
|
||||||
document.title = t("titles.profile");
|
document.title = t("titles.profile");
|
||||||
}, [t]);
|
}, [t, setBreadcrumbs]);
|
||||||
|
|
||||||
return <ProfilePage />;
|
return <ProfilePage />;
|
||||||
}
|
}
|
||||||
|
export default connect(null, mapDispatchToProps)(ProfileContainerPage);
|
||||||
|
|||||||
@@ -1,20 +1,12 @@
|
|||||||
import { Layout } from "antd";
|
import React from "react";
|
||||||
import React, { useState } from "react";
|
import ProfileMyComponent from "../../components/profile-my/profile-my.component";
|
||||||
import ProfileContent from "../../components/profile-content/profile-content.component";
|
import ProfileShopsContainer from "../../components/profile-shops/profile-shops.container";
|
||||||
import ProfileSideBar from "../../components/profile-sidebar/profile-sidebar.component";
|
|
||||||
|
|
||||||
export default function ProfilePage() {
|
export default function ProfilePage() {
|
||||||
const [sidebarSelection, setSidebarSelection] = useState({ key: "profile" });
|
|
||||||
return (
|
return (
|
||||||
<Layout>
|
<div>
|
||||||
<ProfileSideBar
|
<ProfileMyComponent />
|
||||||
sidebarSelection={sidebarSelection}
|
<ProfileShopsContainer />;
|
||||||
setSidebarSelection={setSidebarSelection}
|
</div>
|
||||||
/>
|
|
||||||
|
|
||||||
<Layout.Content>
|
|
||||||
<ProfileContent sidebarSelection={sidebarSelection} />
|
|
||||||
</Layout.Content>
|
|
||||||
</Layout>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1203,6 +1203,9 @@
|
|||||||
"profile": {
|
"profile": {
|
||||||
"errors": {
|
"errors": {
|
||||||
"state": "Error reading page state. Please refresh."
|
"state": "Error reading page state. Please refresh."
|
||||||
|
},
|
||||||
|
"labels": {
|
||||||
|
"activeshop": "Active Shop"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"scoreboard": {
|
"scoreboard": {
|
||||||
@@ -1326,6 +1329,7 @@
|
|||||||
"payments-all": "All Payments",
|
"payments-all": "All Payments",
|
||||||
"productionboard": "Production Board - Visual",
|
"productionboard": "Production Board - Visual",
|
||||||
"productionlist": "Production Board - List",
|
"productionlist": "Production Board - List",
|
||||||
|
"profile": "My Profile",
|
||||||
"schedule": "Schedule",
|
"schedule": "Schedule",
|
||||||
"scoreboard": "Scoreboard",
|
"scoreboard": "Scoreboard",
|
||||||
"shop": "Manage my Shop ({{shopname}})",
|
"shop": "Manage my Shop ({{shopname}})",
|
||||||
|
|||||||
@@ -1203,6 +1203,9 @@
|
|||||||
"profile": {
|
"profile": {
|
||||||
"errors": {
|
"errors": {
|
||||||
"state": "Error al leer el estado de la página. Porfavor refresca."
|
"state": "Error al leer el estado de la página. Porfavor refresca."
|
||||||
|
},
|
||||||
|
"labels": {
|
||||||
|
"activeshop": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"scoreboard": {
|
"scoreboard": {
|
||||||
@@ -1326,6 +1329,7 @@
|
|||||||
"payments-all": "",
|
"payments-all": "",
|
||||||
"productionboard": "",
|
"productionboard": "",
|
||||||
"productionlist": "",
|
"productionlist": "",
|
||||||
|
"profile": "",
|
||||||
"schedule": "",
|
"schedule": "",
|
||||||
"scoreboard": "",
|
"scoreboard": "",
|
||||||
"shop": "",
|
"shop": "",
|
||||||
|
|||||||
@@ -1203,6 +1203,9 @@
|
|||||||
"profile": {
|
"profile": {
|
||||||
"errors": {
|
"errors": {
|
||||||
"state": "Erreur lors de la lecture de l'état de la page. Rafraichissez, s'il vous plait."
|
"state": "Erreur lors de la lecture de l'état de la page. Rafraichissez, s'il vous plait."
|
||||||
|
},
|
||||||
|
"labels": {
|
||||||
|
"activeshop": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"scoreboard": {
|
"scoreboard": {
|
||||||
@@ -1326,6 +1329,7 @@
|
|||||||
"payments-all": "",
|
"payments-all": "",
|
||||||
"productionboard": "",
|
"productionboard": "",
|
||||||
"productionlist": "",
|
"productionlist": "",
|
||||||
|
"profile": "",
|
||||||
"schedule": "",
|
"schedule": "",
|
||||||
"scoreboard": "",
|
"scoreboard": "",
|
||||||
"shop": "",
|
"shop": "",
|
||||||
|
|||||||
Reference in New Issue
Block a user