diff --git a/frontend/src/app/modules/imports/components/import_report/import_report.component.html b/frontend/src/app/modules/imports/components/import_report/import_report.component.html index 8db737d816..bb90964cfb 100644 --- a/frontend/src/app/modules/imports/components/import_report/import_report.component.html +++ b/frontend/src/app/modules/imports/components/import_report/import_report.component.html @@ -146,12 +146,14 @@
Champs ({{ (importData?.fieldmapping || {} | keyvalue).length }})
Champ source Champ cible + Description - - {{ field.value }} - {{ field.key }} + + {{ field.source }} + {{ field.destination }} + {{ field.description }} diff --git a/frontend/src/app/modules/imports/components/import_report/import_report.component.scss b/frontend/src/app/modules/imports/components/import_report/import_report.component.scss index 15a6f36e0d..e7c9ffeaa1 100644 --- a/frontend/src/app/modules/imports/components/import_report/import_report.component.scss +++ b/frontend/src/app/modules/imports/components/import_report/import_report.component.scss @@ -76,7 +76,21 @@ img { } } +table { + display: block; + overflow-x: auto; +} + table caption { caption-side: top; border-collapse: collapse; } + +mat-panel-title { + justify-content: space-between; + align-items: center !important; + column-gap: 0.5rem; + h6 { + margin: 0 !important; + } +} diff --git a/frontend/src/app/modules/imports/components/import_report/import_report.component.ts b/frontend/src/app/modules/imports/components/import_report/import_report.component.ts index 4b083622b8..284116916a 100644 --- a/frontend/src/app/modules/imports/components/import_report/import_report.component.ts +++ b/frontend/src/app/modules/imports/components/import_report/import_report.component.ts @@ -24,6 +24,12 @@ import { FieldMappingValues } from '../../models/mapping.model'; import { HttpClient } from '@angular/common/http'; import { finalize } from 'rxjs/operators'; +interface CorrespondancesField { + source: string; + description: string; + destination: string | string[]; +} + @Component({ selector: 'pnx-import-report', templateUrl: 'import_report.component.html', @@ -256,17 +262,18 @@ export class ImportReportComponent implements OnInit { return tableFieldsCorresp; } - mapThemes(themes: ThemesFields[], fieldMapping: FieldMappingValues) { + mapThemes(themes: ThemesFields[], fieldMapping: FieldMappingValues): Array { const mappedThemes = themes.map((theme) => this.mapField(theme.fields, fieldMapping)); - return Object.assign({}, ...mappedThemes); + return mappedThemes.flat(); } - mapField(listField: Field[], fieldMapping: FieldMappingValues) { - const mappedFields = {}; - listField.forEach((field) => { - if (Object.keys(fieldMapping).includes(field.name_field)) { - mappedFields[field.name_field] = fieldMapping[field.name_field]; - } + mapField(listField: Field[], fieldMapping: FieldMappingValues): Array { + const mappedFields: Array = listField.map((field) => { + return { + source: field.name_field, + description: field.comment, + destination: fieldMapping[field.name_field], + }; }); return mappedFields; }