| @@ -4329,7 +4329,10 @@ components: | |||
| - integer | |||
| - 'null' | |||
| trip: | |||
| $ref: '#/components/schemas/Trip' | |||
| readOnly: true | |||
| type: string | |||
| format: iri-reference | |||
| example: 'https://example.com/' | |||
| tripIri: | |||
| type: | |||
| - string | |||
| @@ -4337,7 +4340,10 @@ components: | |||
| format: iri-reference | |||
| example: 'https://example.com/' | |||
| location: | |||
| $ref: '#/components/schemas/Location' | |||
| readOnly: true | |||
| type: string | |||
| format: iri-reference | |||
| example: 'https://example.com/' | |||
| locationIri: | |||
| type: | |||
| - string | |||
| @@ -4397,6 +4403,7 @@ components: | |||
| - integer | |||
| - 'null' | |||
| trip: | |||
| readOnly: true | |||
| $ref: '#/components/schemas/Trip.jsonld' | |||
| tripIri: | |||
| type: | |||
| @@ -4405,6 +4412,7 @@ components: | |||
| format: iri-reference | |||
| example: 'https://example.com/' | |||
| location: | |||
| readOnly: true | |||
| $ref: '#/components/schemas/Location.jsonld' | |||
| locationIri: | |||
| type: | |||
| @@ -103,8 +103,8 @@ export class FilterBarComponent implements OnInit, OnDestroy { | |||
| this.textInputSubject.pipe( | |||
| debounceTime(300), | |||
| takeUntil(this.destroy$) | |||
| ).subscribe(({field, value, subResource}) => { | |||
| this.updateTextFilter(field, value, subResource); | |||
| ).subscribe(({name, value, subResource}) => { | |||
| this.updateTextFilter(name, value, subResource); | |||
| }); | |||
| } | |||
| @@ -142,6 +142,7 @@ export class FilterBarComponent implements OnInit, OnDestroy { | |||
| onTextFilterChanged(colName: string, event: Event): void { | |||
| const target = event.target as HTMLInputElement; | |||
| console.log(target); | |||
| const filterState = this.findFilterState(colName); | |||
| if (filterState) { | |||
| this.textInputSubject.next({ | |||
| @@ -153,8 +154,8 @@ export class FilterBarComponent implements OnInit, OnDestroy { | |||
| } | |||
| } | |||
| private updateTextFilter(field: string, value: string, subResource?: string): void { | |||
| const filterState = this.findFilterState(field); | |||
| private updateTextFilter(colName: string, value: string, subResource?: string): void { | |||
| const filterState = this.findFilterState(colName); | |||
| if (filterState && filterState.type === FilterBarComponent.FILTER_TYPE_TEXT) { | |||
| filterState.value = value; | |||
| this.emitActiveFilters(); | |||
| @@ -25,6 +25,7 @@ export interface ListColDefinition { | |||
| updateBooleanOnClick?: boolean, | |||
| filterType?: string, | |||
| visible?: boolean, | |||
| toggleVisibility?: boolean | |||
| url?: string, | |||
| filterOptions?: string[], | |||
| } | |||
| @@ -28,7 +28,7 @@ | |||
| > | |||
| <div class="row align-items-end"> | |||
| <ng-container *ngFor="let column of listColDefinitions"> | |||
| <div class="col-4 col-sm-3 col-md-2 col-lg-1 mb-3 switch-widget"> | |||
| <div *ngIf="column.toggleVisibility !== false" class="col-4 col-sm-3 col-md-2 col-lg-1 mb-3 switch-widget"> | |||
| <p class="form-label">{{ column.text | translate }}</p> | |||
| <label class="switch"> | |||
| <input type="checkbox" | |||
| @@ -350,7 +350,8 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { | |||
| name: 'detaillink', | |||
| text: '', | |||
| url: currentUrl, | |||
| type: ListComponent.COLUMN_TYPE_DETAIL_LINK | |||
| type: ListComponent.COLUMN_TYPE_DETAIL_LINK, | |||
| toggleVisibility: false | |||
| } as ListColDefinition; | |||
| } | |||
| @@ -358,7 +359,8 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { | |||
| return { | |||
| name: 'edit', | |||
| text: '', | |||
| type: ListComponent.COLUMN_TYPE_BTN_EDIT | |||
| type: ListComponent.COLUMN_TYPE_BTN_EDIT, | |||
| toggleVisibility: false | |||
| } as ListColDefinition; | |||
| } | |||
| @@ -366,7 +368,8 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { | |||
| return { | |||
| name: 'remove', | |||
| text: '', | |||
| type: ListComponent.COLUMN_TYPE_BTN_REMOVE | |||
| type: ListComponent.COLUMN_TYPE_BTN_REMOVE, | |||
| toggleVisibility: false | |||
| } as ListColDefinition; | |||
| } | |||
| @@ -374,7 +377,8 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { | |||
| return { | |||
| name: 'pos', | |||
| text: 'basic.number', | |||
| type: ListComponent.COLUMN_TYPE_POSITION | |||
| type: ListComponent.COLUMN_TYPE_POSITION, | |||
| toggleVisibility: false | |||
| } as ListColDefinition; | |||
| } | |||
| @@ -412,6 +416,8 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { | |||
| public onFilterChanged(filterData: {filters: any, activeCount: number}) { | |||
| const filterJson = JSON.stringify(filterData.filters); | |||
| console.log(filterData); | |||
| console.log(filterJson); | |||
| const currentFilterJson = JSON.stringify(this.filterObj); | |||
| if (filterJson !== currentFilterJson) { | |||
| @@ -373,7 +373,7 @@ export class SearchSelectComponent implements OnInit, AfterViewInit { | |||
| type: ListComponent.COLUMN_TYPE_TEXT_BOLD, | |||
| field: 'pilotageReference', | |||
| sortable: true, | |||
| filterType: FilterBarComponent.FILTER_TYPE_TEXT, | |||
| sortingFieldName: 'id', | |||
| } as ListColDefinition, | |||
| { | |||
| name: 'vessel', | |||
| @@ -382,6 +382,8 @@ export class SearchSelectComponent implements OnInit, AfterViewInit { | |||
| subResource: 'vessel', | |||
| field: 'name', | |||
| sortable: true, | |||
| sortingSubResource: 'vessel', | |||
| sortingFieldName: 'name', | |||
| filterType: FilterBarComponent.FILTER_TYPE_TEXT, | |||
| } as ListColDefinition, | |||
| { | |||
| @@ -391,6 +393,8 @@ export class SearchSelectComponent implements OnInit, AfterViewInit { | |||
| subResource: 'startLocation', | |||
| field: 'name', | |||
| sortable: true, | |||
| sortingSubResource: 'startLocation', | |||
| sortingFieldName: 'name', | |||
| filterType: FilterBarComponent.FILTER_TYPE_TEXT, | |||
| } as ListColDefinition, | |||
| { | |||
| @@ -400,6 +404,8 @@ export class SearchSelectComponent implements OnInit, AfterViewInit { | |||
| subResource: 'endLocation', | |||
| field: 'name', | |||
| sortable: true, | |||
| sortingSubResource: 'endLocation', | |||
| sortingFieldName: 'name', | |||
| filterType: FilterBarComponent.FILTER_TYPE_TEXT, | |||
| } as ListColDefinition, | |||
| { | |||
| @@ -37,16 +37,8 @@ export class UserTripListComponent { | |||
| subResource: 'trip', | |||
| field: 'pilotageReference', | |||
| sortable: true, | |||
| filterType: FilterBarComponent.FILTER_TYPE_TEXT, | |||
| } as ListColDefinition, | |||
| { | |||
| name: 'customerReference', | |||
| text: 'trip.customer_reference', | |||
| type: ListComponent.COLUMN_TYPE_TEXT, | |||
| subResource: 'trip', | |||
| field: 'customerReference', | |||
| sortable: true, | |||
| filterType: FilterBarComponent.FILTER_TYPE_TEXT, | |||
| sortingSubResource: 'trip', | |||
| sortingFieldName: 'id', | |||
| } as ListColDefinition, | |||
| { | |||
| name: 'userFirstname', | |||
| @@ -55,6 +47,8 @@ export class UserTripListComponent { | |||
| field: 'firstName', | |||
| subResource: 'user', | |||
| sortable: true, | |||
| sortingSubResource: 'user', | |||
| sortingFieldName: 'firstName', | |||
| filterType: FilterBarComponent.FILTER_TYPE_TEXT, | |||
| } as ListColDefinition, | |||
| { | |||
| @@ -64,6 +58,8 @@ export class UserTripListComponent { | |||
| field: 'lastName', | |||
| subResource: 'user', | |||
| sortable: true, | |||
| sortingSubResource: 'user', | |||
| sortingFieldName: 'lastName', | |||
| filterType: FilterBarComponent.FILTER_TYPE_TEXT, | |||
| } as ListColDefinition, | |||
| { | |||
| @@ -74,14 +70,6 @@ export class UserTripListComponent { | |||
| sortable: true, | |||
| filterType: FilterBarComponent.FILTER_TYPE_TEXT, | |||
| } as ListColDefinition, | |||
| { | |||
| name: 'createdAt', | |||
| text: 'common.created_at', | |||
| type: ListComponent.COLUMN_TYPE_DATE, | |||
| field: 'createdAt', | |||
| sortable: true, | |||
| filterType: FilterBarComponent.FILTER_TYPE_DATE, | |||
| } as ListColDefinition, | |||
| { | |||
| name: 'completed', | |||
| text: 'user_trip.completed', | |||
| @@ -106,6 +94,14 @@ export class UserTripListComponent { | |||
| sortable: true, | |||
| filterType: FilterBarComponent.FILTER_TYPE_DATE, | |||
| } as ListColDefinition, | |||
| { | |||
| name: 'createdAt', | |||
| text: 'common.created_at', | |||
| type: ListComponent.COLUMN_TYPE_DATE, | |||
| field: 'createdAt', | |||
| sortable: true, | |||
| filterType: FilterBarComponent.FILTER_TYPE_DATE, | |||
| } as ListColDefinition, | |||
| ]; | |||
| } | |||
| @@ -9,8 +9,6 @@ | |||
| * https://openapi-generator.tech | |||
| * Do not edit the class manually. | |||
| */ | |||
| import { Trip } from './trip'; | |||
| import { Location } from './location'; | |||
| /** | |||
| @@ -18,9 +16,9 @@ import { Location } from './location'; | |||
| */ | |||
| export interface TripLocation { | |||
| readonly dbId?: number | null; | |||
| trip?: Trip; | |||
| readonly trip?: string; | |||
| tripIri: string | null; | |||
| location?: Location; | |||
| readonly location?: string; | |||
| locationIri: string | null; | |||
| arrivalDateTime?: string | null; | |||
| departureDateTime?: string | null; | |||
| @@ -21,9 +21,9 @@ export interface TripLocationJsonld { | |||
| readonly id?: string; | |||
| readonly xType?: string; | |||
| readonly dbId?: number | null; | |||
| trip?: TripJsonld; | |||
| readonly trip?: TripJsonld; | |||
| tripIri: string | null; | |||
| location?: LocationJsonld; | |||
| readonly location?: LocationJsonld; | |||
| locationIri: string | null; | |||
| arrivalDateTime?: string | null; | |||
| departureDateTime?: string | null; | |||