Skip to content

Commit

Permalink
Merge branch 'main' into fix-invalid-import-values
Browse files Browse the repository at this point in the history
  • Loading branch information
velrest committed Sep 16, 2021
2 parents 175e6b1 + bca5f83 commit 1968cd6
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 14 deletions.
14 changes: 7 additions & 7 deletions addon/models/construction-project.js
Expand Up @@ -27,7 +27,7 @@ export default class ConstructionProject extends XMLModel {
@tracked projectStartDate;
@tracked durationOfConstructionPhase;
@tracked constructionAuthorisationDeniedDate;
@tracked nonRealisationDate;
@tracked cancellationDate;
@tracked projectCompletionDate;
@tracked projectSuspensionDate;
@tracked buildingPermitIssueDate;
Expand Down Expand Up @@ -60,7 +60,7 @@ export default class ConstructionProject extends XMLModel {
projectStartDate: String,
durationOfConstructionPhase: Number,
constructionAuthorisationDeniedDate: String,
nonRealisationDate: String,
cancellationDate: String,
projectCompletionDate: String,
projectSuspensionDate: String,
buildingPermitIssueDate: String,
Expand Down Expand Up @@ -96,7 +96,7 @@ export default class ConstructionProject extends XMLModel {
? this.STATUS_COMPLETED
: this.withdrawalDate
? this.STATUS_WITHDRAWN
: this.nonRealisationDate
: this.cancellationDate
? this.STATUS_NOT_REALIZED
: this.constructionAuthorisationDeniedDate
? this.STATUS_REFUSED
Expand Down Expand Up @@ -141,7 +141,7 @@ export default class ConstructionProject extends XMLModel {
{{! this is accepted by the api but in the response the field is missing. Is this intended?}}
{{{modelField model "withdrawalDate" value=(echDate model.withdrawalDate)}}}
{{{modelField model "cancellationDate" value=(echDate model.nonRealisationDate)}}}
{{{modelField model "cancellationDate" value=(echDate model.cancellationDate)}}}
{{{modelField model "durationOfConstructionPhase"}}}
{{/unless}}
Expand Down Expand Up @@ -254,7 +254,7 @@ export default class ConstructionProject extends XMLModel {
{ field: "withdrawalDate", type: "date", required: true },
],
setToCancelledConstructionProject: [
{ field: "nonRealisationDate", type: "date", required: true },
{ field: "cancellationDate", type: "date", required: true },
],
setToSuspendedConstructionProject: [
{ field: "projectSuspensionDate", type: "date", required: true },
Expand Down Expand Up @@ -288,7 +288,7 @@ export default class ConstructionProject extends XMLModel {
"projectCompletionDate",
"projectSuspensionDate",
"constructionAuthorisationDeniedDate",
"nonRealisationDate",
"cancellationDate",
"withdrawalDate",
];

Expand Down Expand Up @@ -363,7 +363,7 @@ export default class ConstructionProject extends XMLModel {
[this.STATUS_NOT_REALIZED]: [
{ field: "projectAnnouncementDate", type: "date", required: true },
{ field: "buildingPermitIssueDate", type: "date", required: false },
{ field: "nonRealisationDate", type: "date", required: true },
{ field: "cancellationDate", type: "date", required: true },
],
[this.STATUS_WITHDRAWN]: [
{ field: "projectAnnouncementDate", type: "date", required: true },
Expand Down
4 changes: 2 additions & 2 deletions addon/templates/project/form.hbs
Expand Up @@ -197,9 +197,9 @@
/>
</div>
{{/if}}
{{#if this.project.nonRealisationDate}}
{{#if this.project.cancellationDate}}
<div class={{spacingClass}}>
<Field @inputType="date" @attr="nonRealisationDate" />
<Field @inputType="date" @attr="cancellationDate" />
</div>
{{/if}}
{{#if this.project.withdrawalDate}}
Expand Down
2 changes: 1 addition & 1 deletion addon/validations/status/status-project-change.js
Expand Up @@ -44,7 +44,7 @@ export default {
model: "project",
}),
],
nonRealisationDate: [
cancellationDate: [
validatePresenceTransition({
presence: true,
on: "projectStatus",
Expand Down
2 changes: 1 addition & 1 deletion addon/validations/status/status-project-correction.js
Expand Up @@ -94,7 +94,7 @@ export default {
states: [ConstructionProject.STATUS_REFUSED],
}),
],
nonRealisationDate: [
cancellationDate: [
validatePresenceState({
presence: true,
on: "projectStatus",
Expand Down
3 changes: 1 addition & 2 deletions addon/xml/templates/construction-project.js
Expand Up @@ -48,8 +48,7 @@ export const setToWithdrawnConstructionProject =
export const setToCancelledConstructionProject =
`{{#>base}}
<ns2:setToCancelledConstruction>
{{! TODO check if should be nonRealisationDate and if state is accepted}}
<ns2:cancellationDate>{{echDate model.nonRealisationDate}}</ns2:cancellationDate>
<ns2:cancellationDate>{{echDate model.cancellationDate}}</ns2:cancellationDate>
</ns2:setToCancelledConstruction>
{{/base}}`;

Expand Down
2 changes: 1 addition & 1 deletion translations/construction-project/de.yaml
Expand Up @@ -21,7 +21,7 @@ ember-gwr:
projectCompletionDate: Datum Bauende
projectSuspensionDate: Datum Sistierung
constructionAuthorisationDeniedDate: Datum Ablehnung
nonRealisationDate: Datum Nichtrealisierung
cancellationDate: Datum Nichtrealisierung
withdrawalDate: Datum Rückzung des Baugesuchs
projectFreeText1: Freitext Project 1
projectFreeText2: Freitext Project 2
Expand Down

0 comments on commit 1968cd6

Please sign in to comment.