From 83edadda2b559f8009c724f6b47189d54955af7e Mon Sep 17 00:00:00 2001 From: Alexandre Alves <97888974+aalves08@users.noreply.github.com> Date: Thu, 9 Jun 2022 10:12:06 +0100 Subject: [PATCH] Multiple issues in Fleet (Dashboard and gitRepo Graph views) (#6008) * add check for missing props so that ui doesnt break + add missing state definition * Fix extra space. * Fix spacing. Co-authored-by: Alexandre Alves Co-authored-by: Shavindra --- shell/models/fleet.cattle.io.bundle.js | 2 +- shell/pages/c/_cluster/fleet/GitRepoGraphConfig.js | 2 +- shell/plugins/dashboard-store/resource-class.js | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/shell/models/fleet.cattle.io.bundle.js b/shell/models/fleet.cattle.io.bundle.js index 79810f29f3..96d7560a39 100644 --- a/shell/models/fleet.cattle.io.bundle.js +++ b/shell/models/fleet.cattle.io.bundle.js @@ -91,7 +91,7 @@ export default class FleetBundle extends SteveModel { } get stateObj() { - const errorState = this.status.conditions.find((item) => { + const errorState = this.status?.conditions?.find((item) => { const { error, message } = item; const errState = !!error; diff --git a/shell/pages/c/_cluster/fleet/GitRepoGraphConfig.js b/shell/pages/c/_cluster/fleet/GitRepoGraphConfig.js index e692bb8dd0..55d093a317 100644 --- a/shell/pages/c/_cluster/fleet/GitRepoGraphConfig.js +++ b/shell/pages/c/_cluster/fleet/GitRepoGraphConfig.js @@ -65,7 +65,7 @@ export const gitRepoGraphConfig = { bds.forEach((bd) => { const bdLowercaseState = bd.state ? bd.state.toLowerCase() : 'unknown'; - const bdStateColor = STATES[bdLowercaseState].color; + const bdStateColor = STATES[bdLowercaseState]?.color; const cluster = data.clustersList.find((cluster) => { const clusterString = `${ cluster.namespace }-${ cluster.name }`; diff --git a/shell/plugins/dashboard-store/resource-class.js b/shell/plugins/dashboard-store/resource-class.js index cf913d16f2..b22d096095 100644 --- a/shell/plugins/dashboard-store/resource-class.js +++ b/shell/plugins/dashboard-store/resource-class.js @@ -89,6 +89,7 @@ export const STATES_ENUM = { DEGRADED: 'degraded', DENIED: 'denied', DEPLOYED: 'deployed', + DEPLOYING: 'deploying', DISABLED: 'disabled', DISCONNECTED: 'disconnected', DRAINED: 'drained', @@ -428,6 +429,9 @@ export const STATES = { [STATES_ENUM.WARNING]: { color: 'warning', icon: 'error', label: 'Warning', compoundIcon: 'warning' }, + [STATES_ENUM.DEPLOYING]: { + color: 'info', icon: 'info', label: 'Deploying', compoundIcon: 'info' + }, }; export function getStatesByType(type = 'info') {