| @@ -26,7 +26,10 @@ | |||||
| </ng-container> | </ng-container> | ||||
| <ng-container *ngIf="column.columnType == COLUMN_TYPE_IMAGE"> | <ng-container *ngIf="column.columnType == COLUMN_TYPE_IMAGE"> | ||||
| <td mat-cell *matCellDef="let element"> | <td mat-cell *matCellDef="let element"> | ||||
| <img src="{{ getElementValue(element, column) }}" width="40" height="40"/> | |||||
| <img *ngIf="element.imageUrl !== null && element.imageUrl !== undefined" | |||||
| src="{{ getElementValue(element, column) }}" width="40" height="40"/> | |||||
| <img *ngIf="element.imageUrl === null || element.imageUrl === undefined" | |||||
| src="/assets/images/icons/dummy-product.png" width="40" height="40" alt="" /> | |||||
| </td> | </td> | ||||
| </ng-container> | </ng-container> | ||||
| <ng-container *ngIf="column.columnType == COLUMN_TYPE_TEXT"> | <ng-container *ngIf="column.columnType == COLUMN_TYPE_TEXT"> | ||||
| @@ -19,6 +19,8 @@ export class SearchSelectComponent implements OnInit, AfterViewInit { | |||||
| @Input() public getDataFunction!: Function; | @Input() public getDataFunction!: Function; | ||||
| @Input() public dataSource: any; | @Input() public dataSource: any; | ||||
| @Input() public searchSelectColDefs!: SearchInputColDef[]; | @Input() public searchSelectColDefs!: SearchInputColDef[]; | ||||
| @Input() public displayedDataField!: string; | |||||
| @Input() public displayedDataSubResource!: string; | |||||
| @Output() rowSelected = new EventEmitter<any>(); | @Output() rowSelected = new EventEmitter<any>(); | ||||
| @@ -90,7 +92,11 @@ export class SearchSelectComponent implements OnInit, AfterViewInit { | |||||
| console.log(row, index); | console.log(row, index); | ||||
| this.selectedRowIndex = index; | this.selectedRowIndex = index; | ||||
| this.documentForm.get(this.formId)?.setValue(row.id); | this.documentForm.get(this.formId)?.setValue(row.id); | ||||
| this.paragraphRef.nativeElement.textContent = row.fullName; | |||||
| if (this.displayedDataSubResource !== undefined) { | |||||
| this.paragraphRef.nativeElement.textContent = row[this.displayedDataSubResource][this.displayedDataField]; | |||||
| } else { | |||||
| this.paragraphRef.nativeElement.textContent = row[this.displayedDataField]; | |||||
| } | |||||
| this.searchBoxFilled = true; | this.searchBoxFilled = true; | ||||
| this.searchBoxOpen = false; | this.searchBoxOpen = false; | ||||
| } | } | ||||
| @@ -20,6 +20,7 @@ | |||||
| [getDataFunction]="getPartners" | [getDataFunction]="getPartners" | ||||
| [dataSource]="dataSourcePartners" | [dataSource]="dataSourcePartners" | ||||
| [searchSelectColDefs]="colDefPartners" | [searchSelectColDefs]="colDefPartners" | ||||
| [displayedDataField]="'name'" | |||||
| > | > | ||||
| </app-search-select> | </app-search-select> | ||||
| <input type="hidden" formControlName="partner"/> | <input type="hidden" formControlName="partner"/> | ||||
| @@ -33,6 +34,7 @@ | |||||
| [getDataFunction]="getProducts" | [getDataFunction]="getProducts" | ||||
| [dataSource]="dataSourceProducts" | [dataSource]="dataSourceProducts" | ||||
| [searchSelectColDefs]="colDefProducts" | [searchSelectColDefs]="colDefProducts" | ||||
| [displayedDataField]="'name'" | |||||
| > | > | ||||
| </app-search-select> | </app-search-select> | ||||
| <input type="hidden" formControlName="product"/> | <input type="hidden" formControlName="product"/> | ||||
| @@ -10,6 +10,7 @@ | |||||
| [getDataFunction]="getUnassignedProducts" | [getDataFunction]="getUnassignedProducts" | ||||
| [dataSource]="dataSourceProducts" | [dataSource]="dataSourceProducts" | ||||
| [searchSelectColDefs]="colDefProducts" | [searchSelectColDefs]="colDefProducts" | ||||
| [displayedDataField]="'name'" | |||||
| > | > | ||||
| <input type="hidden" formControlName="productIri" value="{{partnerProduct.productIri}}"/> | <input type="hidden" formControlName="productIri" value="{{partnerProduct.productIri}}"/> | ||||
| </app-search-select> | </app-search-select> | ||||
| @@ -22,6 +23,8 @@ | |||||
| [getDataFunction]="getUnassignedPartnerProducts" | [getDataFunction]="getUnassignedPartnerProducts" | ||||
| [dataSource]="dataSourcePartnerProducts" | [dataSource]="dataSourcePartnerProducts" | ||||
| [searchSelectColDefs]="colDefPartnerProducts" | [searchSelectColDefs]="colDefPartnerProducts" | ||||
| [displayedDataField]="'name'" | |||||
| [displayedDataSubResource]="'product'" | |||||
| > | > | ||||
| <input type="hidden" formControlName="partnerProductIri" value="{{contactPartnerProduct.partnerProductIri}}"/> | <input type="hidden" formControlName="partnerProductIri" value="{{contactPartnerProduct.partnerProductIri}}"/> | ||||
| </app-search-select> | </app-search-select> | ||||
| @@ -11,6 +11,7 @@ | |||||
| [getDataFunction]="getPartners" | [getDataFunction]="getPartners" | ||||
| [dataSource]="dataSourcePartners" | [dataSource]="dataSourcePartners" | ||||
| [searchSelectColDefs]="colDefPartners" | [searchSelectColDefs]="colDefPartners" | ||||
| [displayedDataField]="'name'" | |||||
| > | > | ||||
| </app-search-select> | </app-search-select> | ||||
| <input type="hidden" formControlName="partnerIri"/> | <input type="hidden" formControlName="partnerIri"/> | ||||
| @@ -24,6 +25,7 @@ | |||||
| [getDataFunction]="getProducts" | [getDataFunction]="getProducts" | ||||
| [dataSource]="dataSourceProducts" | [dataSource]="dataSourceProducts" | ||||
| [searchSelectColDefs]="colDefProducts" | [searchSelectColDefs]="colDefProducts" | ||||
| [displayedDataField]="'name'" | |||||
| > | > | ||||
| </app-search-select> | </app-search-select> | ||||
| <input type="hidden" formControlName="productIri"/> | <input type="hidden" formControlName="productIri"/> | ||||
| @@ -19,6 +19,7 @@ | |||||
| [getDataFunction]="getContacts" | [getDataFunction]="getContacts" | ||||
| [dataSource]="dataSourceContacts" | [dataSource]="dataSourceContacts" | ||||
| [searchSelectColDefs]="colDefContacts" | [searchSelectColDefs]="colDefContacts" | ||||
| [displayedDataField]="'fullName'" | |||||
| > | > | ||||
| </app-search-select> | </app-search-select> | ||||
| <input type="hidden" formControlName="contactIri" value="{{taskNote.contactIri}}"/> | <input type="hidden" formControlName="contactIri" value="{{taskNote.contactIri}}"/> | ||||
| @@ -27,6 +27,7 @@ | |||||
| [getDataFunction]="getProducts" | [getDataFunction]="getProducts" | ||||
| [dataSource]="dataSourceProducts" | [dataSource]="dataSourceProducts" | ||||
| [searchSelectColDefs]="colDefProducts" | [searchSelectColDefs]="colDefProducts" | ||||
| [displayedDataField]="'name'" | |||||
| > | > | ||||
| <input type="hidden" formControlName="productIri" value="{{task.productIri}}"/> | <input type="hidden" formControlName="productIri" value="{{task.productIri}}"/> | ||||
| </app-search-select> | </app-search-select> | ||||
| @@ -42,6 +43,7 @@ | |||||
| [getDataFunction]="getUsers" | [getDataFunction]="getUsers" | ||||
| [dataSource]="dataSourceUsers" | [dataSource]="dataSourceUsers" | ||||
| [searchSelectColDefs]="colDefUsers" | [searchSelectColDefs]="colDefUsers" | ||||
| [displayedDataField]="'fullName'" | |||||
| > | > | ||||
| <input type="hidden" formControlName="assignedToIri" value="{{task.productIri}}"/> | <input type="hidden" formControlName="assignedToIri" value="{{task.productIri}}"/> | ||||
| </app-search-select> | </app-search-select> | ||||