Browse Source

wip

master
Daniel 1 year ago
parent
commit
46aa4723f0
13 changed files with 96 additions and 40 deletions
  1. +1
    -1
      angular/openapi.json
  2. +12
    -10
      angular/openapi.yaml
  3. +27
    -0
      angular/src/app/_components/search-select/search-select.component.ts
  4. +4
    -4
      angular/src/app/_forms/apiForms.ts
  5. +0
    -1
      angular/src/app/_views/trip/trip-detail/trip-detail.component.html
  6. +7
    -1
      angular/src/app/_views/user/user-list/user-list.component.ts
  7. +2
    -2
      angular/src/app/core/api/v1/model/userTrip.ts
  8. +2
    -2
      angular/src/app/core/api/v1/model/userTripJsonld.ts
  9. +3
    -1
      angular/src/assets/i18n/en.json
  10. +31
    -0
      httpdocs/migrations/Version20250311143225.php
  11. +2
    -4
      httpdocs/src/ApiResource/UserTripApi.php
  12. +5
    -11
      httpdocs/src/Entity/UserTrip.php
  13. +0
    -3
      httpdocs/src/Mapper/UserTripApiToEntityMapper.php

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


+ 12
- 10
angular/openapi.yaml View File

@@ -2783,14 +2783,18 @@ components:
user: user:
$ref: '#/components/schemas/User' $ref: '#/components/schemas/User'
captainName: captainName:
type: string
type:
- string
- 'null'
signatureUrl: signatureUrl:
readOnly: true readOnly: true
type: type:
- string - string
- 'null' - 'null'
completedDate: completedDate:
type: string
type:
- string
- 'null'
format: date-time format: date-time
createdAt: createdAt:
readOnly: true readOnly: true
@@ -2798,9 +2802,6 @@ components:
- string - string
- 'null' - 'null'
format: date-time format: date-time
required:
- captainName
- completedDate
UserTrip.jsonld: UserTrip.jsonld:
type: object type: object
description: '' description: ''
@@ -2839,14 +2840,18 @@ components:
user: user:
$ref: '#/components/schemas/User.jsonld' $ref: '#/components/schemas/User.jsonld'
captainName: captainName:
type: string
type:
- string
- 'null'
signatureUrl: signatureUrl:
readOnly: true readOnly: true
type: type:
- string - string
- 'null' - 'null'
completedDate: completedDate:
type: string
type:
- string
- 'null'
format: date-time format: date-time
createdAt: createdAt:
readOnly: true readOnly: true
@@ -2854,9 +2859,6 @@ components:
- string - string
- 'null' - 'null'
format: date-time format: date-time
required:
- captainName
- completedDate
UserTripEvent: UserTripEvent:
type: object type: object
description: '' description: ''


+ 27
- 0
angular/src/app/_components/search-select/search-select.component.ts View File

@@ -214,4 +214,31 @@ export class SearchSelectComponent implements OnInit, AfterViewInit {
} as ListColDefinition, } as ListColDefinition,
]; ];
} }

public static getDefaultColDefUsers(subResource?: string): ListColDefinition[] {
return [
{
name: 'fullName',
text: 'users.full_name',
type: ListComponent.COLUMN_TYPE_TEXT,
field: 'fullName',
sortable: true,
filterType: FilterBarComponent.FILTER_TYPE_TEXT,
},
{
name: 'email',
text: 'users.email',
type: ListComponent.COLUMN_TYPE_TEXT,
field: 'email',
sortable: true,
filterType: FilterBarComponent.FILTER_TYPE_TEXT,
},
{
name: 'referenceId',
text: 'users.pilotIdNo',
type: ListComponent.COLUMN_TYPE_TEXT_BOLD,
field: 'referenceId',
} as ListColDefinition,
];
}
} }

+ 4
- 4
angular/src/app/_forms/apiForms.ts View File

