diff --git a/src/frontend/app/administration/contact/list/import/contact-import.component.html b/src/frontend/app/administration/contact/list/import/contact-import.component.html index 2907ce1fab7ecc9776f65def2b37dee947b508c1..b69387eba120e577647df4add69f5afbb573fc20 100644 --- a/src/frontend/app/administration/contact/list/import/contact-import.component.html +++ b/src/frontend/app/administration/contact/list/import/contact-import.component.html @@ -48,7 +48,7 @@ </div> <div style="width:100%;box-shadow: inset 0px 0px 5px 0px rgba(0,0,0,0.75);padding:10px;"> <div style="overflow: auto;"> - <mat-table *ngIf="csvData.length > 0" #table [dataSource]="dataSource" style="width:5000px;"> + <mat-table *ngIf="csvData.length > 0" #table [dataSource]="dataSource" [style.width.px]="contactColumns.length * 300"> <ng-container *ngFor="let column of contactColumns;let i=index;"> <ng-container [matColumnDef]="column.id"> <mat-header-cell *matHeaderCellDef style="padding-left: 5px;padding-right: 5px;"> diff --git a/src/frontend/app/administration/contact/list/import/contact-import.component.ts b/src/frontend/app/administration/contact/list/import/contact-import.component.ts index 50d69683a1949310eed611ca5d5971eba9ad0fd2..24fd1d8895ef63635fd79eaf753ba18ef3eca6b7 100644 --- a/src/frontend/app/administration/contact/list/import/contact-import.component.ts +++ b/src/frontend/app/administration/contact/list/import/contact-import.component.ts @@ -152,7 +152,8 @@ export class ContactImportComponent implements OnInit { data = data.customFields.map(custom => { return { id: `contactCustomField_${custom.id}`, - label: custom.label + label: custom.label, + type: custom.type }; }); return data; @@ -315,7 +316,12 @@ export class ContactImportComponent implements OnInit { if (element[this.associatedColmuns[key.id]] === undefined) { objContact[key.id] = ''; } else { - objContact[key.id] = element[this.associatedColmuns[key.id]].includes('\n') ? element[this.associatedColmuns[key.id]].split('\n') : element[this.associatedColmuns[key.id]]; + if (key.type === 'checkbox') { + objContact[key.id] = !this.functionsService.empty(element[this.associatedColmuns[key.id]]) ? element[this.associatedColmuns[key.id]].split('\n') : []; + + } else { + objContact[key.id] = element[this.associatedColmuns[key.id]]; + } } } });