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 <aalves@Alexandres-MacBook-Pro.local>
Co-authored-by: Shavindra <Shavindra@users.noreply.github.com>
This commit is contained in:
Alexandre Alves 2022-06-09 10:12:06 +01:00 committed by GitHub
parent 40c9fa322f
commit 83edadda2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 2 deletions

View File

@ -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;

View File

@ -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 }`;

View File

@ -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') {