From 662092c86ad02b98099dc229405d8b2278a89bc4 Mon Sep 17 00:00:00 2001 From: Lyubov Voloshko Date: Tue, 24 Feb 2026 15:05:07 +0000 Subject: [PATCH 1/2] tables list: forbid drag-n-drop to non-admins --- .../db-tables-list/db-tables-list.component.html | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/frontend/src/app/components/dashboard/db-tables-list/db-tables-list.component.html b/frontend/src/app/components/dashboard/db-tables-list/db-tables-list.component.html index 161541582..1bfddd5ea 100644 --- a/frontend/src/app/components/dashboard/db-tables-list/db-tables-list.component.html +++ b/frontend/src/app/components/dashboard/db-tables-list/db-tables-list.component.html @@ -95,10 +95,10 @@
+ [class.drag-over]="accessLevel === 'edit' && dragOverFolder !== 'all-tables-kitten' && dragOverFolder === folder.id" + (dragover)="accessLevel === 'edit' && onFolderDragOver($event, folder.id)" + (dragleave)="accessLevel === 'edit' && onFolderDragLeave($event, folder.id)" + (drop)="accessLevel === 'edit' && onFolderDrop($event, folder)">
@@ -156,9 +156,9 @@ routerLink="/dashboard/{{connectionID}}/{{table.table}}" [queryParams]="{page_index: 0, page_size: 30}" [ngClass]="{'table-link_active': selectedTable === table.table}" - [draggable]="true" - (dragstart)="onTableDragStart($event, table)" - (dragend)="onTableDragEnd($event)" + [draggable]="accessLevel === 'edit'" + (dragstart)="accessLevel === 'edit' && onTableDragStart($event, table)" + (dragend)="accessLevel === 'edit' && onTableDragEnd($event)" (click)="closeSidebar()"> {{getTableName(table)}} From 57eaaae62b6c4ff4994f98a2d431d36b7a88293d Mon Sep 17 00:00:00 2001 From: Lyubov Voloshko Date: Tue, 24 Feb 2026 15:24:44 +0000 Subject: [PATCH 2/2] tables list: fix hasCustomFolders; show All tables folder open and hide toggle if no custom folders --- .../db-tables-list.component.html | 3 +- .../db-tables-list.component.ts | 34 +++++++++++-------- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/frontend/src/app/components/dashboard/db-tables-list/db-tables-list.component.html b/frontend/src/app/components/dashboard/db-tables-list/db-tables-list.component.html index 1bfddd5ea..c3d3768a3 100644 --- a/frontend/src/app/components/dashboard/db-tables-list/db-tables-list.component.html +++ b/frontend/src/app/components/dashboard/db-tables-list/db-tables-list.component.html @@ -124,7 +124,8 @@ - + chevron_right diff --git a/frontend/src/app/components/dashboard/db-tables-list/db-tables-list.component.ts b/frontend/src/app/components/dashboard/db-tables-list/db-tables-list.component.ts index df2cb1818..467ca4e72 100644 --- a/frontend/src/app/components/dashboard/db-tables-list/db-tables-list.component.ts +++ b/frontend/src/app/components/dashboard/db-tables-list/db-tables-list.component.ts @@ -143,6 +143,14 @@ export class DbTablesListComponent implements OnInit, OnChanges { }); } + // If no custom folders exist, always keep "All tables" expanded + if (!this.hasCustomFolders()) { + const allTablesFolder = this.folders.find(folder => folder.id === 'all-tables-kitten'); + if (allTablesFolder) { + allTablesFolder.expanded = true; + } + } + console.log('ngOnInit - showCollapsedTableList initialized to:', this.showCollapsedTableList); } @@ -234,6 +242,10 @@ export class DbTablesListComponent implements OnInit, OnChanges { toggleFolder(folderId: string) { const folder = this.folders.find (f => f.id === folderId); if (folder) { + // Prevent collapsing "All tables" when no custom folders exist + if (folder.id === 'all-tables-kitten' && folder.expanded && !this.hasCustomFolders()) { + return; + } folder.expanded = !folder.expanded; const expandedFolders = this.folders.filter(f => f.expanded).map(f => f.id); this._uiSettingsService.updateConnectionSetting(this.connectionID, 'tableFoldersExpanded', expandedFolders); @@ -443,8 +455,8 @@ export class DbTablesListComponent implements OnInit, OnChanges { } hasCustomFolders(): boolean { - // Check if there are folders other than "All Tables" - return this.folders.some(folder => folder.name !== 'All Tables'); + // Check if there are folders other than "All tables" + return this.folders.some(folder => folder.id !== 'all-tables-kitten'); } private preserveFolderStates() { @@ -453,12 +465,9 @@ export class DbTablesListComponent implements OnInit, OnChanges { this.preservedFolderStates[folder.id] = folder.expanded; }); - // Check if there are only "All Tables" folder (no custom folders) - const hasCustomFolders = this.folders.some(folder => folder.name !== 'All Tables'); - - // If no custom folders exist, ensure "All Tables" is always expanded - if (!hasCustomFolders) { - const allTablesFolder = this.folders.find(folder => folder.name === 'All Tables'); + // If no custom folders exist, ensure "All tables" is always expanded + if (!this.hasCustomFolders()) { + const allTablesFolder = this.folders.find(folder => folder.id === 'all-tables-kitten'); if (allTablesFolder) { this.preservedFolderStates[allTablesFolder.id] = true; this.preservedActiveFolder = allTablesFolder.id; @@ -471,12 +480,9 @@ export class DbTablesListComponent implements OnInit, OnChanges { } private restoreFolderStates() { - // Check if there are only "All Tables" folder (no custom folders) - const hasCustomFolders = this.folders.some(folder => folder.name !== 'All Tables'); - - // If no custom folders exist, always expand "All Tables" - if (!hasCustomFolders) { - const allTablesFolder = this.folders.find(folder => folder.name === 'All Tables'); + // If no custom folders exist, always expand "All tables" + if (!this.hasCustomFolders()) { + const allTablesFolder = this.folders.find(folder => folder.id === 'all-tables-kitten'); if (allTablesFolder) { allTablesFolder.expanded = true; this.currentCollapsedFolder = allTablesFolder;