CEC-1050 New manifest format (#117)
* CEC-1050 Manifest changes * Fix delete bug * Add approve update button * Code smell * Remove update approval
This commit is contained in:
@@ -22,13 +22,10 @@ const checkExistingManifest = async (data, token) => {
|
||||
|
||||
const ECUTemplate = {
|
||||
name: "AGS",
|
||||
part_number: "",
|
||||
version: "",
|
||||
serial_number: "",
|
||||
hw_version: "",
|
||||
vendor: "",
|
||||
configuration_mask: "",
|
||||
configuration: "",
|
||||
fingerprint: "",
|
||||
files: [],
|
||||
manifest_id: 0,
|
||||
};
|
||||
|
||||
@@ -46,16 +46,16 @@ export const ManifestsProvider = ({ children }) => {
|
||||
const deleteManifest = async (package_id, token) => {
|
||||
let result;
|
||||
|
||||
const index = manifests.findIndex((element) => {
|
||||
return element.id === package_id;
|
||||
});
|
||||
manifests.splice(index, 1);
|
||||
|
||||
try {
|
||||
setBusy(true);
|
||||
result = await api.deleteManifest(package_id, token);
|
||||
if (result.error)
|
||||
throw new Error(`Delete manifest error. ${result.message}`);
|
||||
|
||||
const index = manifests.findIndex((element) => {
|
||||
return element.id === package_id;
|
||||
});
|
||||
manifests.splice(index, 1);
|
||||
} finally {
|
||||
setBusy(false);
|
||||
}
|
||||
|
||||
@@ -44,8 +44,17 @@ let carUpdateLog = {
|
||||
created: "2021-08-23T17:06:38.030052Z",
|
||||
updated: "2021-08-23T17:06:38.030052Z",
|
||||
},
|
||||
{
|
||||
id: 88,
|
||||
carupdate_id: 284,
|
||||
status: "install_approval_await",
|
||||
error_code: 0,
|
||||
info: "TEST",
|
||||
created: "2021-08-23T17:06:38.030052Z",
|
||||
updated: "2021-08-23T17:06:38.030052Z",
|
||||
},
|
||||
],
|
||||
total: 2,
|
||||
total: 3,
|
||||
};
|
||||
|
||||
export const CarUpdatesProvider = ({ children }) => {
|
||||
@@ -64,4 +73,5 @@ export const useCarUpdatesContext = () => ({
|
||||
getVINUpdates: jest.fn(() => carUpdates),
|
||||
startMonitor: jest.fn(),
|
||||
stopMonitor: jest.fn(),
|
||||
approveUpdate: jest.fn(),
|
||||
});
|
||||
|
||||
@@ -7,13 +7,8 @@ let ecus = [
|
||||
{
|
||||
data_id: 0,
|
||||
name: "AGS",
|
||||
part_number: "",
|
||||
version: "",
|
||||
serial_number: "",
|
||||
hw_version: "",
|
||||
vendor: "",
|
||||
configuration: "",
|
||||
fingerprint: "",
|
||||
manifest_id: 0,
|
||||
files: [
|
||||
{
|
||||
@@ -21,6 +16,8 @@ let ecus = [
|
||||
order: 0,
|
||||
offset: "0",
|
||||
checksum: "",
|
||||
self_download: false,
|
||||
mode: "D",
|
||||
type: 1,
|
||||
},
|
||||
],
|
||||
|
||||
@@ -31,28 +31,19 @@ export const useVehicleContext = () => ({
|
||||
return {
|
||||
data: [
|
||||
{
|
||||
boot_loader_version: "BLVERSION",
|
||||
config: "CONFIG",
|
||||
created: "2021-07-14T20:09:40.98187Z",
|
||||
ecu: "ECUA",
|
||||
fingerprint: "FINGERPRINT",
|
||||
hw_version: "HWVERSION",
|
||||
serial_number: "SERIAL",
|
||||
sw_version: "SWVERSION",
|
||||
updated: "2021-07-14T20:09:40.98187Z",
|
||||
vendor: "VENDOR",
|
||||
},
|
||||
{
|
||||
boot_loader_version: "BLVERSION",
|
||||
config: "CONFIG",
|
||||
created: "2021-07-14T20:09:40.98187Z",
|
||||
ecu: "ECUB",
|
||||
fingerprint: "FINGERPRINT",
|
||||
hw_version: "HWVERSION",
|
||||
serial_number: "SERIAL",
|
||||
sw_version: "SWVERSION",
|
||||
updated: "2021-07-14T20:09:40.98187Z",
|
||||
vendor: "VENDOR",
|
||||
},
|
||||
],
|
||||
total: 2,
|
||||
|
||||
Reference in New Issue
Block a user