mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
ci: Ensure that eslint runs on all frontend code (no-changelog) (#4602)
* ensure that eslint runs on all frontend code * remove tslint from `design-system` * enable prettier and eslint-prettier for `design-system` * Delete tslint.json * use a single editorconfig for the repo * enable prettier for all code in `design-system` * more linting fixes on design-system * ignore coverage for git and prettier * lintfix on editor-ui
This commit is contained in:
committed by
GitHub
parent
d96d6f11db
commit
13659d036f
@@ -6,14 +6,19 @@
|
||||
:class="{
|
||||
[$style.submenu]: true,
|
||||
[$style.compact]: compact,
|
||||
[$style.active]: mode === 'router' && isItemActive(item)
|
||||
[$style.active]: mode === 'router' && isItemActive(item),
|
||||
}"
|
||||
:index="item.id"
|
||||
popper-append-to-body
|
||||
:popper-class="`${$style.submenuPopper} ${popperClass}`"
|
||||
>
|
||||
<template slot="title">
|
||||
<n8n-icon v-if="item.icon" :class="$style.icon" :icon="item.icon" :size="item.customIconSize || 'large'" />
|
||||
<n8n-icon
|
||||
v-if="item.icon"
|
||||
:class="$style.icon"
|
||||
:icon="item.icon"
|
||||
:size="item.customIconSize || 'large'"
|
||||
/>
|
||||
<span :class="$style.label">{{ item.label }}</span>
|
||||
</template>
|
||||
<el-menu-item
|
||||
@@ -32,7 +37,13 @@
|
||||
<span :class="$style.label">{{ child.label }}</span>
|
||||
</el-menu-item>
|
||||
</el-submenu>
|
||||
<n8n-tooltip v-else placement="right" :content="item.label" :disabled="!compact" :open-delay="tooltipDelay">
|
||||
<n8n-tooltip
|
||||
v-else
|
||||
placement="right"
|
||||
:content="item.label"
|
||||
:disabled="!compact"
|
||||
:open-delay="tooltipDelay"
|
||||
>
|
||||
<el-menu-item
|
||||
:id="item.id"
|
||||
:class="{
|
||||
@@ -40,12 +51,17 @@
|
||||
[$style.item]: true,
|
||||
[$style.disableActiveStyle]: !isItemActive(item),
|
||||
[$style.active]: isItemActive(item),
|
||||
[$style.compact]: compact
|
||||
[$style.compact]: compact,
|
||||
}"
|
||||
:index="item.id"
|
||||
@click="onItemClick(item)"
|
||||
>
|
||||
<n8n-icon v-if="item.icon" :class="$style.icon" :icon="item.icon" :size="item.customIconSize || 'large'" />
|
||||
<n8n-icon
|
||||
v-if="item.icon"
|
||||
:class="$style.icon"
|
||||
:icon="item.icon"
|
||||
:size="item.customIconSize || 'large'"
|
||||
/>
|
||||
<span :class="$style.label">{{ item.label }}</span>
|
||||
</el-menu-item>
|
||||
</n8n-tooltip>
|
||||
@@ -58,8 +74,7 @@ import ElMenuItem from 'element-ui/lib/menu-item';
|
||||
import N8nTooltip from '../N8nTooltip';
|
||||
import N8nIcon from '../N8nIcon';
|
||||
import { IMenuItem } from '../../types';
|
||||
import Vue from 'vue';
|
||||
import { Route } from 'vue-router';
|
||||
import Vue, { PropType } from 'vue';
|
||||
|
||||
export default Vue.extend({
|
||||
name: 'n8n-menu-item',
|
||||
@@ -71,7 +86,7 @@ export default Vue.extend({
|
||||
},
|
||||
props: {
|
||||
item: {
|
||||
type: Object as () => IMenuItem,
|
||||
type: Object as PropType<IMenuItem>,
|
||||
required: true,
|
||||
},
|
||||
compact: {
|
||||
@@ -97,21 +112,30 @@ export default Vue.extend({
|
||||
},
|
||||
computed: {
|
||||
availableChildren(): IMenuItem[] {
|
||||
return Array.isArray(this.item.children) ? this.item.children.filter(child => child.available !== false) : [];
|
||||
return Array.isArray(this.item.children)
|
||||
? this.item.children.filter((child) => child.available !== false)
|
||||
: [];
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
isItemActive(item: IMenuItem): boolean {
|
||||
const isItemActive = this.isActive(item);
|
||||
const hasActiveChild = Array.isArray(item.children) && item.children.some(child => this.isActive(child));
|
||||
const hasActiveChild =
|
||||
Array.isArray(item.children) && item.children.some((child) => this.isActive(child));
|
||||
return isItemActive || hasActiveChild;
|
||||
},
|
||||
isActive(item: IMenuItem): boolean {
|
||||
if (this.mode === 'router') {
|
||||
if (item.activateOnRoutePaths) {
|
||||
return Array.isArray(item.activateOnRoutePaths) && item.activateOnRoutePaths.includes(this.$route.path);
|
||||
return (
|
||||
Array.isArray(item.activateOnRoutePaths) &&
|
||||
item.activateOnRoutePaths.includes(this.$route.path)
|
||||
);
|
||||
} else if (item.activateOnRouteNames) {
|
||||
return Array.isArray(item.activateOnRouteNames) && item.activateOnRouteNames.includes(this.$route.name || '');
|
||||
return (
|
||||
Array.isArray(item.activateOnRouteNames) &&
|
||||
item.activateOnRouteNames.includes(this.$route.name ?? '')
|
||||
);
|
||||
}
|
||||
return false;
|
||||
} else {
|
||||
@@ -127,22 +151,20 @@ export default Vue.extend({
|
||||
|
||||
if (item.properties.newWindow) {
|
||||
window.open(href);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
window.location.assign(item.properties.href);
|
||||
}
|
||||
|
||||
}
|
||||
this.$emit('click', event, item.id);
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<style module lang="scss">
|
||||
// Element menu-item overrides
|
||||
:global(.el-menu-item), :global(.el-submenu__title) {
|
||||
:global(.el-menu-item),
|
||||
:global(.el-submenu__title) {
|
||||
--menu-font-color: var(--color-text-base);
|
||||
--menu-item-active-background-color: var(--color-foreground-base);
|
||||
--menu-item-active-font-color: var(--color-text-dark);
|
||||
@@ -152,7 +174,6 @@ export default Vue.extend({
|
||||
--submenu-item-height: 27px;
|
||||
}
|
||||
|
||||
|
||||
.submenu {
|
||||
background: none !important;
|
||||
|
||||
@@ -177,7 +198,9 @@ export default Vue.extend({
|
||||
}
|
||||
|
||||
&:hover {
|
||||
.icon { color: var(--color-text-dark) }
|
||||
.icon {
|
||||
color: var(--color-text-dark);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,9 +212,11 @@ export default Vue.extend({
|
||||
user-select: none;
|
||||
|
||||
&:hover {
|
||||
.icon { color: var(--color-text-dark) }
|
||||
.icon {
|
||||
color: var(--color-text-dark);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
.disableActiveStyle {
|
||||
@@ -214,10 +239,13 @@ export default Vue.extend({
|
||||
}
|
||||
|
||||
.active {
|
||||
&, & :global(.el-submenu__title) {
|
||||
&,
|
||||
& :global(.el-submenu__title) {
|
||||
background-color: var(--color-foreground-base);
|
||||
border-radius: var(--border-radius-base);
|
||||
.icon { color: var(--color-text-dark) }
|
||||
.icon {
|
||||
color: var(--color-text-dark);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user