Daniel pirms 1 gada
vecāks
revīzija
7310230f27
29 mainītis faili ar 336 papildinājumiem un 59 dzēšanām
  1. +1
    -1
      angular/openapi.json
  2. +27
    -10
      angular/openapi.yaml
  3. +0
    -1
      angular/src/app/_views/trip-location/trip-location.component.html
  4. +0
    -10
      angular/src/app/_views/trip-location/trip-location.component.ts
  5. +0
    -1
      angular/src/app/_views/trip-work-log/trip-work-log.component.html
  6. +0
    -10
      angular/src/app/_views/trip-work-log/trip-work-log.component.ts
  7. +3
    -0
      angular/src/app/_views/trip/trip-detail/trip-detail.component.html
  8. +1
    -2
      angular/src/app/_views/trip/trip-detail/trip-detail.component.ts
  9. +1
    -0
      angular/src/app/_views/user-trip/user-trip-detail/user-trip-detail.component.html
  10. +0
    -0
      angular/src/app/_views/user-trip/user-trip-detail/user-trip-detail.component.scss
  11. +23
    -0
      angular/src/app/_views/user-trip/user-trip-detail/user-trip-detail.component.spec.ts
  12. +10
    -0
      angular/src/app/_views/user-trip/user-trip-detail/user-trip-detail.component.ts
  13. +1
    -0
      angular/src/app/_views/user-trip/user-trip-form/user-trip-form.component.html
  14. +0
    -0
      angular/src/app/_views/user-trip/user-trip-form/user-trip-form.component.scss
  15. +6
    -6
      angular/src/app/_views/user-trip/user-trip-form/user-trip-form.component.spec.ts
  16. +10
    -0
      angular/src/app/_views/user-trip/user-trip-form/user-trip-form.component.ts
  17. +1
    -0
      angular/src/app/_views/user-trip/user-trip-list/user-trip-list.component.html
  18. +0
    -0
      angular/src/app/_views/user-trip/user-trip-list/user-trip-list.component.scss
  19. +23
    -0
      angular/src/app/_views/user-trip/user-trip-list/user-trip-list.component.spec.ts
  20. +103
    -0
      angular/src/app/_views/user-trip/user-trip-list/user-trip-list.component.ts
  21. +6
    -0
      angular/src/app/_views/user-trip/user-trip.component.html
  22. +0
    -0
      angular/src/app/_views/user-trip/user-trip.component.scss
  23. +6
    -6
      angular/src/app/_views/user-trip/user-trip.component.spec.ts
  24. +10
    -0
      angular/src/app/_views/user-trip/user-trip.component.ts
  25. +8
    -4
      angular/src/app/app.module.ts
  26. +71
    -0
      angular/src/app/core/api/v1/api/userTrip.service.ts
  27. +4
    -2
      angular/src/app/core/api/v1/model/userTrip.ts
  28. +2
    -2
      angular/src/app/core/api/v1/model/userTripJsonld.ts
  29. +19
    -4
      httpdocs/src/ApiResource/UserTripApi.php

+ 1
- 1
angular/openapi.json
Failā izmaiņas netiks attēlotas, jo tās ir par lielu
Parādīt failu


+ 27
- 10
angular/openapi.yaml Parādīt failu

@@ -1467,6 +1467,31 @@ paths:
explode: false
allowReserved: false
deprecated: false
delete:
operationId: api_user_trips_id_delete
tags:
- UserTrip
responses:
'204':
description: 'UserTrip resource deleted'
'404':
description: 'Resource not found'
summary: 'Removes the UserTrip resource.'
description: 'Removes the UserTrip resource.'
parameters:
-
name: id
in: path
description: 'UserTrip identifier'
required: true
deprecated: false
allowEmptyValue: false
schema:
type: string
style: simple
explode: false
allowReserved: false
deprecated: false
patch:
operationId: api_user_trips_id_patch
tags:
@@ -2529,15 +2554,9 @@ components:
- integer
- 'null'
trip:
readOnly: true
type: string
format: iri-reference
example: 'https://example.com/'
$ref: '#/components/schemas/Trip'
user:
readOnly: true
type: string
format: iri-reference
example: 'https://example.com/'
$ref: '#/components/schemas/User'
captainName:
type: string
startDate:
@@ -2590,10 +2609,8 @@ components:
- integer
- 'null'
trip:
readOnly: true
$ref: '#/components/schemas/Trip.jsonld'
user:
readOnly: true
$ref: '#/components/schemas/User.jsonld'
captainName:
type: string


