-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6020010
commit fe5d857
Showing
3 changed files
with
98 additions
and
4 deletions.
There are no files selected for viewing
73 changes: 72 additions & 1 deletion
73
.../components/import_process/fields-mapping-step/mapping-theme/mapping-theme.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,72 @@ | ||
<p>mapping-theme works!</p> | ||
<div class="entities-tab__content" [formGroup]="mappingFormControl"> | ||
<fieldset> | ||
<legend class="px-1"> | ||
{{ themeLabel }} | ||
</legend> | ||
<div class="row m-0"> | ||
<ng-container *ngFor="let field of fieldsData"> | ||
<!-- *ngIf="!getValue(field) || displayAllValues" --> | ||
<div class="col-6"> | ||
<div *ngIf="!field.autogenerated" class="form-group"> | ||
<small | ||
>{{ field.fr_label }} : | ||
<i | ||
*ngIf="field.comment" | ||
matTooltip="{{ field.comment }}" | ||
matTooltipClass="custom-tooltip" | ||
class="fa fa-info-circle" | ||
aria-hidden="true" | ||
></i> | ||
</small> | ||
<ng-select | ||
id="{{ field.name_field }}" | ||
[items]="sourceFields" | ||
[multiple]="field.multi" | ||
[clearable]="true" | ||
[virtualScroll]="true" | ||
formControlName="{{ field.name_field }}" | ||
> | ||
<ng-template ng-option-tmp let-item="item" let-index="index" let-search="searchTerm"> | ||
<div> | ||
<span [ngClass]="{ in_use: mappedSourceFields.has(item) }" class="pre-wrap"> | ||
{{ item }} | ||
</span> | ||
</div> | ||
</ng-template> | ||
</ng-select> | ||
<div | ||
*ngIf="mappingFormControl.controls[field.name_field].hasError('required')" | ||
class="invalid-feedback d-block" | ||
> | ||
Sélectionnez {{ field.name_field }} | ||
</div> | ||
<div *ngIf="field.name_field == 'WKT'"> | ||
<small>*si pas de WKT, indiquez longitude et latitude.</small> | ||
</div> | ||
|
||
<div | ||
*ngIf="mappingFormControl.controls[field.name_field].hasError('conflict')" | ||
class="invalid-feedback d-block" | ||
> | ||
{{ mappingFormControl.controls[field.name_field].getError('conflict') }} | ||
</div> | ||
</div> | ||
<div *ngIf="field.autogenerated" class="form-group"> | ||
<p *ngIf="displayAlert(field)" class="text-warning text-sm"> | ||
Attention les identifiants SINP ne seront pas générés | ||
</p> | ||
<label for="{{ field.name_field }}"> | ||
<small>{{ field.fr_label }} :</small> | ||
</label> | ||
<input | ||
class="ml-1" | ||
type="checkbox" | ||
id="{{ field.name_field }}" | ||
formControlName="{{ field.name_field }}" | ||
/> | ||
</div> | ||
</div> | ||
</ng-container> | ||
</div> | ||
</fieldset> | ||
</div> |
16 changes: 13 additions & 3 deletions
16
...ts/components/import_process/fields-mapping-step/mapping-theme/mapping-theme.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,20 @@ | ||
import { Component } from '@angular/core'; | ||
import { Component, Input, OnInit } from '@angular/core'; | ||
import { FormControl, FormGroup } from '@angular/forms'; | ||
import { Field } from '@geonature/modules/imports/models/mapping.model'; | ||
|
||
@Component({ | ||
selector: 'pnx-mapping-theme', | ||
templateUrl: './mapping-theme.component.html', | ||
styleUrls: ['./mapping-theme.component.scss'] | ||
styleUrls: ['./mapping-theme.component.scss'], | ||
}) | ||
export class MappingThemeComponent { | ||
export class MappingThemeComponent implements OnInit { | ||
@Input() fieldsData: Field[]; | ||
@Input() themeLabel: string; | ||
@Input() sourceFields: any; | ||
@Input() mappingFormControl: FormGroup; | ||
|
||
ngOnInit() { | ||
console.log(this.sourceFields); | ||
console.log('HAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters