From de721d9862158e3b1150bba82e25db2de051c921 Mon Sep 17 00:00:00 2001 From: Paul Adamsen <117673433+pauladamseniii@users.noreply.github.com> Date: Tue, 24 Jan 2023 14:38:06 -0500 Subject: [PATCH] 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 --- .env.cec-euprd | 1 + .env.cec-prd | 1 + .env.dev | 1 + .env.local | 1 + .env.prd | 1 + .env.stg | 1 + .env.template | 1 + .../App/__snapshots__/App.test.js.snap | 6 ++- .../Details/__snapshots__/index.test.jsx.snap | 6 ++- src/components/Cars/Status/Details/index.jsx | 9 +++- .../__snapshots__/DetailsTab.test.jsx.snap | 6 ++- .../Status/__snapshots__/index.test.jsx.snap | 10 +++++ .../Update/__snapshots__/index.test.jsx.snap | 11 ++--- src/components/Cars/Update/index.jsx | 44 +++++++++++-------- 14 files changed, 72 insertions(+), 27 deletions(-) diff --git a/.env.cec-euprd b/.env.cec-euprd index 763a959..5fb535f 100644 --- a/.env.cec-euprd +++ b/.env.cec-euprd @@ -1,6 +1,7 @@ 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_CERT_SERVICE_URL=https://gw.cec-prd.fiskerinc.com/certificate +REACT_APP_ENV=cec-euprd REACT_APP_MAGNA_PROVIDER=Magna REACT_APP_MAGNA_GROUP_ID=68273225-9da4-4fa7-aea5-38e16ec471fe REACT_APP_OTA_SERVICE_URL=https://gw.cec-euprd.fiskerinc.com/ota_update diff --git a/.env.cec-prd b/.env.cec-prd index 956480c..67d8f04 100644 --- a/.env.cec-prd +++ b/.env.cec-prd @@ -1,6 +1,7 @@ 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_CERT_SERVICE_URL=https://gw.cec-prd.fiskerinc.com/certificate +REACT_APP_ENV=cec-prd REACT_APP_MAGNA_PROVIDER=Magna REACT_APP_MAGNA_GROUP_ID=68273225-9da4-4fa7-aea5-38e16ec471fe REACT_APP_OTA_SERVICE_URL=https://gw.cec-prd.fiskerinc.com/ota_update diff --git a/.env.dev b/.env.dev index 84cee69..25f1da8 100644 --- a/.env.dev +++ b/.env.dev @@ -1,6 +1,7 @@ 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_CERT_SERVICE_URL=https://dev-gw.cloud.fiskerinc.com/certificate +REACT_APP_ENV=dev REACT_APP_MAGNA_PROVIDER=Fisker-QA REACT_APP_MAGNA_GROUP_ID=efcc3025-e2d8-4212-8227-805c7be39d2c REACT_APP_OTA_SERVICE_URL=https://dev-gw.cloud.fiskerinc.com/ota_update diff --git a/.env.local b/.env.local index b51db82..3441980 100644 --- a/.env.local +++ b/.env.local @@ -1,6 +1,7 @@ REACT_APP_AUTH_CALLBACK_URL=http://localhost:3000 REACT_APP_AUTH_SERVICE_URL=http://localhost/compute_auth REACT_APP_CERT_SERVICE_URL=http://localhost/certificate +REACT_APP_ENV=local REACT_APP_MAGNA_PROVIDER=Fisker-QA REACT_APP_MAGNA_GROUP_ID=efcc3025-e2d8-4212-8227-805c7be39d2c REACT_APP_OTA_SERVICE_URL=http://localhost/ota_update diff --git a/.env.prd b/.env.prd index 793c11b..f075c03 100644 --- a/.env.prd +++ b/.env.prd @@ -1,6 +1,7 @@ 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_CERT_SERVICE_URL=https://gw.cloud.fiskerinc.com/certificate +REACT_APP_ENV=prd REACT_APP_MAGNA_PROVIDER=Magna REACT_APP_MAGNA_GROUP_ID=68273225-9da4-4fa7-aea5-38e16ec471fe REACT_APP_OTA_SERVICE_URL=https://gw.cloud.fiskerinc.com/ota_update diff --git a/.env.stg b/.env.stg index ba137f8..ad05398 100644 --- a/.env.stg +++ b/.env.stg @@ -1,6 +1,7 @@ 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_CERT_SERVICE_URL=https://stg-gw.cloud.fiskerinc.com/certificate +REACT_APP_ENV=stg REACT_APP_MAGNA_PROVIDER=Magna REACT_APP_MAGNA_GROUP_ID=68273225-9da4-4fa7-aea5-38e16ec471fe REACT_APP_OTA_SERVICE_URL=https://stg-gw.cloud.fiskerinc.com/ota_update diff --git a/.env.template b/.env.template index d20768a..af1d4e4 100644 --- a/.env.template +++ b/.env.template @@ -1,6 +1,7 @@ REACT_APP_AUTH_CALLBACK_URL=http://localhost:3000 REACT_APP_AUTH_SERVICE_URL=http://localhost/compute_auth REACT_APP_CERT_SERVICE_URL=http://localhost/certificate +REACT_APP_ENV=local REACT_APP_MAGNA_PROVIDER=Magna REACT_APP_MAGNA_GROUP_ID=68273225-9da4-4fa7-aea5-38e16ec471fe REACT_APP_OTA_SERVICE_URL=http://localhost/ota_update diff --git a/src/components/App/__snapshots__/App.test.js.snap b/src/components/App/__snapshots__/App.test.js.snap index fd02840..70011a4 100644 --- a/src/components/App/__snapshots__/App.test.js.snap +++ b/src/components/App/__snapshots__/App.test.js.snap @@ -9958,9 +9958,13 @@ exports[`App Route /vehicle-status authenticated 1`] = ` : 3
+ +- Debug Mask + DebugMask :
diff --git a/src/components/Cars/Status/Details/__snapshots__/index.test.jsx.snap b/src/components/Cars/Status/Details/__snapshots__/index.test.jsx.snap index 267a4d4..30b2e69 100644 --- a/src/components/Cars/Status/Details/__snapshots__/index.test.jsx.snap +++ b/src/components/Cars/Status/Details/__snapshots__/index.test.jsx.snap @@ -136,9 +136,13 @@ exports[`VehicleDetailsTab Render 1`] = ` : 3 +- Debug Mask + DebugMask :
diff --git a/src/components/Cars/Status/Details/index.jsx b/src/components/Cars/Status/Details/index.jsx index 0679934..6307310 100644 --- a/src/components/Cars/Status/Details/index.jsx +++ b/src/components/Cars/Status/Details/index.jsx @@ -32,6 +32,9 @@ const MainForm = ({ vin }) => { providers, } = useUserContext(); + const ENV = process.env.REACT_APP_ENV; + const showDebugMask = (ENV === 'local' || ENV === 'dev' || ENV === 'stg') + useEffect(() => { (async () => { try { @@ -118,8 +121,12 @@ const MainForm = ({ vin }) => {Filters: {vehicle.canbus.filters ? vehicle.canbus.filters.length : 0}
+ + )} + {showDebugMask && ( +- Debug Mask: {vehicle.debug_mask} + DebugMask: {vehicle.debug_mask}
- Debug Mask + DebugMask :
diff --git a/src/components/Cars/Status/__snapshots__/index.test.jsx.snap b/src/components/Cars/Status/__snapshots__/index.test.jsx.snap index e2731f0..0e24f78 100644 --- a/src/components/Cars/Status/__snapshots__/index.test.jsx.snap +++ b/src/components/Cars/Status/__snapshots__/index.test.jsx.snap @@ -272,6 +272,16 @@ exports[`CarStatus Render 1`] = ` :+ + DebugMask + + : +
+