Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug/212 decode errors #229

Merged
merged 3 commits into from
Nov 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
<address>
<ng-container *ngIf="company.apprenticeshipContract.CompanyName"
>{{ company.apprenticeshipContract.CompanyName }}<br
<ng-container *ngIf="company.apprenticeshipManager?.CompanyName"
>{{ company.apprenticeshipManager?.CompanyName }}<br
/></ng-container>
<ng-container *ngIf="company.apprenticeshipManager?.CompanyNameAddition"
>{{ company.apprenticeshipManager?.CompanyNameAddition }}<br
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gibt es hier einen zusätzlichen Abstand, wegen dem <br>, wenn nur eines der beiden vornhanden ist, oder ist das kein Problem? Vielleicht könntest du die einzelnen Zeilen einfach in ein <div> wrappen, welches ein Blockelement ist: <div *ngIf="company.apprenticeshipManager?.CompanyName" >{{ company.apprenticeshipContract.CompanyName }}</div>. Das wäre wohl grundsätzlich im ganzen File der Fall.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sollte nicht, die
sind ja innerhalb vom Container. Oder verstehe ich etwas falsch?
Im konkreten Beispiel, wo CompanyNameAddition nicht gesetzt ist, gibt es keinen Zusätzlichen Abstand.

Ansonsten müsste man es dann gleich in allen Dateien anpassen, wo wir das bisher so machen...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nein, ich denke es ist OK so 👍

/></ng-container>
<ng-container
*ngIf="
company.apprenticeshipManager?.Lastname &&
company.apprenticeshipManager?.Lastname ||
company.apprenticeshipManager?.Firstname
"
>
{{ company.apprenticeshipManager.Lastname }}
{{ company.apprenticeshipManager.Firstname }}<br />
{{ company.apprenticeshipManager.Lastname || '' }}
{{ company.apprenticeshipManager.Firstname || '' }}<br />
</ng-container>
<ng-container *ngIf="company.apprenticeshipManager?.AddressLine1"
>{{ company.apprenticeshipManager.AddressLine1 }}<br
Expand Down Expand Up @@ -45,8 +48,12 @@
<div *ngIf="company.jobTrainer" class="subentry">
{{ 'shared.profile.job-trainer' | translate }}:
<address>
{{ company.jobTrainer.Lastname }}
{{ company.jobTrainer.Firstname }}<br />
<ng-container
*ngIf="company.jobTrainer.Lastname || company.jobTrainer.Firstname"
>
{{ company.jobTrainer.Lastname || '' }}
{{ company.jobTrainer.Firstname || '' }}<br />
</ng-container>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Könnte ev. auch nur der Nachname gesetzt sein?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ich weiss es nicht. Das scheint mir nicht wahrscheinlich.

Dieselbe Frage würde sich dann auch bei apprenticeshipManager und person stellen.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Es wäre wohl etwas robuster dies vorzusehen:

    <ng-container *ngIf="company.jobTrainer.Lastname || company.jobTrainer.Firstname"
    >
      {{ company.jobTrainer.Lastname || '' }}
      {{ company.jobTrainer.Firstname || '' }}<br />
    </ng-container>

Aber ist wohl nicht so wichtig...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Find ich gut und habe ich für die Fälle in der ApprenticeshipCompany-Komponente so übernommen.

<ng-container *ngIf="company.jobTrainer.PhoneBusiness">
<a href="tel:{{ company.jobTrainer.PhoneBusiness }}"
>{{ company.jobTrainer.PhoneBusiness }}<br /></a
Expand Down
3 changes: 2 additions & 1 deletion src/app/shared/models/apprenticeship-contract.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ const ApprenticeshipContract = t.type({
ApprenticeshipManagerId: t.number,
// ApprenticeshipDateFrom: t.string,
// ApprenticeshipDateTo: t.string,
CompanyName: Maybe(t.string),
// CompanyName: Maybe(t.string),
// CompanyNameAddition: Maybe(t.string),
ContractDateFrom: Option(LocalDateTimeFromString),
ContractDateTo: Option(LocalDateTimeFromString),
// ContractNumber: t.string,
Expand Down
14 changes: 7 additions & 7 deletions src/app/shared/models/apprenticeship-manager.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@ import { Maybe, Option } from './common-types';

const ApprenticeshipManager = t.type({
// HRef: t.string,
Email: t.string,
Email: Option(t.string),
Email2: Option(t.string),
PhoneBusiness: t.string,
PhoneBusiness: Option(t.string),
// PhoneMobile: Option(t.string),
CompanyName: t.string,
// CompanyNameAddition: Option(t.string),
CompanyName: Maybe(t.string),
CompanyNameAddition: Maybe(t.string),
Firstname: Option(t.string),
// MiddleName: Option(t.string),
Lastname: Option(t.string),
// FormOfAddress: Option(t.string),
// Gender: t.union([t.literal('M'), t.literal('F'), t.literal('X')]),
AddressLine1: t.string,
AddressLine1: Maybe(t.string),
AddressLine2: Maybe(t.string),
PostalCode: t.string,
Location: t.string,
PostalCode: Option(t.string),
Location: Option(t.string),
// Country: Option(t.string),
// CountryId: t.string,
// CorrespondenceAddress: Option(t.string),
Expand Down
4 changes: 2 additions & 2 deletions src/app/shared/models/job-trainer.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ const JobTrainer = t.type({
Email2: Option(t.string),
PhoneBusiness: Option(t.string),
PhoneMobile: Option(t.string),
Firstname: t.string,
Firstname: Option(t.string),
// MiddleName: Option(t.string),
Lastname: t.string,
Lastname: Option(t.string),
// FormOfAddress: Option(t.string),
// Gender: t.union([t.literal('M'), t.literal('F'), t.literal('X')]),
// AddressLine1: Maybe(t.string),
Expand Down
9 changes: 5 additions & 4 deletions src/spec-builders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ export function buildApprenticeshipContract(
ApprenticeshipManagerId: apprenticeshipManagerId,
// ApprenticeshipDateFrom: '',
// ApprenticeshipDateTo: '',
CompanyName: '',
// CompanyName: '',
// CompanyNameAddition: null,
ContractDateFrom: null,
ContractDateTo: null,
// ContractNumber: '',
Expand Down Expand Up @@ -196,16 +197,16 @@ export function buildApprenticeshipManager(id: number): ApprenticeshipManager {
// HRef: '',
Email: '',
Email2: null,
PhoneBusiness: '',
PhoneBusiness: null,
// PhoneMobile: null,
CompanyName: '',
// CompanyNameAddition: null,
CompanyNameAddition: null,
Firstname: null,
// MiddleName: null,
Lastname: null,
// FormOfAddress: null,
// Gender: 'X',
AddressLine1: '',
AddressLine1: undefined,
AddressLine2: undefined,
PostalCode: '',
Location: '',
Expand Down