@@ -132,9 +132,9 @@ export const userTripForm = new FormGroup({
dbId: new FormControl(null, []), dbId: new FormControl(null, []),
trip: new FormControl(null, []), trip: new FormControl(null, []),
user: new FormControl(null, []), user: new FormControl(null, []),
captainName: new FormControl(null, [Validators.required]),
captainName: new FormControl(null, []),
signatureUrl: new FormControl(null, []), signatureUrl: new FormControl(null, []),
completedDate: new FormControl(null, [Validators.required]),
completedDate: new FormControl(null, []),
createdAt: new FormControl(null, []) createdAt: new FormControl(null, [])
}); });


@@ -142,9 +142,9 @@ export const userTripJsonldForm = new FormGroup({
dbId: new FormControl(null, []), dbId: new FormControl(null, []),
trip: new FormControl(null, []), trip: new FormControl(null, []),
user: new FormControl(null, []), user: new FormControl(null, []),
captainName: new FormControl(null, [Validators.required]),
captainName: new FormControl(null, []),
signatureUrl: new FormControl(null, []), signatureUrl: new FormControl(null, []),
completedDate: new FormControl(null, [Validators.required]),
completedDate: new FormControl(null, []),
createdAt: new FormControl(null, []) createdAt: new FormControl(null, [])
}); });




+ 0
- 1
angular/src/app/_views/trip/trip-detail/trip-detail.component.html View File

@@ -31,7 +31,6 @@
[dataSet]="tripLocation.location" [dataSet]="tripLocation.location"
> >
</app-search-select> </app-search-select>
<!-- <input [id]="'location_' + i" type="hidden" formControlName="location"/>-->
</div> </div>


<div class="col-12 col-md-2 mb-3"> <div class="col-12 col-md-2 mb-3">


+ 7
- 1
angular/src/app/_views/user/user-list/user-list.component.ts View File

@@ -46,7 +46,7 @@ export class UserListComponent implements OnInit, AfterViewInit {
{ {
name: 'lastName', name: 'lastName',
text: 'users.lastname', text: 'users.lastname',
type: ListComponent.COLUMN_TYPE_TEXT,
type: ListComponent.COLUMN_TYPE_TEXT_BOLD,
field: 'lastName', field: 'lastName',
sortable: true, sortable: true,
} as ListColDefinition, } as ListColDefinition,
@@ -56,6 +56,12 @@ export class UserListComponent implements OnInit, AfterViewInit {
type: ListComponent.COLUMN_TYPE_EMAIL, type: ListComponent.COLUMN_TYPE_EMAIL,
field: 'email', field: 'email',
} as ListColDefinition, } as ListColDefinition,
{
name: 'referenceId',
text: 'users.pilotIdNo',
type: ListComponent.COLUMN_TYPE_TEXT_BOLD,
field: 'referenceId',
} as ListColDefinition,
]; ];
} }




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

@@ -20,9 +20,9 @@ export interface UserTrip {
readonly dbId?: number | null; readonly dbId?: number | null;
trip?: Trip; trip?: Trip;
user?: User; user?: User;
captainName: string;
captainName?: string | null;
readonly signatureUrl?: string | null; readonly signatureUrl?: string | null;
completedDate: string;
completedDate?: string | null;
readonly createdAt?: string | null; readonly createdAt?: string | null;
} }



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

@@ -24,9 +24,9 @@ export interface UserTripJsonld {
readonly dbId?: number | null; readonly dbId?: number | null;
trip?: TripJsonld; trip?: TripJsonld;
user?: UserJsonld; user?: UserJsonld;
captainName: string;
captainName?: string | null;
readonly signatureUrl?: string | null; readonly signatureUrl?: string | null;
completedDate: string;
completedDate?: string | null;
readonly createdAt?: string | null; readonly createdAt?: string | null;
} }



+ 3
- 1
angular/src/assets/i18n/en.json View File

