Skip to content

Commit

Permalink
fix(import) fix design flaws
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Narcisi authored and jacquesfize committed Mar 8, 2024
1 parent 80c53a3 commit 2658f5e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
[clearable]="clearable"
[virtualScroll]="true"
[formControl]="parentFormControl"
(clear)="onClear.emit()"
>
<ng-template ng-option-tmp let-item="item" let-index="index" let-search="searchTerm">
<div matTooltip="{{ item.code }}" [attr.data-qa]="item.code">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Component, Input } from '@angular/core';
import { Component, Input, Output } from '@angular/core';
import { DataService } from '../../services/data.service';
import { Destination } from '../../models/import.model';
import { GenericFormComponent } from '@geonature_common/form/genericForm.component';
import { EventEmitter } from '@angular/core';

@Component({
selector: 'pnx-destinations',
Expand All @@ -12,6 +13,7 @@ export class DestinationsComponent extends GenericFormComponent {
destinations: Array<Destination>;

@Input() bindValue: string = 'code';
@Output() onClear = new EventEmitter<any>();

constructor(private _ds: DataService) {
super();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ <h5 class="card-title mb-0">Liste des imports</h5>
'Import.Destinations' | translate | lowercase
}}"
[parentFormControl]="selectDestinationForm"
(onChange) = "onImportList()"
(onChange) = "resetPage()"
(onClear) = "resetPage()"
class="flex-fill pr-1"
></pnx-destinations>
<div class="flex-fill">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,15 @@ export class ImportListComponent implements OnInit {
*/
updateSearchQuery() {
this.searchString = this.search.value;
this.onImportList();
this.resetPage();
}

/**
* Resets the page offset before updating the import list
*/
resetPage() {
this.offset = 0;
this.updateImports();
}


Expand Down

0 comments on commit 2658f5e

Please sign in to comment.