Browse Source

bugfixes

master
Daniel 9 months ago
parent
commit
d866535a46
10 changed files with 53 additions and 37 deletions
  1. +1
    -1
      angular/openapi.json
  2. +10
    -2
      angular/openapi.yaml
  3. +5
    -4
      angular/src/app/_components/filter-bar/filter-bar.component.ts
  4. +1
    -0
      angular/src/app/_components/list/list-col-definition.ts
  5. +1
    -1
      angular/src/app/_components/list/list.component.html
  6. +10
    -4
      angular/src/app/_components/list/list.component.ts
  7. +7
    -1
      angular/src/app/_components/search-select/search-select.component.ts
  8. +14
    -18
      angular/src/app/_views/user-trip/user-trip-list/user-trip-list.component.ts
  9. +2
    -4
      angular/src/app/core/api/v1/model/tripLocation.ts
  10. +2
    -2
      angular/src/app/core/api/v1/model/tripLocationJsonld.ts

+ 1
- 1
angular/openapi.json
File diff suppressed because it is too large
View File


+ 10
- 2
angular/openapi.yaml View File

@@ -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:


+ 5
- 4
angular/src/app/_components/filter-bar/filter-bar.component.ts View File

@@ -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();


+ 1
- 0
angular/src/app/_components/list/list-col-definition.ts View File

@@ -25,6 +25,7 @@ export interface ListColDefinition {
updateBooleanOnClick?: boolean,
filterType?: string,
visible?: boolean,
toggleVisibility?: boolean
url?: string,
filterOptions?: string[],
}

+ 1
- 1
angular/src/app/_components/list/list.component.html View File

@@ -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"


+ 10
- 4
angular/src/app/_components/list/list.component.ts View File

@@ -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) {


+ 7
- 1
angular/src/app/_components/search-select/search-select.component.ts View File

@@ -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,
{


+ 14
- 18
angular/src/app/_views/user-trip/user-trip-list/user-trip-list.component.ts View File

@@ -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,
];
}



+ 2
- 4
angular/src/app/core/api/v1/model/tripLocation.ts View File

@@ -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;


+ 2
- 2
angular/src/app/core/api/v1/model/tripLocationJsonld.ts View File

@@ -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;


Loading…
Cancel
Save