Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.9.7] - Backport fix for the badge background color issue #13130

Draft
wants to merge 1 commit into
base: release-2.9
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion shell/components/ClusterIconMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default {
},

customColor() {
return !this.cluster.removePreviewColor && this.cluster.badge?.iconText ? this.cluster.badge?.color : '';
return this.cluster.iconColor || '';
},
},

Expand Down
1 change: 1 addition & 0 deletions shell/components/nav/TopLevelMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ export default {
osLogo: mgmtCluster.providerOsLogo,
providerNavLogo: mgmtCluster.providerMenuLogo,
badge: mgmtCluster.badge,
iconColor: mgmtCluster.iconColor,
isLocal: mgmtCluster.isLocal,
isHarvester: mgmtCluster.isHarvester,
pinned: mgmtCluster.pinned,
Expand Down
7 changes: 6 additions & 1 deletion shell/models/management.cattle.io.cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,11 @@ export default class MgmtCluster extends SteveModel {
return this.providerLogo;
}

// Color to use as the underline for the icon in the app bar
get iconColor() {
return this.metadata?.annotations[CLUSTER_BADGE.COLOR];
}

// Custom badge to show for the Cluster (if the appropriate annotations are set)
get badge() {
const icon = this.metadata?.annotations?.[CLUSTER_BADGE.ICON_TEXT];
Expand All @@ -305,7 +310,7 @@ export default class MgmtCluster extends SteveModel {
return undefined;
}

let color = this.metadata?.annotations[CLUSTER_BADGE.COLOR] || DEFAULT_BADGE_COLOR;
let color = this.iconColor || DEFAULT_BADGE_COLOR;
const iconText = this.metadata?.annotations[CLUSTER_BADGE.ICON_TEXT] || '';
let foregroundColor;

Expand Down
Loading