Reorganize app pages (#73)
* Update layout and menus * Add breadcrumbs Add menu icons Add ECU drop down * Implement submenu Update download progress * revamped dashboard section - failing app.test.js * Clean up Co-authored-by: Drew Taylor <dtaylor@fiskerinc.com>
This commit is contained in:
121
src/components/Controls/ECUDropDown/index.jsx
Normal file
121
src/components/Controls/ECUDropDown/index.jsx
Normal file
@@ -0,0 +1,121 @@
|
||||
import React from "react";
|
||||
import { Select } from "@material-ui/core";
|
||||
|
||||
const ECUDropDown = (props) => {
|
||||
const changeHandler = (e) => {
|
||||
if (!props.changeHandler) return;
|
||||
props.changeHandler(e);
|
||||
};
|
||||
|
||||
return (
|
||||
<Select
|
||||
id={props.id}
|
||||
native
|
||||
variant="outlined"
|
||||
value={props.value}
|
||||
onChange={changeHandler}
|
||||
>
|
||||
{ECUs.map((item, index) => (
|
||||
<option key={index} value={item[0]}>
|
||||
{item[1]}
|
||||
</option>
|
||||
))}
|
||||
</Select>
|
||||
);
|
||||
};
|
||||
|
||||
export default ECUDropDown;
|
||||
|
||||
const ECUs = [
|
||||
["AGS", "Active Grille Shutter"],
|
||||
["ADB", "Adaptive Driving Beam"],
|
||||
["ADAS", "Advanced Driver Assist System"],
|
||||
["ACU", "Airbag Control Unit"],
|
||||
["ACP", "Airconditioning Control Panel"],
|
||||
["AMP", "Amplifier"],
|
||||
["AP_FL", "Anti-Pinch Front Left"],
|
||||
["AP_FR", "Anti-Pinch Front Right"],
|
||||
["AP_RL", "Anti-Pinch Rear Left"],
|
||||
["AP_RR", "Anti-Pinch Rear Right"],
|
||||
["AL", "Atmosphere Lamp"],
|
||||
["BCS", "Battery HV Current Sensor"],
|
||||
["BMS", "Battery Management System"],
|
||||
["BMU", "Battery Management Unit"],
|
||||
["BCM", "Body Control Module"],
|
||||
["CDS", "Center Display Screen"],
|
||||
["CCU", "Charging Control Unit"],
|
||||
["CIM", "Column Integrated Module"],
|
||||
["CVM", "Coolant Valve Module"],
|
||||
["CFM", "Cooling Fan Module"],
|
||||
["CMRR_FL", "Corner Mid Range Radar Front Left"],
|
||||
["CMRR_FR", "Corner Mid Range Radar Front Right"],
|
||||
["CMRR_RL", "Corner Mid Range Radar Rear Left"],
|
||||
["CMRR_RR", "Corner Mid Range Radar Rear Right"],
|
||||
["DVRC", "Digital Video Recorder Camera"],
|
||||
["DC-CHM", "Direct Current Charge Machine"],
|
||||
["DMC", "Driver Monitor Camera"],
|
||||
["DSMC", "Driver Seat Memory Controller"],
|
||||
["DWSG", "Driver Window Switch Group"],
|
||||
["EPS", "Electric Power Steering"],
|
||||
["EAS", "Electrical Air Compressor System"],
|
||||
["ECC", "Electrical Climate Controller"],
|
||||
["EWP_B", "Electrical Water Pump Battery"],
|
||||
["EWP_FD", "Electrical Water Pump Front Drive"],
|
||||
["EWP_H", "Electrical Water Pump Heat"],
|
||||
["EWP_RD", "Electrical Water Pump Rear Drive"],
|
||||
["EWM", "Electrical Wiper Motor"],
|
||||
["EXV_B", "Electronic Expansion Value Battery"],
|
||||
["EXV_HP", "Electronic Expansion Valve HPC"],
|
||||
["ESP", "Electronic Stability Program"],
|
||||
["FDHA_FL", "Flush Door Handle Actuator Front Left"],
|
||||
["FDHA_FR", "Flush Door Handle Actuator Front Right"],
|
||||
["FDHA_RL", "Flush Door Handle Actuator Rear Left"],
|
||||
["FDHA_RR", "Flush Door Handle Actuator Rear Right"],
|
||||
["Lumber", "Four-Way Lumber"],
|
||||
["FBM_L", "Front Beam Module Left"],
|
||||
["FBM_R", "Front Beam Module Right"],
|
||||
["FVC", "Front Video Camera"],
|
||||
["GW", "Gateway"],
|
||||
["HUD", "Head-Up Display"],
|
||||
["IDS", "Instrument Display Screen"],
|
||||
["ICC", "Integrated Cockpit Controller"],
|
||||
["IBS", "Intelligent Battery Sensor"],
|
||||
["iBooster", "Intelligent Booster"],
|
||||
["KS", "Kick Sensor"],
|
||||
["LSC", "Left Side Camera"],
|
||||
["MRR", "Mid Range Radar"],
|
||||
["MCU_F", "Motor Control Unit Front"],
|
||||
["MCU_R", "Motor Control Unit Rear"],
|
||||
["MDV", "Motorized Deco-Vent"],
|
||||
["MFS", "Multifunction Steering"],
|
||||
["MIS", "Multimedia Interactive Switch"],
|
||||
["MPC", "Multipurpose Camera"],
|
||||
["OMC", "Occupant Monitor Camera"],
|
||||
["OHC", "Overhead Console"],
|
||||
["PAS", "Parking Assistant System"],
|
||||
["PCU", "Parking Control Unit"],
|
||||
["PMS", "Particulate Matter Sensor"],
|
||||
["PSM", "Passenger Seat Module"],
|
||||
["PEPS", "Passive Entry And Passive Start"],
|
||||
["PKC", "Phone Key Controller"],
|
||||
["PKC_ANT_L", "Phone Key Controller Antenna Left"],
|
||||
["PKC_ANT_R", "Phone Key Controller Antenna Right"],
|
||||
["PWC", "Phone Wireless Charging"],
|
||||
["PASC", "Power Adjust Steering Column"],
|
||||
["PDU", "Power Distribution Unit"],
|
||||
["PLGM", "Power Lift Gate Module"],
|
||||
["RLS", "Rain Light Sensor"],
|
||||
["RAC", "Rear Airconditioning Control"],
|
||||
["RVC", "Rear View Camera"],
|
||||
["RSC", "Right Side Camera"],
|
||||
["RCM", "Roof Control Module"],
|
||||
["RSM", "Roof Shade Module"],
|
||||
["TBOX", "Telematics Box"],
|
||||
["TPMS", "Tire Pressure Monitoring System"],
|
||||
["TDS", "Touch Display Screen"],
|
||||
["USB Box", "USB Box"],
|
||||
["VCU", "Vehicle Control Unit"],
|
||||
["VSP", "Vehicle Sound For Pedestraion"],
|
||||
["WTC_B", "Water Thermal Controller Battery"],
|
||||
["WTC_H", "Water Thermal Controller Heat"],
|
||||
];
|
||||
34
src/components/Controls/SiteBreadCrumbs/index.jsx
Normal file
34
src/components/Controls/SiteBreadCrumbs/index.jsx
Normal file
@@ -0,0 +1,34 @@
|
||||
import React from "react";
|
||||
import { Link as RouterLink } from "react-router-dom";
|
||||
import Breadcrumbs from "@material-ui/core/Breadcrumbs";
|
||||
import { Link } from "@material-ui/core";
|
||||
|
||||
const SiteBreadcrumbs = ({ path }) => {
|
||||
if (!path || path.length === 0) return null;
|
||||
|
||||
return (
|
||||
<Breadcrumbs
|
||||
aria-label="breadcrumb"
|
||||
color="inherit"
|
||||
style={{ fontSize: "10px" }}
|
||||
>
|
||||
{path.map((item, index, items) => {
|
||||
if (index < items.length) {
|
||||
return (
|
||||
<Link
|
||||
key={index}
|
||||
color="inherit"
|
||||
to={item.link || "#"}
|
||||
component={RouterLink}
|
||||
>
|
||||
{item.label}
|
||||
</Link>
|
||||
);
|
||||
}
|
||||
return null;
|
||||
})}
|
||||
</Breadcrumbs>
|
||||
);
|
||||
};
|
||||
|
||||
export default SiteBreadcrumbs;
|
||||
@@ -27,6 +27,15 @@ const DataDisplay = ({ data, option, onDelete }) => {
|
||||
<DeleteIcon />
|
||||
</Link>
|
||||
);
|
||||
} else if (option.control) {
|
||||
return (
|
||||
<option.control
|
||||
id={option.field}
|
||||
name={option.field}
|
||||
value={text}
|
||||
changeHandler={onChange}
|
||||
></option.control>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user