Skip to content

Conversation

@gugu
Copy link
Contributor

@gugu gugu commented Dec 12, 2025

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements fixes for SaaS mode configuration and mobile responsiveness. The changes disable SaaS mode in the dev environment and add conditional rendering throughout the UI to show/hide SaaS-specific features accordingly. Additionally, it introduces a table folder/category grouping feature in the table switcher and adds mobile-friendly UI adjustments for the saved filters panel.

Key changes:

  • Disabled SaaS mode in development environment configuration
  • Wrapped SaaS-specific UI elements (Google/GitHub login, SSO, registration) with isSaas conditionals
  • Added table folder/category grouping in the table switcher dropdown
  • Implemented mobile-responsive design for filter panels with collapsible comparator selectors

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
frontend/src/environments/environment.dev.ts Changed saas flag from true to false to disable SaaS features in dev environment
frontend/src/app/components/login/login.component.ts Wrapped Google login initialization in isSaas conditional check
frontend/src/app/components/login/login.component.html Added isSaas checks to conditionally render Google login, GitHub login, divider, and SSO buttons
frontend/src/app/components/dashboard/db-table-view/saved-filters-panel/saved-filters-panel.component.html Added mobile-friendly comparator text display for text and number filters
frontend/src/app/components/dashboard/db-table-view/saved-filters-panel/saved-filters-panel.component.css Added responsive CSS media queries for mobile devices (≤600px) to hide dropdown selectors and show text labels
frontend/src/app/components/dashboard/db-table-view/db-table-view.component.ts Added Folder interface, folder-related methods, and MatSelectModule import; replaced autocomplete with select dropdown
frontend/src/app/components/dashboard/db-table-view/db-table-view.component.html Replaced autocomplete table switcher with mat-select dropdown that supports folder grouping
frontend/src/app/components/dashboard/dashboard.component.ts Added tableFolders property and loadTableFolders() method to fetch and transform table categories
frontend/src/app/components/dashboard/dashboard.component.html Passed tableFolders to the table view component
frontend/src/app/components/company/company.component.html Added isSaas check to custom domain display section
frontend/src/app/app.component.html Added isSaas conditionals to registration and login header links

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

public isAIpanelOpened: boolean = false;

public uiSettings: ConnectionSettingsUI;
public tableFolders: Folder[] = [];
Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The property name tableFolders could be more consistent with the API terminology. Since the backend API endpoint is /table-categories and uses the TableCategory interface, consider renaming to tableCategories to maintain consistency with the domain model throughout the codebase.

Copilot uses AI. Check for mistakes.
Comment on lines +55 to +59
export interface Folder {
id: string;
name: string;
tableIds: string[];
}
Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Folder interface is exported from this component file but is primarily a data model. Consider moving it to a dedicated models file (e.g., src/app/models/folder.ts or alongside TableCategory in src/app/models/connection.ts) to improve code organization and reusability, especially since it's imported by the dashboard component.

Copilot uses AI. Check for mistakes.
Comment on lines +534 to 544
getFolderTables(folder: Folder): TableProperties[] {
return this.tables.filter(table => folder.tableIds.includes(table.table));
}

getUncategorizedTables(): TableProperties[] {
const categorizedTableIds = new Set<string>();
this.folders.forEach(folder => {
folder.tableIds.forEach(id => categorizedTableIds.add(id));
});
return this.tables.filter(table => !categorizedTableIds.has(table.table));
}
Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The getFolderTables and getUncategorizedTables methods should handle the case where this.tables could be undefined or null. Consider adding null checks to prevent potential runtime errors when these properties are not yet initialized.

Copilot uses AI. Check for mistakes.
Comment on lines +526 to 544
switchTable(tableName: string) {
if (tableName && tableName !== this.name) {
this.router.navigate([`/dashboard/${this.connectionID}/${tableName}`], {
queryParams: { page_index: 0, page_size: 30 }
});
}
}

getFolderTables(folder: Folder): TableProperties[] {
return this.tables.filter(table => folder.tableIds.includes(table.table));
}

getUncategorizedTables(): TableProperties[] {
const categorizedTableIds = new Set<string>();
this.folders.forEach(folder => {
folder.tableIds.forEach(id => categorizedTableIds.add(id));
});
return this.tables.filter(table => !categorizedTableIds.has(table.table));
}
Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new methods switchTable, getFolderTables, and getUncategorizedTables lack test coverage. Since the component has a spec file with existing tests, please add tests for these new methods to verify they work correctly with folders and handle edge cases like empty folder arrays or uncategorized tables.

Copilot uses AI. Check for mistakes.
Comment on lines +438 to +456
private loadTableFolders() {
this._connections.getTablesFolders(this.connectionID).subscribe({
next: (categories: TableCategory[]) => {
if (categories && categories.length > 0) {
this.tableFolders = categories.map(cat => ({
id: cat.category_id,
name: cat.category_name,
tableIds: cat.tables
}));
} else {
this.tableFolders = [];
}
},
error: (error) => {
console.error('Error fetching table folders:', error);
this.tableFolders = [];
}
});
}
Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new loadTableFolders method lacks test coverage. Since this component has a spec file with existing tests, please add tests to verify this method correctly handles successful API responses, error scenarios, and empty category arrays.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants