Skip to content

Commit

Permalink
fix(metadata): changing fields to ng-select
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Narcisi committed Aug 3, 2023
1 parent 450b36c commit 4f91053
Showing 1 changed file with 38 additions and 27 deletions.
65 changes: 38 additions & 27 deletions frontend/src/app/metadataModule/metadata.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -251,40 +251,51 @@ <h3 class="main-color">Catalogue des jeux de données</h3>
[parentFormControl]="metadataService.form.get('date')"
label="Date de création"
></pnx-date>
<label>Acteur (organisme)</label>

<select
<label>Acteur (organisme)</label>

<ng-select
[items]="organisms"
[formControl]="metadataService.form.get('organism')"
class="form-control form-control"
>
<option
value=""
selected
>--</option>
<option
*ngFor="let org of organisms"
value="{{ org.id_organisme }}"
bindLabel="nom_organisme"
bindValue="id_organisme"
[multiple]="false"
[searchable]="true"
[clearable]="true"
>
{{ org.nom_organisme }}
</option>
</select>
<ng-template
ng-option-tmp
let-item="item"
let-index="index"
let-search="searchTerm"
>
<div [matTooltip]="item.nom_organisme" [attr.data-qa]="item.id_organism">
<span class="pre-wrap">{{item.nom_organisme}}</span>
</div>
</ng-template>
</ng-select>

<label> Acteur (personne)</label>

<select
class="form-control form-control"
<ng-select
[items]="roles"
[formControl]="metadataService.form.get('person')"
>
<option
value=""
selected
>--</option>
<option
*ngFor="let role of roles"
value="{{ role.id_role }}"
bindLabel="nom_complet"
bindValue="id_role"
[multiple]="false"
[virtualScroll]="true"
>
{{ role?.nom_complet }}
</option>
</select>
<ng-template
ng-option-tmp
let-item="item"
let-index="index"
let-search="searchTerm"
>
<div [matTooltip]="item.nom_complet" [attr.data-qa]="item.id_role">
<span class="pre-wrap">{{item.nom_complet}}</span>
</div>
</ng-template>
</ng-select>

<div *ngIf="displayMetaAreaFilters() && metadataService.formBuilded">
<div *ngFor="let area of areaFilters; let i = index">
Expand Down

0 comments on commit 4f91053

Please sign in to comment.