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
@@ -9,6 +9,8 @@ jobs:
9
9
  steps:
10
10
  - uses: actions/checkout@v1
11
11
  - uses: actions/setup-node@v1
12
+ with:
13
+ node-version: 14
12
14
 
13
15
  - name: Install dependencies
14
16
  run: yarn install
package/CHANGELOG.md CHANGED
@@ -1,3 +1,98 @@
1
+ # [3.2.0](https://github.com/adfinis-sygroup/ember-ebau-gwr/compare/v3.1.1...v3.2.0) (2021-10-18)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **building:** add realestate id validation and surface / volume units ([6e8525f](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/6e8525fe696fb34e718d0c78cdc284c99782101d))
7
+ * **dates:** do not show construction / demolition dates on new models ([d7cc4ac](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/d7cc4ac2f071bcdf46a0184364c439cd37d0ed82))
8
+ * **dwelling:** do not show floor number field for ground floor ([dd96b5e](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/dd96b5e3ed419b2a0181944a93105ba9d19e2f3d))
9
+ * **dwelling:** refetch dwellings after dwelling update ([bf02e33](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/bf02e33dab1d242eb22810c8e87ee27377c21140))
10
+ * **entrance:** fix tooltip container on building entrance number ([d5eb009](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/d5eb0091dd554ba69a44cb1c621200bdfec7a26d))
11
+ * **header:** add scroll into view for status change ([7a3ee64](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/7a3ee645bd042689829f1050b65c7a33403e2203))
12
+ * **import:** show conditional fields during import ([0952c69](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/0952c69567b453cd05ca0145733e6410c90204a9))
13
+ * **import:** show import date fields and cast imported dates ([00fe1fa](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/00fe1fa9a468281d070ef500292e4e1953477ede))
14
+ * **project:** add hints for typeOfConstructionProject ([881a945](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/881a945fd6f69bcc5760c2ce5488c83d204ee41c))
15
+ * **project:** filter project list by local_id ([26c55e1](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/26c55e1807a417203ff9b0b4b2b942ad6464b11a))
16
+ * **translations:** fix some typos ([4227439](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/4227439a31190f4cbeb982041530a816925401cf))
17
+
18
+
19
+ ### Features
20
+
21
+ * **linked-models:** clarification info for object additions ([12d7886](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/12d7886d258b964a12860cfa7e2430412c9a149a))
22
+ * **project:** complete client country options ([bd36e3f](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/bd36e3ffe74094021a69ca60c8ff7d824ab55f3b))
23
+ * **search:** add back routes for building and project search ([a22c9d2](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/a22c9d2c42a624123814fbc59e449bec94032561))
24
+
25
+ ## [3.1.1](https://github.com/adfinis-sygroup/ember-ebau-gwr/compare/v3.1.0...v3.1.1) (2021-10-01)
26
+
27
+
28
+ ### Bug Fixes
29
+
30
+ * **components/link-street:** use decorator function from ember-concurrency-decorators ([8dbf001](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/8dbf00101a449dec217e97704e415c5a21b75b94))
31
+
32
+ # [3.1.0](https://github.com/adfinis-sygroup/ember-ebau-gwr/compare/v3.0.0...v3.1.0) (2021-10-01)
33
+
34
+
35
+ ### Bug Fixes
36
+
37
+ * **client:** correct fields on client model ([8339e91](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/8339e91bf744658cf50fac1a1339102ad42fdd35))
38
+ * **client:** ensure client identification type is set correctly ([7d11198](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/7d11198026fe612d92afcfc4cd03f9a015bf0d71))
39
+ * **entrance:** ensure entrance & street are within same locality ([d88b91d](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/d88b91d5d5a8138535e2a50d6eed4f4c9ee1d079))
40
+ * **life-cycles:** correct life cycle error links for camac-ng ([0c3f1c6](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/0c3f1c6dc14cca1fbbb75dd52880e5b786d22611))
41
+ * **model-form:** bump ember-validated-form to v4.1.0 to fix on-update issue ([2752b23](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/2752b23260d4903c44dc989650e92fb6ad93baa2))
42
+ * **model-form:** fix merge conflict issue ([aaeb372](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/aaeb372ae6965db89209326d4cb5382df3d28070))
43
+ * **model-form:** read dates as date objects instead of strings ([34a525e](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/34a525e9145e2f0270751ba4a295b9c1ca7990cb))
44
+ * **project:** differentiate swiss and foreign client addresses ([6a69d14](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/6a69d14492481ace39455b1c6870a91573640974))
45
+ * **realestate-identification:** remove unused (ignored) fields ([bf94133](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/bf94133029dbf7e08a9c7dc93af87be8920d4397))
46
+ * **translation:** change field label of energy source field ([93740aa](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/93740aa6ff5648cff5e2b2459c9a839b9f546676))
47
+ * **ui:** minor bugfixes and changes ([4bdfe3c](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/4bdfe3cc8525283ae819bfe45d897a8629210cae))
48
+
49
+
50
+ ### Features
51
+
52
+ * **dwelling:** show complete entrance address in dwelling form ([f842502](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/f84250296527a4511e421f5b38f80470dd679882))
53
+ * **header:** add info for deleting fields ([1a53df2](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/1a53df25cd11f86ac4cc8de909d53c00c50da00f))
54
+ * **model-form:** complete validations on models ([6c443af](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/6c443af41714276468cba0bd4c358b031d6c5f0c))
55
+ * **project:** alert user about missing buildings on superstructure projects ([caea071](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/caea07138041cc06fc0871faeba8f05b8aec88bc))
56
+
57
+ # [3.0.0](https://github.com/adfinis-sygroup/ember-ebau-gwr/compare/v2.7.1...v3.0.0) (2021-09-28)
58
+
59
+
60
+ ### Bug Fixes
61
+
62
+ * **building:** add default building entrance and street validation ([74b1a5b](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/74b1a5b13e713e63785a7eb27a2ccba7d22095d9))
63
+ * **building:** make default building entrance editable ([1ca2c4e](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/1ca2c4e1550da378ac6768c60ebca94f119ed711))
64
+ * **controllers/import:** reset query params while fetching caluma data ([d56ac06](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/d56ac06657cd8db3637e6db7c60f29850a787d61))
65
+ * **data-import:** pass instanceId to import functions ([eacdc4f](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/eacdc4fbfd9aabd61a744cb7daf9723cb9ff76ed))
66
+ * **import:** ignore null values in import data ([ab7df83](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/ab7df83431bab62c0c2edf8b3d5850ce2ff18956))
67
+ * **model-form:** ensure date values are reset on model update ([b73d6a5](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/b73d6a5dafd6984ebba548abc7e68c67734d74a1))
68
+ * **project:** correct confirmation dialog modal container ([1bd5be9](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/1bd5be949225d6d07dfa0670cac3238f5e901a61))
69
+ * **project:** fix client identification template ([9c50743](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/9c50743c069d2a6b21cf0a1ba3f8a9dc2f9e317f))
70
+ * **project:** replace non-realisation date with cancellation date ([bca5f83](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/bca5f83ca15f5a5311a86471a9ce9144a31e3bf0))
71
+ * **project/new:** extend new route from form route ([e2837d3](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/e2837d3825369033bf14b8e876b9bacddf7b7449))
72
+ * **translations:** use a conciser word for cancel to reject a import value ([1ea1a8e](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/1ea1a8eb8dcd64e0ffa295784c992d63d2365a1d))
73
+ * **ui:** render tooltips in correct application container ([65f5265](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/65f5265ce8b010fb13933bc808b8cb510272feb0))
74
+
75
+
76
+ ### Code Refactoring
77
+
78
+ * **modal-container:** make the modal container configurable via config-service ([328fdd8](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/328fdd8e4753cfe41d2d2b5e5c0d49bb931b18de))
79
+
80
+
81
+ ### Features
82
+
83
+ * **building:** enable building entrance deactivation ([6840c4a](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/6840c4a1ab8a913259c8dca976d620340d372047))
84
+ * add import for buildings, entrances & dwellings ([9c80eca](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/9c80eca2d75e154232a4c74b8fb6616bb77c4fff))
85
+ * **import:** implement import-modal for dwelling, entrances and buildings ([10db43c](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/10db43ce61e195191f5b02b43c811facaf476826))
86
+
87
+
88
+ ### BREAKING CHANGES
89
+
90
+ * **modal-container:** To keep the previous behavior of modals, `modalContainer` now needs to be set to a
91
+ valid dom-selector in the gwr config service.
92
+
93
+ Example:
94
+ `modalContainer = "#my-modal-div"`
95
+
1
96
  ## [2.7.1](https://github.com/adfinis-sygroup/ember-ebau-gwr/compare/v2.7.0...v2.7.1) (2021-09-13)