+ 0
- 1
angular/src/app/_views/trip-location/trip-location.component.html Parādīt failu

@@ -1 +0,0 @@
<p>trip-location works!</p>

+ 0
- 10
angular/src/app/_views/trip-location/trip-location.component.ts Parādīt failu

@@ -1,10 +0,0 @@
import { Component } from '@angular/core';

@Component({
selector: 'app-trip-location',
templateUrl: './trip-location.component.html',
styleUrl: './trip-location.component.scss'
})
export class TripLocationComponent {

}

+ 0
- 1
angular/src/app/_views/trip-work-log/trip-work-log.component.html Parādīt failu

@@ -1 +0,0 @@
<p>trip-work-log works!</p>

+ 0
- 10
angular/src/app/_views/trip-work-log/trip-work-log.component.ts Parādīt failu

@@ -1,10 +0,0 @@
import { Component } from '@angular/core';

@Component({
selector: 'app-trip-work-log',
templateUrl: './trip-work-log.component.html',
styleUrl: './trip-work-log.component.scss'
})
export class TripWorkLogComponent {

}

+ 3
- 0
angular/src/app/_views/trip/trip-detail/trip-detail.component.html Parādīt failu

@@ -94,6 +94,9 @@
</div>
</div>
</mat-tab>
<mat-tab label="{{ 'user_trip.view' | translate }}">

</mat-tab>
</mat-tab-group>

}

+ 1
- 2
angular/src/app/_views/trip/trip-detail/trip-detail.component.ts Parādīt failu

@@ -1,4 +1,4 @@
import { Component, OnInit, ViewChild, AfterViewInit, QueryList, ViewChildren } from '@angular/core';
import { Component, OnInit, AfterViewInit, QueryList, ViewChildren } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
import { TripJsonld, TripLocationJsonld, TripLocationService, TripService, LocationService, LocationJsonld } from "@app/core/api/v1";
import { AppHelperService } from "@app/_helpers/app-helper.service";
@@ -8,7 +8,6 @@ import { ModalStatus } from "@app/_helpers/modal.states";
import { Observable } from 'rxjs';
import { ListColDefinition } from '@app/_components/list/list-col-definition';
import { SearchSelectComponent } from '@app/_components/search-select/search-select.component';
import { ListComponent } from '@app/_components/list/list.component';

