display labor type when logging in as dealership
This commit is contained in:
@@ -8,6 +8,7 @@ import { createStructuredSelector } from "reselect";
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
import { QUERY_EMPLOYEE_BY_ID } from "../../graphql/employees.queries";
|
||||
import { useEffect } from "react";
|
||||
import { t } from "i18next";
|
||||
|
||||
const data = [
|
||||
{ label: "Item 1", value: "1" },
|
||||
@@ -15,16 +16,17 @@ const data = [
|
||||
{ label: "Item 3", value: "3" },
|
||||
];
|
||||
|
||||
// const mapStateToProps = createStructuredSelector({
|
||||
// bodyshop: selectBodyshop,
|
||||
// timeTicketJobId: selectCurrentTimeTicketJobId,
|
||||
// timeTicketJob: selectCurrentTimeTicketJob,
|
||||
// });
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
bodyshop: selectBodyshop
|
||||
// timeTicketJobId: selectCurrentTimeTicketJobId,
|
||||
// timeTicketJob: selectCurrentTimeTicketJob,
|
||||
});
|
||||
|
||||
// const mapDispatchToProps = {};
|
||||
|
||||
export function CostCenterSelect(props) {
|
||||
const currentRatesNCostCenters = props.currentRatesNCostCenters;
|
||||
const bodyshop = props.bodyshop;
|
||||
|
||||
const [value, setValue] = useState(null);
|
||||
const [isFocus, setIsFocus] = useState(false);
|
||||
@@ -37,7 +39,10 @@ export function CostCenterSelect(props) {
|
||||
for (let i = 0; i < count; i++) {
|
||||
selectDataArray.push({
|
||||
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,
|
||||
});
|
||||
}
|
||||
@@ -73,7 +78,7 @@ export function CostCenterSelect(props) {
|
||||
);
|
||||
}
|
||||
|
||||
export default connect(null, null)(CostCenterSelect);
|
||||
export default connect(mapStateToProps, null)(CostCenterSelect);
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
|
||||
Reference in New Issue
Block a user