-
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
7e34569
commit 4695787
Showing
9 changed files
with
268 additions
and
20 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
...s/import_process/fields-mapping-step/field-mapping-test/field-mapping-test.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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<div> | ||
<pnx-mapping-selection></pnx-mapping-selection> | ||
pouet | ||
<ng-container *ngIf="isReady"> | ||
<mat-tab-group [(selectedIndex)]="selectedIndex" animationDuration="0ms" class="entities-tab"> | ||
<mat-tab *ngFor="let entitythemes of targetFields"> | ||
test | ||
{{entitythemes|json}} | ||
<ng-template mat-tab-label> | ||
<span | ||
[matBadge]="this.invalidEntityControls(entitythemes.entity.label)" | ||
matBadgeColor="warn" | ||
matBadgeSize="small" | ||
[matBadgeHidden]="this.invalidEntityControls(entitythemes.entity.label)<1" | ||
class="entity-tab-label" | ||
> | ||
{{ entitythemes.entity.label }} | ||
</span> | ||
</ng-template> | ||
<div *ngFor="let themefields of entitythemes.themes" class="entities-tab__content"> | ||
<pnx-mapping-theme | ||
[themeData]="themefields" | ||
></pnx-mapping-theme> | ||
</div> | ||
</mat-tab> | ||
</mat-tab-group> | ||
</ng-container> | ||
|
||
</div> |
Empty file.
23 changes: 23 additions & 0 deletions
23
...mport_process/fields-mapping-step/field-mapping-test/field-mapping-test.component.spec.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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { FieldMappingTestComponent } from './field-mapping-test.component'; | ||
|
||
describe('FieldMappingTestComponent', () => { | ||
let component: FieldMappingTestComponent; | ||
let fixture: ComponentFixture<FieldMappingTestComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [ FieldMappingTestComponent ] | ||
}) | ||
.compileComponents(); | ||
|
||
fixture = TestBed.createComponent(FieldMappingTestComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
26 changes: 26 additions & 0 deletions
26
...nts/import_process/fields-mapping-step/field-mapping-test/field-mapping-test.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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
import { ImportDataService } from '../../../../services/data.service'; | ||
import { FieldMappingService } from '@geonature/modules/imports/services/mappings/field-mapping.service'; | ||
|
||
@Component({ | ||
selector: 'pnx-field-mapping-test', | ||
templateUrl: './field-mapping-test.component.html', | ||
styleUrls: ['./field-mapping-test.component.scss'] | ||
}) | ||
export class FieldMappingTestComponent implements OnInit { | ||
public targetFields; | ||
public isReady:boolean=false; | ||
constructor(public _fm: FieldMappingService) {} | ||
|
||
ngOnInit() { | ||
// subscribe(({ fieldMappings, targetFields, sourceFields }) => { | ||
|
||
this._fm.retrieveData().subscribe(({ fieldMappings, targetFields, sourceFields })=>{ | ||
this._fm.parseData({ fieldMappings, targetFields, sourceFields }); | ||
this.targetFields = this._fm.getTargetFieldsData(); | ||
this._fm.initForm(); | ||
this._fm.populateMappingForm(); | ||
this.isReady = true; | ||
}); | ||
} | ||
} |
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
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
10 changes: 4 additions & 6 deletions
10
...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,21 +1,19 @@ | ||
import { Component, Input, OnInit } from '@angular/core'; | ||
import { FormControl, FormGroup } from '@angular/forms'; | ||
import { Field } from '@geonature/modules/imports/models/mapping.model'; | ||
import { FieldMappingService } from 'external_modules/WA/app/services/mappings/field-mapping.service'; | ||
import { FieldMappingService } from '@geonature/modules/imports/services/mappings/field-mapping.service'; | ||
|
||
|
||
@Component({ | ||
selector: 'pnx-mapping-theme', | ||
templateUrl: './mapping-theme.component.html', | ||
styleUrls: ['./mapping-theme.component.scss'], | ||
}) | ||
export class MappingThemeComponent implements OnInit { | ||
@Input() fieldsData: Field[]; | ||
@Input() themeLabel: string; | ||
@Input() sourceFields: any; | ||
@Input() mappingFormControl: FormGroup; | ||
@Input() mappedSourceFields: any; | ||
@Input() themeData; | ||
|
||
constructor(public _fm: FieldMappingService) {} | ||
|
||
ngOnInit() {} | ||
} | ||
FieldMappingService |
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
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