CEC-5752 - Define trim as well as model for Flashpack mappings
This commit is contained in:
@@ -69,6 +69,52 @@ exports[`FlashpackAdd Render 1`] = `
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="MuiFormControl-root MuiTextField-root MuiFormControl-marginNormal MuiFormControl-fullWidth"
|
||||
>
|
||||
<label
|
||||
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-outlined Mui-required Mui-required"
|
||||
data-shrink="false"
|
||||
for="carTrim"
|
||||
id="carTrim-label"
|
||||
>
|
||||
Trim
|
||||
<span
|
||||
aria-hidden="true"
|
||||
class="MuiFormLabel-asterisk MuiInputLabel-asterisk"
|
||||
>
|
||||
|
||||
*
|
||||
</span>
|
||||
</label>
|
||||
<div
|
||||
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-fullWidth MuiInputBase-formControl"
|
||||
>
|
||||
<input
|
||||
aria-invalid="false"
|
||||
class="MuiInputBase-input MuiOutlinedInput-input"
|
||||
id="carTrim"
|
||||
maxlength="255"
|
||||
name="carTrim"
|
||||
required=""
|
||||
type="text"
|
||||
value=""
|
||||
/>
|
||||
<fieldset
|
||||
aria-hidden="true"
|
||||
class="PrivateNotchedOutline-root-0 MuiOutlinedInput-notchedOutline"
|
||||
>
|
||||
<legend
|
||||
class="PrivateNotchedOutline-legendLabelled-0"
|
||||
>
|
||||
<span>
|
||||
Trim
|
||||
*
|
||||
</span>
|
||||
</legend>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="MuiFormControl-root MuiTextField-root MuiFormControl-marginNormal MuiFormControl-fullWidth"
|
||||
>
|
||||
|
||||
@@ -23,6 +23,7 @@ const MainForm = () => {
|
||||
const [redirect, setRedirect] = useState(null);
|
||||
const { setMessage, setTitle, setSitePath } = useStatusContext();
|
||||
const [carModel, setCarModel] = useState("");
|
||||
const [carTrim, setCarTrim] = useState("");
|
||||
const [carYear, setCarYear] = useState();
|
||||
const [flashpack, setFlashpack] = useState();
|
||||
const [mappingInputs, setMappingInputs] = useState([{ ecuName: "", ecuVersion: "" }]);
|
||||
@@ -53,6 +54,10 @@ const MainForm = () => {
|
||||
setCarModel(event.target.value);
|
||||
}
|
||||
|
||||
const onCarTrimChange = (event) => {
|
||||
setCarTrim(event.target.value);
|
||||
}
|
||||
|
||||
const onCarYearChange = (event) => {
|
||||
setCarYear(event.target.value);
|
||||
}
|
||||
@@ -74,11 +79,11 @@ const MainForm = () => {
|
||||
})
|
||||
}
|
||||
|
||||
const result = await addFlashpackVersion(carModel, parseInt(carYear), flashpack, carFlashpackVersions, token);
|
||||
const result = await addFlashpackVersion(carModel, carTrim, parseInt(carYear), flashpack, carFlashpackVersions, token);
|
||||
if (!result || result.error) return;
|
||||
|
||||
setMessage(`Added ${carYear} ${carModel} ${flashpack}`);
|
||||
setRedirect(`/tools/flashpack/${carModel}/${carYear}/${flashpack}`);
|
||||
setMessage(`Added ${carYear} ${carModel} ${carTrim} ${flashpack}`);
|
||||
setRedirect(`/tools/flashpack/${carModel}/${carTrim}/${carYear}/${flashpack}`);
|
||||
} catch (e) {
|
||||
setMessage(e.message);
|
||||
logger.warn(e.stack);
|
||||
@@ -128,6 +133,21 @@ const MainForm = () => {
|
||||
onChange={onCarModelChange}
|
||||
type="text"
|
||||
/>
|
||||
<TextField
|
||||
id="carTrim"
|
||||
name="carTrim"
|
||||
label="Trim"
|
||||
variant="outlined"
|
||||
margin="normal"
|
||||
inputProps={{
|
||||
maxLength: "255",
|
||||
}}
|
||||
required
|
||||
fullWidth
|
||||
value={carTrim}
|
||||
onChange={onCarTrimChange}
|
||||
type="text"
|
||||
/>
|
||||
<TextField
|
||||
id="carYear"
|
||||
name="carYear"
|
||||
|
||||
Reference in New Issue
Block a user