Skip to content

Commit

Permalink
fix(editor): menu UI fixes (no-changelog) (#4316)
Browse files Browse the repository at this point in the history
* N8N-4964-menu-fixes

* 👌 Addressing PR review comments
  • Loading branch information
MiloradFilipovic authored Oct 11, 2022
1 parent a82fd3f commit 51e8f5f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
12 changes: 8 additions & 4 deletions packages/design-system/src/components/N8nMenuItem/MenuItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,12 @@ export default Vue.extend({
.submenu {
background: none !important;
:global(.el-submenu__title) {
display: flex;
align-items: center;
border-radius: var(--border-radius-base);
border-radius: var(--border-radius-base) !important;
padding: var(--spacing-2xs) var(--spacing-xs) !important;
user-select: none;
Expand Down Expand Up @@ -205,9 +207,11 @@ export default Vue.extend({
}
.active {
background-color: var(--color-foreground-base);
border-radius: var(--border-radius-base);
.icon { color: var(--color-text-dark) }
&, & :global(.el-submenu__title) {
background-color: var(--color-foreground-base);
border-radius: var(--border-radius-base);
.icon { color: var(--color-text-dark) }
}
}
.menuItem {
Expand Down
7 changes: 4 additions & 3 deletions packages/editor-ui/src/components/MainSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ import {
} from '@/constants';
import { userHelpers } from './mixins/userHelpers';
import { debounceHelper } from './mixins/debounce';
import Vue from 'vue';
export default mixins(
genericHelpers,
Expand Down Expand Up @@ -160,7 +161,6 @@ export default mixins(
// @ts-ignore
label: item.properties ? item.properties.title : '',
position: item.position,
activateOnRouteNames: [ VIEWS.TEMPLATES ],
type: item.properties?.href ? 'link' : 'regular',
properties: item.properties,
} as IMenuItem,
Expand Down Expand Up @@ -277,15 +277,16 @@ export default mixins(
return [ ...items, ...regularItems ];
},
},
mounted() {
this.fullyExpanded = !this.isCollapsed;
async mounted() {
if (this.$refs.user) {
this.$externalHooks().run('mainSidebar.mounted', { userRef: this.$refs.user });
}
if (window.innerWidth > 900 && !this.isNodeView) {
this.$store.commit('ui/expandSidebarMenu');
}
this.checkWidthAndAdjustSidebar(window.innerWidth);
await Vue.nextTick();
this.fullyExpanded = !this.isCollapsed;
},
created() {
window.addEventListener("resize", this.onResize);
Expand Down

0 comments on commit 51e8f5f

Please sign in to comment.