Skip to content

Commit

Permalink
Fix(mapping) fix mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Narcisi authored and bouttier committed Sep 19, 2024
1 parent be5f87e commit dcdde5a
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion frontend/cypress/e2e/import/step3-field-mapping-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function fillTheFormRaw() {

function fillTheForm() {
// Fill in the form with mandatory field
cy.get(SELECTOR_IMPORT_FIELDMAPPING_VALIDATE).should('exist').should('not.be.enabled');
cy.get(SELECTOR_IMPORT_FIELDMAPPING_VALIDATE).should('exist');

selectField(SELECTOR_IMPORT_FIELDMAPPING_DATE_MIN, 'date_debut');
cy.get(SELECTOR_IMPORT_FIELDMAPPING_VALIDATE).should('exist').should('not.be.enabled');
Expand Down
1 change: 1 addition & 0 deletions frontend/cypress/e2e/import/step4-content-mapping-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ function runTheProcessForOcchab(user) {
cy.configureImportFile();
// cy.configureImportFieldMapping();
selectFieldMappingField('import-fieldmapping-theme-date_min', 'error');
selectFieldMappingField('import-fieldmapping-theme-WKT', 'error');
cy.get('#mat-tab-label-0-1').click();
selectFieldMappingField('import-fieldmapping-theme-nom_cite', 'error');
selectFieldMappingField('import-fieldmapping-theme-cd_hab', 'error');
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/GN2CommonModule/form/form.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ export class FormService {
if (!this.areAnyRefControlsNotNull(entityControls, currentControl)) {
return null;
}
return this.areAllRefControlsNotNull(referenceControlNames, currentControl)
return this.areAnyRefControlsNotNull(referenceControlNames, currentControl)
? null
: Validators.required(currentControl);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ <h6>
<mat-expansion-panel>
<mat-expansion-panel-header [collapsedHeight]="expansionPanelHeight">
<mat-panel-title>
<h6>{{ importErrors.length }} erreur(s)</h6>
<h6 data-qa="import-report-errors-title">{{ importErrors.length }} erreur(s)</h6>
</mat-panel-title>
</mat-expansion-panel-header>
<table class="table table-responsive table-striped table-bordered">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ export class FieldMappingService {
this.fieldsByEntity.set(entity.label, entityFields);
});
});
this.fieldsByEntity = this.removeCommonStrings(this.fieldsByEntity);
if (this.fieldsByEntity.size > 1)
this.fieldsByEntity = this.removeCommonStrings(this.fieldsByEntity);
return flattened;
}

Expand Down

0 comments on commit dcdde5a

Please sign in to comment.