-
-
Notifications
You must be signed in to change notification settings - Fork 18
Fast filters (UI changes) #1533
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
4fd8a84
13b924f
a84e684
747c601
9102f1a
eb5cf78
5b6f9a1
8ef3b9c
eea5ef9
ee531d4
399131d
5ed54a9
e06d62d
8a11aee
9056832
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -4,6 +4,10 @@ import { AgentEntity } from '../agent.entity.js'; | |||||||||||||||||
| import { ConnectionTypeTestEnum } from '@rocketadmin/shared-code/dist/src/shared/enums/connection-types-enum.js'; | ||||||||||||||||||
|
|
||||||||||||||||||
| export const customAgentRepositoryExtension = { | ||||||||||||||||||
| async saveNewAgent(agent: AgentEntity): Promise<AgentEntity> { | ||||||||||||||||||
| return await this.save(agent); | ||||||||||||||||||
| }, | ||||||||||||||||||
|
|
||||||||||||||||||
| async createNewAgentForConnectionAndReturnToken(connection: ConnectionEntity): Promise<string> { | ||||||||||||||||||
| const newAgent = await this.createNewAgentForConnection(connection); | ||||||||||||||||||
| return newAgent.token; | ||||||||||||||||||
|
|
@@ -59,14 +63,8 @@ export const customAgentRepositoryExtension = { | |||||||||||||||||
| return 'IBMDB2-TEST-AGENT-TOKEN'; | ||||||||||||||||||
| case ConnectionTypeTestEnum.agent_mongodb: | ||||||||||||||||||
| return 'MONGODB-TEST-AGENT-TOKEN'; | ||||||||||||||||||
|
||||||||||||||||||
| return 'MONGODB-TEST-AGENT-TOKEN'; | |
| return 'MONGODB-TEST-AGENT-TOKEN'; | |
| case ConnectionTypeTestEnum.agent_clickhouse: | |
| return 'CLICKHOUSE-TEST-AGENT-TOKEN'; | |
| case ConnectionTypeTestEnum.agent_cassandra: | |
| return 'CASSANDRA-TEST-AGENT-TOKEN'; | |
| case ConnectionTypeTestEnum.agent_redis: | |
| return 'REDIS-TEST-AGENT-TOKEN'; |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,4 +1,4 @@ | ||||||||||||||||||
| import { Component, OnInit, Inject, KeyValueDiffers, KeyValueDiffer } from '@angular/core'; | ||||||||||||||||||
| import { Component, OnInit, AfterViewInit, Inject, KeyValueDiffers, KeyValueDiffer } from '@angular/core'; | ||||||||||||||||||
| import { MAT_DIALOG_DATA } from '@angular/material/dialog'; | ||||||||||||||||||
| import { CommonModule } from '@angular/common'; | ||||||||||||||||||
| import { ReactiveFormsModule, FormsModule } from '@angular/forms'; | ||||||||||||||||||
|
|
@@ -16,7 +16,7 @@ import { filterTypes } from 'src/app/consts/filter-types'; | |||||||||||||||||
| import { ActivatedRoute } from '@angular/router'; | ||||||||||||||||||
| import { getComparatorsFromUrl, getFiltersFromUrl } from 'src/app/lib/parse-filter-params'; | ||||||||||||||||||
| import { getTableTypes } from 'src/app/lib/setup-table-row-structure'; | ||||||||||||||||||
| import * as JSON5 from 'json5'; | ||||||||||||||||||
| import JSON5 from 'json5'; | ||||||||||||||||||
| import { map, startWith } from 'rxjs/operators'; | ||||||||||||||||||
| import { Observable, } from 'rxjs'; | ||||||||||||||||||
| import { FormControl } from '@angular/forms'; | ||||||||||||||||||
|
|
@@ -48,7 +48,7 @@ import { Angulartics2OnModule } from 'angulartics2'; | |||||||||||||||||
| ContentLoaderComponent | ||||||||||||||||||
| ] | ||||||||||||||||||
| }) | ||||||||||||||||||
| export class DbTableFiltersDialogComponent implements OnInit { | ||||||||||||||||||
| export class DbTableFiltersDialogComponent implements OnInit, AfterViewInit { | ||||||||||||||||||
|
|
||||||||||||||||||
| public tableFilters = []; | ||||||||||||||||||
| public fieldSearchControl = new FormControl(''); | ||||||||||||||||||
|
|
@@ -67,6 +67,7 @@ export class DbTableFiltersDialogComponent implements OnInit { | |||||||||||||||||
| public tableWidgets: object; | ||||||||||||||||||
| public tableWidgetsList: string[] = []; | ||||||||||||||||||
| public UIwidgets = UIwidgets; | ||||||||||||||||||
| public autofocusField: string | null = null; | ||||||||||||||||||
|
|
||||||||||||||||||
| constructor( | ||||||||||||||||||
| @Inject(MAT_DIALOG_DATA) public data: any, | ||||||||||||||||||
|
|
@@ -91,6 +92,11 @@ export class DbTableFiltersDialogComponent implements OnInit { | |||||||||||||||||
| return {[field.column_name]: field}; | ||||||||||||||||||
| })); | ||||||||||||||||||
|
|
||||||||||||||||||
| // Set autofocus field if provided | ||||||||||||||||||
| if (this.data.autofocusField) { | ||||||||||||||||||
| this.autofocusField = this.data.autofocusField; | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| const queryParams = this.route.snapshot.queryParams; | ||||||||||||||||||
|
|
||||||||||||||||||
| // If saved_filter is present in queryParams, show empty form without applying filters | ||||||||||||||||||
|
|
@@ -122,12 +128,75 @@ export class DbTableFiltersDialogComponent implements OnInit { | |||||||||||||||||
| } | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| this.data.structure.widgets.length && this.setWidgets(this.data.structure.widgets); | ||||||||||||||||||
| if (this.data.structure.widgets && this.data.structure.widgets.length) { | ||||||||||||||||||
| this.setWidgets(this.data.structure.widgets); | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| // If autofocusField is provided, ensure it's in the filters list | ||||||||||||||||||
| if (this.autofocusField && this.tableFilters && !this.tableFilters.includes(this.autofocusField)) { | ||||||||||||||||||
| this.tableFilters.push(this.autofocusField); | ||||||||||||||||||
| if (!this.tableRowFieldsShown[this.autofocusField]) { | ||||||||||||||||||
| this.tableRowFieldsShown[this.autofocusField] = undefined; | ||||||||||||||||||
| } | ||||||||||||||||||
| if (!this.tableRowFieldsComparator[this.autofocusField]) { | ||||||||||||||||||
|
Comment on lines
+138
to
+141
|
||||||||||||||||||
| if (!this.tableRowFieldsShown[this.autofocusField]) { | |
| this.tableRowFieldsShown[this.autofocusField] = undefined; | |
| } | |
| if (!this.tableRowFieldsComparator[this.autofocusField]) { | |
| if (!(this.autofocusField in this.tableRowFieldsShown)) { | |
| this.tableRowFieldsShown[this.autofocusField] = undefined; | |
| } | |
| if (!(this.autofocusField in this.tableRowFieldsComparator)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saveNewAgentis not referenced anywhere in the backend (search shows only this declaration). If it’s not intended as part of the public repository extension API, consider removing it to avoid unused surface area.