mirror of https://github.com/rancher/dashboard.git
Fix app bar overlaps issue (#9685)
* Fixed app bar overlaps issue and active group highlight bug in firefox * Fix group highlight for Cluster Management and other section * Fixed overlap issues in home and other pages * Fixed lint and revert test changes * Added getter for showTopLevelMenu * Added a showTopLevelMenu getter * Fixed lint
This commit is contained in:
parent
2ffe8d3170
commit
d1e8740548
|
|
@ -49,6 +49,10 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
|
isGroupActive() {
|
||||||
|
return this.isOverview || (this.hasActiveRoute() && this.isExpanded && this.showHeader);
|
||||||
|
},
|
||||||
|
|
||||||
hasChildren() {
|
hasChildren() {
|
||||||
return this.group.children?.length > 0;
|
return this.group.children?.length > 0;
|
||||||
},
|
},
|
||||||
|
|
@ -199,7 +203,7 @@ export default {
|
||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
class="accordion"
|
class="accordion"
|
||||||
:class="{[`depth-${depth}`]: true, 'expanded': isExpanded, 'has-children': hasChildren}"
|
:class="{[`depth-${depth}`]: true, 'expanded': isExpanded, 'has-children': hasChildren, 'group-highlight': isGroupActive}"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
v-if="showHeader"
|
v-if="showHeader"
|
||||||
|
|
@ -349,6 +353,10 @@ export default {
|
||||||
> .body {
|
> .body {
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.group-highlight {
|
||||||
|
background: var(--nav-active);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.depth-1 {
|
&.depth-1 {
|
||||||
|
|
@ -380,15 +388,6 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.expanded:has(> .active),
|
|
||||||
&.expanded:has(> ul li.nuxt-link-active) {
|
|
||||||
background: var(--nav-active);
|
|
||||||
}
|
|
||||||
|
|
||||||
&.expanded:has(> ul li.root) {
|
|
||||||
background: transparent;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.body ::v-deep > .child.nuxt-link-active,
|
.body ::v-deep > .child.nuxt-link-active,
|
||||||
|
|
|
||||||
|
|
@ -60,8 +60,8 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters(['clusterReady', 'isExplorer', 'isMultiCluster', 'isRancher', 'currentCluster',
|
...mapGetters(['clusterReady', 'isExplorer', 'isRancher', 'currentCluster',
|
||||||
'currentProduct', 'backToRancherLink', 'backToRancherGlobalLink', 'pageActions', 'isSingleProduct', 'isRancherInHarvester']),
|
'currentProduct', 'backToRancherLink', 'backToRancherGlobalLink', 'pageActions', 'isSingleProduct', 'isRancherInHarvester', 'showTopLevelMenu']),
|
||||||
...mapGetters('type-map', ['activeProducts']),
|
...mapGetters('type-map', ['activeProducts']),
|
||||||
|
|
||||||
appName() {
|
appName() {
|
||||||
|
|
@ -338,7 +338,7 @@ export default {
|
||||||
data-testid="header"
|
data-testid="header"
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
<TopLevelMenu v-if="isRancherInHarvester || isMultiCluster || !isSingleProduct" />
|
<TopLevelMenu v-if="showTopLevelMenu" />
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="menu-spacer"
|
class="menu-spacer"
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ export default {
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['managementReady', 'clusterReady']),
|
...mapState(['managementReady', 'clusterReady']),
|
||||||
...mapGetters(['clusterId', 'currentProduct', 'isRancherInHarvester']),
|
...mapGetters(['clusterId', 'currentProduct', 'isRancherInHarvester', 'showTopLevelMenu']),
|
||||||
|
|
||||||
afterLoginRoute: mapPref(AFTER_LOGIN_ROUTE),
|
afterLoginRoute: mapPref(AFTER_LOGIN_ROUTE),
|
||||||
|
|
||||||
|
|
@ -237,7 +237,7 @@ export default {
|
||||||
<div
|
<div
|
||||||
v-if="managementReady"
|
v-if="managementReady"
|
||||||
class="dashboard-content"
|
class="dashboard-content"
|
||||||
:class="{[pinClass]: true}"
|
:class="{[pinClass]: true, 'dashboard-padding-left': showTopLevelMenu}"
|
||||||
>
|
>
|
||||||
<Header />
|
<Header />
|
||||||
<SideNav
|
<SideNav
|
||||||
|
|
@ -318,12 +318,12 @@ export default {
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
min-height: 0px;
|
min-height: 0px;
|
||||||
|
|
||||||
&:has(.side-menu) {
|
&.dashboard-padding-left {
|
||||||
padding-left: $app-bar-collapsed-width;
|
padding-left: $app-bar-collapsed-width;
|
||||||
|
|
||||||
.overlay-content-mode {
|
.overlay-content-mode {
|
||||||
left: calc(var(--nav-width) + $app-bar-collapsed-width);
|
left: calc(var(--nav-width) + $app-bar-collapsed-width);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&:has(.side-menu) {
|
&:has(.side-menu) {
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import AwsComplianceBanner from '@shell/components/AwsComplianceBanner';
|
||||||
import AzureWarning from '@shell/components/auth/AzureWarning';
|
import AzureWarning from '@shell/components/auth/AzureWarning';
|
||||||
import BrowserTabVisibility from '@shell/mixins/browser-tab-visibility';
|
import BrowserTabVisibility from '@shell/mixins/browser-tab-visibility';
|
||||||
import Inactivity from '@shell/components/Inactivity';
|
import Inactivity from '@shell/components/Inactivity';
|
||||||
import { mapState } from 'vuex';
|
import { mapState, mapGetters } from 'vuex';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
|
|
@ -36,6 +36,7 @@ export default {
|
||||||
computed: {
|
computed: {
|
||||||
themeShortcut: mapPref(THEME_SHORTCUT),
|
themeShortcut: mapPref(THEME_SHORTCUT),
|
||||||
...mapState(['managementReady']),
|
...mapState(['managementReady']),
|
||||||
|
...mapGetters(['showTopLevelMenu']),
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
|
@ -57,7 +58,10 @@ export default {
|
||||||
<AwsComplianceBanner />
|
<AwsComplianceBanner />
|
||||||
<AzureWarning />
|
<AzureWarning />
|
||||||
|
|
||||||
<div class="dashboard-content">
|
<div
|
||||||
|
class="dashboard-content"
|
||||||
|
:class="{'dashboard-padding-left': showTopLevelMenu}"
|
||||||
|
>
|
||||||
<Header
|
<Header
|
||||||
v-if="managementReady"
|
v-if="managementReady"
|
||||||
:simple="true"
|
:simple="true"
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ import AwsComplianceBanner from '@shell/components/AwsComplianceBanner';
|
||||||
import AzureWarning from '@shell/components/auth/AzureWarning';
|
import AzureWarning from '@shell/components/auth/AzureWarning';
|
||||||
import BrowserTabVisibility from '@shell/mixins/browser-tab-visibility';
|
import BrowserTabVisibility from '@shell/mixins/browser-tab-visibility';
|
||||||
import Inactivity from '@shell/components/Inactivity';
|
import Inactivity from '@shell/components/Inactivity';
|
||||||
|
import { mapGetters } from 'vuex';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
|
|
@ -40,7 +41,10 @@ export default {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: { themeShortcut: mapPref(THEME_SHORTCUT) },
|
computed: {
|
||||||
|
themeShortcut: mapPref(THEME_SHORTCUT),
|
||||||
|
...mapGetters(['showTopLevelMenu']),
|
||||||
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
toggleTheme() {
|
toggleTheme() {
|
||||||
|
|
@ -59,7 +63,10 @@ export default {
|
||||||
<AwsComplianceBanner />
|
<AwsComplianceBanner />
|
||||||
<AzureWarning />
|
<AzureWarning />
|
||||||
|
|
||||||
<div class="dashboard-content">
|
<div
|
||||||
|
class="dashboard-content"
|
||||||
|
:class="{'dashboard-padding-left': showTopLevelMenu}"
|
||||||
|
>
|
||||||
<Header :simple="true" />
|
<Header :simple="true" />
|
||||||
<main class="main-layout">
|
<main class="main-layout">
|
||||||
<IndentedPanel class="pt-20">
|
<IndentedPanel class="pt-20">
|
||||||
|
|
|
||||||
|
|
@ -568,6 +568,10 @@ export const getters = {
|
||||||
return getters['isSingleProduct'] && cluster.isHarvester && !getters['isRancherInHarvester'];
|
return getters['isSingleProduct'] && cluster.isHarvester && !getters['isRancherInHarvester'];
|
||||||
},
|
},
|
||||||
|
|
||||||
|
showTopLevelMenu(getters) {
|
||||||
|
return getters['isRancherInHarvester'] || getters['isMultiCluster'] || !getters['isSingleProduct'];
|
||||||
|
},
|
||||||
|
|
||||||
targetRoute(state) {
|
targetRoute(state) {
|
||||||
return state.targetRoute;
|
return state.targetRoute;
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue