chore: lint

This commit is contained in:
Ramesh Mane
2026-03-04 14:42:39 +00:00
parent 06b453baa8
commit 6cd7ff50ae
14 changed files with 70 additions and 91 deletions

View File

@@ -249,13 +249,7 @@ useEventListener(document, 'keydown', async (e: KeyboardEvent) => {
</script>
<template>
<nav
ref="dockRef"
class="nc-dock"
data-testid="nc-mini-sidebar-v2-dock"
@mousemove="onMouseMove"
@mouseleave="onMouseLeave"
>
<nav ref="dockRef" class="nc-dock" data-testid="nc-mini-sidebar-v2-dock" @mousemove="onMouseMove" @mouseleave="onMouseLeave">
<!-- Logo -->
<DashboardMiniSidebarV2DockItem
:ref="(el: any) => setItemRef('logo', el)"
@@ -324,11 +318,11 @@ useEventListener(document, 'keydown', async (e: KeyboardEvent) => {
<DashboardMiniSidebarV2DockItem
v-if="isThemeEnabled"
:ref="(el: any) => setItemRef('theme', el)"
v-e="['c:nocodb:theme']"
:label="selectedTheme === 'light' ? 'Light' : selectedTheme === 'dark' ? 'Dark' : 'System'"
panel-key="theme"
data-testid="nc-sidebar-theme"
:scale="getScale('theme')"
v-e="['c:nocodb:theme']"
@click="toggleTheme"
>
<GeneralIcon :icon="themeIcon" class="nc-dock-item-icon" />
@@ -348,20 +342,12 @@ useEventListener(document, 'keydown', async (e: KeyboardEvent) => {
<div class="nc-dock-separator" />
<div
:ref="(el: any) => setItemRef('create', el)"
class="nc-dock-magnify-wrapper"
:style="getMagnifyStyle('create')"
>
<div :ref="(el: any) => setItemRef('create', el)" class="nc-dock-magnify-wrapper" :style="getMagnifyStyle('create')">
<DashboardMiniSidebarCreateNewActionMenu />
</div>
<!-- User Avatar -->
<div
:ref="(el: any) => setItemRef('user', el)"
class="nc-dock-magnify-wrapper"
:style="getMagnifyStyle('user')"
>
<div :ref="(el: any) => setItemRef('user', el)" class="nc-dock-magnify-wrapper" :style="getMagnifyStyle('user')">
<DashboardSidebarUserInfo />
</div>

View File

@@ -35,9 +35,9 @@ const dynamicMargin = computed(() => {
})
const itemStyle = computed(() => ({
'transform': `scale(${props.scale})`,
'marginTop': `${dynamicMargin.value}px`,
'marginBottom': `${dynamicMargin.value}px`,
transform: `scale(${props.scale})`,
marginTop: `${dynamicMargin.value}px`,
marginBottom: `${dynamicMargin.value}px`,
}))
</script>

View File

@@ -61,18 +61,13 @@ const toggleChatSupport = () => {
window.$chatwoot.toggle(toggleText)
}
const activePanel = ref('agents')
const isBaseOpen = computed(() => {
return route.value.name?.toString().startsWith('index-typeOrId-baseId-')
})
const isWsAdminRoute = computed(() => route.value.name === 'index-typeOrId-settings-page')
// Resolve a base for icon display when not on a base route (e.g. ws-admin)
const resolvedProject = computed(() => {
if (openedProject.value) return openedProject.value
if (!isWsAdminRoute.value) return undefined
const lastVisitedBaseId = ncLastVisitedBase().get()
return basesList.value?.find((b) => b.id === lastVisitedBaseId) || basesList.value?.[0]
@@ -84,18 +79,8 @@ const baseIconColor = computed(() => {
return meta.iconColor
})
const showBaseIcon = computed(() => (isBaseOpen.value && openedProject.value) || (isWsAdminRoute.value && resolvedProject.value))
const isBaseListModalOpen = ref(false)
const miniSidebarTabs = computed(() => [
{ key: 'data' as const, icon: 'ncTableOutline', activeIcon: 'ncTableFilled', label: 'Data' },
{ key: 'automations' as const, icon: 'ncAutomation', activeIcon: 'ncAutomationsFilled', label: 'Automate' },
// { key: 'agents' as const, icon: 'ncSupportAgent', activeIcon: 'ncSupportAgent', label: 'Agents' },
])
const { isUIAllowed } = useRoles()
const navigateToProjectPage = () => {
if (route.value.name?.toString().startsWith('index-typeOrId-baseId-')) {
return
@@ -205,19 +190,18 @@ const mainItems = computed<NavItem[]>(() => [
])
// ── Bottom items (pushed down by margin-top: auto) ──
const bottomItems: NavItem[] = [{ key: 'support', icon: 'ncSupportAgent', label: 'Support', onClick: () => toggleChatSupport() }]
const onItemClick = (panel: string) => {
activePanel.value = panel
emits('switch-panel', panel)
}
const bottomItems: NavItem[] = [
isChatWootEnabled.value
? { key: 'support', icon: 'ncSupportAgent', label: 'Support', onClick: () => toggleChatSupport() }
: null,
].filter(Boolean) as NavItem[]
</script>
<template>
<nav class="nc-rail" data-testid="nc-mini-sidebar-v2-rail">
<!-- Logo -->
<div class="nc-rail-logo" title="Home" data-testid="nc-mini-sidebar-v2-logo" @click="isBaseListModalOpen = true">
<GeneralProjectIcon class="!h-7 !w-7" />
<GeneralProjectIcon class="!h-7 !w-7" :color="baseIconColor" />
</div>
<div class="nc-rail-divider" />
@@ -277,11 +261,11 @@ const onItemClick = (panel: string) => {
<!-- Theme toggle -->
<DashboardMiniSidebarV2RailItem
v-if="isThemeEnabled"
v-e="['c:nocodb:theme']"
:label="selectedTheme === 'light' ? 'Light' : selectedTheme === 'dark' ? 'Dark' : 'System'"
:disable-tooltip="true"
panel-key="theme"
data-testid="nc-sidebar-theme"
v-e="['c:nocodb:theme']"
@click="toggleTheme"
>
<template #icon>

View File

@@ -7,11 +7,7 @@ const isDockMode = computed(() => !isRail.value)
</script>
<template>
<NcDropdown
v-model:visible="isMenuOpen"
placement="topLeft"
overlay-class-name="!min-w-60 !left-1"
>
<NcDropdown v-model:visible="isMenuOpen" placement="topLeft" overlay-class-name="!min-w-60 !left-1">
<div class="nc-rail-avatar" :class="{ active: isMenuOpen }" title="Account">
<img src="https://i.pravatar.cc/64?u=gilfoyle" alt="BG" />
</div>