@@ -107,9 +107,11 @@
"view": "Users", "view": "Users",
"user": "User", "user": "User",
"email": "Email", "email": "Email",
"full_name": "Name",
"firstname": "Firstname", "firstname": "Firstname",
"lastname": "Lastname", "lastname": "Lastname",
"userTrips": "User trips"
"userTrips": "User trips",
"pilotIdNo": "#Pilot id"
}, },
"form": "form":
{ {


+ 31
- 0
httpdocs/migrations/Version20250311143225.php View File

@@ -0,0 +1,31 @@
<?php

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250311143225 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}

public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE user_trip CHANGE captain_name captain_name VARCHAR(255) DEFAULT NULL, CHANGE completed_date completed_date DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\'');
}

public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE user_trip CHANGE captain_name captain_name VARCHAR(255) NOT NULL, CHANGE completed_date completed_date DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\'');
}
}

+ 2
- 4
httpdocs/src/ApiResource/UserTripApi.php View File

@@ -91,14 +91,12 @@ class UserTripApi
)] )]
public ?UserApi $user = null; public ?UserApi $user = null;


#[Assert\NotBlank]
public string $captainName;
public ?string $captainName = null;


#[ApiProperty(writable: false)] #[ApiProperty(writable: false)]
public ?string $signatureUrl = null; public ?string $signatureUrl = null;


#[Assert\NotBlank]
public \DateTimeImmutable $completedDate;
public ?\DateTimeImmutable $completedDate = null;


#[ApiProperty(writable: false)] #[ApiProperty(writable: false)]
public ?\DateTimeImmutable $createdAt = null; public ?\DateTimeImmutable $createdAt = null;

+ 5
- 11
httpdocs/src/Entity/UserTrip.php View File

@@ -27,14 +27,14 @@ class UserTrip
#[ORM\JoinColumn(nullable: false)] #[ORM\JoinColumn(nullable: false)]
private User $user; private User $user;


#[ORM\Column(length: 255)]
private string $captainName;
#[ORM\Column(length: 255, nullable: true)]
private ?string $captainName = null;


#[ORM\ManyToOne] #[ORM\ManyToOne]
#[ORM\JoinColumn(nullable: true, onDelete: "SET NULL")] #[ORM\JoinColumn(nullable: true, onDelete: "SET NULL")]
private ?MediaObject $signature = null; private ?MediaObject $signature = null;


#[ORM\Column]
#[ORM\Column(nullable: true)]
private DateTimeImmutable $completedDate; private DateTimeImmutable $completedDate;


#[ORM\Column] #[ORM\Column]
@@ -46,14 +46,9 @@ class UserTrip
public function __construct( public function __construct(
Trip $trip, Trip $trip,
User $user, User $user,
string $captainName,
DateTimeImmutable $startDate,
DateTimeImmutable $endDate
) { ) {
$this->trip = $trip; $this->trip = $trip;
$this->user = $user; $this->user = $user;
$this->captainName = $captainName;
$this->completedDate = $endDate;
$this->createdAt = new DateTimeImmutable(); $this->createdAt = new DateTimeImmutable();
$this->userTripEvents = new ArrayCollection(); $this->userTripEvents = new ArrayCollection();
} }
@@ -85,15 +80,14 @@ class UserTrip
return $this; return $this;
} }


public function getCaptainName(): string
public function getCaptainName(): ?string
{ {
return $this->captainName; return $this->captainName;
} }


public function setCaptainName(string $captainName): self
public function setCaptainName(?string $captainName): void
{ {
$this->captainName = $captainName; $this->captainName = $captainName;
return $this;
} }


public function getSignature(): ?MediaObject public function getSignature(): ?MediaObject


+ 0
- 3
httpdocs/src/Mapper/UserTripApiToEntityMapper.php View File

@@ -52,9 +52,6 @@ class UserTripApiToEntityMapper implements MapperInterface
return new UserTrip( return new UserTrip(
$trip, $trip,
$user, $user,
$dto->captainName,
$dto->startDate,
$dto->endDate
); );
} }




Loading…
Cancel
Save