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.
Files changed (116) hide show
  1. package/.github/workflows/release.yml +2 -0
  2. package/CHANGELOG.md +95 -0
  3. package/addon/components/back-route.hbs +10 -0
  4. package/addon/components/import-modal/building-data.hbs +64 -0
  5. package/addon/components/import-modal/dwelling-data.hbs +30 -0
  6. package/addon/components/import-modal/entrance-data.hbs +14 -0
  7. package/addon/components/import-modal.hbs +54 -0
  8. package/addon/components/import-modal.js +6 -0
  9. package/addon/components/link-building-modal.hbs +1 -1
  10. package/addon/components/link-building-modal.js +2 -0
  11. package/addon/components/link-street.hbs +105 -0
  12. package/addon/components/link-street.js +24 -0
  13. package/addon/components/linked-models.hbs +12 -6
  14. package/addon/components/linked-models.js +6 -0
  15. package/addon/components/linked-projects.hbs +1 -1
  16. package/addon/components/linked-projects.js +6 -0
  17. package/addon/components/model-errors/error-indicator.hbs +3 -1
  18. package/addon/components/model-errors/header.hbs +4 -2
  19. package/addon/components/model-errors.hbs +1 -0
  20. package/addon/components/model-form/date.hbs +1 -0
  21. package/addon/components/model-form/date.js +6 -6
  22. package/addon/components/model-form/diff.hbs +40 -27
  23. package/addon/components/model-form/field.hbs +13 -8
  24. package/addon/components/model-form/field.js +36 -9
  25. package/addon/components/model-form/header/actions.hbs +70 -36
  26. package/addon/components/model-form/header/actions.js +6 -0
  27. package/addon/components/model-form/header/status-selector/submit-parameters.hbs +1 -1
  28. package/addon/components/model-form/header/status-selector.hbs +1 -1
  29. package/addon/components/model-form/header.hbs +4 -2
  30. package/addon/components/model-form/submit-errors.hbs +41 -23
  31. package/addon/components/model-form.hbs +6 -5
  32. package/addon/components/model-form.js +25 -5
  33. package/addon/components/model-inview.hbs +8 -0
  34. package/addon/components/model-inview.js +12 -0
  35. package/addon/components/project-form/date.hbs +1 -1
  36. package/addon/components/project-form/field.hbs +1 -1
  37. package/addon/components/project-form/field.js +5 -1
  38. package/addon/components/search/filters.hbs +0 -5
  39. package/addon/components/search/filters.js +1 -3
  40. package/addon/components/sub-nav.hbs +5 -10
  41. package/addon/controllers/building/edit/dwelling/edit.js +27 -32
  42. package/addon/controllers/building/edit/dwellings.js +1 -1
  43. package/addon/controllers/building/edit/entrance/edit/index.js +26 -13
  44. package/addon/controllers/building/edit/entrance/edit/link-street.js +45 -20
  45. package/addon/controllers/building/edit/entrances.js +18 -2
  46. package/addon/controllers/building/edit/form.js +29 -44
  47. package/addon/controllers/import.js +70 -0
  48. package/addon/controllers/project/errors.js +25 -29
  49. package/addon/controllers/project/form.js +35 -48
  50. package/addon/controllers/project.js +2 -1
  51. package/addon/helpers/housing-stat-link.js +13 -0
  52. package/addon/helpers/is-unset.js +7 -0
  53. package/addon/helpers/show-model-field.js +13 -0
  54. package/addon/models/address.js +39 -9
  55. package/addon/models/building-entrance.js +17 -7
  56. package/addon/models/building.js +74 -75
  57. package/addon/models/client.js +1 -1
  58. package/addon/models/construction-project.js +18 -16
  59. package/addon/models/date-partially-known.js +1 -1
  60. package/addon/models/dwelling.js +28 -1
  61. package/addon/models/heating.js +1 -1
  62. package/addon/models/identification.js +2 -1
  63. package/addon/models/options.js +251 -1
  64. package/addon/models/organisation-identification.js +6 -3
  65. package/addon/models/realestate-identification.js +0 -6
  66. package/addon/models/street.js +2 -0
  67. package/addon/models/xml-model.js +18 -7
  68. package/addon/models.js +2 -1
  69. package/addon/routes/building/edit/entrance/edit/index.js +0 -2
  70. package/addon/routes/building/edit/entrance/edit/link-street.js +10 -1
  71. package/addon/routes/building/edit/entrance/new.js +9 -16
  72. package/addon/routes/building/edit/index.js +8 -1
  73. package/addon/routes/building/new.js +10 -1
  74. package/addon/routes/project/form.js +5 -0
  75. package/addon/routes/project/new.js +3 -2
  76. package/addon/services/building-entrance.js +13 -9
  77. package/addon/services/building.js +195 -193
  78. package/addon/services/construction-project.js +140 -152
  79. package/addon/services/gwr.js +47 -2
  80. package/addon/services/street.js +10 -0
  81. package/addon/templates/building/edit/dwelling/edit.hbs +29 -6
  82. package/addon/templates/building/edit/dwellings.hbs +7 -4
  83. package/addon/templates/building/edit/entrance/edit/index.hbs +49 -84
  84. package/addon/templates/building/edit/entrance/edit/link-street.hbs +41 -12
  85. package/addon/templates/building/edit/entrances.hbs +6 -3
  86. package/addon/templates/building/edit/form.hbs +75 -21
  87. package/addon/templates/project/errors.hbs +121 -132
  88. package/addon/templates/project/form.hbs +126 -97
  89. package/addon/templates/project/linked-buildings.hbs +13 -20
  90. package/addon/templates/project.hbs +29 -19
  91. package/addon/templates/search-building.hbs +6 -0
  92. package/addon/templates/search-project.hbs +6 -0
  93. package/addon/utils.js +8 -0
  94. package/addon/validations/building-entrance.js +6 -4
  95. package/addon/validations/building-work.js +131 -11
  96. package/addon/validations/construction-project.js +154 -6
  97. package/addon/validations/coordinates.js +2 -2
  98. package/addon/validations/dwelling.js +61 -6
  99. package/addon/validations/realestate-identification.js +9 -9
  100. package/addon/validations/status/status-project-change.js +1 -1
  101. package/addon/validations/status/status-project-correction.js +1 -1
  102. package/addon/validators/range-state.js +27 -0
  103. package/addon/xml/helpers.js +4 -0
  104. package/addon/xml/templates/building-entrance.js +0 -14
  105. package/addon/xml/templates/building.js +0 -6
  106. package/addon/xml/templates/construction-project.js +2 -9
  107. package/addon/xml/templates/street.js +1 -7
  108. package/app/styles/ember-ebau-gwr.scss +32 -5
  109. package/config/environment.js +3 -0
  110. package/package.json +2 -2
  111. package/translations/building/de.yaml +13 -8
  112. package/translations/building-entrance/de.yaml +4 -10
  113. package/translations/construction-project/de.yaml +270 -15
  114. package/translations/de.yaml +46 -13
  115. package/translations/dwelling/de.yaml +14 -0
  116. 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
