display labor type when logging in as dealership

This commit is contained in:
jfrye122
2023-06-05 11:50:58 -04:00
parent c27eb29b63
commit 5e107bc767

View File

@@ -8,6 +8,7 @@ import { createStructuredSelector } from "reselect";
import { selectBodyshop } from "../../redux/user/user.selectors"; import { selectBodyshop } from "../../redux/user/user.selectors";
import { QUERY_EMPLOYEE_BY_ID } from "../../graphql/employees.queries"; import { QUERY_EMPLOYEE_BY_ID } from "../../graphql/employees.queries";
import { useEffect } from "react"; import { useEffect } from "react";
import { t } from "i18next";
const data = [ const data = [
{ label: "Item 1", value: "1" }, { label: "Item 1", value: "1" },
@@ -15,16 +16,17 @@ const data = [
{ label: "Item 3", value: "3" }, { label: "Item 3", value: "3" },
]; ];
// const mapStateToProps = createStructuredSelector({ const mapStateToProps = createStructuredSelector({
// bodyshop: selectBodyshop, bodyshop: selectBodyshop
// timeTicketJobId: selectCurrentTimeTicketJobId, // timeTicketJobId: selectCurrentTimeTicketJobId,
// timeTicketJob: selectCurrentTimeTicketJob, // timeTicketJob: selectCurrentTimeTicketJob,
// }); });
// const mapDispatchToProps = {}; // const mapDispatchToProps = {};
export function CostCenterSelect(props) { export function CostCenterSelect(props) {
const currentRatesNCostCenters = props.currentRatesNCostCenters; const currentRatesNCostCenters = props.currentRatesNCostCenters;
const bodyshop = props.bodyshop;
const [value, setValue] = useState(null); const [value, setValue] = useState(null);
const [isFocus, setIsFocus] = useState(false); const [isFocus, setIsFocus] = useState(false);
@@ -37,7 +39,10 @@ export function CostCenterSelect(props) {
for (let i = 0; i < count; i++) { for (let i = 0; i < count; i++) {
selectDataArray.push({ selectDataArray.push({
value: currentRatesNCostCenters[i].cost_center, value: currentRatesNCostCenters[i].cost_center,
label: currentRatesNCostCenters[i].cost_center, label: bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber ? t(
`joblines.fields.lbr_types.${currentRatesNCostCenters[i].cost_center.toUpperCase()}`
)
: currentRatesNCostCenters[i].cost_center,
rate: currentRatesNCostCenters[i].rate, rate: currentRatesNCostCenters[i].rate,
}); });
} }
@@ -73,7 +78,7 @@ export function CostCenterSelect(props) {
); );
} }
export default connect(null, null)(CostCenterSelect); export default connect(mapStateToProps, null)(CostCenterSelect);
const styles = StyleSheet.create({ const styles = StyleSheet.create({
container: { container: {