ember-ebau-gwr 2.7.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/.github/workflows/release.yml +2 -0
- package/CHANGELOG.md +95 -0
- package/addon/components/back-route.hbs +10 -0
- package/addon/components/import-modal/building-data.hbs +64 -0
- package/addon/components/import-modal/dwelling-data.hbs +30 -0
- package/addon/components/import-modal/entrance-data.hbs +14 -0
- package/addon/components/import-modal.hbs +54 -0
- package/addon/components/import-modal.js +6 -0
- package/addon/components/link-building-modal.hbs +1 -1
- package/addon/components/link-building-modal.js +2 -0
- package/addon/components/link-street.hbs +105 -0
- package/addon/components/link-street.js +24 -0
- package/addon/components/linked-models.hbs +12 -6
- package/addon/components/linked-models.js +6 -0
- package/addon/components/linked-projects.hbs +1 -1
- package/addon/components/linked-projects.js +6 -0
- 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/date.hbs +1 -0
- package/addon/components/model-form/date.js +6 -6
- package/addon/components/model-form/diff.hbs +40 -27
- package/addon/components/model-form/field.hbs +13 -8
- package/addon/components/model-form/field.js +36 -9
- package/addon/components/model-form/header/actions.hbs +70 -36
- package/addon/components/model-form/header/actions.js +6 -0
- package/addon/components/model-form/header/status-selector/submit-parameters.hbs +1 -1
- package/addon/components/model-form/header/status-selector.hbs +1 -1
- package/addon/components/model-form/header.hbs +4 -2
- package/addon/components/model-form/submit-errors.hbs +41 -23
- package/addon/components/model-form.hbs +6 -5
- package/addon/components/model-form.js +25 -5
- package/addon/components/model-inview.hbs +8 -0
- package/addon/components/model-inview.js +12 -0
- package/addon/components/project-form/date.hbs +1 -1
- package/addon/components/project-form/field.hbs +1 -1
- package/addon/components/project-form/field.js +5 -1
- package/addon/components/search/filters.hbs +0 -5
- package/addon/components/search/filters.js +1 -3
- package/addon/components/sub-nav.hbs +5 -10
- package/addon/controllers/building/edit/dwelling/edit.js +27 -32
- package/addon/controllers/building/edit/dwellings.js +1 -1
- package/addon/controllers/building/edit/entrance/edit/index.js +26 -13
- package/addon/controllers/building/edit/entrance/edit/link-street.js +45 -20
- package/addon/controllers/building/edit/entrances.js +18 -2
- package/addon/controllers/building/edit/form.js +29 -44
- package/addon/controllers/import.js +70 -0
- package/addon/controllers/project/errors.js +25 -29
- package/addon/controllers/project/form.js +35 -48
- package/addon/controllers/project.js +2 -1
- package/addon/helpers/housing-stat-link.js +13 -0
- package/addon/helpers/is-unset.js +7 -0
- package/addon/helpers/show-model-field.js +13 -0
- package/addon/models/address.js +39 -9
- package/addon/models/building-entrance.js +17 -7
- package/addon/models/building.js +74 -75
- package/addon/models/client.js +1 -1
- package/addon/models/construction-project.js +18 -16
- package/addon/models/date-partially-known.js +1 -1
- package/addon/models/dwelling.js +28 -1
- package/addon/models/heating.js +1 -1
- package/addon/models/identification.js +2 -1
- package/addon/models/options.js +251 -1
- package/addon/models/organisation-identification.js +6 -3
- package/addon/models/realestate-identification.js +0 -6
- package/addon/models/street.js +2 -0
- package/addon/models/xml-model.js +18 -7
- package/addon/models.js +2 -1
- package/addon/routes/building/edit/entrance/edit/index.js +0 -2
- package/addon/routes/building/edit/entrance/edit/link-street.js +10 -1
- package/addon/routes/building/edit/entrance/new.js +9 -16
- package/addon/routes/building/edit/index.js +8 -1
- package/addon/routes/building/new.js +10 -1
- package/addon/routes/project/form.js +5 -0
- package/addon/routes/project/new.js +3 -2
- package/addon/services/building-entrance.js +13 -9
- package/addon/services/building.js +195 -193
- package/addon/services/construction-project.js +140 -152
- package/addon/services/gwr.js +47 -2
- package/addon/services/street.js +10 -0
- package/addon/templates/building/edit/dwelling/edit.hbs +29 -6
- package/addon/templates/building/edit/dwellings.hbs +7 -4
- package/addon/templates/building/edit/entrance/edit/index.hbs +49 -84
- package/addon/templates/building/edit/entrance/edit/link-street.hbs +41 -12
- package/addon/templates/building/edit/entrances.hbs +6 -3
- package/addon/templates/building/edit/form.hbs +75 -21
- package/addon/templates/project/errors.hbs +121 -132
- package/addon/templates/project/form.hbs +126 -97
- package/addon/templates/project/linked-buildings.hbs +13 -20
- package/addon/templates/project.hbs +29 -19
- 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-entrance.js +6 -4
- package/addon/validations/building-work.js +131 -11
- package/addon/validations/construction-project.js +154 -6
- package/addon/validations/coordinates.js +2 -2
- package/addon/validations/dwelling.js +61 -6
- package/addon/validations/realestate-identification.js +9 -9
- package/addon/validations/status/status-project-change.js +1 -1
- package/addon/validations/status/status-project-correction.js +1 -1
- package/addon/validators/range-state.js +27 -0
- package/addon/xml/helpers.js +4 -0
- package/addon/xml/templates/building-entrance.js +0 -14
- package/addon/xml/templates/building.js +0 -6
- package/addon/xml/templates/construction-project.js +2 -9
- package/addon/xml/templates/street.js +1 -7
- package/app/styles/ember-ebau-gwr.scss +32 -5
- package/config/environment.js +3 -0
- package/package.json +2 -2
- package/translations/building/de.yaml +13 -8
- package/translations/building-entrance/de.yaml +4 -10
- package/translations/construction-project/de.yaml +270 -15
- package/translations/de.yaml +46 -13
- package/translations/dwelling/de.yaml +14 -0
- package/translations/locality/de.yaml +2 -0
|
@@ -12,6 +12,7 @@ import GwrService from "./gwr";
|
|
|
12
12
|
export default class ConstructionProjectService extends GwrService {
|
|
13
13
|
cacheKey = "EPROID";
|
|
14
14
|
cacheClass = ConstructionProject;
|
|
15
|
+
ConstructionProject = ConstructionProject;
|
|
15
16
|
|
|
16
17
|
@service building;
|
|
17
18
|
@service dwelling;
|
|
@@ -104,13 +105,7 @@ export default class ConstructionProjectService extends GwrService {
|
|
|
104
105
|
|
|
105
106
|
buildingWork.ARBID = ARBID;
|
|
106
107
|
buildingWork.isNew = false;
|
|
107
|
-
|
|
108
|
-
// TODO: apply for type "Umbau" with modifyWork
|
|
109
|
-
// don't execute bindBuildingToConstructionProject
|
|
110
108
|
return buildingWork;
|
|
111
|
-
/*return buildingWork.kindOfWork === 6002
|
|
112
|
-
? await this.modifyWork(projectId, buildingWork)
|
|
113
|
-
: buildingWork;*/
|
|
114
109
|
}
|
|
115
110
|
|
|
116
111
|
async modifyWork(projectId, buildingWork) {
|
|
@@ -227,26 +222,25 @@ export default class ConstructionProjectService extends GwrService {
|
|
|
227
222
|
}
|
|
228
223
|
} else if (buildingWork.kindOfWork === 6002) {
|
|
229
224
|
await Promise.all(
|
|
230
|
-
buildingWork.building.buildingEntrance.map(
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
)
|
|
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
|
+
)
|
|
250
244
|
)
|
|
251
245
|
);
|
|
252
246
|
}
|
|
@@ -310,27 +304,26 @@ export default class ConstructionProjectService extends GwrService {
|
|
|
310
304
|
}
|
|
311
305
|
} else if (buildingWork.kindOfWork === 6002) {
|
|
312
306
|
await Promise.all(
|
|
313
|
-
buildingWork.building.buildingEntrance.map(
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
)
|
|
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
|
+
)
|
|
334
327
|
)
|
|
335
328
|
);
|
|
336
329
|
}
|
|
@@ -411,33 +404,30 @@ export default class ConstructionProjectService extends GwrService {
|
|
|
411
404
|
}
|
|
412
405
|
|
|
413
406
|
await Promise.all(
|
|
414
|
-
buildingWork.building.buildingEntrance.map(
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
if (
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
};
|
|
426
|
-
}
|
|
427
|
-
} else if (buildingWork.kindOfWork === 6007) {
|
|
428
|
-
if (
|
|
429
|
-
dwelling.dwellingStatus !== Dwelling.STATUS_DEMOLISHED
|
|
430
|
-
) {
|
|
431
|
-
throw {
|
|
432
|
-
isLifeCycleError: true,
|
|
433
|
-
dwellingId: dwelling.EWID,
|
|
434
|
-
buildingId: buildingWork.building.EGID,
|
|
435
|
-
states: [Dwelling.STATUS_DEMOLISHED],
|
|
436
|
-
};
|
|
437
|
-
}
|
|
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
|
+
};
|
|
438
418
|
}
|
|
439
|
-
})
|
|
440
|
-
|
|
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
|
+
)
|
|
441
431
|
)
|
|
442
432
|
);
|
|
443
433
|
})
|
|
@@ -500,43 +490,42 @@ export default class ConstructionProjectService extends GwrService {
|
|
|
500
490
|
}
|
|
501
491
|
} else if (buildingWork.kindOfWork === 6002) {
|
|
502
492
|
await Promise.all(
|
|
503
|
-
buildingWork.building.buildingEntrance.map(
|
|
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
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
)
|
|
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
|
+
)
|
|
540
529
|
)
|
|
541
530
|
);
|
|
542
531
|
}
|
|
@@ -634,43 +623,42 @@ export default class ConstructionProjectService extends GwrService {
|
|
|
634
623
|
}
|
|
635
624
|
} else if (buildingWork.kindOfWork === 6002) {
|
|
636
625
|
await Promise.all(
|
|
637
|
-
buildingWork.building.buildingEntrance.map(
|
|
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
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
)
|
|
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
|
+
)
|
|
674
662
|
)
|
|
675
663
|
);
|
|
676
664
|
}
|
|
@@ -738,7 +726,11 @@ export default class ConstructionProjectService extends GwrService {
|
|
|
738
726
|
|
|
739
727
|
if (!response.ok) {
|
|
740
728
|
const xmlErrors = await response.text();
|
|
741
|
-
const errors = this.extractErrorsFromXML(
|
|
729
|
+
const errors = this.extractErrorsFromXML(
|
|
730
|
+
xmlErrors,
|
|
731
|
+
this.ConstructionProject.MISSING_BUILDING_ERROR,
|
|
732
|
+
this.intl.t("ember-gwr.constructionProject.missingBuildingError")
|
|
733
|
+
);
|
|
742
734
|
|
|
743
735
|
console.error(`GWR API: ${transition} failed`);
|
|
744
736
|
throw errors;
|
|
@@ -773,8 +765,4 @@ export default class ConstructionProjectService extends GwrService {
|
|
|
773
765
|
}
|
|
774
766
|
});
|
|
775
767
|
}
|
|
776
|
-
|
|
777
|
-
getChangeHint(currentStatus, newStatus) {
|
|
778
|
-
return ConstructionProject.projectTransitionHint[currentStatus][newStatus];
|
|
779
|
-
}
|
|
780
768
|
}
|
package/addon/services/gwr.js
CHANGED
|
@@ -88,7 +88,7 @@ export default class GwrService extends Service {
|
|
|
88
88
|
})[searchKey];
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
extractErrorsFromXML(xml) {
|
|
91
|
+
extractErrorsFromXML(xml, specificError, specificErrorMsg) {
|
|
92
92
|
const model = new XMLModel(xml);
|
|
93
93
|
model.setFieldsFromXML({
|
|
94
94
|
fields: {
|
|
@@ -99,7 +99,9 @@ export default class GwrService extends Service {
|
|
|
99
99
|
|
|
100
100
|
const errors = [
|
|
101
101
|
...(model.error
|
|
102
|
-
? [
|
|
102
|
+
? model.error[0] === specificError
|
|
103
|
+
? [specificErrorMsg]
|
|
104
|
+
: [this.intl.t("ember-gwr.generalErrors.genericFormError")]
|
|
103
105
|
: []),
|
|
104
106
|
...(model.errorList
|
|
105
107
|
? model.errorList.map((error) => error.messageOfError)
|
|
@@ -108,4 +110,47 @@ export default class GwrService extends Service {
|
|
|
108
110
|
|
|
109
111
|
return errors;
|
|
110
112
|
}
|
|
113
|
+
|
|
114
|
+
concatStates(states) {
|
|
115
|
+
if (states.length === 1) {
|
|
116
|
+
return this.intl.t(`ember-gwr.lifeCycles.states.${states[0]}`);
|
|
117
|
+
}
|
|
118
|
+
const tail = states.pop();
|
|
119
|
+
return `${states
|
|
120
|
+
.map((state) => this.intl.t(`ember-gwr.lifeCycles.states.${state}`))
|
|
121
|
+
.join(", ")} ${this.intl.t("ember-gwr.general.or")} ${this.intl.t(
|
|
122
|
+
`ember-gwr.lifeCycles.states.${tail}`
|
|
123
|
+
)}`;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
buildLifeCycleError(error, { instanceId, projectId }) {
|
|
127
|
+
const { buildingId, dwellingId, states } = error;
|
|
128
|
+
return {
|
|
129
|
+
linkToRoute: dwellingId
|
|
130
|
+
? "building.edit.dwelling.edit"
|
|
131
|
+
: "building.edit.form",
|
|
132
|
+
linkToModels: [
|
|
133
|
+
instanceId,
|
|
134
|
+
projectId,
|
|
135
|
+
buildingId,
|
|
136
|
+
...(dwellingId ? [dwellingId] : []),
|
|
137
|
+
],
|
|
138
|
+
linkToText: this.intl.t(
|
|
139
|
+
`ember-gwr.lifeCycles.statusError${
|
|
140
|
+
dwellingId ? "Dwelling" : "Building"
|
|
141
|
+
}`,
|
|
142
|
+
{
|
|
143
|
+
dwellingId,
|
|
144
|
+
buildingId,
|
|
145
|
+
}
|
|
146
|
+
),
|
|
147
|
+
linkToTextAfter: this.intl.t(`ember-gwr.lifeCycles.statusError`, {
|
|
148
|
+
states: this.concatStates(states),
|
|
149
|
+
}),
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
getChangeHint(cacheClass, currentStatus, newStatus) {
|
|
154
|
+
return cacheClass.transitionHint[currentStatus][newStatus];
|
|
155
|
+
}
|
|
111
156
|
}
|
package/addon/services/street.js
CHANGED
|
@@ -6,6 +6,16 @@ export default class StreetService extends GWRService {
|
|
|
6
6
|
cacheKey = "ESID";
|
|
7
7
|
cacheClass = Street;
|
|
8
8
|
|
|
9
|
+
async get(ESID) {
|
|
10
|
+
if (!ESID) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
const response = await this.authFetch.fetch(`/streets/${ESID}`);
|
|
14
|
+
const xml = await response.text();
|
|
15
|
+
const street = new Street(xml, "streetWithoutStreetGeometryType");
|
|
16
|
+
return this.cache(street);
|
|
17
|
+
}
|
|
18
|
+
|
|
9
19
|
async search(query = {}) {
|
|
10
20
|
return super.search(query, query.EGID, {
|
|
11
21
|
xmlMethod: "getStreet",
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
@projectId={{this.router.currentRoute.attributes.projectId}}
|
|
16
16
|
@headerModelName="dwelling"
|
|
17
17
|
@hasStatus={{true}}
|
|
18
|
+
@import={{this.import}}
|
|
18
19
|
@modelStatusOptions={{this.dwellingStatusOptions}}
|
|
19
20
|
@nextValidStates={{this.nextValidStates}}
|
|
20
21
|
@onStatusChange={{this.transitionState}}
|
|
@@ -22,18 +23,37 @@
|
|
|
22
23
|
@getChangeParameters={{this.getChangeParameters}}
|
|
23
24
|
@getCorrectionParameters={{this.getCorrectionParameters}}
|
|
24
25
|
@modelStatusField="dwellingStatus"
|
|
25
|
-
as |Field|
|
|
26
|
+
as |Field changeset|
|
|
26
27
|
>
|
|
27
28
|
<Field
|
|
28
29
|
@attr="EDID"
|
|
29
30
|
@type="select"
|
|
30
|
-
@options={{this.
|
|
31
|
+
@options={{this.entranceOptions}}
|
|
31
32
|
@optionTargetPath="EDID"
|
|
32
|
-
@optionLabelPath="
|
|
33
|
+
@optionLabelPath="label"
|
|
33
34
|
@noPlaceholder={{true}}
|
|
34
35
|
@required={{true}}
|
|
35
36
|
/>
|
|
36
|
-
|
|
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
|
+
|
|
37
57
|
<Field @attr="multipleFloor" @type="checkbox" @required={{true}} />
|
|
38
58
|
<Field @attr="physicalDwellingNo" />
|
|
39
59
|
<Field @attr="administrativeDwellingNo" />
|
|
@@ -47,8 +67,11 @@
|
|
|
47
67
|
/>
|
|
48
68
|
<Field @attr="kitchen" @type="checkbox" />
|
|
49
69
|
<Field @attr="surfaceAreaOfDwelling" @type="number" />
|
|
50
|
-
|
|
51
|
-
|
|
70
|
+
|
|
71
|
+
{{#if (or (not this.dwelling.isNew) this.import)}}
|
|
72
|
+
<Field @attr="yearOfConstruction" @type="number" />
|
|
73
|
+
<Field @attr="yearOfDemolition" @type="number" />
|
|
74
|
+
{{/if}}
|
|
52
75
|
|
|
53
76
|
<h2>{{t "ember-gwr.dwelling.usage.heading"}}</h2>
|
|
54
77
|
<Field
|
|
@@ -21,9 +21,12 @@
|
|
|
21
21
|
</LinkTo>
|
|
22
22
|
</td>
|
|
23
23
|
<td>
|
|
24
|
-
{{
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
{{concat
|
|
25
|
+
(t
|
|
26
|
+
"ember-gwr.buildingEntrance.title"
|
|
27
|
+
address=model.buildingEntrance.EDID
|
|
28
|
+
) " - "
|
|
29
|
+
model.buildingEntrance.fullAddressText
|
|
27
30
|
}}
|
|
28
31
|
</td>
|
|
29
32
|
<td>
|
|
@@ -47,4 +50,4 @@
|
|
|
47
50
|
</td>
|
|
48
51
|
</LinkedModels>
|
|
49
52
|
{{/if}}
|
|
50
|
-
</div>
|
|
53
|
+
</div>
|