| @@ -586,6 +586,18 @@ paths: | |||||
| style: form | style: form | ||||
| explode: true | explode: true | ||||
| allowReserved: false | allowReserved: false | ||||
| - | |||||
| name: nameSearch | |||||
| in: query | |||||
| description: '' | |||||
| required: false | |||||
| deprecated: false | |||||
| allowEmptyValue: true | |||||
| schema: | |||||
| type: string | |||||
| style: form | |||||
| explode: false | |||||
| allowReserved: false | |||||
| deprecated: false | deprecated: false | ||||
| post: | post: | ||||
| operationId: api_contacts_post | operationId: api_contacts_post | ||||
| @@ -1811,6 +1823,18 @@ paths: | |||||
| style: form | style: form | ||||
| explode: true | explode: true | ||||
| allowReserved: false | allowReserved: false | ||||
| - | |||||
| name: productPartnerUnassigned | |||||
| in: query | |||||
| description: '' | |||||
| required: false | |||||
| deprecated: false | |||||
| allowEmptyValue: true | |||||
| schema: | |||||
| type: string | |||||
| style: form | |||||
| explode: false | |||||
| allowReserved: false | |||||
| deprecated: false | deprecated: false | ||||
| post: | post: | ||||
| operationId: api_partner_products_post | operationId: api_partner_products_post | ||||
| @@ -2633,6 +2657,18 @@ paths: | |||||
| style: form | style: form | ||||
| explode: false | explode: false | ||||
| allowReserved: false | allowReserved: false | ||||
| - | |||||
| name: partnerIdUnassigned | |||||
| in: query | |||||
| description: '' | |||||
| required: false | |||||
| deprecated: false | |||||
| allowEmptyValue: true | |||||
| schema: | |||||
| type: string | |||||
| style: form | |||||
| explode: false | |||||
| allowReserved: false | |||||
| - | - | ||||
| name: 'order[name]' | name: 'order[name]' | ||||
| in: query | in: query | ||||
| @@ -4023,6 +4059,18 @@ paths: | |||||
| style: form | style: form | ||||
| explode: false | explode: false | ||||
| allowReserved: false | allowReserved: false | ||||
| - | |||||
| name: nameSearch | |||||
| in: query | |||||
| description: '' | |||||
| required: false | |||||
| deprecated: false | |||||
| allowEmptyValue: true | |||||
| schema: | |||||
| type: string | |||||
| style: form | |||||
| explode: false | |||||
| allowReserved: false | |||||
| deprecated: false | deprecated: false | ||||
| post: | post: | ||||
| operationId: api_users_post | operationId: api_users_post | ||||
| @@ -6657,6 +6705,16 @@ components: | |||||
| - 'null' | - 'null' | ||||
| format: iri-reference | format: iri-reference | ||||
| example: 'https://example.com/' | example: 'https://example.com/' | ||||
| contact: | |||||
| readOnly: true | |||||
| description: '?ContactApi' | |||||
| $ref: '#/components/schemas/Contact' | |||||
| contactIri: | |||||
| type: | |||||
| - string | |||||
| - 'null' | |||||
| format: iri-reference | |||||
| example: 'https://example.com/' | |||||
| contactType: | contactType: | ||||
| type: string | type: string | ||||
| enum: | enum: | ||||
| @@ -6701,6 +6759,16 @@ components: | |||||
| - 'null' | - 'null' | ||||
| format: iri-reference | format: iri-reference | ||||
| example: 'https://example.com/' | example: 'https://example.com/' | ||||
| contact: | |||||
| readOnly: true | |||||
| description: '?ContactApi' | |||||
| $ref: '#/components/schemas/Contact.jsonhal' | |||||
| contactIri: | |||||
| type: | |||||
| - string | |||||
| - 'null' | |||||
| format: iri-reference | |||||
| example: 'https://example.com/' | |||||
| contactType: | contactType: | ||||
| type: string | type: string | ||||
| enum: | enum: | ||||
| @@ -6759,6 +6827,16 @@ components: | |||||
| - 'null' | - 'null' | ||||
| format: iri-reference | format: iri-reference | ||||
| example: 'https://example.com/' | example: 'https://example.com/' | ||||
| contact: | |||||
| readOnly: true | |||||
| description: '?ContactApi' | |||||
| $ref: '#/components/schemas/Contact.jsonld' | |||||
| contactIri: | |||||
| type: | |||||
| - string | |||||
| - 'null' | |||||
| format: iri-reference | |||||
| example: 'https://example.com/' | |||||
| contactType: | contactType: | ||||
| type: string | type: string | ||||
| enum: | enum: | ||||
| @@ -0,0 +1,7 @@ | |||||
| export interface SearchInputColDef { | |||||
| column: string, | |||||
| columnHeader: string, | |||||
| columnType: string, | |||||
| field?: string | |||||
| subResource?: string | |||||
| } | |||||
| @@ -0,0 +1,41 @@ | |||||
| <app-paging #pagingComponent | |||||
| [getDataFunction]="getDataFunction" | |||||
| [dataSource]="dataSource" | |||||
| [searchable]="true" | |||||
| > | |||||
| <div *ngIf="searchSelectColDefs" class="table-responsive"> | |||||
| <table mat-table [dataSource]="dataSource" matSort (matSortChange)="onSortChange($event)" class="mat-elevation-z8"> | |||||
| <ng-container *ngFor="let column of searchSelectColDefs" [matColumnDef]="column.column"> | |||||
| <th mat-header-cell *matHeaderCellDef> | |||||
| {{ column.columnHeader | translate }} | |||||
| </th> | |||||
| <ng-container *ngIf="column.columnType == COLUMN_TYPE_POSITION"> | |||||
| <td mat-cell *matCellDef="let element"> | |||||
| {{ pagingComponent.getPageSize() * (pagingComponent.getPageIndex()-1) + dataSource.filteredData.indexOf(element) + 1 }} | |||||
| </td> | |||||
| </ng-container> | |||||
| <ng-container *ngIf="column.columnType == COLUMN_TYPE_IMAGE"> | |||||
| <td mat-cell *matCellDef="let element"> | |||||
| <img src="{{ getElementValue(element, column) }}" width="40" height="40"/> | |||||
| </td> | |||||
| </ng-container> | |||||
| <ng-container *ngIf="column.columnType == COLUMN_TYPE_TEXT"> | |||||
| <td mat-cell *matCellDef="let element"> | |||||
| {{ getElementValue(element, column) }} | |||||
| </td> | |||||
| </ng-container> | |||||
| </ng-container> | |||||
| <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr> | |||||
| <tr mat-row | |||||
| *matRowDef="let row; columns: displayedColumns; index as i;" | |||||
| (click)="onRowSelected(row, i)" | |||||
| [ngClass]="{'highlighted': selectedRowIndex === i}" | |||||
| ></tr> | |||||
| </table> | |||||
| </div> | |||||
| </app-paging> | |||||
| @@ -0,0 +1,23 @@ | |||||
| import { ComponentFixture, TestBed } from '@angular/core/testing'; | |||||
| import { SearchSelectComponent } from './search-select.component'; | |||||
| describe('SearchSelectComponent', () => { | |||||
| let component: SearchSelectComponent; | |||||
| let fixture: ComponentFixture<SearchSelectComponent>; | |||||
| beforeEach(async () => { | |||||
| await TestBed.configureTestingModule({ | |||||
| declarations: [SearchSelectComponent] | |||||
| }) | |||||
| .compileComponents(); | |||||
| fixture = TestBed.createComponent(SearchSelectComponent); | |||||
| component = fixture.componentInstance; | |||||
| fixture.detectChanges(); | |||||
| }); | |||||
| it('should create', () => { | |||||
| expect(component).toBeTruthy(); | |||||
| }); | |||||
| }); | |||||
| @@ -0,0 +1,124 @@ | |||||
| import {AfterViewInit, Component, EventEmitter, Input, OnInit, Output, ViewChild} from '@angular/core'; | |||||
| import {PagingComponent} from "@app/_components/paging/paging.component"; | |||||
| import {FormGroup} from "@angular/forms"; | |||||
| import {SearchInputColDef} from "@app/_components/search-input/search-input-col-def"; | |||||
| import {MatSort, Sort} from "@angular/material/sort"; | |||||
| import {OrderFilter} from "@app/_models/orderFilter"; | |||||
| @Component({ | |||||
| selector: 'app-search-select', | |||||
| templateUrl: './search-select.component.html', | |||||
| styleUrl: './search-select.component.scss' | |||||
| }) | |||||
| export class SearchSelectComponent implements OnInit, AfterViewInit { | |||||
| static COLUMN_TYPE_POSITION: string = 'position'; | |||||
| static COLUMN_TYPE_TEXT: string = 'text'; | |||||
| static COLUMN_TYPE_IMAGE: string = 'image'; | |||||
| static validColumnTypes: string[] = [ | |||||
| SearchSelectComponent.COLUMN_TYPE_POSITION, | |||||
| SearchSelectComponent.COLUMN_TYPE_TEXT, | |||||
| SearchSelectComponent.COLUMN_TYPE_IMAGE | |||||
| ]; | |||||
| @Input() public formId!: string; | |||||
| @Input() public formLabelLangKey!: string; | |||||
| @Input() public documentForm!: FormGroup; | |||||
| @Input() public documentFormField!: string; | |||||
| @Input() public getDataFunction!: Function; | |||||
| @Input() public dataSource: any; | |||||
| @Input() public searchSelectColDefs!: SearchInputColDef[]; | |||||
| @Output() rowSelected = new EventEmitter<any>(); | |||||
| @ViewChild("pagingComponent", { static: false }) pagingComponent!: PagingComponent | |||||
| @ViewChild(MatSort) sort; | |||||
| protected displayedColumns!: string[]; | |||||
| protected selectedRowIndex: number | null = null; | |||||
| constructor() { | |||||
| this.sort = new MatSort(); | |||||
| } | |||||
| ngOnInit(): void { | |||||
| this.displayedColumns = []; | |||||
| this.searchSelectColDefs.forEach((value, index) => { | |||||
| this.displayedColumns.push(value.column); | |||||
| }); | |||||
| } | |||||
| ngAfterViewInit(): void { | |||||
| } | |||||
| getData(): void { | |||||
| this.pagingComponent.getData(); | |||||
| } | |||||
| setData(dataSource: any, data: any[], dataLength: number): void { | |||||
| console.log(data); | |||||
| this.dataSource = dataSource; | |||||
| this.pagingComponent.dataSource = dataSource; | |||||
| this.pagingComponent.dataLength = dataLength; | |||||
| } | |||||
| getPagingComponent(): PagingComponent { | |||||
| return this.pagingComponent; | |||||
| } | |||||
| onSortChange = (sortState: Sort) => { | |||||
| this.pagingComponent.resetPageIndex() | |||||
| let order: OrderFilter; | |||||
| if (sortState.direction === "") { | |||||
| order = OrderFilter.Undefined; | |||||
| } else { | |||||
| order = sortState.direction; | |||||
| } | |||||
| this.pagingComponent.getData(); | |||||
| } | |||||
| onRowSelected(row: any, index: number) { | |||||
| console.log('row selected'); | |||||
| console.log(row, index); | |||||
| this.selectedRowIndex = index; | |||||
| this.documentForm.get(this.formId)?.setValue(row.id); | |||||
| } | |||||
| get COLUMN_TYPE_POSITION(): string { | |||||
| return SearchSelectComponent.COLUMN_TYPE_POSITION; | |||||
| } | |||||
| get COLUMN_TYPE_IMAGE(): string { | |||||
| return SearchSelectComponent.COLUMN_TYPE_IMAGE; | |||||
| } | |||||
| get COLUMN_TYPE_TEXT(): string { | |||||
| return SearchSelectComponent.COLUMN_TYPE_TEXT; | |||||
| } | |||||
| getElementValue(element: any, column: SearchInputColDef): any { | |||||
| if (column.field) { | |||||
| return column.subResource ? element[column.subResource][column.field] : element[column.field]; | |||||
| } | |||||
| } | |||||
| static createColDef( | |||||
| column: string, | |||||
| columnHeader: string, | |||||
| columnType: string, | |||||
| field?: string, | |||||
| subResource?: string | |||||
| ): SearchInputColDef { | |||||
| if (!this.validColumnTypes.includes(columnType)) { | |||||
| throw Error('invalid column type'); | |||||
| } | |||||
| let res: SearchInputColDef = {} as SearchInputColDef; | |||||
| res.column = column; | |||||
| res.columnHeader = columnHeader; | |||||
| res.columnType = columnType; | |||||
| res.field = field; | |||||
| res.subResource = subResource | |||||
| return res; | |||||
| } | |||||
| } | |||||
| @@ -498,6 +498,8 @@ export const taskNoteForm = new FormGroup({ | |||||
| message: new FormControl(null, [Validators.required]), | message: new FormControl(null, [Validators.required]), | ||||
| owner: new FormControl(null, []), | owner: new FormControl(null, []), | ||||
| taskIri: new FormControl(null, [Validators.required]), | taskIri: new FormControl(null, [Validators.required]), | ||||
| contact: new FormControl(null, []), | |||||
| contactIri: new FormControl(null, []), | |||||
| contactType: new FormControl(null, [Validators.required]), | contactType: new FormControl(null, [Validators.required]), | ||||
| createdAt: new FormControl(null, []) | createdAt: new FormControl(null, []) | ||||
| }); | }); | ||||
| @@ -507,6 +509,8 @@ export const taskNoteJsonhalForm = new FormGroup({ | |||||
| message: new FormControl(null, [Validators.required]), | message: new FormControl(null, [Validators.required]), | ||||
| owner: new FormControl(null, []), | owner: new FormControl(null, []), | ||||
| taskIri: new FormControl(null, [Validators.required]), | taskIri: new FormControl(null, [Validators.required]), | ||||
| contact: new FormControl(null, []), | |||||
| contactIri: new FormControl(null, []), | |||||
| contactType: new FormControl(null, [Validators.required]), | contactType: new FormControl(null, [Validators.required]), | ||||
| createdAt: new FormControl(null, []) | createdAt: new FormControl(null, []) | ||||
| }); | }); | ||||
| @@ -515,6 +519,8 @@ export const taskNoteJsonldForm = new FormGroup({ | |||||
| message: new FormControl(null, [Validators.required]), | message: new FormControl(null, [Validators.required]), | ||||
| owner: new FormControl(null, []), | owner: new FormControl(null, []), | ||||
| taskIri: new FormControl(null, [Validators.required]), | taskIri: new FormControl(null, [Validators.required]), | ||||
| contact: new FormControl(null, []), | |||||
| contactIri: new FormControl(null, []), | |||||
| contactType: new FormControl(null, [Validators.required]), | contactType: new FormControl(null, [Validators.required]), | ||||
| createdAt: new FormControl(null, []) | createdAt: new FormControl(null, []) | ||||
| }); | }); | ||||
| @@ -3,26 +3,28 @@ | |||||
| <div class="spt-form"> | <div class="spt-form"> | ||||
| <form [formGroup]="form" (ngSubmit)="onSubmit()"> | <form [formGroup]="form" (ngSubmit)="onSubmit()"> | ||||
| <div class="mb-3" *ngIf="this.partnerProduct"> | <div class="mb-3" *ngIf="this.partnerProduct"> | ||||
| <app-search-input #productSearchInput | |||||
| [formId]="'productIri'" | |||||
| [formLabelLangKey]="'form.product'" | |||||
| [dataField]="'productName'" | |||||
| [documentForm]="form" | |||||
| [documentFormField]="'productName'" | |||||
| [fetchFunction]="fetchPartnerProducts"> | |||||
| </app-search-input> | |||||
| <input type="hidden" formControlName="partnerIri" value="{{partnerProduct.partnerIri}}"/> | |||||
| <app-search-select #productSearchSelect | |||||
| [formId]="'productIri'" | |||||
| [formLabelLangKey]="'form.product'" | |||||
| [documentForm]="form" | |||||
| [getDataFunction]="getUnassignedProducts" | |||||
| [dataSource]="dataSourceProducts" | |||||
| [searchSelectColDefs]="colDefProducts" | |||||
| > | |||||
| <input type="hidden" formControlName="productIri" value="{{partnerProduct.productIri}}"/> | |||||
| </app-search-select> | |||||
| </div> | </div> | ||||
| <div class="mb-3" *ngIf="this.contactPartnerProduct"> | <div class="mb-3" *ngIf="this.contactPartnerProduct"> | ||||
| <app-search-input #productSearchInput | |||||
| [formId]="'partnerProductIri'" | |||||
| [formLabelLangKey]="'form.product'" | |||||
| [dataField]="'productName'" | |||||
| [documentForm]="form" | |||||
| [documentFormField]="'productName'" | |||||
| [fetchFunction]="fetchContactPartnerProducts"> | |||||
| </app-search-input> | |||||
| <input type="hidden" formControlName="partnerProductIri" value="{{contactPartnerProduct.partnerProductIri}}"/> | |||||
| <app-search-select #productSearchSelect | |||||
| [formId]="'partnerProductIri'" | |||||
| [formLabelLangKey]="'form.product'" | |||||
| [documentForm]="form" | |||||
| [getDataFunction]="getUnassignedPartnerProducts" | |||||
| [dataSource]="dataSourcePartnerProducts" | |||||
| [searchSelectColDefs]="colDefPartnerProducts" | |||||
| > | |||||
| <input type="hidden" formControlName="partnerProductIri" value="{{contactPartnerProduct.partnerProductIri}}"/> | |||||
| </app-search-select> | |||||
| </div> | </div> | ||||
| <button type="submit" class="btn btn-primary" [disabled]="form.invalid">{{'form.send' | translate}}</button> | <button type="submit" class="btn btn-primary" [disabled]="form.invalid">{{'form.send' | translate}}</button> | ||||
| </form> | </form> | ||||
| @@ -1,37 +1,62 @@ | |||||
| import {Component, EventEmitter, Input, OnInit, Output, ViewChild} from '@angular/core'; | |||||
| import {AfterViewInit, Component, EventEmitter, Input, OnInit, Output, ViewChild} from '@angular/core'; | |||||
| import { | import { | ||||
| ContactPartnerProductJsonld, ContactPartnerProductService, PartnerJsonld, | |||||
| PartnerProductJsonld, PartnerProductService, | |||||
| ContactPartnerProductJsonld, ContactPartnerProductService, | |||||
| PartnerProductJsonld, PartnerProductService, ProductJsonld, | |||||
| ProductService, | ProductService, | ||||
| } from "@app/core/api/v1"; | } from "@app/core/api/v1"; | ||||
| import {ModalStatus} from "@app/_helpers/modal.states"; | import {ModalStatus} from "@app/_helpers/modal.states"; | ||||
| import {SearchInputComponent} from "@app/_components/search-input/search-input.component"; | |||||
| import {FormGroupInitializer} from "@app/_helpers/formgroup.initializer"; | import {FormGroupInitializer} from "@app/_helpers/formgroup.initializer"; | ||||
| import {FormGroup} from "@angular/forms"; | import {FormGroup} from "@angular/forms"; | ||||
| import {contactPartnerProductForm, partnerProductForm} from "@app/_forms/apiForms"; | import {contactPartnerProductForm, partnerProductForm} from "@app/_forms/apiForms"; | ||||
| import {forkJoin, Observable} from "rxjs"; | |||||
| import {map} from "rxjs/operators"; | |||||
| import {SearchSelectComponent} from "@app/_components/search-select/search-select.component"; | |||||
| import {MatTableDataSource} from "@angular/material/table"; | |||||
| import {SearchInputColDef} from "@app/_components/search-input/search-input-col-def"; | |||||
| import {AppHelperService} from "@app/_helpers/app-helper.service"; | |||||
| @Component({ | @Component({ | ||||
| selector: 'app-assign-product', | selector: 'app-assign-product', | ||||
| templateUrl: './assign-product.component.html', | templateUrl: './assign-product.component.html', | ||||
| styleUrl: './assign-product.component.scss' | styleUrl: './assign-product.component.scss' | ||||
| }) | }) | ||||
| export class AssignProductComponent implements OnInit { | |||||
| export class AssignProductComponent implements OnInit, AfterViewInit { | |||||
| @Input() public partnerIri!: string; | @Input() public partnerIri!: string; | ||||
| @Input() public partnerProduct!: PartnerProductJsonld; | @Input() public partnerProduct!: PartnerProductJsonld; | ||||
| @Input() public contactPartnerProduct!: ContactPartnerProductJsonld; | @Input() public contactPartnerProduct!: ContactPartnerProductJsonld; | ||||
| @Output() public submit: EventEmitter<ModalStatus> = new EventEmitter<ModalStatus>(); | @Output() public submit: EventEmitter<ModalStatus> = new EventEmitter<ModalStatus>(); | ||||
| @ViewChild('productSearchInput', { static: false }) $productSearchInput!: SearchInputComponent; | |||||
| @ViewChild('productSearchSelect', { static: false }) productSearchSelect!: SearchSelectComponent; | |||||
| protected products: Array<ProductJsonld>; | |||||
| protected dataSourceProducts; | |||||
| protected partnerProducts: Array<PartnerProductJsonld>; | |||||
| protected dataSourcePartnerProducts; | |||||
| protected form!: FormGroup; | protected form!: FormGroup; | ||||
| protected colDefProducts: SearchInputColDef[]; | |||||
| protected colDefPartnerProducts: SearchInputColDef[]; | |||||
| constructor( | constructor( | ||||
| protected productService: ProductService, | protected productService: ProductService, | ||||
| protected partnerProductService: PartnerProductService, | protected partnerProductService: PartnerProductService, | ||||
| protected contactPartnerProductService: ContactPartnerProductService | |||||
| protected contactPartnerProductService: ContactPartnerProductService, | |||||
| protected appHelperService: AppHelperService, | |||||
| ) { | ) { | ||||
| this.products = []; | |||||
| this.dataSourceProducts = new MatTableDataSource<ProductJsonld>(this.products); | |||||
| this.partnerProducts = []; | |||||
| this.dataSourcePartnerProducts = new MatTableDataSource<PartnerProductJsonld>(this.partnerProducts); | |||||
| this.colDefProducts = [ | |||||
| SearchSelectComponent.createColDef('pos', 'overview.number', SearchSelectComponent.COLUMN_TYPE_POSITION), | |||||
| SearchSelectComponent.createColDef('img', 'overview.image', SearchSelectComponent.COLUMN_TYPE_IMAGE, 'imageUrl'), | |||||
| SearchSelectComponent.createColDef('name', 'overview.productname', SearchSelectComponent.COLUMN_TYPE_TEXT, 'name') | |||||
| ]; | |||||
| this.colDefPartnerProducts = [ | |||||
| SearchSelectComponent.createColDef('pos', 'overview.number', SearchSelectComponent.COLUMN_TYPE_POSITION), | |||||
| SearchSelectComponent.createColDef('img', 'overview.image', SearchSelectComponent.COLUMN_TYPE_IMAGE, 'imageUrl', 'product'), | |||||
| SearchSelectComponent.createColDef('name', 'overview.productname', SearchSelectComponent.COLUMN_TYPE_TEXT, 'name', 'product') | |||||
| ]; | |||||
| } | } | ||||
| ngOnInit(): void { | ngOnInit(): void { | ||||
| @@ -43,33 +68,29 @@ export class AssignProductComponent implements OnInit { | |||||
| } | } | ||||
| } | } | ||||
| fetchPartnerProducts = (term: string): Observable<{ id: any; name: any }[]> => { | |||||
| let products$ = this.productService.productsGetCollection(1, 50, term); | |||||
| let partnerProducts$ = this.partnerProductService.partnerProductsGetCollection( | |||||
| 1, | |||||
| 50, | |||||
| this.partnerProduct.partnerIri!, | |||||
| undefined, | |||||
| undefined, | |||||
| undefined, | |||||
| undefined, | |||||
| term | |||||
| ); | |||||
| ngAfterViewInit(): void { | |||||
| this.productSearchSelect.getData(); | |||||
| } | |||||
| // Combine api calls | |||||
| return forkJoin([products$, partnerProducts$]) | |||||
| .pipe( | |||||
| map(([productsResponse, partnerProductsResponse]) => { | |||||
| let products = productsResponse['hydra:member'].map(product => ({ id: product.id, name: product.name })); | |||||
| let partnerProductIds = partnerProductsResponse['hydra:member'].map(partnerProduct => partnerProduct.product?.id); | |||||
| // Filter all products where a partner product already exists | |||||
| return products.filter(product => !partnerProductIds.includes(product.id)); | |||||
| }) | |||||
| ); | |||||
| getUnassignedProducts = (term?: string): void => { | |||||
| // NOTE: all products that are not assigned to partner yet | |||||
| this.productService.productsGetCollection( | |||||
| this.productSearchSelect.pagingComponent.getPageIndex(), | |||||
| this.productSearchSelect.pagingComponent.getPageSize(), | |||||
| term, | |||||
| this.appHelperService.extractId(this.partnerProduct.partnerIri) | |||||
| ).subscribe( | |||||
| data => { | |||||
| this.products = data['hydra:member']; | |||||
| this.dataSourceProducts = new MatTableDataSource<ProductJsonld>(this.products); | |||||
| this.productSearchSelect.setData(this.dataSourceProducts, this.products, Number(data["hydra:totalItems"])); | |||||
| } | |||||
| ); | |||||
| } | } | ||||
| fetchContactPartnerProducts = (term: string): Observable<{ id: any; name: any }[]> => { | |||||
| let partnerProducts$ = this.partnerProductService.partnerProductsGetCollection( | |||||
| getUnassignedPartnerProducts = (term: string) => { | |||||
| // NOTE: all partner products that are not assigned to contact yet | |||||
| this.partnerProductService.partnerProductsGetCollection( | |||||
| 1, | 1, | ||||
| 50, | 50, | ||||
| this.partnerIri, | this.partnerIri, | ||||
| @@ -77,31 +98,17 @@ export class AssignProductComponent implements OnInit { | |||||
| undefined, | undefined, | ||||
| undefined, | undefined, | ||||
| undefined, | undefined, | ||||
| term | |||||
| ); | |||||
| let contactPartnerProducts$ = this.contactPartnerProductService.contactPartnerProductsGetCollection( | |||||
| 1, | |||||
| 50, | |||||
| this.contactPartnerProduct.contactIri!, | |||||
| term, | |||||
| undefined, | |||||
| undefined, | undefined, | ||||
| term | |||||
| this.appHelperService.extractId(this.contactPartnerProduct.contactIri) | |||||
| ).subscribe( | |||||
| data => { | |||||
| this.partnerProducts = data['hydra:member']; | |||||
| this.dataSourcePartnerProducts = new MatTableDataSource<PartnerProductJsonld>(this.partnerProducts); | |||||
| this.productSearchSelect.setData(this.dataSourceProducts, this.partnerProducts, Number(data["hydra:totalItems"])); | |||||
| } | |||||
| ); | ); | ||||
| // Combine api calls | |||||
| return forkJoin([partnerProducts$, contactPartnerProducts$]) | |||||
| .pipe( | |||||
| map(([partnerProductsResponse, contactPartnerProductsResponse]) => { | |||||
| let partnerProducts = partnerProductsResponse['hydra:member'].map(partnerProduct => | |||||
| ({ id: partnerProduct.id, name: partnerProduct.product!.name }) | |||||
| ); | |||||
| let contactPartnerProductIds = contactPartnerProductsResponse['hydra:member'].map(contactPartnerProduct => | |||||
| contactPartnerProduct.partnerProduct?.id | |||||
| ); | |||||
| // Filter all products where a partner product already exists | |||||
| return partnerProducts.filter(partnerProduct => !contactPartnerProductIds.includes(partnerProduct.id)); | |||||
| }) | |||||
| ); | |||||
| } | } | ||||
| onSubmit() { | onSubmit() { | ||||
| @@ -38,6 +38,7 @@ export class ProductListComponent implements OnInit, AfterViewInit { | |||||
| protected products: Array<ProductJsonld>; | protected products: Array<ProductJsonld>; | ||||
| protected dataSource; | protected dataSource; | ||||
| protected bShowNewProductButton: boolean; | protected bShowNewProductButton: boolean; | ||||
| protected nameOrderAsc: OrderFilter; | |||||
| constructor( | constructor( | ||||
| private router: Router, | private router: Router, | ||||
| @@ -55,6 +56,7 @@ export class ProductListComponent implements OnInit, AfterViewInit { | |||||
| this.products = []; | this.products = []; | ||||
| this.dataSource = new MatTableDataSource<ProductJsonld>(this.products); | this.dataSource = new MatTableDataSource<ProductJsonld>(this.products); | ||||
| this.bShowNewProductButton = true; | this.bShowNewProductButton = true; | ||||
| this.nameOrderAsc = OrderFilter.Asc; | |||||
| } | } | ||||
| ngOnInit(){ | ngOnInit(){ | ||||
| @@ -88,7 +90,9 @@ export class ProductListComponent implements OnInit, AfterViewInit { | |||||
| this.productsSub = this.productService.productsGetCollection( | this.productsSub = this.productService.productsGetCollection( | ||||
| this.pagingComponent.getPageIndex(), | this.pagingComponent.getPageIndex(), | ||||
| this.pagingComponent.getPageSize(), | this.pagingComponent.getPageSize(), | ||||
| searchValue | |||||
| searchValue, | |||||
| undefined, | |||||
| this.nameOrderAsc, | |||||
| ).subscribe( | ).subscribe( | ||||
| data => { | data => { | ||||
| this.products = data["hydra:member"]; | this.products = data["hydra:member"]; | ||||
| @@ -103,6 +107,10 @@ export class ProductListComponent implements OnInit, AfterViewInit { | |||||
| this.pagingComponent.getPageIndex(), | this.pagingComponent.getPageIndex(), | ||||
| this.pagingComponent.getPageSize(), | this.pagingComponent.getPageSize(), | ||||
| this.user.id, | this.user.id, | ||||
| undefined, | |||||
| undefined, | |||||
| undefined, | |||||
| this.nameOrderAsc, | |||||
| ).subscribe( | ).subscribe( | ||||
| data => { | data => { | ||||
| let userProducts = data["hydra:member"]; | let userProducts = data["hydra:member"]; | ||||
| @@ -127,7 +135,8 @@ export class ProductListComponent implements OnInit, AfterViewInit { | |||||
| undefined, | undefined, | ||||
| undefined, | undefined, | ||||
| undefined, | undefined, | ||||
| searchValue | |||||
| undefined, | |||||
| searchValue, | |||||
| ).subscribe( | ).subscribe( | ||||
| data => { | data => { | ||||
| let partnerProducts = data["hydra:member"]; | let partnerProducts = data["hydra:member"]; | ||||
| @@ -159,7 +168,6 @@ export class ProductListComponent implements OnInit, AfterViewInit { | |||||
| this.products.push(item.product); | this.products.push(item.product); | ||||
| } | } | ||||
| }) | }) | ||||
| console.log(this.products); | |||||
| this.pagingComponent.dataLength = Number(data["hydra:totalItems"]); | this.pagingComponent.dataLength = Number(data["hydra:totalItems"]); | ||||
| this.dataSource = new MatTableDataSource<ProductJsonld>(this.products); | this.dataSource = new MatTableDataSource<ProductJsonld>(this.products); | ||||
| } | } | ||||
| @@ -177,6 +185,7 @@ export class ProductListComponent implements OnInit, AfterViewInit { | |||||
| } else { | } else { | ||||
| order = sortState.direction; | order = sortState.direction; | ||||
| } | } | ||||
| this.nameOrderAsc = order; | |||||
| this.pagingComponent.getData(); | this.pagingComponent.getData(); | ||||
| } | } | ||||
| @@ -11,12 +11,23 @@ | |||||
| </div> | </div> | ||||
| <div class="mb-3"> | <div class="mb-3"> | ||||
| <p class="form-label">{{ 'form.contact-type' | translate }}:</p> | |||||
| <div class="d-flex"> | |||||
| <div class="form-check me-3" *ngFor="let type of contactTypes; let i = index"> | |||||
| <input type="radio" class="form-check-input" id="radio-{{ type }}" formControlName="contactType" [value]="type" /> | |||||
| <label for="radio-{{ type }}" class="form-check-label">{{ getTranslationKey(type) | translate }}</label> | |||||
| </div> | |||||
| <app-search-select #contactSearchSelect | |||||
| [formId]="'contactIri'" | |||||
| [formLabelLangKey]="'form.product'" | |||||
| [documentForm]="taskNoteForm" | |||||
| [getDataFunction]="getContacts" | |||||
| [dataSource]="dataSourceContacts" | |||||
| [searchSelectColDefs]="colDefContacts" | |||||
| > | |||||
| <input type="hidden" formControlName="contactIri" value="{{taskNote.contactIri}}"/> | |||||
| </app-search-select> | |||||
| </div> | |||||
| <p class="form-label">{{ 'form.contact-type' | translate }}:</p> | |||||
| <div class="d-flex"> | |||||
| <div class="form-check me-3" *ngFor="let type of contactTypes; let i = index"> | |||||
| <input type="radio" class="form-check-input" id="radio-{{ type }}" formControlName="contactType" [value]="type" /> | |||||
| <label for="radio-{{ type }}" class="form-check-label">{{ getContactTypeTranslationKey(type) | translate }}</label> | |||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| @@ -1,71 +1,113 @@ | |||||
| import {Component, EventEmitter, Input, Output} from '@angular/core'; | |||||
| import {TaskNoteJsonld, TaskNoteService} from "@app/core/api/v1"; | |||||
| import {AfterViewInit, Component, EventEmitter, Input, OnInit, Output, ViewChild} from '@angular/core'; | |||||
| import { | |||||
| ContactJsonld, | |||||
| ContactService, | |||||
| TaskJsonld, | |||||
| TaskNoteJsonld, | |||||
| TaskNoteService | |||||
| } from "@app/core/api/v1"; | |||||
| import {ModalStatus} from "@app/_helpers/modal.states"; | import {ModalStatus} from "@app/_helpers/modal.states"; | ||||
| import {FormGroup} from "@angular/forms"; | import {FormGroup} from "@angular/forms"; | ||||
| import {Subscription} from "rxjs"; | import {Subscription} from "rxjs"; | ||||
| import {FormGroupInitializer} from "@app/_helpers/formgroup.initializer"; | import {FormGroupInitializer} from "@app/_helpers/formgroup.initializer"; | ||||
| import {AppHelperService} from "@app/_helpers/app-helper.service"; | import {AppHelperService} from "@app/_helpers/app-helper.service"; | ||||
| import {taskNoteForm} from "@app/_forms/apiForms"; | import {taskNoteForm} from "@app/_forms/apiForms"; | ||||
| import {SearchSelectComponent} from "@app/_components/search-select/search-select.component"; | |||||
| import {MatTableDataSource} from "@angular/material/table"; | |||||
| import {SearchInputColDef} from "@app/_components/search-input/search-input-col-def"; | |||||
| @Component({ | @Component({ | ||||
| selector: 'app-new-task-note', | |||||
| templateUrl: './new-task-note.component.html', | |||||
| styleUrl: './new-task-note.component.scss' | |||||
| selector: 'app-new-task-note', | |||||
| templateUrl: './new-task-note.component.html', | |||||
| styleUrl: './new-task-note.component.scss' | |||||
| }) | }) | ||||
| export class NewTaskNoteComponent { | |||||
| @Input() public taskNote!: TaskNoteJsonld; | |||||
| @Output() public submit: EventEmitter<ModalStatus> = new EventEmitter<ModalStatus>(); | |||||
| export class NewTaskNoteComponent implements OnInit, AfterViewInit { | |||||
| @Input() public task!: TaskJsonld; | |||||
| @Input() public taskNote!: TaskNoteJsonld; | |||||
| @Output() public submit: EventEmitter<ModalStatus> = new EventEmitter<ModalStatus>(); | |||||
| @ViewChild('contactSearchSelect', { static: false }) contactSearchSelect!: SearchSelectComponent; | |||||
| protected taskNoteForm: FormGroup; | |||||
| protected taskNoteSub: Subscription; | |||||
| protected contactTypes = Object.values(TaskNoteJsonld.ContactTypeEnum); | |||||
| protected taskNoteForm: FormGroup; | |||||
| protected taskNoteSub: Subscription; | |||||
| protected contactTypes = Object.values(TaskNoteJsonld.ContactTypeEnum); | |||||
| protected contacts: Array<ContactJsonld>; | |||||
| protected dataSourceContacts; | |||||
| protected colDefContacts: SearchInputColDef[]; | |||||
| constructor( | |||||
| private taskNoteService: TaskNoteService, | |||||
| protected appHelperService: AppHelperService | |||||
| ) { | |||||
| this.taskNoteForm = taskNoteForm; | |||||
| this.taskNoteSub = new Subscription(); | |||||
| } | |||||
| constructor( | |||||
| protected taskNoteService: TaskNoteService, | |||||
| protected appHelperService: AppHelperService, | |||||
| protected contactService: ContactService | |||||
| ) { | |||||
| this.taskNoteForm = taskNoteForm; | |||||
| this.taskNoteSub = new Subscription(); | |||||
| this.contacts = []; | |||||
| this.dataSourceContacts = new MatTableDataSource<ContactJsonld>(this.contacts); | |||||
| ngOnInit(): void { | |||||
| this.taskNoteForm = FormGroupInitializer.initFormGroup(this.taskNoteForm, this.taskNote); | |||||
| const contactTypeControl = this.taskNoteForm.get('contactType'); | |||||
| // Set first radio checked | |||||
| if (contactTypeControl && !contactTypeControl.value) { | |||||
| contactTypeControl.patchValue(this.contactTypes[0]); | |||||
| this.colDefContacts = [ | |||||
| SearchSelectComponent.createColDef('pos', 'overview.number', SearchSelectComponent.COLUMN_TYPE_POSITION), | |||||
| SearchSelectComponent.createColDef('img', 'overview.image', SearchSelectComponent.COLUMN_TYPE_IMAGE, 'imageUrl'), | |||||
| SearchSelectComponent.createColDef('name', 'form.name', SearchSelectComponent.COLUMN_TYPE_TEXT, 'fullName') | |||||
| ]; | |||||
| } | } | ||||
| console.log(this.taskNoteForm); | |||||
| } | |||||
| getTranslationKey(type: string): string { | |||||
| return `task-note.type-${type}`; | |||||
| } | |||||
| ngOnInit(): void { | |||||
| this.taskNoteForm = FormGroupInitializer.initFormGroup(this.taskNoteForm, this.taskNote); | |||||
| const contactTypeControl = this.taskNoteForm.get('contactType'); | |||||
| // Set first radio checked | |||||
| if (contactTypeControl && !contactTypeControl.value) { | |||||
| contactTypeControl.patchValue(this.contactTypes[0]); | |||||
| } | |||||
| } | |||||
| ngAfterViewInit(): void { | |||||
| this.contactSearchSelect.getData(); | |||||
| } | |||||
| onSubmit() { | |||||
| if (this.taskNoteForm.valid) { | |||||
| if (this.taskNote.id === null || this.taskNote.id === undefined) { | |||||
| // Create new taskNote | |||||
| this.taskNoteSub = this.taskNoteService.taskNotesPost( | |||||
| this.taskNoteForm.value as TaskNoteJsonld | |||||
| getContacts = (term?: string): void => { | |||||
| this.contactService.contactsGetCollection( | |||||
| this.contactSearchSelect.pagingComponent.getPageIndex(), | |||||
| this.contactSearchSelect.pagingComponent.getPageSize(), | |||||
| this.task.partnerIri!, | |||||
| undefined, | |||||
| term | |||||
| ).subscribe( | ).subscribe( | ||||
| data => { | data => { | ||||
| this.taskNoteForm.reset(); | |||||
| this.submit.emit(ModalStatus.Submitted); | |||||
| this.contacts = data['hydra:member']; | |||||
| this.dataSourceContacts = new MatTableDataSource<ContactJsonld>(this.contacts); | |||||
| this.contactSearchSelect.setData(this.dataSourceContacts, this.contacts, Number(data["hydra:totalItems"])); | |||||
| } | } | ||||
| ); | ); | ||||
| } else { | |||||
| // Edit taskNote | |||||
| this.taskNoteSub = this.taskNoteService.taskNotesIdPatch( | |||||
| this.appHelperService.extractId(this.taskNote.id), | |||||
| this.taskNoteForm.value as TaskNoteJsonld | |||||
| ).subscribe( | |||||
| data => { | |||||
| this.taskNoteForm.reset(); | |||||
| this.submit.emit(ModalStatus.Submitted); | |||||
| } | |||||
| getContactTypeTranslationKey(type: string): string { | |||||
| return `task-note.type-${type}`; | |||||
| } | |||||
| onSubmit() { | |||||
| if (this.taskNoteForm.valid) { | |||||
| if (this.taskNote.id === null || this.taskNote.id === undefined) { | |||||
| // Create new taskNote | |||||
| this.taskNoteSub = this.taskNoteService.taskNotesPost( | |||||
| this.taskNoteForm.value as TaskNoteJsonld | |||||
| ).subscribe( | |||||
| data => { | |||||
| this.taskNoteForm.reset(); | |||||
| this.submit.emit(ModalStatus.Submitted); | |||||
| } | |||||
| ); | |||||
| } else { | |||||
| // Edit taskNote | |||||
| this.taskNoteSub = this.taskNoteService.taskNotesIdPatch( | |||||
| this.appHelperService.extractId(this.taskNote.id), | |||||
| this.taskNoteForm.value as TaskNoteJsonld | |||||
| ).subscribe( | |||||
| data => { | |||||
| this.taskNoteForm.reset(); | |||||
| this.submit.emit(ModalStatus.Submitted); | |||||
| } | |||||
| ); | |||||
| } | } | ||||
| ); | |||||
| } | |||||
| } | |||||
| } | } | ||||
| } | |||||
| } | } | ||||
| @@ -18,18 +18,33 @@ | |||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| <div class="mb-3" *ngIf="task.partner === null"> | |||||
| <label for="partner" class="form-label">{{ 'form.partner' | translate }}:</label> | |||||
| <input type="text" class="form-control" id="partner" [ngbTypeahead]="searchPartners" [inputFormatter]="formatter" | |||||
| [resultFormatter]="formatter" [value]="taskForm.get('partnerName')?.value" [editable]="false" (selectItem)="onPartnerSelect($event)"/> | |||||
| <input type="hidden" formControlName="partner"/> | |||||
| <div class="mb-3"> | |||||
| <label for="productIri" class="form-label">{{ 'form.product' | translate }}:</label> | |||||
| <app-search-select #productSearchSelect id="productIri" | |||||
| [formId]="'productIri'" | |||||
| [formLabelLangKey]="'form.product'" | |||||
| [documentForm]="taskForm" | |||||
| [getDataFunction]="getProducts" | |||||
| [dataSource]="dataSourceProducts" | |||||
| [searchSelectColDefs]="colDefProducts" | |||||
| > | |||||
| <input type="hidden" formControlName="productIri" value="{{task.productIri}}"/> | |||||
| </app-search-select> | |||||
| </div> | </div> | ||||
| <div class="mb-3"> | <div class="mb-3"> | ||||
| <label for="assignedTo" class="form-label">{{ 'form.assign-to' | translate }}:</label> | |||||
| <input type="text" class="form-control" id="assignedTo" [ngbTypeahead]="searchUsers" [inputFormatter]="formatter" | |||||
| [resultFormatter]="formatter" [value]="taskForm.get('assignedToName')?.value" [editable]="false" (selectItem)="onAssignedToSelect($event)"/> | |||||
| <input type="hidden" formControlName="assignedTo"/> | |||||
| <label for="assignedToIri" class="form-label">{{ 'form.assign-to' | translate }}:</label> | |||||
| <app-search-select #userSearchSelect id="assignedToIri" | |||||
| [formId]="'assignedToIri'" | |||||
| [formLabelLangKey]="'form.user'" | |||||
| [documentForm]="taskForm" | |||||
| [getDataFunction]="getUsers" | |||||
| [dataSource]="dataSourceUsers" | |||||
| [searchSelectColDefs]="colDefUsers" | |||||
| > | |||||
| <input type="hidden" formControlName="assignedToIri" value="{{task.productIri}}"/> | |||||
| </app-search-select> | |||||
| <div class="form-text" *ngIf="taskForm.get('assignedTo')?.invalid && taskForm.get('assignedTo')?.touched"> | <div class="form-text" *ngIf="taskForm.get('assignedTo')?.invalid && taskForm.get('assignedTo')?.touched"> | ||||
| {{ 'form.assign-to' | translate }} {{ 'form.mandatory' | translate }}. | {{ 'form.assign-to' | translate }} {{ 'form.mandatory' | translate }}. | ||||
| </div> | </div> | ||||
| @@ -1,5 +1,13 @@ | |||||
| import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core'; | |||||
| import {PartnerService, TaskJsonld, TaskService, UserJsonld, UserService} from "@app/core/api/v1"; | |||||
| import {AfterViewInit, Component, EventEmitter, Input, OnInit, Output, ViewChild} from '@angular/core'; | |||||
| import { | |||||
| PartnerService, | |||||
| ProductJsonld, | |||||
| ProductService, | |||||
| TaskJsonld, | |||||
| TaskService, | |||||
| UserJsonld, | |||||
| UserService | |||||
| } from "@app/core/api/v1"; | |||||
| import {ModalStatus} from "@app/_helpers/modal.states"; | import {ModalStatus} from "@app/_helpers/modal.states"; | ||||
| import {FormGroupInitializer} from "@app/_helpers/formgroup.initializer"; | import {FormGroupInitializer} from "@app/_helpers/formgroup.initializer"; | ||||
| import {FormGroup} from "@angular/forms"; | import {FormGroup} from "@angular/forms"; | ||||
| @@ -7,37 +15,105 @@ import {debounceTime, distinctUntilChanged, Observable, OperatorFunction, Subscr | |||||
| import {taskForm} from "@app/_forms/apiForms"; | import {taskForm} from "@app/_forms/apiForms"; | ||||
| import {AppHelperService} from "@app/_helpers/app-helper.service"; | import {AppHelperService} from "@app/_helpers/app-helper.service"; | ||||
| import {filter, map} from "rxjs/operators"; | import {filter, map} from "rxjs/operators"; | ||||
| import {MatTableDataSource} from "@angular/material/table"; | |||||
| import {SearchSelectComponent} from "@app/_components/search-select/search-select.component"; | |||||
| import {SearchInputColDef} from "@app/_components/search-input/search-input-col-def"; | |||||
| @Component({ | @Component({ | ||||
| selector: 'app-new-task', | selector: 'app-new-task', | ||||
| templateUrl: './new-task.component.html', | templateUrl: './new-task.component.html', | ||||
| styleUrl: './new-task.component.scss' | styleUrl: './new-task.component.scss' | ||||
| }) | }) | ||||
| export class NewTaskComponent implements OnInit { | |||||
| export class NewTaskComponent implements OnInit, AfterViewInit { | |||||
| @Input() public task!: TaskJsonld; | @Input() public task!: TaskJsonld; | ||||
| @Output() public submit: EventEmitter<ModalStatus> = new EventEmitter<ModalStatus>(); | @Output() public submit: EventEmitter<ModalStatus> = new EventEmitter<ModalStatus>(); | ||||
| @ViewChild('userSearchSelect', { static: false }) userSearchSelect!: SearchSelectComponent; | |||||
| @ViewChild('productSearchSelect', { static: false }) productSearchSelect!: SearchSelectComponent; | |||||
| protected taskForm: FormGroup; | protected taskForm: FormGroup; | ||||
| protected taskSub: Subscription; | protected taskSub: Subscription; | ||||
| protected dueAtValue: string; | protected dueAtValue: string; | ||||
| protected users: Array<UserJsonld>; | |||||
| protected dataSourceUsers; | |||||
| protected products: Array<ProductJsonld>; | |||||
| protected dataSourceProducts; | |||||
| protected colDefUsers: SearchInputColDef[]; | |||||
| protected colDefProducts: SearchInputColDef[]; | |||||
| protected formatter = (apiData: any) => apiData.name; | protected formatter = (apiData: any) => apiData.name; | ||||
| constructor( | constructor( | ||||
| private taskService: TaskService, | private taskService: TaskService, | ||||
| private userService: UserService, | private userService: UserService, | ||||
| private partnerService: PartnerService, | private partnerService: PartnerService, | ||||
| protected productService: ProductService, | |||||
| protected appHelperService: AppHelperService | protected appHelperService: AppHelperService | ||||
| ) { | ) { | ||||
| this.users = []; | |||||
| this.dataSourceUsers = new MatTableDataSource<UserJsonld>(this.users); | |||||
| this.products = []; | |||||
| this.dataSourceProducts = new MatTableDataSource<ProductJsonld>(this.products); | |||||
| this.taskForm = taskForm; | this.taskForm = taskForm; | ||||
| this.taskSub = new Subscription(); | this.taskSub = new Subscription(); | ||||
| this.dueAtValue = ""; | this.dueAtValue = ""; | ||||
| this.colDefUsers = [ | |||||
| SearchSelectComponent.createColDef('pos', 'overview.number', SearchSelectComponent.COLUMN_TYPE_POSITION), | |||||
| SearchSelectComponent.createColDef('img', 'overview.image', SearchSelectComponent.COLUMN_TYPE_IMAGE, 'imageUrl'), | |||||
| SearchSelectComponent.createColDef('name', 'form.name', SearchSelectComponent.COLUMN_TYPE_TEXT, 'fullName'), | |||||
| ]; | |||||
| this.colDefProducts = [ | |||||
| SearchSelectComponent.createColDef('pos', 'overview.number', SearchSelectComponent.COLUMN_TYPE_POSITION), | |||||
| SearchSelectComponent.createColDef('img', 'overview.image', SearchSelectComponent.COLUMN_TYPE_IMAGE, 'imageUrl'), | |||||
| SearchSelectComponent.createColDef('name', 'form.product', SearchSelectComponent.COLUMN_TYPE_TEXT, 'name'), | |||||
| ]; | |||||
| } | } | ||||
| ngOnInit(): void { | ngOnInit(): void { | ||||
| this.taskForm = FormGroupInitializer.initFormGroup(this.taskForm, this.task); | this.taskForm = FormGroupInitializer.initFormGroup(this.taskForm, this.task); | ||||
| } | } | ||||
| ngAfterViewInit(): void { | |||||
| this.userSearchSelect.getData(); | |||||
| this.productSearchSelect.getData(); | |||||
| } | |||||
| getUsers = (term?: string): void => { | |||||
| this.userService.usersGetCollection(1, 50, undefined, term) | |||||
| this.userService.usersGetCollection( | |||||
| this.userSearchSelect.pagingComponent.getPageIndex(), | |||||
| this.userSearchSelect.pagingComponent.getPageSize(), | |||||
| undefined, | |||||
| undefined, | |||||
| term | |||||
| ).subscribe( | |||||
| data => { | |||||
| this.users = data['hydra:member']; | |||||
| this.dataSourceUsers = new MatTableDataSource<UserJsonld>(this.users); | |||||
| this.userSearchSelect.setData(this.dataSourceUsers, this.users, Number(data["hydra:totalItems"])); | |||||
| } | |||||
| ) | |||||
| } | |||||
| getProducts = (term?: string): void => { | |||||
| // NOTE: all products that are not assigned to partner yet | |||||
| this.productService.productsGetCollection( | |||||
| this.productSearchSelect.pagingComponent.getPageIndex(), | |||||
| this.productSearchSelect.pagingComponent.getPageSize(), | |||||
| term | |||||
| ).subscribe( | |||||
| data => { | |||||
| this.products = data['hydra:member']; | |||||
| this.dataSourceProducts = new MatTableDataSource<ProductJsonld>(this.products); | |||||
| this.productSearchSelect.setData(this.dataSourceProducts, this.products, Number(data["hydra:totalItems"])); | |||||
| } | |||||
| ); | |||||
| } | |||||
| protected searchUsers: OperatorFunction<string, readonly { id: any; name: any }[]> = (text$: Observable<string>) => | protected searchUsers: OperatorFunction<string, readonly { id: any; name: any }[]> = (text$: Observable<string>) => | ||||
| text$.pipe( | text$.pipe( | ||||
| debounceTime(200), | debounceTime(200), | ||||
| @@ -111,7 +111,7 @@ | |||||
| </div> | </div> | ||||
| <span *ngIf="taskNote.owner === currentUser?.id" class="position-absolute bi bi-pencil p-2" | <span *ngIf="taskNote.owner === currentUser?.id" class="position-absolute bi bi-pencil p-2" | ||||
| data-type="user-tool" data-action="edit" | data-type="user-tool" data-action="edit" | ||||
| (click)="openModalEditTaskNote(taskNote)"></span> | |||||
| (click)="openModalEditTaskNote(taskNote, task)"></span> | |||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| @@ -153,11 +153,15 @@ export class TaskListComponent implements OnInit, AfterViewInit { | |||||
| openModalNewTaskNote(task: TaskJsonld) { | openModalNewTaskNote(task: TaskJsonld) { | ||||
| let taskNote: TaskNoteJsonld = {} as TaskNoteJsonld; | let taskNote: TaskNoteJsonld = {} as TaskNoteJsonld; | ||||
| taskNote.taskIri = task.id ?? null; | taskNote.taskIri = task.id ?? null; | ||||
| this.appHelperService.openModal(NewTaskNoteComponent, { 'taskNote': taskNote }, this.afterCommentCreation, task.id); | |||||
| this.appHelperService.openModal( | |||||
| NewTaskNoteComponent, { 'taskNote': taskNote, 'task': task }, this.afterCommentCreation, task.id | |||||
| ); | |||||
| } | } | ||||
| openModalEditTaskNote(taskNote: TaskNoteJsonld) { | |||||
| this.appHelperService.openModal(NewTaskNoteComponent, { 'taskNote': taskNote }, this.afterCommentCreation, taskNote.id); | |||||
| openModalEditTaskNote(taskNote: TaskNoteJsonld, task: TaskJsonld) { | |||||
| this.appHelperService.openModal( | |||||
| NewTaskNoteComponent, { 'taskNote': taskNote, 'task': task }, this.afterCommentCreation, taskNote.id | |||||
| ); | |||||
| } | } | ||||
| switchTaskCompactMode() { | switchTaskCompactMode() { | ||||
| @@ -64,6 +64,7 @@ import { UserListComponent } from './_views/user/user-list/user-list.component'; | |||||
| import { AssignProductComponent } from './_views/products/assign-product/assign-product.component'; | import { AssignProductComponent } from './_views/products/assign-product/assign-product.component'; | ||||
| import { LinkedLabelComponent } from './_components/linked-label/linked-label.component'; | import { LinkedLabelComponent } from './_components/linked-label/linked-label.component'; | ||||
| import {LoadingInterceptor} from "@app/_helpers/loading-interceptor.service"; | import {LoadingInterceptor} from "@app/_helpers/loading-interceptor.service"; | ||||
| import { SearchSelectComponent } from './_components/search-select/search-select.component'; | |||||
| export function apiConfigFactory(): Configuration { | export function apiConfigFactory(): Configuration { | ||||
| @@ -150,6 +151,7 @@ export function HttpLoaderFactory(http: HttpClient) { | |||||
| UserListComponent, | UserListComponent, | ||||
| AssignProductComponent, | AssignProductComponent, | ||||
| LinkedLabelComponent, | LinkedLabelComponent, | ||||
| SearchSelectComponent, | |||||
| ], | ], | ||||
| providers: [ | providers: [ | ||||
| {provide: HTTP_INTERCEPTORS, useClass: JwtInterceptor, multi: true}, | {provide: HTTP_INTERCEPTORS, useClass: JwtInterceptor, multi: true}, | ||||
| @@ -106,13 +106,14 @@ export class ContactService { | |||||
| * @param itemsPerPage The number of items per page | * @param itemsPerPage The number of items per page | ||||
| * @param partner | * @param partner | ||||
| * @param partner2 | * @param partner2 | ||||
| * @param nameSearch | |||||
| * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | ||||
| * @param reportProgress flag to report request and response progress. | * @param reportProgress flag to report request and response progress. | ||||
| */ | */ | ||||
| public contactsGetCollection(page?: number, itemsPerPage?: number, partner?: string, partner2?: Array<string>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<ApiContactsGetCollection200Response>; | |||||
| public contactsGetCollection(page?: number, itemsPerPage?: number, partner?: string, partner2?: Array<string>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<ApiContactsGetCollection200Response>>; | |||||
| public contactsGetCollection(page?: number, itemsPerPage?: number, partner?: string, partner2?: Array<string>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<ApiContactsGetCollection200Response>>; | |||||
| public contactsGetCollection(page?: number, itemsPerPage?: number, partner?: string, partner2?: Array<string>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<any> { | |||||
| public contactsGetCollection(page?: number, itemsPerPage?: number, partner?: string, partner2?: Array<string>, nameSearch?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<ApiContactsGetCollection200Response>; | |||||
| public contactsGetCollection(page?: number, itemsPerPage?: number, partner?: string, partner2?: Array<string>, nameSearch?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<ApiContactsGetCollection200Response>>; | |||||
| public contactsGetCollection(page?: number, itemsPerPage?: number, partner?: string, partner2?: Array<string>, nameSearch?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<ApiContactsGetCollection200Response>>; | |||||
| public contactsGetCollection(page?: number, itemsPerPage?: number, partner?: string, partner2?: Array<string>, nameSearch?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<any> { | |||||
| let localVarQueryParameters = new HttpParams({encoder: this.encoder}); | let localVarQueryParameters = new HttpParams({encoder: this.encoder}); | ||||
| if (page !== undefined && page !== null) { | if (page !== undefined && page !== null) { | ||||
| @@ -133,6 +134,10 @@ export class ContactService { | |||||
| <any>element, 'partner[]'); | <any>element, 'partner[]'); | ||||
| }) | }) | ||||
| } | } | ||||
| if (nameSearch !== undefined && nameSearch !== null) { | |||||
| localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, | |||||
| <any>nameSearch, 'nameSearch'); | |||||
| } | |||||
| let localVarHeaders = this.defaultHeaders; | let localVarHeaders = this.defaultHeaders; | ||||
| @@ -112,13 +112,14 @@ export class PartnerProductService { | |||||
| * @param productName | * @param productName | ||||
| * @param partnerType | * @param partnerType | ||||
| * @param partnerType2 | * @param partnerType2 | ||||
| * @param productPartnerUnassigned | |||||
| * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | ||||
| * @param reportProgress flag to report request and response progress. | * @param reportProgress flag to report request and response progress. | ||||
| */ | */ | ||||
| public partnerProductsGetCollection(page?: number, itemsPerPage?: number, partner?: string, partner2?: Array<string>, partnerName?: string, product?: string, product2?: Array<string>, productName?: string, partnerType?: string, partnerType2?: Array<string>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<ApiPartnerProductsGetCollection200Response>; | |||||
| public partnerProductsGetCollection(page?: number, itemsPerPage?: number, partner?: string, partner2?: Array<string>, partnerName?: string, product?: string, product2?: Array<string>, productName?: string, partnerType?: string, partnerType2?: Array<string>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<ApiPartnerProductsGetCollection200Response>>; | |||||
| public partnerProductsGetCollection(page?: number, itemsPerPage?: number, partner?: string, partner2?: Array<string>, partnerName?: string, product?: string, product2?: Array<string>, productName?: string, partnerType?: string, partnerType2?: Array<string>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<ApiPartnerProductsGetCollection200Response>>; | |||||
| public partnerProductsGetCollection(page?: number, itemsPerPage?: number, partner?: string, partner2?: Array<string>, partnerName?: string, product?: string, product2?: Array<string>, productName?: string, partnerType?: string, partnerType2?: Array<string>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<any> { | |||||
| public partnerProductsGetCollection(page?: number, itemsPerPage?: number, partner?: string, partner2?: Array<string>, partnerName?: string, product?: string, product2?: Array<string>, productName?: string, partnerType?: string, partnerType2?: Array<string>, productPartnerUnassigned?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<ApiPartnerProductsGetCollection200Response>; | |||||
| public partnerProductsGetCollection(page?: number, itemsPerPage?: number, partner?: string, partner2?: Array<string>, partnerName?: string, product?: string, product2?: Array<string>, productName?: string, partnerType?: string, partnerType2?: Array<string>, productPartnerUnassigned?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<ApiPartnerProductsGetCollection200Response>>; | |||||
| public partnerProductsGetCollection(page?: number, itemsPerPage?: number, partner?: string, partner2?: Array<string>, partnerName?: string, product?: string, product2?: Array<string>, productName?: string, partnerType?: string, partnerType2?: Array<string>, productPartnerUnassigned?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<ApiPartnerProductsGetCollection200Response>>; | |||||
| public partnerProductsGetCollection(page?: number, itemsPerPage?: number, partner?: string, partner2?: Array<string>, partnerName?: string, product?: string, product2?: Array<string>, productName?: string, partnerType?: string, partnerType2?: Array<string>, productPartnerUnassigned?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<any> { | |||||
| let localVarQueryParameters = new HttpParams({encoder: this.encoder}); | let localVarQueryParameters = new HttpParams({encoder: this.encoder}); | ||||
| if (page !== undefined && page !== null) { | if (page !== undefined && page !== null) { | ||||
| @@ -167,6 +168,10 @@ export class PartnerProductService { | |||||
| <any>element, 'partner.type[]'); | <any>element, 'partner.type[]'); | ||||
| }) | }) | ||||
| } | } | ||||
| if (productPartnerUnassigned !== undefined && productPartnerUnassigned !== null) { | |||||
| localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, | |||||
| <any>productPartnerUnassigned, 'productPartnerUnassigned'); | |||||
| } | |||||
| let localVarHeaders = this.defaultHeaders; | let localVarHeaders = this.defaultHeaders; | ||||
| @@ -105,14 +105,15 @@ export class ProductService { | |||||
| * @param page The collection page number | * @param page The collection page number | ||||
| * @param itemsPerPage The number of items per page | * @param itemsPerPage The number of items per page | ||||
| * @param name | * @param name | ||||
| * @param partnerIdUnassigned | |||||
| * @param orderName | * @param orderName | ||||
| * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | ||||
| * @param reportProgress flag to report request and response progress. | * @param reportProgress flag to report request and response progress. | ||||
| */ | */ | ||||
| public productsGetCollection(page?: number, itemsPerPage?: number, name?: string, orderName?: 'asc' | 'desc', observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<ApiProductsGetCollection200Response>; | |||||
| public productsGetCollection(page?: number, itemsPerPage?: number, name?: string, orderName?: 'asc' | 'desc', observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<ApiProductsGetCollection200Response>>; | |||||
| public productsGetCollection(page?: number, itemsPerPage?: number, name?: string, orderName?: 'asc' | 'desc', observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<ApiProductsGetCollection200Response>>; | |||||
| public productsGetCollection(page?: number, itemsPerPage?: number, name?: string, orderName?: 'asc' | 'desc', observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<any> { | |||||
| public productsGetCollection(page?: number, itemsPerPage?: number, name?: string, partnerIdUnassigned?: string, orderName?: 'asc' | 'desc', observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<ApiProductsGetCollection200Response>; | |||||
| public productsGetCollection(page?: number, itemsPerPage?: number, name?: string, partnerIdUnassigned?: string, orderName?: 'asc' | 'desc', observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<ApiProductsGetCollection200Response>>; | |||||
| public productsGetCollection(page?: number, itemsPerPage?: number, name?: string, partnerIdUnassigned?: string, orderName?: 'asc' | 'desc', observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<ApiProductsGetCollection200Response>>; | |||||
| public productsGetCollection(page?: number, itemsPerPage?: number, name?: string, partnerIdUnassigned?: string, orderName?: 'asc' | 'desc', observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<any> { | |||||
| let localVarQueryParameters = new HttpParams({encoder: this.encoder}); | let localVarQueryParameters = new HttpParams({encoder: this.encoder}); | ||||
| if (page !== undefined && page !== null) { | if (page !== undefined && page !== null) { | ||||
| @@ -127,6 +128,10 @@ export class ProductService { | |||||
| localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, | localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, | ||||
| <any>name, 'name'); | <any>name, 'name'); | ||||
| } | } | ||||
| if (partnerIdUnassigned !== undefined && partnerIdUnassigned !== null) { | |||||
| localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, | |||||
| <any>partnerIdUnassigned, 'partnerIdUnassigned'); | |||||
| } | |||||
| if (orderName !== undefined && orderName !== null) { | if (orderName !== undefined && orderName !== null) { | ||||
| localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, | localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, | ||||
| <any>orderName, 'order[name]'); | <any>orderName, 'order[name]'); | ||||
| @@ -106,13 +106,14 @@ export class UserService { | |||||
| * @param itemsPerPage The number of items per page | * @param itemsPerPage The number of items per page | ||||
| * @param firstName | * @param firstName | ||||
| * @param lastName | * @param lastName | ||||
| * @param nameSearch | |||||
| * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | ||||
| * @param reportProgress flag to report request and response progress. | * @param reportProgress flag to report request and response progress. | ||||
| */ | */ | ||||
| public usersGetCollection(page?: number, itemsPerPage?: number, firstName?: string, lastName?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<ApiUsersGetCollection200Response>; | |||||
| public usersGetCollection(page?: number, itemsPerPage?: number, firstName?: string, lastName?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<ApiUsersGetCollection200Response>>; | |||||
| public usersGetCollection(page?: number, itemsPerPage?: number, firstName?: string, lastName?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<ApiUsersGetCollection200Response>>; | |||||
| public usersGetCollection(page?: number, itemsPerPage?: number, firstName?: string, lastName?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<any> { | |||||
| public usersGetCollection(page?: number, itemsPerPage?: number, firstName?: string, lastName?: string, nameSearch?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<ApiUsersGetCollection200Response>; | |||||
| public usersGetCollection(page?: number, itemsPerPage?: number, firstName?: string, lastName?: string, nameSearch?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<ApiUsersGetCollection200Response>>; | |||||
| public usersGetCollection(page?: number, itemsPerPage?: number, firstName?: string, lastName?: string, nameSearch?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<ApiUsersGetCollection200Response>>; | |||||
| public usersGetCollection(page?: number, itemsPerPage?: number, firstName?: string, lastName?: string, nameSearch?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<any> { | |||||
| let localVarQueryParameters = new HttpParams({encoder: this.encoder}); | let localVarQueryParameters = new HttpParams({encoder: this.encoder}); | ||||
| if (page !== undefined && page !== null) { | if (page !== undefined && page !== null) { | ||||
| @@ -131,6 +132,10 @@ export class UserService { | |||||
| localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, | localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, | ||||
| <any>lastName, 'lastName'); | <any>lastName, 'lastName'); | ||||
| } | } | ||||
| if (nameSearch !== undefined && nameSearch !== null) { | |||||
| localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, | |||||
| <any>nameSearch, 'nameSearch'); | |||||
| } | |||||
| let localVarHeaders = this.defaultHeaders; | let localVarHeaders = this.defaultHeaders; | ||||
| @@ -10,6 +10,7 @@ | |||||
| * Do not edit the class manually. | * Do not edit the class manually. | ||||
| */ | */ | ||||
| import { User } from './user'; | import { User } from './user'; | ||||
| import { Contact } from './contact'; | |||||
| /** | /** | ||||
| @@ -22,6 +23,11 @@ export interface TaskNote { | |||||
| */ | */ | ||||
| readonly owner?: User; | readonly owner?: User; | ||||
| taskIri: string | null; | taskIri: string | null; | ||||
| /** | |||||
| * ?ContactApi | |||||
| */ | |||||
| readonly contact?: Contact; | |||||
| contactIri?: string | null; | |||||
| contactType: TaskNote.ContactTypeEnum; | contactType: TaskNote.ContactTypeEnum; | ||||
| readonly createdAt?: string | null; | readonly createdAt?: string | null; | ||||
| } | } | ||||
| @@ -10,6 +10,7 @@ | |||||
| * Do not edit the class manually. | * Do not edit the class manually. | ||||
| */ | */ | ||||
| import { CommentJsonhalLinks } from './commentJsonhalLinks'; | import { CommentJsonhalLinks } from './commentJsonhalLinks'; | ||||
| import { ContactJsonhal } from './contactJsonhal'; | |||||
| import { UserJsonhal } from './userJsonhal'; | import { UserJsonhal } from './userJsonhal'; | ||||
| @@ -24,6 +25,11 @@ export interface TaskNoteJsonhal { | |||||
| */ | */ | ||||
| readonly owner?: UserJsonhal; | readonly owner?: UserJsonhal; | ||||
| taskIri: string | null; | taskIri: string | null; | ||||
| /** | |||||
| * ?ContactApi | |||||
| */ | |||||
| readonly contact?: ContactJsonhal; | |||||
| contactIri?: string | null; | |||||
| contactType: TaskNoteJsonhal.ContactTypeEnum; | contactType: TaskNoteJsonhal.ContactTypeEnum; | ||||
| readonly createdAt?: string | null; | readonly createdAt?: string | null; | ||||
| } | } | ||||
| @@ -9,6 +9,7 @@ | |||||
| * https://openapi-generator.tech | * https://openapi-generator.tech | ||||
| * Do not edit the class manually. | * Do not edit the class manually. | ||||
| */ | */ | ||||
| import { ContactJsonld } from './contactJsonld'; | |||||
| import { UserJsonld } from './userJsonld'; | import { UserJsonld } from './userJsonld'; | ||||
| import { CommentJsonldContext } from './commentJsonldContext'; | import { CommentJsonldContext } from './commentJsonldContext'; | ||||
| @@ -26,6 +27,11 @@ export interface TaskNoteJsonld { | |||||
| */ | */ | ||||
| readonly owner?: UserJsonld; | readonly owner?: UserJsonld; | ||||
| taskIri: string | null; | taskIri: string | null; | ||||
| /** | |||||
| * ?ContactApi | |||||
| */ | |||||
| readonly contact?: ContactJsonld; | |||||
| contactIri?: string | null; | |||||
| contactType: TaskNoteJsonld.ContactTypeEnum; | contactType: TaskNoteJsonld.ContactTypeEnum; | ||||
| readonly createdAt?: string | null; | readonly createdAt?: string | null; | ||||
| } | } | ||||
| @@ -130,7 +130,9 @@ | |||||
| "send": "Speichern", | "send": "Speichern", | ||||
| "search-placeholder": "Suche", | "search-placeholder": "Suche", | ||||
| "no-data": "Keine Datensätze gefunden.", | "no-data": "Keine Datensätze gefunden.", | ||||
| "contact-type": "Kontaktart" | |||||
| "contact-type": "Kontaktart", | |||||
| "user": "Benutzer", | |||||
| "contact": "Kontakt" | |||||
| }, | }, | ||||
| "sales": | "sales": | ||||
| { | { | ||||