- async (buildingEntrance) =>
232
- await Promise.all(
233
- buildingEntrance.dwelling.map(async (dwelling) => {
234
- if (
235
- [
236
- Dwelling.STATUS_PROJECTED,
237
- Dwelling.STATUS_APPROVED,
238
- ].includes(dwelling.dwellingStatus)
239
- ) {
240
- await this.dwelling.setToApprovedDwelling(
241
- "setToApprovedDwelling",
242
- cascadeLevel - 1,
243
- isDryRun,
244
- dwelling,
245
- buildingWork.building.EGID
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
- async (buildingEntrance) =>
315
- await Promise.all(
316
- buildingEntrance.dwelling.map(async (dwelling) => {
317
- if (
318
- [
319
- Dwelling.STATUS_PROJECTED,
320
- Dwelling.STATUS_APPROVED,
321
- Dwelling.STATUS_NOT_REALIZED,
322
- ].includes(dwelling.dwellingStatus)
323
- ) {
324
- await this.dwelling.setToNotRealizedDwelling(
325
- "setToNotRealizedDwelling",
326
- cascadeLevel - 1,
327
- isDryRun,
328
- dwelling,
329
- buildingWork.building.EGID
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
- async (buildingEntrance) =>
416
- await Promise.all(
417
- buildingEntrance.dwelling.map(async (dwelling) => {
418
- if (buildingWork.kindOfWork === 6001) {
419
- if (dwelling.dwellingStatus !== Dwelling.STATUS_COMPLETED) {
420
- throw {
421
- isLifeCycleError: true,
422
- dwellingId: dwelling.EWID,
423
- buildingId: buildingWork.building.EGID,
424
- states: [Dwelling.STATUS_COMPLETED],
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
- async (buildingEntrance) =>
505
- await Promise.all(
506
- buildingEntrance.dwelling.map(async (dwelling) => {
507
- if (
508
- [
509
- Dwelling.STATUS_PROJECTED,
510
- Dwelling.STATUS_APPROVED,
511
- Dwelling.STATUS_NOT_REALIZED,
512
- ].includes(dwelling.dwellingStatus)
513
- ) {
514
- await this.dwelling.setToNotRealizedDwelling(
515
- "setToNotRealizedDwelling",
516
- cascadeLevel - 1,
517
- isDryRun,
518
- dwelling,
519
- buildingWork.building.EGID
520
- );
521
- } else {
522
- // Display message with link to dwelling with issue
523
- const states =
524
- cascadeLevel > 1
525
- ? [
526
- Dwelling.STATUS_PROJECTED,
527
- Dwelling.STATUS_APPROVED,
528
- Dwelling.STATUS_NOT_REALIZED,
529
- ]
530
- : [Dwelling.STATUS_NOT_REALIZED];
531
- throw {
532
- isLifeCycleError: true,
533
- dwellingId: dwelling.EWID,
534
- buildingId: buildingWork.building.EGID,
535
- states,
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
- async (buildingEntrance) =>
639
- await Promise.all(
640
- buildingEntrance.dwelling.map(async (dwelling) => {
641
- if (
642
- [
643
- Dwelling.STATUS_PROJECTED,
644
- Dwelling.STATUS_APPROVED,
645
- Dwelling.STATUS_NOT_REALIZED,
646
- ].includes(dwelling.dwellingStatus)
647
- ) {
648
- await this.dwelling.setToNotRealizedDwelling(
649
- "setToNotRealizedDwelling",
650
- cascadeLevel - 1,
651
- isDryRun,
652
- dwelling,
653
- buildingWork.building.EGID
654
- );
655
- } else {
656
- // Display message with link to dwelling with issue
657
- const states =
658
- cascadeLevel > 1
659
- ? [
660
- Dwelling.STATUS_PROJECTED,
661
- Dwelling.STATUS_APPROVED,
662
- Dwelling.STATUS_NOT_REALIZED,
663
- ]
664
- : [Dwelling.STATUS_NOT_REALIZED];
665
- throw {
666
- isLifeCycleError: true,
667
- dwellingId: dwelling.EWID,
668
- buildingId: buildingWork.building.EGID,
669
- states,
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(xmlErrors);
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
  }
@@ -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
- ? [this.intl.t("ember-gwr.generalErrors.genericFormError")]
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
  }
@@ -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.entrances}}
31
+ @options={{this.entranceOptions}}
31
32
  @optionTargetPath="EDID"
32
- @optionLabelPath="buildingEntranceNo"
33
+ @optionLabelPath="label"
33
34
  @noPlaceholder={{true}}
34
35
  @required={{true}}
35
36
  />
36
- <Field @attr="floor" @type="number" @required={{true}} @min="3100" />
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
- <Field @attr="yearOfConstruction" @type="number" />
51
- <Field @attr="yearOfDemolition" @type="number" />
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
- {{t
25
- "ember-gwr.building.dwellings.entrance"
26
- number=model.buildingEntranceNo
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>