auto_awesome
New: AI Configuration
@@ -122,7 +121,6 @@
Rocketadmin can not find any tables
[selection]="selection"
[connectionID]="connectionID"
[isTestConnection]="currentConnectionIsTest"
- [accessLevel]="currentConnectionAccessLevel"
[tableFolders]="tableFolders"
(openFilters)="openTableFilters($event)"
(removeFilter)="removeFilter($event)"
diff --git a/frontend/src/app/components/dashboard/dashboard.component.spec.ts b/frontend/src/app/components/dashboard/dashboard.component.spec.ts
index a9c869990..1f8f135d2 100644
--- a/frontend/src/app/components/dashboard/dashboard.component.spec.ts
+++ b/frontend/src/app/components/dashboard/dashboard.component.spec.ts
@@ -24,6 +24,7 @@ describe('DashboardComponent', () => {
return AccessLevel.None;
},
getTablesFolders: () => of([]),
+ canEditConnection: () => false,
};
const fakeRouter = {
navigate: vi.fn().mockReturnValue(Promise.resolve('')),
diff --git a/frontend/src/app/components/dashboard/dashboard.component.ts b/frontend/src/app/components/dashboard/dashboard.component.ts
index 4179439f3..a2ca9e898 100644
--- a/frontend/src/app/components/dashboard/dashboard.component.ts
+++ b/frontend/src/app/components/dashboard/dashboard.component.ts
@@ -117,6 +117,8 @@ export class DashboardComponent implements OnInit, OnDestroy {
private angulartics2: Angulartics2,
) {}
+ protected canEditConnection = () => this._connections.canEditConnection();
+
get currentConnectionAccessLevel() {
return this._connections.currentConnectionAccessLevel;
}
@@ -166,66 +168,68 @@ export class DashboardComponent implements OnInit, OnDestroy {
getData() {
console.log('getData');
- this._tables.fetchTablesFolders(this.connectionID).subscribe((res) => {
- const tables = res.find((item) => item.category_id === 'all-tables-kitten')?.tables || [];
-
- this.tableFolders = res;
-
- if (tables && tables.length === 0) {
- this.noTablesError = true;
- this.loading = false;
- this.title.setTitle(`No tables | ${this._company.companyTabTitle || 'Rocketadmin'}`);
- } else if (tables) {
- this.formatTableNames();
- this.route.paramMap
- .pipe(
- map((params: ParamMap) => {
- let tableName = params.get('table-name');
- if (tableName) {
- this.selectedTableName = tableName;
- this.setTable(tableName);
- console.log('setTable from getData paramMap');
- this.title.setTitle(
- `${this.selectedTableDisplayName} table | ${this._company.companyTabTitle || 'Rocketadmin'}`,
- );
- this.selection.clear();
- } else {
- if (this.defaultTableToOpen) {
- tableName = this.defaultTableToOpen;
+ this._tables.fetchTablesFolders(this.connectionID).subscribe(
+ (res) => {
+ const tables = res.find((item) => item.category_id === 'all-tables-kitten')?.tables || [];
+
+ this.tableFolders = res;
+
+ if (tables && tables.length === 0) {
+ this.noTablesError = true;
+ this.loading = false;
+ this.title.setTitle(`No tables | ${this._company.companyTabTitle || 'Rocketadmin'}`);
+ } else if (tables) {
+ this.formatTableNames();
+ this.route.paramMap
+ .pipe(
+ map((params: ParamMap) => {
+ let tableName = params.get('table-name');
+ if (tableName) {
+ this.selectedTableName = tableName;
+ this.setTable(tableName);
+ console.log('setTable from getData paramMap');
+ this.title.setTitle(
+ `${this.selectedTableDisplayName} table | ${this._company.companyTabTitle || 'Rocketadmin'}`,
+ );
+ this.selection.clear();
} else {
- tableName = this.allTables[0]?.table;
+ if (this.defaultTableToOpen) {
+ tableName = this.defaultTableToOpen;
+ } else {
+ tableName = this.allTables[0]?.table;
+ }
+ this.router.navigate([`/dashboard/${this.connectionID}/${tableName}`], { replaceUrl: true });
+ this.selectedTableName = tableName;
}
- this.router.navigate([`/dashboard/${this.connectionID}/${tableName}`], { replaceUrl: true });
- this.selectedTableName = tableName;
- }
- }),
- )
- .subscribe();
- this._tableRow.cast.subscribe((arg) => {
- if (arg === 'delete row' && this.selectedTableName) {
- this.setTable(this.selectedTableName);
- console.log('setTable from getData _tableRow cast');
- this.selection.clear();
- }
- });
- this._tables.cast.subscribe((arg) => {
- if ((arg === 'delete rows' || arg === 'import') && this.selectedTableName) {
- this.setTable(this.selectedTableName);
- console.log('setTable from getData _tables cast');
- this.selection.clear();
- }
- if (arg === 'activate actions') {
- this.selection.clear();
- }
- });
- }
- },
- (err) => {
- this.isServerError = true;
- this.serverError = { abstract: err.error?.message || err.message, details: err.error?.originalMessage };
- this.loading = false;
- this.title.setTitle(`Error | ${this._company.companyTabTitle || 'Rocketadmin'}`);
- });
+ }),
+ )
+ .subscribe();
+ this._tableRow.cast.subscribe((arg) => {
+ if (arg === 'delete row' && this.selectedTableName) {
+ this.setTable(this.selectedTableName);
+ console.log('setTable from getData _tableRow cast');
+ this.selection.clear();
+ }
+ });
+ this._tables.cast.subscribe((arg) => {
+ if ((arg === 'delete rows' || arg === 'import') && this.selectedTableName) {
+ this.setTable(this.selectedTableName);
+ console.log('setTable from getData _tables cast');
+ this.selection.clear();
+ }
+ if (arg === 'activate actions') {
+ this.selection.clear();
+ }
+ });
+ }
+ },
+ (err) => {
+ this.isServerError = true;
+ this.serverError = { abstract: err.error?.message || err.message, details: err.error?.originalMessage };
+ this.loading = false;
+ this.title.setTitle(`Error | ${this._company.companyTabTitle || 'Rocketadmin'}`);
+ },
+ );
}
formatTableNames() {
diff --git a/frontend/src/app/components/dashboard/db-table-view/db-table-view.component.html b/frontend/src/app/components/dashboard/db-table-view/db-table-view.component.html
index 299cb757b..0d0e546c8 100644
--- a/frontend/src/app/components/dashboard/db-table-view/db-table-view.component.html
+++ b/frontend/src/app/components/dashboard/db-table-view/db-table-view.component.html
@@ -20,7 +20,7 @@ {{ displayName }}
-
@@ -32,11 +32,11 @@
{{ displayName }}
{{action.title}}
-
Export to CSV
-
Delete
@@ -70,7 +70,7 @@
{{ displayName }}
AI insights
-
{{ displayName }}
Filter