Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export class HashlistsTableComponent extends BaseTableComponent implements OnIni
this.dataSource.loadAll(); // Reload all data if input is empty
}
}

handleBackendSqlFilter(event: string) {
if (event && event.trim().length > 0) {
this.filter(event);
Expand Down
10 changes: 8 additions & 2 deletions src/app/core/_components/tables/ht-table/ht-table.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@
@Input() dataType: DataType;

/** Function used to filter table data. */
@Input() filterFn: (item: any, filterValue: string) => boolean;

Check failure on line 121 in src/app/core/_components/tables/ht-table/ht-table.component.ts

View workflow job for this annotation

GitHub Actions / Lint & Prettier Check

Unexpected any. Specify a different type

/** The data source for the table. */
@Input() dataSource: BaseDataSource<any>;

Check failure on line 124 in src/app/core/_components/tables/ht-table/ht-table.component.ts

View workflow job for this annotation

GitHub Actions / Lint & Prettier Check

Unexpected any. Specify a different type

/** Flag to enable or disable pagination. */
@Input() isPageable = false;
Expand Down Expand Up @@ -186,19 +186,19 @@
@Input() supportsAutoRefresh = false;

/** Flag to color a table row */
@Input() rowClass: (row: any) => string;

Check failure on line 189 in src/app/core/_components/tables/ht-table/ht-table.component.ts

View workflow job for this annotation

GitHub Actions / Lint & Prettier Check

Unexpected any. Specify a different type

/** Event emitter for when the user triggers a row action */
@Output() rowActionClicked: EventEmitter<ActionMenuEvent<any>> = new EventEmitter<ActionMenuEvent<any>>();

Check failure on line 192 in src/app/core/_components/tables/ht-table/ht-table.component.ts

View workflow job for this annotation

GitHub Actions / Lint & Prettier Check

Unexpected any. Specify a different type

Check failure on line 192 in src/app/core/_components/tables/ht-table/ht-table.component.ts

View workflow job for this annotation

GitHub Actions / Lint & Prettier Check

Unexpected any. Specify a different type

/** Event emitter for when the user triggers a bulk action */
@Output() bulkActionClicked: EventEmitter<ActionMenuEvent<any>> = new EventEmitter<ActionMenuEvent<any>>();

Check failure on line 195 in src/app/core/_components/tables/ht-table/ht-table.component.ts

View workflow job for this annotation

GitHub Actions / Lint & Prettier Check

Unexpected any. Specify a different type

Check failure on line 195 in src/app/core/_components/tables/ht-table/ht-table.component.ts

View workflow job for this annotation

GitHub Actions / Lint & Prettier Check

Unexpected any. Specify a different type

/** Event emitter for when the user triggers an export action */
@Output() exportActionClicked: EventEmitter<ActionMenuEvent<any>> = new EventEmitter<ActionMenuEvent<any>>();

Check failure on line 198 in src/app/core/_components/tables/ht-table/ht-table.component.ts

View workflow job for this annotation

GitHub Actions / Lint & Prettier Check

Unexpected any. Specify a different type

Check failure on line 198 in src/app/core/_components/tables/ht-table/ht-table.component.ts

View workflow job for this annotation

GitHub Actions / Lint & Prettier Check

Unexpected any. Specify a different type

/** Event emitter for when the user saves an editable input */
@Output() editableSaved: EventEmitter<HTTableEditable<any>> = new EventEmitter<HTTableEditable<any>>();

Check failure on line 201 in src/app/core/_components/tables/ht-table/ht-table.component.ts

View workflow job for this annotation

GitHub Actions / Lint & Prettier Check

Unexpected any. Specify a different type

/** Event emitter for when the user saves a checkbox */
@Output() editableCheckbox: EventEmitter<HTTableEditable<any>> = new EventEmitter<HTTableEditable<any>>();
Expand Down Expand Up @@ -555,12 +555,18 @@
* Reloads the data in the table and the bulk menu.
*/
reload(): void {
this.dataSource.reset(true);
this.dataSource.reset(false);
const tableSettings = this.uiSettings['uiConfig']['tableSettings'][this.name];
this.dataSource.pageSize = tableSettings['page'];
this.dataSource.pageAfter = tableSettings['start'];
this.dataSource.pageBefore = tableSettings['before'];
this.dataSource.index = tableSettings['index'];
this.dataSource.totalItems = tableSettings['totalItems'];
Comment on lines +559 to +564
Copy link

Copilot AI Oct 13, 2025

Choose a reason for hiding this comment

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

Missing null/undefined checks for tableSettings and its properties could cause runtime errors if the settings don't exist in localStorage.

Suggested change
const tableSettings = this.uiSettings['uiConfig']['tableSettings'][this.name];
this.dataSource.pageSize = tableSettings['page'];
this.dataSource.pageAfter = tableSettings['start'];
this.dataSource.pageBefore = tableSettings['before'];
this.dataSource.index = tableSettings['index'];
this.dataSource.totalItems = tableSettings['totalItems'];
const tableSettings = this.uiSettings &&
this.uiSettings['uiConfig'] &&
this.uiSettings['uiConfig']['tableSettings'] &&
this.uiSettings['uiConfig']['tableSettings'][this.name]
? this.uiSettings['uiConfig']['tableSettings'][this.name]
: {};
this.dataSource.pageSize = tableSettings['page'] !== undefined ? tableSettings['page'] : this.dataSource.pageSize;
this.dataSource.pageAfter = tableSettings['start'] !== undefined ? tableSettings['start'] : this.dataSource.pageAfter;
this.dataSource.pageBefore = tableSettings['before'] !== undefined ? tableSettings['before'] : this.dataSource.pageBefore;
this.dataSource.index = tableSettings['index'] !== undefined ? tableSettings['index'] : this.dataSource.index;
this.dataSource.totalItems = tableSettings['totalItems'] !== undefined ? tableSettings['totalItems'] : this.dataSource.totalItems;

Copilot uses AI. Check for mistakes.
this.dataSource.reload();
if (this.bulkMenu) {
this.bulkMenu.reload();
}
this.filterQueryFormGroup.get('textFilter').setValue('');
this.filterQueryFormGroup.get('textFilter').setValue('', { emitEvent: false});
Copy link

Copilot AI Oct 13, 2025

Choose a reason for hiding this comment

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

Missing space before closing brace in object literal.

Suggested change
this.filterQueryFormGroup.get('textFilter').setValue('', { emitEvent: false});
this.filterQueryFormGroup.get('textFilter').setValue('', { emitEvent: false });

Copilot uses AI. Check for mistakes.
}
clearSearchBox(): void {
this.filterQueryFormGroup.get('textFilter').setValue('');
Expand Down
1 change: 1 addition & 0 deletions src/app/core/_datasources/hashlists.datasource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ export class HashlistsDataSource extends BaseDataSource<JHashlist> {
this.clearSelection();
this.loadAll();
}

clearFilter(): void {
this._currentFilter = null;
this.setPaginationConfig(this.pageSize, undefined, undefined, undefined, 0);
Expand Down