2
97
 
3
98
 
@@ -0,0 +1,10 @@
1
+ {{#if @backRoute}}
2
+ <LinkTo
3
+ @route={{@backRoute}}
4
+ @models={{if @backModel (array @backModel) (array)}}
5
+ class="uk-link-muted uk-margin-small-bottom"
6
+ >
7
+ <span uk-icon="icon: arrow-left"></span>
8
+ {{@backText}}
9
+ </LinkTo>
10
+ {{/if}}
@@ -0,0 +1,64 @@
1
+ <span class="uk-flex uk-child-width-1-2">
2
+ <span>{{t "ember-gwr.buildingWork.kindOfWork"}}</span>
3
+ <span class="uk-text-muted">{{if
4
+ @model.kindOfWork
5
+ (t (concat "ember-gwr.buildingWork.kindOfWorkOptions." @model.kindOfWork))
6
+ "-"
7
+ }}</span>
8
+ </span>
9
+ <hr />
10
+ <span class="uk-flex uk-child-width-1-2">
11
+ <span>{{t "ember-gwr.building.buildingStatus"}}</span>
12
+ <span class="uk-text-muted">{{if
13
+ @model.building.buildingStatus
14
+ (t
15
+ (concat
16
+ "ember-gwr.building.buildingStatusOptions."
17
+ @model.building.buildingStatus
18
+ )
19
+ )
20
+ "-"
21
+ }}</span>
22
+ </span>
23
+ <hr />
24
+ <span class="uk-flex uk-child-width-1-2">
25
+ <span>{{t "ember-gwr.building.nameOfBuilding"}}</span>
26
+ <span class="uk-text-muted">{{or @model.building.nameOfBuilding "-"}}</span>
27
+ </span>
28
+ <hr />
29
+ <span class="uk-flex uk-child-width-1-2">
30
+ <span>{{t "ember-gwr.building.buildingCategory"}}</span>
31
+ <span class="uk-text-muted">
32
+ {{if
33
+ @model.building.buildingCategory
34
+ (t
35
+ (concat
36
+ "ember-gwr.building.buildingCategoryOptions."
37
+ @model.building.buildingCategory
38
+ )
39
+ )
40
+ "-"
41
+ }}
42
+ </span>
43
+ </span>
44
+ <hr />
45
+ <span class="uk-flex uk-child-width-1-2">
46
+ <span>{{t "ember-gwr.building.buildingClass"}}</span>
47
+ <span class="uk-text-muted">
48
+ {{if
49
+ @model.building.buildingClass
50
+ (t
51
+ (concat
52
+ "ember-gwr.building.buildingClassOptions."
53
+ @model.building.buildingClass
54
+ )
55
+ )
56
+ "-"
57
+ }}
58
+ </span>
59
+ </span>
60
+ <hr />
61
+ <span class="uk-flex uk-child-width-1-2">
62
+ <span>{{t "ember-gwr.building.numberOfFloors"}}</span>
63
+ <span class="uk-text-muted">{{or @model.building.numberOfFloors "-"}}</span>
64
+ </span>
@@ -0,0 +1,30 @@
1
+ <span class="uk-flex uk-child-width-1-2">
2
+ <span>{{t "ember-gwr.dwelling.floor"}}</span>
3
+ <span class="uk-text-muted">{{or @model.floor "-"}}</span>
4
+ </span>
5
+ <hr />
6
+ <span class="uk-flex uk-child-width-1-2">
7
+ <span>{{t "ember-gwr.dwelling.noOfHabitableRooms"}}</span>
8
+ <span class="uk-text-muted">{{or @model.noOfHabitableRooms "-"}}</span>
9
+ </span>
10
+ <hr />
11
+ <span class="uk-flex uk-child-width-1-2">
12
+ <span>{{t "ember-gwr.dwelling.dwellingUsage.usageCode"}}</span>
13
+ <span class="uk-text-muted">{{if
14
+ @model.dwellingUsage.usageCode
15
+ (t
16
+ (concat
17
+ "ember-gwr.dwelling.dwellingUsage.usageCodeOptions."
18
+ @model.dwellingUsage.usageCode
19
+ )
20
+ )
21
+ "-"
22
+ }}</span>
23
+ </span>
24
+ <hr />
25
+ <span class="uk-flex uk-child-width-1-2">
26
+ <span>{{t "ember-gwr.dwelling.locationOfDwellingOnFloor"}}</span>
27
+ <span class="uk-text-muted">
28
+ {{or @model.locationOfDwellingOnFloor "-"}}
29
+ </span>
30
+ </span>
@@ -0,0 +1,14 @@
1
+ <span class="uk-flex uk-child-width-1-2">
2
+ <span>{{t "ember-gwr.buildingEntrance.fields.buildingEntranceNo"}}</span>
3
+ <span class="uk-text-muted">{{or @model.buildingEntranceNo "-"}}</span>
4
+ </span>
5
+ <hr />
6
+ <span class="uk-flex uk-child-width-1-2">
7
+ <span>{{t "ember-gwr.buildingEntrance.fields.locality.name.nameLong"}}</span>
8
+ <span class="uk-text-muted">{{or @model.locality.name.nameLong "-"}}</span>
9
+ </span>
10
+ <hr />
11
+ <span class="uk-flex uk-child-width-1-2">
12
+ <span>{{t "ember-gwr.buildingEntrance.fields.locality.swissZipCode"}}</span>
13
+ <span class="uk-text-muted">{{or @model.locality.swissZipCode "-"}}</span>
14
+ </span>
@@ -0,0 +1,54 @@
1
+ <UkModal
2
+ @visible={{@visible}}
3
+ @btnClose={{false}}
4
+ @escClose={{false}}
5
+ @bgClose={{false}}
6
+ @on-hide={{@close}}
7
+ @container={{this.config.modalContainer}}
8
+ as |Modal|
9
+ >
10
+ <Modal.header>
11
+ <h2 class="uk-modal-title">
12
+ {{t "ember-gwr.components.importModal.selectImportData"}}
13
+ </h2>
14
+ </Modal.header>
15
+ <Modal.body class="uk-overflow-auto">
16
+ <ul
17
+ uk-accordion="collapsible: false;multiple: false; active: 0;"
18
+ class="ember-ebau-gwr-import-building-list"
19
+ >
20
+ {{#each @import.originalData as |model index|}}
21
+ <li>
22
+ <a class="uk-accordion-title" href="#">{{t
23
+ (concat "ember-gwr.models." @modelName)
24
+ count=1
25
+ }}
26
+ {{inc index}}</a>
27
+ <div class="uk-accordion-content">
28
+ {{component
29
+ (concat "import-modal/" @modelName "-data")
30
+ model=model
31
+ }}
32
+
33
+ <LinkTo
34
+ @query={{hash import=true index=index}}
35
+ class="uk-button uk-button-primary uk-margin-medium-top uk-width-1"
36
+ {{on "click" @close}}
37
+ >
38
+ {{t "ember-gwr.components.modelForm.importFromCaluma"}}
39
+ </LinkTo>
40
+ </div>
41
+ </li>
42
+ {{/each}}
43
+ </ul>
44
+ </Modal.body>
45
+ <Modal.footer>
46
+ <LinkTo
47
+ @query={{hash import=false index=undefined}}
48
+ class="uk-button uk-button-default uk-width-1"
49
+ {{on "click" @close}}
50
+ >
51
+ {{t "ember-gwr.components.modelForm.cancelImport"}}
52
+ </LinkTo>
53
+ </Modal.footer>
54
+ </UkModal>
@@ -0,0 +1,6 @@
1
+ import { inject as service } from "@ember/service";
2
+ import Component from "@glimmer/component";
3
+
4
+ export default class ImportModalComponent extends Component {
5
+ @service config;
6
+ }
@@ -1,7 +1,7 @@
1
1
  <UkModal
2
2
  @visible={{@visible}}
3
3
  @on-hide={{@close}}
4
- @container="#ember-camac-ng"
4
+ @container={{this.config.modalContainer}}
5
5
  as |Modal|
6
6
  >
7
7
  <Modal.header>
@@ -1,8 +1,10 @@
1
+ import { inject as service } from "@ember/service";
1
2
  import Component from "@glimmer/component";
2
3
  import { tracked } from "@glimmer/tracking";
3
4
  import BuildingWork from "ember-ebau-gwr/models/building-work";
4
5
 
5
6
  export default class LinkBuildingModalComponent extends Component {
7
+ @service config;
6
8
  @tracked buildingWork = new BuildingWork();
7
9
  // Remove the state "Neubau" from the array since you cant link
8
10
  // existing buildings as "Neubau".
@@ -0,0 +1,105 @@
1
+ {{#if this.fetchStreet.isRunning}}
2
+ <div class="uk-flex uk-flex-center uk-flex-middle uk-margin-large-top">
3
+ <UkSpinner @ratio="3" />
4
+ </div>
5
+ {{else}}
6
+ {{#let @fieldComponent as |Field|}}
7
+ {{#unless @buildingEntrance.street.isNew}}
8
+ <span>
9
+ {{! this is needed since the h2 selector is * + h2}}
10
+ <span></span>
11
+ <h3>
12
+ {{t "ember-gwr.buildingEntrance.street"}}
13
+ </h3>
14
+ </span>
15
+ <Field
16
+ @attr="street.ESID"
17
+ @disabled={{true}}
18
+ @translationBase={{@translationBase}}
19
+ @value={{@buildingEntrance.street.ESID}}
20
+ readonly
21
+ />
22
+ <Field
23
+ @attr="street.description.descriptionLong"
24
+ @disabled={{true}}
25
+ @translationBase={{@translationBase}}
26
+ @value={{@buildingEntrance.street.description.descriptionLong}}
27
+ readonly
28
+ />
29
+ <Field
30
+ @attr="locality.name.nameLong"
31
+ @disabled={{true}}
32
+ @value={{this.street.locality.name.nameLong}}
33
+ />
34
+ <Field
35
+ @attr="locality.swissZipCode"
36
+ @type="number"
37
+ @disabled={{true}}
38
+ @value={{this.street.locality.swissZipCode}}
39
+ />
40
+ <Field
41
+ @attr="locality.swissZipCodeAddOn"
42
+ @type="number"
43
+ @disabled={{true}}
44
+ @value={{this.street.locality.swissZipCodeAddOn}}
45
+ />
46
+
47
+ <Field
48
+ @attr="street.streetKind"
49
+ @type="select"
50
+ @gwrEnumOptions={{this.Street.streetKindOptions}}
51
+ @convertValueTo="number"
52
+ @disabled={{true}}
53
+ @translationBase={{@translationBase}}
54
+ @value={{@buildingEntrance.street.streetKind}}
55
+ readonly
56
+ />
57
+ <Field
58
+ @attr="street.officialStreetNumber"
59
+ @type="number"
60
+ @disabled={{true}}
61
+ @translationBase={{@translationBase}}
62
+ @value={{@buildingEntrance.street.officialStreetNumber}}
63
+ readonly
64
+ />
65
+ <Field
66
+ @attr="street.isOfficialDescription"
67
+ @type="checkbox"
68
+ @disabled={{true}}
69
+ @translationBase={{@translationBase}}
70
+ @value={{@buildingEntrance.street.isOfficialDescription}}
71
+ readonly
72
+ />
73
+ {{/unless}}
74
+ <div class="uk-flex-inline">
75
+ <LinkTo
76
+ class="uk-button
77
+ {{if @buildingEntrance.street.isNew "uk-button-primary" "uk-button-default"
78
+ }}"
79
+ @route="building.edit.entrance.edit.link-street"
80
+ @models={{or
81
+ @routeModels
82
+ (if @buildingEntrance.isNew (array "new") (array))
83
+ }}
84
+ @query={{hash
85
+ locality=@buildingEntrance.locality.name.nameLong
86
+ PLZ4=@buildingEntrance.locality.swissZipCode
87
+ PLZ6=@buildingEntrance.locality.swissZipCodeAddOn
88
+ }}
89
+ @disabled={{not @buildingEntrance.locality.name.nameLong}}
90
+ uk-tooltip="title: {{unless
91
+ @buildingEntrance.locality.name.nameLong
92
+ (t "ember-gwr.components.linkStreet.missingLocalityHint")
93
+ }}; container: {{this.config.modalContainer}}"
94
+ >
95
+ {{t
96
+ (if
97
+ @buildingEntrance.street.isNew
98
+ "ember-gwr.components.linkStreet.link"
99
+ "ember-gwr.components.linkStreet.change"
100
+ )
101
+ }}
102
+ </LinkTo>
103
+ </div>
104
+ {{/let}}
105
+ {{/if}}
@@ -0,0 +1,24 @@
1
+ import { inject as service } from "@ember/service";
2
+ import Component from "@glimmer/component";
3
+ import { task, lastValue } from "ember-concurrency-decorators";
4
+ import Street from "ember-ebau-gwr/models/street";
5
+
6
+ export default class LinkStreetComponent extends Component {
7
+ Street = Street;
8
+
9
+ @service config;
10
+ @service("street") streetAPI;
11
+
12
+ constructor(...args) {
13
+ super(...args);
14
+ this.fetchStreet.perform();
15
+ }
16
+
17
+ @lastValue("fetchStreet") street;
18
+ @task
19
+ *fetchStreet() {
20
+ if (!this.args.buildingEntrance.isNew) {
21
+ return yield this.streetAPI.get(this.args.buildingEntrance.street.ESID);
22
+ }
23
+ }
24
+ }
@@ -27,7 +27,7 @@
27
27
  type="button"
28
28
  class="uk-icon-button"
29
29
  uk-icon="trash"
30
- uk-tooltip={{t "ember-gwr.components.linkedModels.removeLink"}}
30
+ uk-tooltip="title: {{t "ember-gwr.components.linkedModels.removeLink"}}; container: {{this.config.modalContainer}}"
31
31
  {{on "click" (fn @removeLink model)}}
32
32
  ></button>
33
33
  </td>
@@ -51,11 +51,15 @@
51
51
  <LinkTo
52
52
  @route={{@searchRoute}}
53
53
  @models={{or @searchModels (array)}}
54
- >
55
- {{t
56
- "ember-gwr.components.linkedModels.linkEntry"
57
- modelName=modelName
58
- }}
54
+ >
55
+ {{#if (eq @modelName "building")}}
56
+ {{t "ember-gwr.components.linkedModels.linkExistingBuilding"}}
57
+ {{else}}
58
+ {{t
59
+ "ember-gwr.components.linkedModels.linkEntry"
60
+ modelName=modelName
61
+ }}
62
+ {{/if}}
59
63
  </LinkTo>
60
64
  {{/if}}
61
65
  {{#if (and @searchRoute @newRoute)}}
@@ -66,6 +70,7 @@
66
70
  {{t
67
71
  "ember-gwr.components.linkedModels.createEntry"
68
72
  modelName=modelName
73
+ model=@modelName
69
74
  }}
70
75
  </LinkTo>
71
76
  {{else if @addLink}}
@@ -77,6 +82,7 @@
77
82
  {{t
78
83
  "ember-gwr.components.linkedModels.createEntry"
79
84
  modelName=modelName
85
+ model=@modelName
80
86
  }}
81
87
  </button>
82
88
  {{/if}}
@@ -0,0 +1,6 @@
1
+ import { inject as service } from "@ember/service";
2
+ import Component from "@glimmer/component";
3
+
4
+ export default class LinkedModelsComponent extends Component {
5
+ @service config;
6
+ }
@@ -25,7 +25,7 @@
25
25
  type="button"
26
26
  class="uk-icon-button"
27
27
  uk-icon="trash"
28
- uk-tooltip={{t "ember-gwr.components.linkedModels.removeLink"}}
28
+ uk-tooltip="title: {{t "ember-gwr.components.linkedModels.removeLink"}}; container: {{this.config.modalContainer}}"
29
29
  {{on "click" @removeProject}}
30
30
  >
31
31
  </button>
@@ -0,0 +1,6 @@
1
+ import { inject as service } from "@ember/service";
2
+ import Component from "@glimmer/component";
3
+
4
+ export default class LinkedProjectsComponent extends Component {
5
+ @service config;
6
+ }
@@ -3,6 +3,8 @@
3
3
  class="uk-label uk-label-danger uk-margin-small-left uk-flex-inline
4
4
  uk-flex-middle uk-flex-center uk-flex-none uk-text-small uk-text-bold"
5
5
  >
6
- {{@errorCount}}
6
+ <small>
7
+ {{@errorCount}}
8
+ </small>
7
9
  </div>
8
10
  {{/if}}
@@ -1,6 +1,8 @@
1
1
  {{#unless @noHeader}}
2
2
  <div class="uk-flex-inline uk-flex-top uk-width-expand">
3
- <div class="uk-flex-none">
3
+ <div
4
+ class="uk-flex-none ember-ebau-gwr-model-id-width-{{if @smallHeaderIdWidth "small" "large"}}"
5
+ >
4
6
  <LinkTo
5
7
  class="uk-text-bold"
6
8
  @route={{@linkRoute}}
@@ -9,7 +11,7 @@
9
11
  {{@modelId}}
10
12
  </LinkTo>
11
13
  </div>
12
- <div class="uk-margin-left uk-flex uk-width-expand uk-flex-column">
14
+ <div class="uk-margin-small-left uk-flex uk-width-expand uk-flex-column">
13
15
  <div class="uk-flex-inline uk-flex-middle">
14
16
  <div class="uk-text-bold">
15
17
  {{@modelDescription}}
@@ -7,6 +7,7 @@
7
7
  @linkRoute={{@linkRoute}}
8
8
  @linkModels={{@linkModels}}
9
9
  @modelDescription={{@modelDescription}}
10
+ @smallHeaderIdWidth={{@smallHeaderIdWidth}}
10
11
  >
11
12
  {{#if (has-block)}}
12
13
  {{yield
@@ -8,6 +8,7 @@
8
8
  @onSelection={{@update}}
9
9
  @value={{this.value}}
10
10
  @disabled={{@disabled}}
11
+ @yearRange={{"2000,currentYear"}}
11
12
  class="uk-width-1 uk-input
12
13
  {{if @isInvalid "uk-form-danger"}}
13
14
  {{if @isValid "uk-form-success"}}"
@@ -1,13 +1,13 @@
1
1
  import Component from "@glimmer/component";
2
- import { tracked } from "@glimmer/tracking";
3
2
 
4
3
  // TODO: remove file once two-way binding issue of value is resolved in ember-pikaday
5
4
  // https://github.com/adopted-ember-addons/ember-pikaday/issues/212
6
5
  export default class ModelFormDateComponent extends Component {
7
- @tracked value;
8
-
9
- constructor(...args) {
10
- super(...args);
11
- this.value = this.args.value;
6
+ get value() {
7
+ return this.args.value;
12
8
  }
9
+
10
+ // prevent pikaday two-way binding from
11
+ // updating "value" field on input
12
+ set value(value) {}
13
13
  }