ember-ebau-gwr 3.1.1 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/addon/components/back-route.hbs +10 -0
- package/addon/components/linked-models.hbs +11 -5
- package/addon/components/model-errors/error-indicator.hbs +3 -1
- package/addon/components/model-errors/header.hbs +4 -2
- package/addon/components/model-errors.hbs +1 -0
- package/addon/components/model-form/field.js +5 -2
- package/addon/components/model-form/header/actions.hbs +5 -3
- package/addon/components/model-form.js +9 -1
- package/addon/components/model-inview.hbs +8 -0
- package/addon/components/model-inview.js +12 -0
- package/addon/components/sub-nav.hbs +5 -10
- package/addon/controllers/building/edit/dwelling/edit.js +2 -2
- package/addon/controllers/building/edit/form.js +0 -5
- package/addon/controllers/project/errors.js +25 -29
- package/addon/controllers/project/form.js +25 -5
- package/addon/controllers/project.js +1 -1
- package/addon/helpers/housing-stat-link.js +13 -0
- package/addon/helpers/show-model-field.js +13 -0
- package/addon/models/building.js +1 -1
- package/addon/models/construction-project.js +1 -1
- package/addon/models/options.js +251 -1
- package/addon/services/building.js +182 -192
- package/addon/services/construction-project.js +134 -145
- package/addon/services/gwr.js +4 -0
- package/addon/templates/building/edit/dwelling/edit.hbs +25 -22
- package/addon/templates/building/edit/entrance/edit/index.hbs +1 -2
- package/addon/templates/building/edit/form.hbs +38 -16
- package/addon/templates/project/errors.hbs +121 -132
- package/addon/templates/project/form.hbs +87 -53
- package/addon/templates/project/linked-buildings.hbs +13 -20
- package/addon/templates/project.hbs +23 -17
- package/addon/templates/search-building.hbs +6 -0
- package/addon/templates/search-project.hbs +6 -0
- package/addon/utils.js +8 -0
- package/addon/validations/building-work.js +2 -0
- package/addon/validations/dwelling.js +0 -5
- package/app/styles/ember-ebau-gwr.scss +8 -0
- package/config/environment.js +3 -0
- package/package.json +1 -1
- package/translations/building/de.yaml +3 -5
- package/translations/construction-project/de.yaml +256 -4
- package/translations/de.yaml +21 -3
- package/translations/dwelling/de.yaml +3 -1
|
@@ -222,26 +222,25 @@ export default class ConstructionProjectService extends GwrService {
|
|
|
222
222
|
}
|
|
223
223
|
} else if (buildingWork.kindOfWork === 6002) {
|
|
224
224
|
await Promise.all(
|
|
225
|
-
buildingWork.building.buildingEntrance.map(
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
)
|
|
225
|
+
buildingWork.building.buildingEntrance.map((buildingEntrance) =>
|
|
226
|
+
Promise.all(
|
|
227
|
+
buildingEntrance.dwelling.map(async (dwelling) => {
|
|
228
|
+
if (
|
|
229
|
+
[
|
|
230
|
+
Dwelling.STATUS_PROJECTED,
|
|
231
|
+
Dwelling.STATUS_APPROVED,
|
|
232
|
+
].includes(dwelling.dwellingStatus)
|
|
233
|
+
) {
|
|
234
|
+
await this.dwelling.setToApprovedDwelling(
|
|
235
|
+
"setToApprovedDwelling",
|
|
236
|
+
cascadeLevel - 1,
|
|
237
|
+
isDryRun,
|
|
238
|
+
dwelling,
|
|
239
|
+
buildingWork.building.EGID
|
|
240
|
+
);
|
|
241
|
+
}
|
|
242
|
+
})
|
|
243
|
+
)
|
|
245
244
|
)
|
|
246
245
|
);
|
|
247
246
|
}
|
|
@@ -305,27 +304,26 @@ export default class ConstructionProjectService extends GwrService {
|
|
|
305
304
|
}
|
|
306
305
|
} else if (buildingWork.kindOfWork === 6002) {
|
|
307
306
|
await Promise.all(
|
|
308
|
-
buildingWork.building.buildingEntrance.map(
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
)
|
|
307
|
+
buildingWork.building.buildingEntrance.map((buildingEntrance) =>
|
|
308
|
+
Promise.all(
|
|
309
|
+
buildingEntrance.dwelling.map(async (dwelling) => {
|
|
310
|
+
if (
|
|
311
|
+
[
|
|
312
|
+
Dwelling.STATUS_PROJECTED,
|
|
313
|
+
Dwelling.STATUS_APPROVED,
|
|
314
|
+
Dwelling.STATUS_NOT_REALIZED,
|
|
315
|
+
].includes(dwelling.dwellingStatus)
|
|
316
|
+
) {
|
|
317
|
+
await this.dwelling.setToNotRealizedDwelling(
|
|
318
|
+
"setToNotRealizedDwelling",
|
|
319
|
+
cascadeLevel - 1,
|
|
320
|
+
isDryRun,
|
|
321
|
+
dwelling,
|
|
322
|
+
buildingWork.building.EGID
|
|
323
|
+
);
|
|
324
|
+
}
|
|
325
|
+
})
|
|
326
|
+
)
|
|
329
327
|
)
|
|
330
328
|
);
|
|
331
329
|
}
|
|
@@ -406,33 +404,30 @@ export default class ConstructionProjectService extends GwrService {
|
|
|
406
404
|
}
|
|
407
405
|
|
|
408
406
|
await Promise.all(
|
|
409
|
-
buildingWork.building.buildingEntrance.map(
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
if (
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
};
|
|
421
|
-
}
|
|
422
|
-
} else if (buildingWork.kindOfWork === 6007) {
|
|
423
|
-
if (
|
|
424
|
-
dwelling.dwellingStatus !== Dwelling.STATUS_DEMOLISHED
|
|
425
|
-
) {
|
|
426
|
-
throw {
|
|
427
|
-
isLifeCycleError: true,
|
|
428
|
-
dwellingId: dwelling.EWID,
|
|
429
|
-
buildingId: buildingWork.building.EGID,
|
|
430
|
-
states: [Dwelling.STATUS_DEMOLISHED],
|
|
431
|
-
};
|
|
432
|
-
}
|
|
407
|
+
buildingWork.building.buildingEntrance.map((buildingEntrance) =>
|
|
408
|
+
Promise.all(
|
|
409
|
+
buildingEntrance.dwelling.map(async (dwelling) => {
|
|
410
|
+
if (buildingWork.kindOfWork === 6001) {
|
|
411
|
+
if (dwelling.dwellingStatus !== Dwelling.STATUS_COMPLETED) {
|
|
412
|
+
throw {
|
|
413
|
+
isLifeCycleError: true,
|
|
414
|
+
dwellingId: dwelling.EWID,
|
|
415
|
+
buildingId: buildingWork.building.EGID,
|
|
416
|
+
states: [Dwelling.STATUS_COMPLETED],
|
|
417
|
+
};
|
|
433
418
|
}
|
|
434
|
-
})
|
|
435
|
-
|
|
419
|
+
} else if (buildingWork.kindOfWork === 6007) {
|
|
420
|
+
if (dwelling.dwellingStatus !== Dwelling.STATUS_DEMOLISHED) {
|
|
421
|
+
throw {
|
|
422
|
+
isLifeCycleError: true,
|
|
423
|
+
dwellingId: dwelling.EWID,
|
|
424
|
+
buildingId: buildingWork.building.EGID,
|
|
425
|
+
states: [Dwelling.STATUS_DEMOLISHED],
|
|
426
|
+
};
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
})
|
|
430
|
+
)
|
|
436
431
|
)
|
|
437
432
|
);
|
|
438
433
|
})
|
|
@@ -495,43 +490,42 @@ export default class ConstructionProjectService extends GwrService {
|
|
|
495
490
|
}
|
|
496
491
|
} else if (buildingWork.kindOfWork === 6002) {
|
|
497
492
|
await Promise.all(
|
|
498
|
-
buildingWork.building.buildingEntrance.map(
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
)
|
|
493
|
+
buildingWork.building.buildingEntrance.map((buildingEntrance) =>
|
|
494
|
+
Promise.all(
|
|
495
|
+
buildingEntrance.dwelling.map(async (dwelling) => {
|
|
496
|
+
if (
|
|
497
|
+
[
|
|
498
|
+
Dwelling.STATUS_PROJECTED,
|
|
499
|
+
Dwelling.STATUS_APPROVED,
|
|
500
|
+
Dwelling.STATUS_NOT_REALIZED,
|
|
501
|
+
].includes(dwelling.dwellingStatus)
|
|
502
|
+
) {
|
|
503
|
+
await this.dwelling.setToNotRealizedDwelling(
|
|
504
|
+
"setToNotRealizedDwelling",
|
|
505
|
+
cascadeLevel - 1,
|
|
506
|
+
isDryRun,
|
|
507
|
+
dwelling,
|
|
508
|
+
buildingWork.building.EGID
|
|
509
|
+
);
|
|
510
|
+
} else {
|
|
511
|
+
// Display message with link to dwelling with issue
|
|
512
|
+
const states =
|
|
513
|
+
cascadeLevel > 1
|
|
514
|
+
? [
|
|
515
|
+
Dwelling.STATUS_PROJECTED,
|
|
516
|
+
Dwelling.STATUS_APPROVED,
|
|
517
|
+
Dwelling.STATUS_NOT_REALIZED,
|
|
518
|
+
]
|
|
519
|
+
: [Dwelling.STATUS_NOT_REALIZED];
|
|
520
|
+
throw {
|
|
521
|
+
isLifeCycleError: true,
|
|
522
|
+
dwellingId: dwelling.EWID,
|
|
523
|
+
buildingId: buildingWork.building.EGID,
|
|
524
|
+
states,
|
|
525
|
+
};
|
|
526
|
+
}
|
|
527
|
+
})
|
|
528
|
+
)
|
|
535
529
|
)
|
|
536
530
|
);
|
|
537
531
|
}
|
|
@@ -629,43 +623,42 @@ export default class ConstructionProjectService extends GwrService {
|
|
|
629
623
|
}
|
|
630
624
|
} else if (buildingWork.kindOfWork === 6002) {
|
|
631
625
|
await Promise.all(
|
|
632
|
-
buildingWork.building.buildingEntrance.map(
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
)
|
|
626
|
+
buildingWork.building.buildingEntrance.map((buildingEntrance) =>
|
|
627
|
+
Promise.all(
|
|
628
|
+
buildingEntrance.dwelling.map(async (dwelling) => {
|
|
629
|
+
if (
|
|
630
|
+
[
|
|
631
|
+
Dwelling.STATUS_PROJECTED,
|
|
632
|
+
Dwelling.STATUS_APPROVED,
|
|
633
|
+
Dwelling.STATUS_NOT_REALIZED,
|
|
634
|
+
].includes(dwelling.dwellingStatus)
|
|
635
|
+
) {
|
|
636
|
+
await this.dwelling.setToNotRealizedDwelling(
|
|
637
|
+
"setToNotRealizedDwelling",
|
|
638
|
+
cascadeLevel - 1,
|
|
639
|
+
isDryRun,
|
|
640
|
+
dwelling,
|
|
641
|
+
buildingWork.building.EGID
|
|
642
|
+
);
|
|
643
|
+
} else {
|
|
644
|
+
// Display message with link to dwelling with issue
|
|
645
|
+
const states =
|
|
646
|
+
cascadeLevel > 1
|
|
647
|
+
? [
|
|
648
|
+
Dwelling.STATUS_PROJECTED,
|
|
649
|
+
Dwelling.STATUS_APPROVED,
|
|
650
|
+
Dwelling.STATUS_NOT_REALIZED,
|
|
651
|
+
]
|
|
652
|
+
: [Dwelling.STATUS_NOT_REALIZED];
|
|
653
|
+
throw {
|
|
654
|
+
isLifeCycleError: true,
|
|
655
|
+
dwellingId: dwelling.EWID,
|
|
656
|
+
buildingId: buildingWork.building.EGID,
|
|
657
|
+
states,
|
|
658
|
+
};
|
|
659
|
+
}
|
|
660
|
+
})
|
|
661
|
+
)
|
|
669
662
|
)
|
|
670
663
|
);
|
|
671
664
|
}
|
|
@@ -772,8 +765,4 @@ export default class ConstructionProjectService extends GwrService {
|
|
|
772
765
|
}
|
|
773
766
|
});
|
|
774
767
|
}
|
|
775
|
-
|
|
776
|
-
getChangeHint(currentStatus, newStatus) {
|
|
777
|
-
return ConstructionProject.projectTransitionHint[currentStatus][newStatus];
|
|
778
|
-
}
|
|
779
768
|
}
|
package/addon/services/gwr.js
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
@getChangeParameters={{this.getChangeParameters}}
|
|
24
24
|
@getCorrectionParameters={{this.getCorrectionParameters}}
|
|
25
25
|
@modelStatusField="dwellingStatus"
|
|
26
|
-
as |Field|
|
|
26
|
+
as |Field changeset|
|
|
27
27
|
>
|
|
28
28
|
<Field
|
|
29
29
|
@attr="EDID"
|
|
@@ -34,25 +34,25 @@
|
|
|
34
34
|
@noPlaceholder={{true}}
|
|
35
35
|
@required={{true}}
|
|
36
36
|
/>
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
37
|
+
|
|
38
|
+
<Field
|
|
39
|
+
@attr="floorType"
|
|
40
|
+
@type="select" @required={{true}}
|
|
41
|
+
@gwrEnumOptions={{this.Models.Dwelling.floorTypeOptions}}
|
|
42
|
+
@hint={{t "ember-gwr.dwelling.floorHint"}}
|
|
43
|
+
/>
|
|
44
|
+
|
|
45
|
+
{{#if (or
|
|
46
|
+
(eq changeset.floorType 3101)
|
|
47
|
+
(eq changeset.floorType 3401)
|
|
48
|
+
(and this.import this.import.data.floorNumber)
|
|
49
|
+
)}}
|
|
50
|
+
<Field
|
|
51
|
+
@attr="floorNumber"
|
|
52
|
+
@type="number"
|
|
53
|
+
@required={{true}}
|
|
54
|
+
/>
|
|
55
|
+
{{/if}}
|
|
56
56
|
|
|
57
57
|
<Field @attr="multipleFloor" @type="checkbox" @required={{true}} />
|
|
58
58
|
<Field @attr="physicalDwellingNo" />
|
|
@@ -67,8 +67,11 @@
|
|
|
67
67
|
/>
|
|
68
68
|
<Field @attr="kitchen" @type="checkbox" />
|
|
69
69
|
<Field @attr="surfaceAreaOfDwelling" @type="number" />
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
|
|
71
|
+
{{#if (or (not this.dwelling.isNew) this.import)}}
|
|
72
|
+
<Field @attr="yearOfConstruction" @type="number" />
|
|
73
|
+
<Field @attr="yearOfDemolition" @type="number" />
|
|
74
|
+
{{/if}}
|
|
72
75
|
|
|
73
76
|
<h2>{{t "ember-gwr.dwelling.usage.heading"}}</h2>
|
|
74
77
|
<Field
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
@onStatusCorrection={{this.correctState}}
|
|
36
36
|
@getChangeParameters={{this.getChangeParameters}}
|
|
37
37
|
@getCorrectionParameters={{this.getCorrectionParameters}}
|
|
38
|
-
@getChangeHint={{this.getChangeHint}}
|
|
38
|
+
@getChangeHint={{fn this.gwr.getChangeHint this.buildingAPI.cacheClass}}
|
|
39
39
|
@modelStatusField="buildingStatus"
|
|
40
40
|
as |Field changeset|
|
|
41
41
|
>
|
|
@@ -220,26 +220,26 @@
|
|
|
220
220
|
|
|
221
221
|
<Field @attr="building.nameOfBuilding" />
|
|
222
222
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
223
|
+
{{#if (or (not this.buildingWork.isNew) this.import)}}
|
|
224
|
+
<Field @attr="building.dateOfConstruction.yearMonthDay" @type="date" />
|
|
225
|
+
{{#if this.buildingWork.building.dateOfConstruction.year}}
|
|
226
|
+
<Field @attr="building.dateOfConstruction.year" @disabled={{true}} />
|
|
227
|
+
{{/if}}
|
|
228
|
+
{{#if this.buildingWork.building.dateOfConstruction.yearMonth}}
|
|
229
|
+
<Field
|
|
230
|
+
@attr="building.dateOfConstruction.yearMonth"
|
|
231
|
+
@disabled={{true}}
|
|
232
|
+
/>
|
|
233
|
+
{{/if}}
|
|
234
234
|
<Field
|
|
235
235
|
@attr="building.dateOfConstruction.periodOfConstruction"
|
|
236
236
|
@type="select"
|
|
237
237
|
@convertValueTo="number"
|
|
238
238
|
@gwrEnumOptions={{this.Models.DateOfConstruction.periodOfConstructionOptions}}
|
|
239
239
|
/>
|
|
240
|
-
{{/if}}
|
|
241
240
|
|
|
242
|
-
|
|
241
|
+
<Field @attr="building.yearOfDemolition" @type="number" />
|
|
242
|
+
{{/if}}
|
|
243
243
|
|
|
244
244
|
<h3>
|
|
245
245
|
{{t "ember-gwr.components.modelForm.realEstateHeading"}}
|
|
@@ -312,7 +312,18 @@
|
|
|
312
312
|
@label="ember-gwr.building.heating.revisionDate"
|
|
313
313
|
/>
|
|
314
314
|
|
|
315
|
-
<ul uk-accordion
|
|
315
|
+
<ul uk-accordion="active: {{if (or
|
|
316
|
+
(show-model-field
|
|
317
|
+
"building.thermotechnicalDeviceForHeating2.heatGeneratorHeating"
|
|
318
|
+
changeset
|
|
319
|
+
this.import
|
|
320
|
+
)
|
|
321
|
+
(show-model-field
|
|
322
|
+
"building.thermotechnicalDeviceForHeating2.energySourceHeating"
|
|
323
|
+
changeset
|
|
324
|
+
this.import
|
|
325
|
+
)) "0" false}}"
|
|
326
|
+
>
|
|
316
327
|
<li>
|
|
317
328
|
<a class="uk-accordion-title" href="#">
|
|
318
329
|
<h4>
|
|
@@ -380,7 +391,18 @@
|
|
|
380
391
|
@label="ember-gwr.building.heating.revisionDate"
|
|
381
392
|
/>
|
|
382
393
|
|
|
383
|
-
<ul uk-accordion
|
|
394
|
+
<ul uk-accordion="active: {{if (or
|
|
395
|
+
(show-model-field
|
|
396
|
+
"building.thermotechnicalDeviceForHeating2.heatGeneratorHeating"
|
|
397
|
+
changeset
|
|
398
|
+
this.import
|
|
399
|
+
)
|
|
400
|
+
(show-model-field
|
|
401
|
+
"building.thermotechnicalDeviceForHeating2.energySourceHeating"
|
|
402
|
+
changeset
|
|
403
|
+
this.import
|
|
404
|
+
)) "0" false}}"
|
|
405
|
+
>
|
|
384
406
|
<li>
|
|
385
407
|
<a class="uk-accordion-title" href="#">
|
|
386
408
|
<h4>
|