ember-ebau-gwr 8.1.3 → 9.0.1

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 (64) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/addon/components/building-preview.hbs +3 -6
  3. package/addon/components/import-modal/building-data.hbs +1 -1
  4. package/addon/components/import-modal.hbs +1 -1
  5. package/addon/components/instance-link.hbs +11 -11
  6. package/addon/components/link-building-modal.hbs +1 -1
  7. package/addon/components/linked-models.hbs +1 -1
  8. package/addon/components/linked-projects.hbs +1 -1
  9. package/addon/components/login-modal.hbs +1 -2
  10. package/addon/components/model-errors/list.hbs +7 -2
  11. package/addon/components/model-form/date.hbs +1 -1
  12. package/addon/components/model-form/diff.hbs +1 -1
  13. package/addon/components/model-form/header/actions.hbs +94 -94
  14. package/addon/components/model-form/header/errors.hbs +1 -1
  15. package/addon/components/model-form/header/status-selector.hbs +1 -1
  16. package/addon/components/model-form/header.hbs +4 -2
  17. package/addon/components/model-form.hbs +5 -1
  18. package/addon/components/project-landing-page.hbs +1 -1
  19. package/addon/components/quarterly-closure/card-status.hbs +2 -1
  20. package/addon/components/quarterly-closure/error-list/project-errors.hbs +3 -1
  21. package/addon/components/quarterly-closure/error-list/survey-department-errors.hbs +1 -3
  22. package/addon/components/quarterly-closure/status.hbs +2 -1
  23. package/addon/components/quarterly-closure/title.hbs +2 -2
  24. package/addon/components/remove-modal.hbs +38 -0
  25. package/addon/components/remove-modal.js +9 -0
  26. package/addon/components/search/filters.hbs +1 -1
  27. package/addon/components/search.hbs +1 -1
  28. package/addon/components/sub-nav.hbs +1 -1
  29. package/addon/components/validated-form-error.hbs +1 -1
  30. package/addon/controllers/building/edit/dwellings.js +16 -2
  31. package/addon/services/dwelling.js +2 -6
  32. package/addon/templates/building/edit/dwelling/edit.hbs +12 -4
  33. package/addon/templates/building/edit/dwelling.hbs +1 -1
  34. package/addon/templates/building/edit/dwellings.hbs +11 -1
  35. package/addon/templates/building/edit/entrance/edit/index.hbs +1 -3
  36. package/addon/templates/building/edit/entrance/edit/link-street.hbs +10 -4
  37. package/addon/templates/building/edit/entrance.hbs +1 -1
  38. package/addon/templates/building/edit/entrances.hbs +1 -1
  39. package/addon/templates/building/edit/form.hbs +4 -1
  40. package/addon/templates/building/edit.hbs +1 -1
  41. package/addon/templates/global-landing-page.hbs +5 -2
  42. package/addon/templates/project/errors.hbs +1 -1
  43. package/addon/templates/project/form.hbs +7 -2
  44. package/addon/templates/project/linked-buildings.hbs +1 -1
  45. package/addon/templates/quarterly-closure.hbs +2 -2
  46. package/addon/templates/search-building.hbs +3 -2
  47. package/addon/templates/search-project.hbs +1 -1
  48. package/addon/validations/dwelling.js +18 -5
  49. package/addon/validations/realestate-identification.js +6 -1
  50. package/addon/validations/remove-modal.js +22 -0
  51. package/package.json +5 -3
  52. package/translations/building/de.yaml +4 -0
  53. package/translations/building/fr.yaml +4 -0
  54. package/translations/building/it.yaml +5 -1
  55. package/translations/construction-project/de.yaml +1 -0
  56. package/translations/construction-project/fr.yaml +1 -0
  57. package/translations/construction-project/it.yaml +1 -0
  58. package/translations/de.yaml +8 -5
  59. package/translations/dwelling/de.yaml +2 -0
  60. package/translations/dwelling/fr.yaml +2 -0
  61. package/translations/dwelling/it.yaml +4 -2
  62. package/translations/fr.yaml +7 -4
  63. package/translations/it.yaml +9 -7
  64. package/translations/quarterly-closure/it.yaml +1 -2
