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