@Component({
selector: 'app-trip-detail',


+ 1
- 0
angular/src/app/_views/user-trip/user-trip-detail/user-trip-detail.component.html Parādīt failu

@@ -0,0 +1 @@
<p>user-trip-detail works!</p>

angular/src/app/_views/trip-location/trip-location.component.scss → angular/src/app/_views/user-trip/user-trip-detail/user-trip-detail.component.scss Parādīt failu


+ 23
- 0
angular/src/app/_views/user-trip/user-trip-detail/user-trip-detail.component.spec.ts Parādīt failu

@@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { UserTripDetailComponent } from './user-trip-detail.component';

describe('UserTripDetailComponent', () => {
let component: UserTripDetailComponent;
let fixture: ComponentFixture<UserTripDetailComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [UserTripDetailComponent]
})
.compileComponents();
fixture = TestBed.createComponent(UserTripDetailComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});

+ 10
- 0
angular/src/app/_views/user-trip/user-trip-detail/user-trip-detail.component.ts Parādīt failu

@@ -0,0 +1,10 @@
import { Component } from '@angular/core';

@Component({
selector: 'app-user-trip-detail',
templateUrl: './user-trip-detail.component.html',
styleUrl: './user-trip-detail.component.scss'
})
export class UserTripDetailComponent {

}

+ 1
- 0
angular/src/app/_views/user-trip/user-trip-form/user-trip-form.component.html Parādīt failu

@@ -0,0 +1 @@
<p>user-trip-form works!</p>

angular/src/app/_views/trip-work-log/trip-work-log.component.scss → angular/src/app/_views/user-trip/user-trip-form/user-trip-form.component.scss Parādīt failu


angular/src/app/_views/trip-location/trip-location.component.spec.ts → angular/src/app/_views/user-trip/user-trip-form/user-trip-form.component.spec.ts Parādīt failu

@@ -1,18 +1,18 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { TripLocationComponent } from './trip-location.component';
import { UserTripFormComponent } from './user-trip-form.component';

describe('TripLocationComponent', () => {
let component: TripLocationComponent;
let fixture: ComponentFixture<TripLocationComponent>;
describe('UserTripFormComponent', () => {
let component: UserTripFormComponent;
let fixture: ComponentFixture<UserTripFormComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [TripLocationComponent]
declarations: [UserTripFormComponent]
})
.compileComponents();
fixture = TestBed.createComponent(TripLocationComponent);
fixture = TestBed.createComponent(UserTripFormComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

+ 10
- 0
angular/src/app/_views/user-trip/user-trip-form/user-trip-form.component.ts Parādīt failu

@@ -0,0 +1,10 @@
import { Component } from '@angular/core';

@Component({
selector: 'app-user-trip-form',
templateUrl: './user-trip-form.component.html',
styleUrl: './user-trip-form.component.scss'
})
export class UserTripFormComponent {

}

+ 1
- 0
angular/src/app/_views/user-trip/user-trip-list/user-trip-list.component.html Parādīt failu

@@ -0,0 +1 @@
<p>user-trip-list works!</p>

+ 0
- 0
angular/src/app/_views/user-trip/user-trip-list/user-trip-list.component.scss Parādīt failu


+ 23
- 0
angular/src/app/_views/user-trip/user-trip-list/user-trip-list.component.spec.ts Parādīt failu

@@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { UserTripListComponent } from './user-trip-list.component';

describe('UserTripListComponent', () => {
let component: UserTripListComponent;
let fixture: ComponentFixture<UserTripListComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [UserTripListComponent]
})
.compileComponents();
fixture = TestBed.createComponent(UserTripListComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});

+ 103
- 0
angular/src/app/_views/user-trip/user-trip-list/user-trip-list.component.ts Parādīt failu

@@ -0,0 +1,103 @@
import {Component, ViewChild} from '@angular/core';
import {ListComponent} from "@app/_components/list/list.component";
import {TripFormComponent} from "@app/_views/trip/trip-form/trip-form.component";
import {ListColDefinition} from "@app/_components/list/list-col-definition";
import {UserTripService} from "@app/core/api/v1";
import {AppHelperService} from "@app/_helpers/app-helper.service";
import {FilterBarComponent} from "@app/_components/filter-bar/filter-bar.component";
import {ListGetDataFunctionType} from "@app/_components/list/list-get-data-function-type";

@Component({
selector: 'app-user-trip-list',
templateUrl: './user-trip-list.component.html',
styleUrl: './user-trip-list.component.scss'
})
export class UserTripListComponent {

@ViewChild("listComponent", {static: false}) listComponent!: ListComponent;

protected readonly tripFormComponent = TripFormComponent;
protected listColDefinitions!: ListColDefinition[];

constructor(
private userTripService: UserTripService,
protected appHelperService: AppHelperService,
) {
this.listColDefinitions = [
{
name: 'pilotageReference',
text: 'trip.pilot_reference',
type: ListComponent.COLUMN_TYPE_TEXT,
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,
} as ListColDefinition,
{
name: 'userFirstname',
text: 'users.firstname',
type: ListComponent.COLUMN_TYPE_TEXT_BOLD,
field: 'firstname',
subResource: 'user',
sortable: true,
filterType: FilterBarComponent.FILTER_TYPE_TEXT,
} as ListColDefinition,
{
name: 'userLastname',
text: 'users.lastname',
type: ListComponent.COLUMN_TYPE_TEXT_BOLD,
field: 'lastname',
subResource: 'user',
sortable: true,
filterType: FilterBarComponent.FILTER_TYPE_TEXT,
} as ListColDefinition,
{
name: 'captainName',
text: 'trip.captain_name',
type: ListComponent.COLUMN_TYPE_TEXT,
field: 'captainName',
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,
];
}

ngOnInit() {

}

ngAfterViewInit(): void {
this.listComponent.getData();
}

getData: ListGetDataFunctionType = (
index: number,
pageSize: number,
term?: string,
) => {
return this.userTripService.userTripsGetCollection(
index,
pageSize,
// term ? Number(term) : undefined,
this.listComponent.getFilterJsonString(),
this.listComponent.getSortingJsonString()
);
}
}

+ 6
- 0
angular/src/app/_views/user-trip/user-trip.component.html Parādīt failu

@@ -0,0 +1,6 @@
<div class="spt-container">
<div class="spt-headline d-flex justify-content-between align-items-start">
<h2>{{ 'user_trip.view' | translate }}</h2>
</div>
<app-trip-list></app-trip-list>
</div>

+ 0
- 0
angular/src/app/_views/user-trip/user-trip.component.scss Parādīt failu


angular/src/app/_views/trip-work-log/trip-work-log.component.spec.ts → angular/src/app/_views/user-trip/user-trip.component.spec.ts Parādīt failu

@@ -1,18 +1,18 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { TripWorkLogComponent } from './trip-work-log.component';
import { UserTripComponent } from './user-trip.component';

describe('TripWorkLogComponent', () => {
let component: TripWorkLogComponent;
let fixture: ComponentFixture<TripWorkLogComponent>;
describe('UserTripComponent', () => {
let component: UserTripComponent;
let fixture: ComponentFixture<UserTripComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [TripWorkLogComponent]
declarations: [UserTripComponent]
})
.compileComponents();
fixture = TestBed.createComponent(TripWorkLogComponent);
fixture = TestBed.createComponent(UserTripComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

+ 10
- 0
angular/src/app/_views/user-trip/user-trip.component.ts Parādīt failu

@@ -0,0 +1,10 @@
import { Component } from '@angular/core';

@Component({
selector: 'app-user-trip',
templateUrl: './user-trip.component.html',
styleUrl: './user-trip.component.scss'
})
export class UserTripComponent {

}

+ 8
- 4
angular/src/app/app.module.ts Parādīt failu

@@ -45,8 +45,6 @@ import { LocationComponent } from './_views/location/location.component';
import { ZoneComponent } from './_views/zone/zone.component';
import { ShippingCompanyComponent } from './_views/shipping-company/shipping-company.component';
import { TripComponent } from './_views/trip/trip.component';
import { TripLocationComponent } from './_views/trip-location/trip-location.component';
import { TripWorkLogComponent } from './_views/trip-work-log/trip-work-log.component';
import { VesselComponent } from './_views/vessel/vessel.component';
import { BaseDataComponent } from './_views/base-data/base-data.component';
import { LocationListComponent } from './_views/location/location-list/location-list.component';
@@ -65,6 +63,10 @@ import { TripListComponent } from './_views/trip/trip-list/trip-list.component';
import { TripDetailComponent } from './_views/trip/trip-detail/trip-detail.component';
import { TripFormComponent } from './_views/trip/trip-form/trip-form.component';
import {DatetimePickerComponent} from "@app/_components/datetime-picker/datetime-picker.component";
import { UserTripComponent } from './_views/user-trip/user-trip.component';
import { UserTripListComponent } from './_views/user-trip/user-trip-list/user-trip-list.component';
import { UserTripDetailComponent } from './_views/user-trip/user-trip-detail/user-trip-detail.component';
import { UserTripFormComponent } from './_views/user-trip/user-trip-form/user-trip-form.component';

registerLocaleData(localeDe, 'de-DE');

@@ -136,8 +138,6 @@ export function HttpLoaderFactory(http: HttpClient) {
ZoneComponent,
ShippingCompanyComponent,
TripComponent,
TripLocationComponent,
TripWorkLogComponent,
VesselComponent,
BaseDataComponent,
LocationListComponent,
@@ -155,6 +155,10 @@ export function HttpLoaderFactory(http: HttpClient) {
TripListComponent,
TripDetailComponent,
TripFormComponent,
UserTripComponent,
UserTripListComponent,
UserTripDetailComponent,
UserTripFormComponent,
],
providers: [
{provide: HTTP_INTERCEPTORS, useClass: JwtInterceptor, multi: true},


+ 71
- 0
angular/src/app/core/api/v1/api/userTrip.service.ts Parādīt failu

@@ -176,6 +176,77 @@ export class UserTripService {
);
}

/**
* Removes the UserTrip resource.
* Removes the UserTrip resource.
* @param id UserTrip identifier
* @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.
*/
public userTripsIdDelete(id: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
public userTripsIdDelete(id: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
public userTripsIdDelete(id: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
public userTripsIdDelete(id: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling userTripsIdDelete.');
}

let localVarHeaders = this.defaultHeaders;

let localVarCredential: string | undefined;
// authentication (JWT) required
localVarCredential = this.configuration.lookupCredential('JWT');
if (localVarCredential) {
localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential);
}

let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
if (localVarHttpHeaderAcceptSelected === undefined) {
// to determine the Accept header
const httpHeaderAccepts: string[] = [
];
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
}
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}

let localVarHttpContext: HttpContext | undefined = options && options.context;
if (localVarHttpContext === undefined) {
localVarHttpContext = new HttpContext();
}

let localVarTransferCache: boolean | undefined = options && options.transferCache;
if (localVarTransferCache === undefined) {
localVarTransferCache = true;
}


let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}

let localVarPath = `/api/user_trips/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);
}

/**
* Retrieves a UserTrip resource.
* Retrieves a UserTrip resource.


+ 4
- 2
angular/src/app/core/api/v1/model/userTrip.ts Parādīt failu

@@ -9,6 +9,8 @@
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { Trip } from './trip';
import { User } from './user';


/**
@@ -16,8 +18,8 @@
*/
export interface UserTrip {
readonly dbId?: number | null;
readonly trip?: string;
readonly user?: string;
trip?: Trip;
user?: User;
captainName: string;
startDate: string;
endDate: string;


+ 2
- 2
angular/src/app/core/api/v1/model/userTripJsonld.ts Parādīt failu

@@ -22,8 +22,8 @@ export interface UserTripJsonld {
readonly id?: string;
readonly type?: string;
readonly dbId?: number | null;
readonly trip?: TripJsonld;
readonly user?: UserJsonld;
trip?: TripJsonld;
user?: UserJsonld;
captainName: string;
startDate: string;
endDate: string;


+ 19
- 4
httpdocs/src/ApiResource/UserTripApi.php Parādīt failu

@@ -2,14 +2,20 @@

namespace App\ApiResource;


use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;
use ApiPlatform\Metadata\ApiFilter;
use ApiPlatform\Metadata\ApiProperty;
use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\Delete;
use ApiPlatform\Metadata\Get;
use ApiPlatform\Metadata\GetCollection;
use ApiPlatform\Metadata\Patch;
use ApiPlatform\Metadata\Post;
use ApiPlatform\Doctrine\Orm\State\Options;
use App\Entity\UserTrip;
use App\Filter\CustomJsonFilter;
use App\Filter\CustomJsonOrderFilter;
use App\State\EntityClassDtoStateProcessor;
use App\State\EntityToDtoStateProvider;
use Symfony\Component\Validator\Constraints as Assert;
@@ -30,12 +36,21 @@ use Symfony\Component\PropertyInfo\Type;
new Patch(
security: 'is_granted("ROLE_ADMIN")'
),
new Delete(
security: 'is_granted("ROLE_ADMIN")'
)
],
security: 'is_granted("ROLE_USER")',
provider: EntityToDtoStateProvider::class,
processor: EntityClassDtoStateProcessor::class,
stateOptions: new Options(entityClass: UserTrip::class),
)]
#[ApiFilter(SearchFilter::class, properties: [
'trip' => 'exact',
'user' => 'exact'
])]
#[ApiFilter(CustomJsonFilter::class)]
#[ApiFilter(CustomJsonOrderFilter::class)]
class UserTripApi
{
#[ApiProperty(readable: false, writable: false, identifier: true)]
@@ -48,9 +63,9 @@ class UserTripApi
* @var TripApi
*/
#[ApiProperty(
writable: false,
writable: true,
readableLink: true,
writableLink: false,
writableLink: true,
builtinTypes: [
new Type(
'object',
@@ -64,9 +79,9 @@ class UserTripApi
* @var UserApi
*/
#[ApiProperty(
writable: false,
writable: true,
readableLink: true,
writableLink: false,
writableLink: true,
builtinTypes: [
new Type(
'object',


Notiek ielāde…
Atcelt
Saglabāt