package/CHANGELOG.md CHANGED
@@ -1,3 +1,30 @@
1
+ ## [9.0.1](https://github.com/inosca/ember-ebau-gwr/compare/v9.0.0...v9.0.1) (2026-10-22)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **dwellings:** add validation for apartment number ([0993844](https://github.com/inosca/ember-ebau-gwr/commit/099384488d22449aad4fce853ab8958527e5b4c6))
7
+ * **project:** add validation for realestateIdentification number ([945e413](https://github.com/inosca/ember-ebau-gwr/commit/945e41323826db72765c193df780b4eedbd0b52c))
8
+
9
+ # [9.0.0](https://github.com/inosca/ember-ebau-gwr/compare/v8.1.3...v9.0.0) (2026-08-19)
10
+
11
+
12
+ ### chore
13
+
14
+ * bump minimum required node version to 20 ([ade5dfe](https://github.com/inosca/ember-ebau-gwr/commit/ade5dfec812de6e0f4baa2448eb8324d4bcafa85))
15
+
16
+
17
+ ### Features
18
+
19
+ * **dwellings:** add character length validation with whitespace cleanup ([7088e99](https://github.com/inosca/ember-ebau-gwr/commit/7088e99195912813de37a21c88322e908b607949))
20
+ * **dwellings:** add mandatory reason for removing dwellings ([40b9a86](https://github.com/inosca/ember-ebau-gwr/commit/40b9a86bf4895cc3a13cc47b6280f6c941c0f6a5))
21
+ * **translations:** use global translations for common modal terms ([6c2929d](https://github.com/inosca/ember-ebau-gwr/commit/6c2929d2f783ee6e93e1b563735b235eb35a1509))
22
+
23
+
24
+ ### BREAKING CHANGES
25
+
26
+ * bump required node version to v20
27
+
1
28
  ## [8.1.3](https://github.com/inosca/ember-ebau-gwr/compare/v8.1.2...v8.1.3) (2026-06-09)
2
29
 
3
30
 
@@ -23,8 +23,7 @@
23
23
  @model.buildingCategory
24
24
  (t
25
25
  (concat
26
- "ember-gwr.building.buildingCategoryOptions."
27
- @model.buildingCategory
26
+ "ember-gwr.building.buildingCategoryOptions." @model.buildingCategory
28
27
  )
29
28
  )
30
29
  "-"
@@ -38,9 +37,7 @@
38
37
  {{if
39
38
  @model.buildingClass
40
39
  (t
41
- (concat
42
- "ember-gwr.building.buildingClassOptions." @model.buildingClass
43
- )
40
+ (concat "ember-gwr.building.buildingClassOptions." @model.buildingClass)
44
41
  )
45
42
  "-"
46
43
  }}
@@ -50,4 +47,4 @@
50
47
  <span class="uk-flex uk-child-width-1-2">
51
48
  <span>{{t "ember-gwr.building.numberOfFloors"}}</span>
52
49
  <span class="uk-text-muted">{{or @model.numberOfFloors "-"}}</span>
53
- </span>
50
+ </span>
@@ -7,4 +7,4 @@
7
7
  }}</span>
8
8
  </span>
9
9
  <hr />
10
- <BuildingPreview @model={{@model.building}} />
10
+ <BuildingPreview @model={{@model.building}} />
@@ -48,4 +48,4 @@
48
48
  {{t "ember-gwr.components.modelForm.cancelImport"}}
49
49
  </LinkTo>
50
50
  </Modal.footer>
51
- </UkModal>
51
+ </UkModal>
@@ -1,16 +1,16 @@
1
1
  {{#if @links.length}}
2
- <div class="uk-flex uk-flex-inline uk-flex-middle">
2
+ <div class="uk-flex uk-flex-inline uk-flex-middle">
3
3
  <UkIcon @icon="link" class="uk-text-emphasis" />
4
4
  {{#each @links as |link index|}}
5
- {{#if index}}
6
- <span class="margin-right-xs">,</span>
7
- {{/if}}
8
- <a
9
- class="uk-button uk-button-link"
10
- href={{concat link.hostLink link.localLink}}
11
- >
12
- {{link.identifier}}
13
- </a>
5
+ {{#if index}}
6
+ <span class="margin-right-xs">,</span>
7
+ {{/if}}
8
+ <a
9
+ class="uk-button uk-button-link"
10
+ href={{concat link.hostLink link.localLink}}
11
+ >
12
+ {{link.identifier}}
13
+ </a>
14
14
  {{/each}}
15
- </div>
15
+ </div>
16
16
  {{/if}}
@@ -55,7 +55,7 @@
55
55
  <Modal.footer class="uk-flex uk-flex-column">
56
56
  <div class="uk-flex uk-flex-between">
57
57
  <UkButton @onClick={{@close}}>
58
- {{t "ember-gwr.components.linkBuildingModal.cancel"}}
58
+ {{t "ember-gwr.components.modal.cancel"}}
59
59
  </UkButton>
60
60
  <UkButton
61
61
  @color="primary"
@@ -102,4 +102,4 @@
102
102
  </tr>
103
103
  </tfoot>
104
104
  </table>
105
- {{/let}}
105
+ {{/let}}
@@ -34,4 +34,4 @@
34
34
  {{/if}}
35
35
  </td>
36
36
  </:list>
37
- </LinkedModels>
37
+ </LinkedModels>
@@ -79,8 +79,7 @@
79
79
  "ember-gwr.components.loginModal.loginInfo"
80
80
  user=this.authFetch.username
81
81
  municipality=(get
82
- (this.getMunicipality this.authFetch.municipality)
83
- "name"
82
+ (this.getMunicipality this.authFetch.municipality) "name"
84
83
  )
85
84
  htmlSafe=true
86
85
  }}
@@ -25,7 +25,12 @@
25
25
  {{else}}
26
26
  <li>
27
27
  <div class="uk-text-success uk-flex uk-flex-middle">
28
- <FaIcon @icon="circle-check" @fixedWidth={{true}} class="margin-right-xs" @size="sm" />
28
+ <FaIcon
29
+ @icon="circle-check"
30
+ @fixedWidth={{true}}
31
+ class="margin-right-xs"
32
+ @size="sm"
33
+ />
29
34
  <div>
30
35
  {{t "ember-gwr.components.modelErrors.empty"}}
31
36
  </div>
@@ -33,4 +38,4 @@
33
38
  </li>
34
39
  {{/each}}
35
40
  </ul>
36
- {{/if}}
41
+ {{/if}}
@@ -47,4 +47,4 @@
47
47
  {{/if}}
48
48
  </div>
49
49
  {{component @hintComponent}}
50
- {{component @errorComponent}}
50
+ {{component @errorComponent}}
@@ -67,4 +67,4 @@
67
67
  </div>
68
68
  </div>
69
69
  {{component @hintComponent}}
70
- {{component @errorComponent}}
70
+ {{component @errorComponent}}
@@ -6,113 +6,113 @@
6
6
  />
7
7
  <div class="uk-flex uk-flex-bottom uk-flex-column-reverse">
8
8
  {{#if (and @modelHasImport @import)}}
9
- <div class="uk-flex uk-flex-wrap uk-flex-right">
10
- {{#if (and @import.originalData.length (is-unset @import.index))}}
9
+ <div class="uk-flex uk-flex-wrap uk-flex-right">
10
+ {{#if (and @import.originalData.length (is-unset @import.index))}}
11
+ <LinkTo
12
+ class="uk-button uk-button-default uk-flex-none"
13
+ @query={{hash index=null}}
14
+ >
15
+ {{t "ember-gwr.components.importModal.selectImportData"}}
16
+ </LinkTo>
17
+ {{else}}
18
+ <button
19
+ class="uk-button uk-button-default uk-flex-none uk-margin-small-left
20
+ {{if (is-unset @import.index) 'uk-margin-small-right'}}"
21
+ type="button"
22
+ {{on "click" @importAllData}}
23
+ >
24
+ {{t "ember-gwr.components.modelForm.applyAll"}}
25
+ </button>
26
+ {{#if (and @import @import.originalData.length)}}
27
+ <button
28
+ class="uk-button uk-button-default uk-flex-none uk-padding-small uk-padding-remove-vertical"
29
+ type="button"
30
+ disabled={{@disabled}}
31
+ >
32
+ <span class="uk-icon" uk-icon="more-vertical"></span>
33
+ </button>
34
+ <div
35
+ uk-dropdown="mode: click; pos: bottom-right; offset: 20"
36
+ class="uk-padding-small"
37
+ >
38
+ <ul
39
+ class="uk-nav uk-dropdown-nav uk-list uk-list-divider uk-list-collapse"
40
+ >
41
+ <li>
42
+ <LinkTo
43
+ class="uk-button uk-text-left uk-highlight-hover uk-text-secondary uk-width-1-1 uk-background-default uk-padding-remove"
44
+ @query={{hash index=null}}
45
+ >
46
+ {{t "ember-gwr.components.importModal.selectImportData"}}
47
+ </LinkTo>
48
+ </li>
49
+ </ul>
50
+ </div>
51
+ {{/if}}
52
+ {{/if}}
11
53
  <LinkTo
12
- class="uk-button uk-button-default uk-flex-none"
13
- @query={{hash index=null}}
54
+ @query={{hash import=false index=undefined}}
55
+ class="uk-button uk-button-default uk-flex-none uk-margin-small-left"
14
56
  >
15
- {{t "ember-gwr.components.importModal.selectImportData"}}
57
+ {{t "ember-gwr.components.modelForm.cancelImport"}}
16
58
  </LinkTo>
17
- {{else}}
59
+ </div>
60
+ {{/if}}
61
+ <div class="uk-margin-small-bottom uk-margin-small-left">
62
+ {{#let @submit as |Submit|}}
63
+ <Submit />
64
+ {{/let}}
65
+ {{#if (or @modelHasImport @statusConfiguration)}}
18
66
  <button
19
- class="uk-button uk-button-default uk-flex-none uk-margin-small-left
20
- {{if (is-unset @import.index) 'uk-margin-small-right'}}"
67
+ class="uk-button uk-button-default uk-flex-none uk-padding-small uk-padding-remove-vertical"
21
68
  type="button"
22
- {{on "click" @importAllData}}
69
+ disabled={{@disabled}}
23
70
  >
24
- {{t "ember-gwr.components.modelForm.applyAll"}}
71
+ <span class="uk-icon" uk-icon="more-vertical"></span>
25
72
  </button>
26
- {{#if (and @import @import.originalData.length)}}
27
- <button
28
- class="uk-button uk-button-default uk-flex-none uk-padding-small uk-padding-remove-vertical"
29
- type="button"
30
- disabled={{@disabled}}
31
- >
32
- <span class="uk-icon" uk-icon="more-vertical"></span>
33
- </button>
34
- <div
35
- uk-dropdown="mode: click; pos: bottom-right; offset: 20"
36
- class="uk-padding-small"
73
+ <div
74
+ uk-dropdown="mode: click; pos: bottom-right; offset: 20"
75
+ class="uk-padding-small"
76
+ >
77
+ <ul
78
+ class="uk-nav uk-dropdown-nav uk-list uk-list-divider uk-list-collapse"
37
79
  >
38
- <ul
39
- class="uk-nav uk-dropdown-nav uk-list uk-list-divider uk-list-collapse"
40
- >
80
+ {{#if @modelHasImport}}
41
81
  <li>
42
82
  <LinkTo
43
- class="uk-button uk-text-left uk-highlight-hover uk-text-secondary uk-width-1-1 uk-background-default uk-padding-remove"
44
- @query={{hash index=null}}
83
+ @disabled={{or @import @import.error}}
84
+ @query={{hash import=true}}
85
+ class="uk-button uk-text-left uk-highlight-hover
86
+ {{if
87
+ (or @import this.importState.hasError)
88
+ 'uk-text-muted'
89
+ 'uk-text-secondary'
90
+ }}
91
+ uk-width-1-1 uk-background-default uk-padding-remove"
92
+ uk-tooltip="title: {{if
93
+ @import.error
94
+ (t 'ember-gwr.components.modelForm.importError')
95
+ }}; container: {{this.config.modalContainer}}"
45
96
  >
46
- {{t "ember-gwr.components.importModal.selectImportData"}}
97
+ {{t "ember-gwr.components.modelForm.importFromCaluma"}}
47
98
  </LinkTo>
48
99
  </li>
49
- </ul>
50
- </div>
51
- {{/if}}
100
+ {{/if}}
101
+ {{#if @statusConfiguration}}
102
+ <li>
103
+ <a
104
+ href="#ember-ebau-gwr-status"
105
+ uk-scroll
106
+ class="uk-button uk-text-left uk-highlight-hover uk-text-secondary uk-width-1-1 uk-background-default uk-padding-remove"
107
+ {{on "click" @openStatus}}
108
+ >
109
+ {{t "ember-gwr.components.modelForm.changeStatus"}}
110
+ </a>
111
+ </li>
112
+ {{/if}}
113
+ </ul>
114
+ </div>
52
115
  {{/if}}
53
- <LinkTo
54
- @query={{hash import=false index=undefined}}
55
- class="uk-button uk-button-default uk-flex-none uk-margin-small-left"
56
- >
57
- {{t "ember-gwr.components.modelForm.cancelImport"}}
58
- </LinkTo>
59
- </div>
60
- {{/if}}
61
- <div class="uk-margin-small-bottom uk-margin-small-left">
62
- {{#let @submit as |Submit|}}
63
- <Submit />
64
- {{/let}}
65
- {{#if (or @modelHasImport @statusConfiguration)}}
66
- <button
67
- class="uk-button uk-button-default uk-flex-none uk-padding-small uk-padding-remove-vertical"
68
- type="button"
69
- disabled={{@disabled}}
70
- >
71
- <span class="uk-icon" uk-icon="more-vertical"></span>
72
- </button>
73
- <div
74
- uk-dropdown="mode: click; pos: bottom-right; offset: 20"
75
- class="uk-padding-small"
76
- >
77
- <ul
78
- class="uk-nav uk-dropdown-nav uk-list uk-list-divider uk-list-collapse"
79
- >
80
- {{#if @modelHasImport}}
81
- <li>
82
- <LinkTo
83
- @disabled={{or @import @import.error}}
84
- @query={{hash import=true}}
85
- class="uk-button uk-text-left uk-highlight-hover
86
- {{if
87
- (or @import this.importState.hasError)
88
- 'uk-text-muted'
89
- 'uk-text-secondary'
90
- }}
91
- uk-width-1-1 uk-background-default uk-padding-remove"
92
- uk-tooltip="title: {{if
93
- @import.error
94
- (t 'ember-gwr.components.modelForm.importError')
95
- }}; container: {{this.config.modalContainer}}"
96
- >
97
- {{t "ember-gwr.components.modelForm.importFromCaluma"}}
98
- </LinkTo>
99
- </li>
100
- {{/if}}
101
- {{#if @statusConfiguration}}
102
- <li>
103
- <a
104
- href="#ember-ebau-gwr-status"
105
- uk-scroll
106
- class="uk-button uk-text-left uk-highlight-hover uk-text-secondary uk-width-1-1 uk-background-default uk-padding-remove"
107
- {{on "click" @openStatus}}
108
- >
109
- {{t "ember-gwr.components.modelForm.changeStatus"}}
110
- </a>
111
- </li>
112
- {{/if}}
113
- </ul>
114
- </div>
115
- {{/if}}
116
116
  </div>
117
117
  </div>
118
118
  <div class="uk-margin-small-top uk-flex uk-flex-right">
@@ -120,4 +120,4 @@
120
120
  <SubmitErrors />
121
121
  {{/let}}
122
122
  </div>
123
- </div>
123
+ </div>
@@ -52,4 +52,4 @@
52
52
  </div>
53
53
  {{/if}}
54
54
  </div>
55
- {{/unless}}
55
+ {{/unless}}
@@ -161,4 +161,4 @@
161
161
  {{/if}}
162
162
  </div>
163
163
  {{/if}}
164
- </div>
164
+ </div>
@@ -1,4 +1,6 @@
1
- <div class="uk-flex uk-flex-between uk-flex-top uk-margin-top uk-child-width-1-2">
1
+ <div
2
+ class="uk-flex uk-flex-between uk-flex-top uk-margin-top uk-child-width-1-2"
3
+ >
2
4
  <ModelForm::Header::Title
3
5
  @model={{@model}}
4
6
  @modelId={{@modelId}}
@@ -59,4 +61,4 @@
59
61
  {{/if}}
60
62
  {{/let}}
61
63
  <hr class="uk-margin-small-top" />
62
- {{/if}}
64
+ {{/if}}
@@ -104,7 +104,11 @@
104
104
  {{t "ember-gwr.components.modelForm.cancelImport"}}
105
105
  </LinkTo>
106
106
  {{/if}}
107
- {{#if (or (and f.model.isInvalid f.model.isDirty this.invalidSubmit) @errors)}}
107
+ {{#if
108
+ (or
109
+ (and f.model.isInvalid f.model.isDirty this.invalidSubmit) @errors
110
+ )
111
+ }}
108
112
  <div class="uk-margin-left uk-flex-inline">
109
113
  <SubmitErrors />
110
114
  </div>
@@ -23,4 +23,4 @@
23
23
  </div>
24
24
  </div>
25
25
  </div>
26
- </div>
26
+ </div>
@@ -1,5 +1,6 @@
1
1
  <div class="uk-text-small {{this.statusClass.text}} uk-flex uk-flex-middle">
2
- <FaIcon class="margin-right-xs"
2
+ <FaIcon
3
+ class="margin-right-xs"
3
4
  @icon={{this.statusClass.icon}}
4
5
  @prefix={{this.statusClass.prefix}}
5
6
  @fixedWidth={{true}}
@@ -1,5 +1,7 @@
1
1
  <h3>{{t "ember-gwr.quarterlyClosure.components.projectErrors.title"}}</h3>
2
- <div class="uk-margin-bottom">{{t "ember-gwr.quarterlyClosure.components.projectErrors.infoText"}}</div>
2
+ <div class="uk-margin-bottom">{{t
3
+ "ember-gwr.quarterlyClosure.components.projectErrors.infoText"
4
+ }}</div>
3
5
 
4
6
  <div id="scroll-container uk-overflow-auto">
5
7
  {{#each this.errors.value as |project|}}
@@ -14,9 +14,7 @@
14
14
  </UkFlex>
15
15
  {{/if}}
16
16
 
17
- <div
18
- class={{if this.errors.value.errorList.length "uk-margin-bottom"}}
19
- >
17
+ <div class={{if this.errors.value.errorList.length "uk-margin-bottom"}}>
20
18
  {{t "ember-gwr.quarterlyClosure.components.departmentErrors.infoText"}}
21
19
  </div>
22
20
 
@@ -5,7 +5,8 @@
5
5
  >
6
6
  {{t "ember-gwr.quarterlyClosure.status.label"}}
7
7
  </div>
8
- <FaIcon class={{this.statusClass.text}}
8
+ <FaIcon
9
+ class={{this.statusClass.text}}
9
10
  @icon={{this.statusClass.icon}}
10
11
  @prefix={{this.statusClass.prefix}}
11
12
  @size="sm"
@@ -14,5 +14,5 @@
14
14
  />
15
15
  {{t "ember-gwr.quarterlyClosure.needsCorrection"}}
16
16
  </div>
17
- </div>
18
- {{/if}}
17
+ </div>
18
+ {{/if}}
@@ -0,0 +1,38 @@
1
+ <UkModal
2
+ @visible={{@visible}}
3
+ @onHide={{@onHide}}
4
+ @container={{this.config.modalContainer}}
5
+ as |Modal|
6
+ >
7
+ <ValidatedForm
8
+ @model={{changeset @model this.RemoveModalValidations}}
9
+ @on-submit={{@on-submit}}
10
+ @on-invalid-submit={{@on-invalid-submit}}
11
+ ...attributes
12
+ as |Form|
13
+ >
14
+ <Modal.header>
15
+ <h2 class="uk-modal-title">
16
+ {{@title}}
17
+ </h2>
18
+ </Modal.header>
19
+ <Modal.body class="uk-overflow-auto">
20
+ <Form.input
21
+ @type="textarea"
22
+ @label={{@label}}
23
+ @name="removeReason"
24
+ @rows="10"
25
+ @required={{true}}
26
+ @hint={{@hint}}
27
+ @errorComponent={{component "validated-form-error"}}
28
+ />
29
+ </Modal.body>
30
+ <Modal.footer class="uk-text-right">
31
+ <Form.button
32
+ @label={{t "ember-gwr.components.modal.cancel"}}
33
+ class="uk-modal-close"
34
+ />
35
+ <Form.submit @label={{t "ember-gwr.components.modal.save"}} />
36
+ </Modal.footer>
37
+ </ValidatedForm>
38
+ </UkModal>
@@ -0,0 +1,9 @@
1
+ import { service } from "@ember/service";
2
+ import Component from "@glimmer/component";
3
+ import RemoveModalValidations from "ember-ebau-gwr/validations/remove-modal";
4
+
5
+ export default class RemoveModalComponent extends Component {
6
+ RemoveModalValidations = RemoveModalValidations;
7
+
8
+ @service config;
9
+ }
@@ -155,4 +155,4 @@
155
155
  @buttonComponent={{component "model-form/submit" color="primary"}}
156
156
  />
157
157
  </div>
158
- </ValidatedForm>
158
+ </ValidatedForm>
@@ -26,4 +26,4 @@
26
26
  @loading={{this.search.isRunning}}
27
27
  />
28
28
  {{/if}}
29
- {{/let}}
29
+ {{/let}}
@@ -6,4 +6,4 @@
6
6
  >{{link.text}}</Tab.item>
7
7
  {{/each}}
8
8
  </UkTab>
9
- {{/if}}
9
+ {{/if}}
@@ -1,4 +1,4 @@
1
1
  <span
2
2
  class="uk-text-danger uk-text-small"
3
3
  ...attributes
4
- >{{yield}}{{this.errorString}}</span>
4
+ >{{yield}}{{this.errorString}}</span>
@@ -1,6 +1,7 @@
1
1
  import Controller from "@ember/controller";
2
2
  import { action } from "@ember/object";
3
3
  import { inject as service } from "@ember/service";
4
+ import { tracked } from "@glimmer/tracking";
4
5
  import { task } from "ember-concurrency";
5
6
 
6
7
  export default class BuildingEditDwellingsController extends Controller {
@@ -9,6 +10,8 @@ export default class BuildingEditDwellingsController extends Controller {
9
10
  @service intl;
10
11
  @service notification;
11
12
 
13
+ @tracked dwellingToRemove;
14
+
12
15
  @task
13
16
  *fetchDwellings() {
14
17
  try {
@@ -28,13 +31,24 @@ export default class BuildingEditDwellingsController extends Controller {
28
31
  }
29
32
 
30
33
  @action
31
- async removeDwelling(dwelling) {
34
+ confirmRemoveDwelling(dwelling) {
35
+ this.dwellingToRemove = dwelling.EWID;
36
+ }
37
+
38
+ @action
39
+ async removeDwelling(formValues) {
32
40
  try {
33
- await this.dwelling.deactivate(this.model, dwelling.EWID);
41
+ await this.dwelling.deactivate(
42
+ this.model,
43
+ this.dwellingToRemove,
44
+ formValues.get("removeReason"),
45
+ );
34
46
  await this.fetchDwellings.perform();
35
47
  this.notification.success(
36
48
  this.intl.t("ember-gwr.building.dwellings.removeLinkSuccess"),
37
49
  );
50
+ // Closes modal on success
51
+ this.dwellingToRemove = null;
38
52
  } catch (error) {
39
53
  console.error(error);
40
54
  this.notification.danger(
@@ -108,12 +108,8 @@ export default class DwellingService extends GwrService {
108
108
  return this.createAndCache(xml);
109
109
  }
110
110
 
111
- async deactivate(EGID, EWID) {
112
- const body = this.xml.buildXMLRequest(
113
- "deactivateDwelling",
114
- null,
115
- "Remove Dwelling",
116
- );
111
+ async deactivate(EGID, EWID, reason) {
112
+ const body = this.xml.buildXMLRequest("deactivateDwelling", null, reason);
117
113
  const response = await this.authFetch.fetch(
118
114
  `/buildings/${EGID}/dwellings/${EWID}`,
119
115
  {
@@ -54,8 +54,14 @@
54
54
  {{/if}}
55
55
 
56
56
  <Field @attr="multipleFloor" @type="checkbox" @required={{true}} />
57
- <Field @attr="physicalDwellingNo" />
58
- <Field @attr="administrativeDwellingNo" />
57
+ <Field
58
+ @attr="physicalDwellingNo"
59
+ @hint={{t "ember-gwr.dwelling.physicalDwellingNo.hint"}}
60
+ />
61
+ <Field
62
+ @attr="administrativeDwellingNo"
63
+ @hint={{t "ember-gwr.dwelling.administrativeDwellingNo.hint"}}
64
+ />
59
65
  <Field @attr="noOfHabitableRooms" @type="number" @min="1" />
60
66
  <Field @attr="locationOfDwellingOnFloor" />
61
67
  <Field
@@ -99,7 +105,9 @@
99
105
  />
100
106
  <div uk-alert>
101
107
  <div class="uk-text-bold">
102
- {{t "ember-gwr.dwelling.dwellingUsage.mainAndSecondaryResidenceInfoHeading"}}
108
+ {{t
109
+ "ember-gwr.dwelling.dwellingUsage.mainAndSecondaryResidenceInfoHeading"
110
+ }}
103
111
  </div>
104
112
  <div>
105
113
  {{t "ember-gwr.dwelling.dwellingUsage.mainAndSecondaryResidenceInfo"}}
@@ -121,4 +129,4 @@
121
129
 
122
130
  </ModelForm>
123
131
  {{/if}}
124
- </div>
132
+ </div>