From 3e115832833cb4e9915afd89568178928e01171c Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 28 Apr 2025 15:01:07 +0200 Subject: [PATCH] 491 [FEAT] Allow disks to be hidden/archived - Fix mock device type definition mismatch in the frontend. - Make DeviceModel archived field optional. --- .../src/app/core/models/device-model.ts | 2 +- .../src/app/data/mock/device/details/sda.ts | 3 ++- .../src/app/data/mock/summary/data.ts | 21 ++++++++++++------- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/webapp/frontend/src/app/core/models/device-model.ts b/webapp/frontend/src/app/core/models/device-model.ts index c07d61a..bddb776 100644 --- a/webapp/frontend/src/app/core/models/device-model.ts +++ b/webapp/frontend/src/app/core/models/device-model.ts @@ -1,6 +1,6 @@ // maps to webapp/backend/pkg/models/device.go export interface DeviceModel { - archived: boolean; + archived?: boolean; wwn: string; device_name?: string; device_uuid?: string; diff --git a/webapp/frontend/src/app/data/mock/device/details/sda.ts b/webapp/frontend/src/app/data/mock/device/details/sda.ts index 6406e5a..b0b0d4d 100644 --- a/webapp/frontend/src/app/data/mock/device/details/sda.ts +++ b/webapp/frontend/src/app/data/mock/device/details/sda.ts @@ -20,7 +20,8 @@ export const sda = { 'device_type': '', 'label': '', 'host_id': '', - 'device_status': 0 + 'device_status': 0, + 'archived': false }, 'smart_results': [{ 'date': '2021-10-24T23:20:44Z', diff --git a/webapp/frontend/src/app/data/mock/summary/data.ts b/webapp/frontend/src/app/data/mock/summary/data.ts index 8530a8d..5156f9e 100644 --- a/webapp/frontend/src/app/data/mock/summary/data.ts +++ b/webapp/frontend/src/app/data/mock/summary/data.ts @@ -28,7 +28,8 @@ export const summary = { 'device_type': '', 'label': '', 'host_id': '', - 'device_status': 0 + 'device_status': 0, + 'archived': false } }, '0x5000cca252c859cc': { @@ -55,7 +56,8 @@ export const summary = { 'device_type': '', 'label': '', 'host_id': '', - 'device_status': 0 + 'device_status': 0, + 'archived': false }, 'smart': { 'collector_date': '2020-08-21T22:27:02Z', @@ -91,7 +93,8 @@ export const summary = { 'device_type': '', 'label': '', 'host_id': '', - 'device_status': 0 + 'device_status': 0, + 'archived': false }, 'smart': { 'collector_date': '2020-06-21T00:03:30Z', @@ -127,7 +130,8 @@ export const summary = { 'device_type': '', 'label': '', 'host_id': '', - 'device_status': 0 + 'device_status': 0, + 'archived': false } }, '0x5000cca264ec3183': { @@ -154,7 +158,8 @@ export const summary = { 'device_type': '', 'label': '', 'host_id': 'custom host id', - 'device_status': 1 + 'device_status': 1, + 'archived': false }, 'smart': { 'collector_date': '2020-09-13T16:29:23Z', @@ -574,7 +579,8 @@ export const summary = { 'device_type': '', 'label': '', 'host_id': '', - 'device_status': 0 + 'device_status': 0, + 'archived': false } }, '0x5002538e40a22954': { @@ -601,7 +607,8 @@ export const summary = { 'device_type': '', 'label': '', 'host_id': '', - 'device_status': 0 + 'device_status': 0, + 'archived': false }, 'smart': { 'collector_date': '2020-06-10T12:01:02Z',