CEC-3579 - Debug Mask on vehicle updates (#271)
* CEC-3579 - Add debug_mask to config message * CEC-3579 - Debug Mask in vehicle update * fix * fix snapshots * more fixes * make debug mask a simple string
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
REACT_APP_AUTH_CALLBACK_URL=https://ota-admin.cec-euprd.fiskerinc.com
|
REACT_APP_AUTH_CALLBACK_URL=https://ota-admin.cec-euprd.fiskerinc.com
|
||||||
REACT_APP_AUTH_SERVICE_URL=https://gw.cec-prd.fiskerinc.com/compute_auth
|
REACT_APP_AUTH_SERVICE_URL=https://gw.cec-prd.fiskerinc.com/compute_auth
|
||||||
REACT_APP_CERT_SERVICE_URL=https://gw.cec-prd.fiskerinc.com/certificate
|
REACT_APP_CERT_SERVICE_URL=https://gw.cec-prd.fiskerinc.com/certificate
|
||||||
|
REACT_APP_ENV=cec-euprd
|
||||||
REACT_APP_MAGNA_PROVIDER=Magna
|
REACT_APP_MAGNA_PROVIDER=Magna
|
||||||
REACT_APP_MAGNA_GROUP_ID=68273225-9da4-4fa7-aea5-38e16ec471fe
|
REACT_APP_MAGNA_GROUP_ID=68273225-9da4-4fa7-aea5-38e16ec471fe
|
||||||
REACT_APP_OTA_SERVICE_URL=https://gw.cec-euprd.fiskerinc.com/ota_update
|
REACT_APP_OTA_SERVICE_URL=https://gw.cec-euprd.fiskerinc.com/ota_update
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
REACT_APP_AUTH_CALLBACK_URL=https://ota-admin.cec-prd.fiskerinc.com
|
REACT_APP_AUTH_CALLBACK_URL=https://ota-admin.cec-prd.fiskerinc.com
|
||||||
REACT_APP_AUTH_SERVICE_URL=https://gw.cec-prd.fiskerinc.com/compute_auth
|
REACT_APP_AUTH_SERVICE_URL=https://gw.cec-prd.fiskerinc.com/compute_auth
|
||||||
REACT_APP_CERT_SERVICE_URL=https://gw.cec-prd.fiskerinc.com/certificate
|
REACT_APP_CERT_SERVICE_URL=https://gw.cec-prd.fiskerinc.com/certificate
|
||||||
|
REACT_APP_ENV=cec-prd
|
||||||
REACT_APP_MAGNA_PROVIDER=Magna
|
REACT_APP_MAGNA_PROVIDER=Magna
|
||||||
REACT_APP_MAGNA_GROUP_ID=68273225-9da4-4fa7-aea5-38e16ec471fe
|
REACT_APP_MAGNA_GROUP_ID=68273225-9da4-4fa7-aea5-38e16ec471fe
|
||||||
REACT_APP_OTA_SERVICE_URL=https://gw.cec-prd.fiskerinc.com/ota_update
|
REACT_APP_OTA_SERVICE_URL=https://gw.cec-prd.fiskerinc.com/ota_update
|
||||||
|
|||||||
1
.env.dev
1
.env.dev
@@ -1,6 +1,7 @@
|
|||||||
REACT_APP_AUTH_CALLBACK_URL=https://dev-ota-admin.cloud.fiskerinc.com
|
REACT_APP_AUTH_CALLBACK_URL=https://dev-ota-admin.cloud.fiskerinc.com
|
||||||
REACT_APP_AUTH_SERVICE_URL=https://dev-gw.cloud.fiskerinc.com/compute_auth
|
REACT_APP_AUTH_SERVICE_URL=https://dev-gw.cloud.fiskerinc.com/compute_auth
|
||||||
REACT_APP_CERT_SERVICE_URL=https://dev-gw.cloud.fiskerinc.com/certificate
|
REACT_APP_CERT_SERVICE_URL=https://dev-gw.cloud.fiskerinc.com/certificate
|
||||||
|
REACT_APP_ENV=dev
|
||||||
REACT_APP_MAGNA_PROVIDER=Fisker-QA
|
REACT_APP_MAGNA_PROVIDER=Fisker-QA
|
||||||
REACT_APP_MAGNA_GROUP_ID=efcc3025-e2d8-4212-8227-805c7be39d2c
|
REACT_APP_MAGNA_GROUP_ID=efcc3025-e2d8-4212-8227-805c7be39d2c
|
||||||
REACT_APP_OTA_SERVICE_URL=https://dev-gw.cloud.fiskerinc.com/ota_update
|
REACT_APP_OTA_SERVICE_URL=https://dev-gw.cloud.fiskerinc.com/ota_update
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
REACT_APP_AUTH_CALLBACK_URL=http://localhost:3000
|
REACT_APP_AUTH_CALLBACK_URL=http://localhost:3000
|
||||||
REACT_APP_AUTH_SERVICE_URL=http://localhost/compute_auth
|
REACT_APP_AUTH_SERVICE_URL=http://localhost/compute_auth
|
||||||
REACT_APP_CERT_SERVICE_URL=http://localhost/certificate
|
REACT_APP_CERT_SERVICE_URL=http://localhost/certificate
|
||||||
|
REACT_APP_ENV=local
|
||||||
REACT_APP_MAGNA_PROVIDER=Fisker-QA
|
REACT_APP_MAGNA_PROVIDER=Fisker-QA
|
||||||
REACT_APP_MAGNA_GROUP_ID=efcc3025-e2d8-4212-8227-805c7be39d2c
|
REACT_APP_MAGNA_GROUP_ID=efcc3025-e2d8-4212-8227-805c7be39d2c
|
||||||
REACT_APP_OTA_SERVICE_URL=http://localhost/ota_update
|
REACT_APP_OTA_SERVICE_URL=http://localhost/ota_update
|
||||||
|
|||||||
1
.env.prd
1
.env.prd
@@ -1,6 +1,7 @@
|
|||||||
REACT_APP_AUTH_CALLBACK_URL=https://ota-admin.cloud.fiskerinc.com
|
REACT_APP_AUTH_CALLBACK_URL=https://ota-admin.cloud.fiskerinc.com
|
||||||
REACT_APP_AUTH_SERVICE_URL=https://gw.cloud.fiskerinc.com/compute_auth
|
REACT_APP_AUTH_SERVICE_URL=https://gw.cloud.fiskerinc.com/compute_auth
|
||||||
REACT_APP_CERT_SERVICE_URL=https://gw.cloud.fiskerinc.com/certificate
|
REACT_APP_CERT_SERVICE_URL=https://gw.cloud.fiskerinc.com/certificate
|
||||||
|
REACT_APP_ENV=prd
|
||||||
REACT_APP_MAGNA_PROVIDER=Magna
|
REACT_APP_MAGNA_PROVIDER=Magna
|
||||||
REACT_APP_MAGNA_GROUP_ID=68273225-9da4-4fa7-aea5-38e16ec471fe
|
REACT_APP_MAGNA_GROUP_ID=68273225-9da4-4fa7-aea5-38e16ec471fe
|
||||||
REACT_APP_OTA_SERVICE_URL=https://gw.cloud.fiskerinc.com/ota_update
|
REACT_APP_OTA_SERVICE_URL=https://gw.cloud.fiskerinc.com/ota_update
|
||||||
|
|||||||
1
.env.stg
1
.env.stg
@@ -1,6 +1,7 @@
|
|||||||
REACT_APP_AUTH_CALLBACK_URL=https://stg-ota-admin.cloud.fiskerinc.com
|
REACT_APP_AUTH_CALLBACK_URL=https://stg-ota-admin.cloud.fiskerinc.com
|
||||||
REACT_APP_AUTH_SERVICE_URL=https://stg-gw.cloud.fiskerinc.com/compute_auth
|
REACT_APP_AUTH_SERVICE_URL=https://stg-gw.cloud.fiskerinc.com/compute_auth
|
||||||
REACT_APP_CERT_SERVICE_URL=https://stg-gw.cloud.fiskerinc.com/certificate
|
REACT_APP_CERT_SERVICE_URL=https://stg-gw.cloud.fiskerinc.com/certificate
|
||||||
|
REACT_APP_ENV=stg
|
||||||
REACT_APP_MAGNA_PROVIDER=Magna
|
REACT_APP_MAGNA_PROVIDER=Magna
|
||||||
REACT_APP_MAGNA_GROUP_ID=68273225-9da4-4fa7-aea5-38e16ec471fe
|
REACT_APP_MAGNA_GROUP_ID=68273225-9da4-4fa7-aea5-38e16ec471fe
|
||||||
REACT_APP_OTA_SERVICE_URL=https://stg-gw.cloud.fiskerinc.com/ota_update
|
REACT_APP_OTA_SERVICE_URL=https://stg-gw.cloud.fiskerinc.com/ota_update
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
REACT_APP_AUTH_CALLBACK_URL=http://localhost:3000
|
REACT_APP_AUTH_CALLBACK_URL=http://localhost:3000
|
||||||
REACT_APP_AUTH_SERVICE_URL=http://localhost/compute_auth
|
REACT_APP_AUTH_SERVICE_URL=http://localhost/compute_auth
|
||||||
REACT_APP_CERT_SERVICE_URL=http://localhost/certificate
|
REACT_APP_CERT_SERVICE_URL=http://localhost/certificate
|
||||||
|
REACT_APP_ENV=local
|
||||||
REACT_APP_MAGNA_PROVIDER=Magna
|
REACT_APP_MAGNA_PROVIDER=Magna
|
||||||
REACT_APP_MAGNA_GROUP_ID=68273225-9da4-4fa7-aea5-38e16ec471fe
|
REACT_APP_MAGNA_GROUP_ID=68273225-9da4-4fa7-aea5-38e16ec471fe
|
||||||
REACT_APP_OTA_SERVICE_URL=http://localhost/ota_update
|
REACT_APP_OTA_SERVICE_URL=http://localhost/ota_update
|
||||||
|
|||||||
@@ -9958,9 +9958,13 @@ exports[`App Route /vehicle-status authenticated 1`] = `
|
|||||||
:
|
:
|
||||||
3
|
3
|
||||||
</p>
|
</p>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="MuiGrid-root makeStyles-textCenterAlign-0 MuiGrid-item MuiGrid-grid-md-12"
|
||||||
|
>
|
||||||
<p>
|
<p>
|
||||||
<b>
|
<b>
|
||||||
Debug Mask
|
DebugMask
|
||||||
</b>
|
</b>
|
||||||
:
|
:
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -136,9 +136,13 @@ exports[`VehicleDetailsTab Render 1`] = `
|
|||||||
:
|
:
|
||||||
3
|
3
|
||||||
</p>
|
</p>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="MuiGrid-root makeStyles-textCenterAlign-0 MuiGrid-item MuiGrid-grid-md-12"
|
||||||
|
>
|
||||||
<p>
|
<p>
|
||||||
<b>
|
<b>
|
||||||
Debug Mask
|
DebugMask
|
||||||
</b>
|
</b>
|
||||||
:
|
:
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -32,6 +32,9 @@ const MainForm = ({ vin }) => {
|
|||||||
providers,
|
providers,
|
||||||
} = useUserContext();
|
} = useUserContext();
|
||||||
|
|
||||||
|
const ENV = process.env.REACT_APP_ENV;
|
||||||
|
const showDebugMask = (ENV === 'local' || ENV === 'dev' || ENV === 'stg')
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
(async () => {
|
(async () => {
|
||||||
try {
|
try {
|
||||||
@@ -118,8 +121,12 @@ const MainForm = ({ vin }) => {
|
|||||||
<p>
|
<p>
|
||||||
<b>Filters</b>: {vehicle.canbus.filters ? vehicle.canbus.filters.length : 0}
|
<b>Filters</b>: {vehicle.canbus.filters ? vehicle.canbus.filters.length : 0}
|
||||||
</p>
|
</p>
|
||||||
|
</Grid>
|
||||||
|
)}
|
||||||
|
{showDebugMask && (
|
||||||
|
<Grid item md={12} className={classes.textCenterAlign}>
|
||||||
<p>
|
<p>
|
||||||
<b>Debug Mask</b>: {vehicle.debug_mask}
|
<b>DebugMask</b>: {vehicle.debug_mask}
|
||||||
</p>
|
</p>
|
||||||
</Grid>
|
</Grid>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -144,9 +144,13 @@ exports[`DetailsTab Render 1`] = `
|
|||||||
:
|
:
|
||||||
3
|
3
|
||||||
</p>
|
</p>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="MuiGrid-root makeStyles-textCenterAlign-0 MuiGrid-item MuiGrid-grid-md-12"
|
||||||
|
>
|
||||||
<p>
|
<p>
|
||||||
<b>
|
<b>
|
||||||
Debug Mask
|
DebugMask
|
||||||
</b>
|
</b>
|
||||||
:
|
:
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -272,6 +272,16 @@ exports[`CarStatus Render 1`] = `
|
|||||||
:
|
:
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
<div
|
||||||
|
class="MuiGrid-root makeStyles-textCenterAlign-0 MuiGrid-item MuiGrid-grid-md-12"
|
||||||
|
>
|
||||||
|
<p>
|
||||||
|
<b>
|
||||||
|
DebugMask
|
||||||
|
</b>
|
||||||
|
:
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
<div
|
<div
|
||||||
class="MuiGrid-root makeStyles-textCenterAlign-0 MuiGrid-item MuiGrid-grid-md-12"
|
class="MuiGrid-root makeStyles-textCenterAlign-0 MuiGrid-item MuiGrid-grid-md-12"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -935,12 +935,12 @@ exports[`VehicleUpdate Render 1`] = `
|
|||||||
class="MuiFormControl-root MuiTextField-root MuiFormControl-marginNormal MuiFormControl-fullWidth"
|
class="MuiFormControl-root MuiTextField-root MuiFormControl-marginNormal MuiFormControl-fullWidth"
|
||||||
>
|
>
|
||||||
<label
|
<label
|
||||||
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-outlined MuiFormLabel-filled"
|
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-outlined"
|
||||||
data-shrink="true"
|
data-shrink="true"
|
||||||
for="debug_mask"
|
for="debug_mask"
|
||||||
id="debug_mask-label"
|
id="debug_mask-label"
|
||||||
>
|
>
|
||||||
Debug Mask
|
DebugMask
|
||||||
</label>
|
</label>
|
||||||
<div
|
<div
|
||||||
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-fullWidth MuiInputBase-formControl"
|
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-fullWidth MuiInputBase-formControl"
|
||||||
@@ -949,9 +949,10 @@ exports[`VehicleUpdate Render 1`] = `
|
|||||||
aria-invalid="false"
|
aria-invalid="false"
|
||||||
class="MuiInputBase-input MuiOutlinedInput-input"
|
class="MuiInputBase-input MuiOutlinedInput-input"
|
||||||
id="debug_mask"
|
id="debug_mask"
|
||||||
|
maxlength="255"
|
||||||
name="debug_mask"
|
name="debug_mask"
|
||||||
type="number"
|
type="text"
|
||||||
value="0"
|
value=""
|
||||||
/>
|
/>
|
||||||
<fieldset
|
<fieldset
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
@@ -961,7 +962,7 @@ exports[`VehicleUpdate Render 1`] = `
|
|||||||
class="PrivateNotchedOutline-legendLabelled-0 PrivateNotchedOutline-legendNotched-0"
|
class="PrivateNotchedOutline-legendLabelled-0 PrivateNotchedOutline-legendNotched-0"
|
||||||
>
|
>
|
||||||
<span>
|
<span>
|
||||||
Debug Mask
|
DebugMask
|
||||||
</span>
|
</span>
|
||||||
</legend>
|
</legend>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|||||||
@@ -46,7 +46,10 @@ const MainForm = () => {
|
|||||||
const [dataLoggerEnabled, setDataLoggerEnabled] = useState(false);
|
const [dataLoggerEnabled, setDataLoggerEnabled] = useState(false);
|
||||||
const [maxMemBufferSize, setMaxMemBufferSize] = useState(0);
|
const [maxMemBufferSize, setMaxMemBufferSize] = useState(0);
|
||||||
const [maxDiskBufferSize, setMaxDiskBufferSize] = useState(0);
|
const [maxDiskBufferSize, setMaxDiskBufferSize] = useState(0);
|
||||||
const [debugMask, setDebugMask] = useState(0);
|
const debugMaskEl = useRef(null);
|
||||||
|
|
||||||
|
const ENV = process.env.REACT_APP_ENV;
|
||||||
|
const showDebugMask = (ENV === 'local' || ENV === 'dev' || ENV === 'stg')
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setTitle("Update Vehicle");
|
setTitle("Update Vehicle");
|
||||||
@@ -95,7 +98,9 @@ const MainForm = () => {
|
|||||||
setMaxDiskBufferSize(vehicle.canbus.max_disk_buffer_size ?? maxDiskBufferSize);
|
setMaxDiskBufferSize(vehicle.canbus.max_disk_buffer_size ?? maxDiskBufferSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
setDebugMask(vehicle.debug_mask ?? debugMask);
|
if (showDebugMask) {
|
||||||
|
debugMaskEl.current.value = vehicle.debug_mask ?? ""
|
||||||
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [vehicle]);
|
}, [vehicle]);
|
||||||
@@ -120,10 +125,6 @@ const MainForm = () => {
|
|||||||
setMaxDiskBufferSize(event.target.value);
|
setMaxDiskBufferSize(event.target.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
const onDebugMaskChange = (event) => {
|
|
||||||
setDebugMask(event.target.value);
|
|
||||||
}
|
|
||||||
|
|
||||||
const onSubmit = async (event) => {
|
const onSubmit = async (event) => {
|
||||||
try {
|
try {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
@@ -145,7 +146,7 @@ const MainForm = () => {
|
|||||||
max_mem_buffer_size: canbusEnabled ? parseInt(maxMemBufferSize) : 0,
|
max_mem_buffer_size: canbusEnabled ? parseInt(maxMemBufferSize) : 0,
|
||||||
max_disk_buffer_size: canbusEnabled && dataLoggerEnabled ? parseInt(maxDiskBufferSize) : 0
|
max_disk_buffer_size: canbusEnabled && dataLoggerEnabled ? parseInt(maxDiskBufferSize) : 0
|
||||||
},
|
},
|
||||||
debug_mask: parseInt(debugMask)
|
debug_mask: debugMaskEl.current.value
|
||||||
};
|
};
|
||||||
|
|
||||||
const result = await updateVehicle(vin, formData, token);
|
const result = await updateVehicle(vin, formData, token);
|
||||||
@@ -388,17 +389,24 @@ const MainForm = () => {
|
|||||||
required
|
required
|
||||||
fullWidth
|
fullWidth
|
||||||
/>
|
/>
|
||||||
<TextField
|
{showDebugMask && (
|
||||||
id="debug_mask"
|
<TextField
|
||||||
name="debug_mask"
|
id="debug_mask"
|
||||||
label='Debug Mask'
|
name="debug_mask"
|
||||||
value={debugMask}
|
label="DebugMask"
|
||||||
onChange={onDebugMaskChange}
|
InputLabelProps={{
|
||||||
variant="outlined"
|
shrink: true
|
||||||
margin="normal"
|
}}
|
||||||
type="number"
|
defaultValue=""
|
||||||
fullWidth
|
variant="outlined"
|
||||||
/>
|
margin="normal"
|
||||||
|
inputProps={{
|
||||||
|
maxLength: "255",
|
||||||
|
}}
|
||||||
|
fullWidth
|
||||||
|
inputRef={debugMaskEl}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
<Button
|
<Button
|
||||||
type="submit"
|
type="submit"
|
||||||
disabled={busy}
|
disabled={busy}
|
||||||
|
|||||||
Reference in New Issue
Block a user