ember-ebau-gwr 3.1.1 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/addon/components/back-route.hbs +10 -0
  3. package/addon/components/linked-models.hbs +11 -5
  4. package/addon/components/model-errors/error-indicator.hbs +3 -1
  5. package/addon/components/model-errors/header.hbs +4 -2
  6. package/addon/components/model-errors.hbs +1 -0
  7. package/addon/components/model-form/field.js +5 -2
  8. package/addon/components/model-form/header/actions.hbs +5 -3
  9. package/addon/components/model-form.js +9 -1
  10. package/addon/components/model-inview.hbs +8 -0
  11. package/addon/components/model-inview.js +12 -0
  12. package/addon/components/sub-nav.hbs +5 -10
  13. package/addon/controllers/building/edit/dwelling/edit.js +2 -2
  14. package/addon/controllers/building/edit/form.js +0 -5
  15. package/addon/controllers/project/errors.js +25 -29
  16. package/addon/controllers/project/form.js +25 -5
  17. package/addon/controllers/project.js +1 -1
  18. package/addon/helpers/housing-stat-link.js +13 -0
  19. package/addon/helpers/show-model-field.js +13 -0
  20. package/addon/models/building.js +1 -1
  21. package/addon/models/construction-project.js +1 -1
  22. package/addon/models/options.js +251 -1
  23. package/addon/services/building.js +182 -192
  24. package/addon/services/construction-project.js +134 -145
  25. package/addon/services/gwr.js +4 -0
  26. package/addon/templates/building/edit/dwelling/edit.hbs +25 -22
  27. package/addon/templates/building/edit/entrance/edit/index.hbs +1 -2
  28. package/addon/templates/building/edit/form.hbs +38 -16
  29. package/addon/templates/project/errors.hbs +121 -132
  30. package/addon/templates/project/form.hbs +87 -53
  31. package/addon/templates/project/linked-buildings.hbs +13 -20
  32. package/addon/templates/project.hbs +23 -17
  33. package/addon/templates/search-building.hbs +6 -0
  34. package/addon/templates/search-project.hbs +6 -0
  35. package/addon/utils.js +8 -0
  36. package/addon/validations/building-work.js +2 -0
  37. package/addon/validations/dwelling.js +0 -5
  38. package/app/styles/ember-ebau-gwr.scss +8 -0
  39. package/config/environment.js +3 -0
  40. package/package.json +1 -1
  41. package/translations/building/de.yaml +3 -5
  42. package/translations/construction-project/de.yaml +256 -4
  43. package/translations/de.yaml +21 -3
  44. package/translations/dwelling/de.yaml +3 -1
@@ -24,138 +24,127 @@
24
24
  @linkModels={{array this.project.EPROID}}
25
25
  @modelDescription={{this.project.constructionProjectDescription}}
26
26
  />
27
- {{#let (filter-by "building.isNew" false this.project.work) as |work|}}
28
- {{#if work.length}}
29
- <h3 class="uk-margin-top">
30
- {{t "ember-gwr.nav.linkedBuildings"}}
31
- </h3>
32
- <div
33
- uk-scrollspy="cls: uk-animation-fade; target: .inview-trigger; offset-top: 300"
34
- >
35
- <ul class="uk-list uk-list-divider uk-list-large">
36
- {{#each (map-by "building" work) as |building|}}
37
- <div
38
- class="inview-trigger"
39
- {{on "inview" (perform this.fetchModel building.EGID)}}
27
+ {{#if this.workBuildings.length}}
28
+ <h3 class="uk-margin-top">
29
+ {{t "ember-gwr.nav.linkedBuildings"}}
30
+ </h3>
31
+ <div
32
+ uk-scrollspy="cls: uk-animation-fade; target: .inview-trigger; offset-top: 300"
33
+ >
34
+ <ul class="uk-list uk-list-divider uk-list-large">
35
+ {{#each this.workBuildings as |building|}}
36
+ <ModelInview
37
+ @model={{building.EGID}}
38
+ @fetchModel={{perform this.fetchModel}}
39
+ as |inview|
40
+ >
41
+ {{#let inview.model as |inviewModel|}}
42
+ <ModelErrors
43
+ @model={{building}}
44
+ @modelId={{building.EGID}}
45
+ @errorModel={{inviewModel.buildingWithErrors}}
46
+ @linkRoute="building.edit.form"
47
+ @linkModels={{array this.project.EPROID building.EGID}}
48
+ @modelDescription={{building.fullAddressTexts
49
+ }} as |BuildingErrorList|
40
50
  >
41
- {{#let
42
- (get (get this.buildings building.EGID) "building")
43
- (get (get this.buildings building.EGID) "entrances")
44
- (get
45
- (get this.buildings building.EGID) "dwellings"
46
- ) as |buildingWithErrors entrancesWithErrors dwellingsWithErrors|
47
- }}
48
- <ModelErrors
49
- @model={{building}}
50
- @modelId={{building.EGID}}
51
- @errorModel={{buildingWithErrors}}
52
- @linkRoute="building.edit.form"
53
- @linkModels={{array this.project.EPROID building.EGID}}
54
- @modelDescription={{building.fullAddressTexts
55
- }} as |BuildingErrorList|
51
+ {{#if inviewModel.buildingWithErrors}}
52
+ <UkSwitcher
53
+ class="uk-margin-small-top uk-animation-fade" as |switcher|
56
54
  >
57
- {{#if buildingWithErrors}}
58
- <UkSwitcher
59
- class="uk-margin-small-top uk-animation-fade" as |switcher|
60
- >
61
- <switcher.nav @type="subnav" as |nav|>
62
- <nav.component uk-switcher @divider={{true}} as |tab|>
63
- {{#if buildingWithErrors.errorList.length}}
64
- <tab.item>
65
- {{t "ember-gwr.issues.switcher.issues"}}
66
- </tab.item>
67
- {{/if}}
68
- {{#if entrancesWithErrors.length}}
69
- <tab.item>
70
- <div class="uk-flex-inline uk-flex-middle">
71
- {{t "ember-gwr.issues.switcher.entrances"}}
72
- <ModelErrors::ErrorIndicator
73
- @errorCount={{get
74
- this.entranceErrorCount
75
- building.EGID
76
- }}
77
- />
78
- </div>
79
- </tab.item>
80
- {{/if}}
81
- {{#if dwellingsWithErrors.length}}
82
- <tab.item>
83
- <div class="uk-flex-inline uk-flex-middle">
84
- {{t "ember-gwr.issues.switcher.dwellings"}}
85
- <ModelErrors::ErrorIndicator
86
- @errorCount={{get
87
- this.dwellingErrorCount
88
- building.EGID
89
- }}
90
- />
91
- </div>
92
- </tab.item>
93
- {{/if}}
94
- </nav.component>
95
- </switcher.nav>
96
- <switcher.content as |content|>
97
- {{#if buildingWithErrors.errorList.length}}
98
- <content.item>
99
- <li>
100
- <BuildingErrorList />
101
- </li>
102
- </content.item>
103
- {{/if}}
104
- {{#if entrancesWithErrors.length}}
105
- <content.item>
106
- <ul class="uk-list uk-list-divider uk-list-large">
107
- {{#each entrancesWithErrors as |entrance|}}
108
- <ModelErrors
109
- @model={{entrance}}
110
- @modelId={{entrance.EDID}}
111
- @errorModel={{entrance}}
112
- @linkRoute="building.edit.entrance.edit"
113
- @linkModels={{array
114
- this.project.EPROID
115
- building.EGID
116
- entrance.EDID
117
- }}
118
- @modelDescription={{entrance.fullAddressText}}
119
- />
120
- {{/each}}
121
- </ul>
122
- </content.item>
123
- {{/if}}
124
- {{#if dwellingsWithErrors.length}}
125
- <content.item>
126
- <ul class="uk-list uk-list-divider uk-list-large">
127
- {{#each dwellingsWithErrors as |dwelling|}}
128
- <ModelErrors
129
- @model={{dwelling.dwelling}}
130
- @modelId={{dwelling.dwelling.EWID}}
131
- @errorModel={{dwelling.dwelling}}
132
- @linkRoute="building.edit.dwelling.edit"
133
- @linkModels={{array
134
- this.project.EPROID
135
- building.EGID
136
- dwelling.dwelling.EWID
137
- }}
138
- @modelDescription={{concat
139
- (t "ember-gwr.models.entrance" count=1)
140
- " "
141
- dwelling.EDID
142
- }}
143
- />
144
- {{/each}}
145
- </ul>
146
- </content.item>
147
- {{/if}}
148
- </switcher.content>
149
- </UkSwitcher>
150
- {{else}}
151
- <ModelErrors::Skeleton />
152
- {{/if}}
153
- </ModelErrors>
154
- {{/let}}
155
- </div>
156
- {{/each}}
157
- </ul>
158
- </div>
159
- {{/if}}
160
- {{/let}}
55
+ <switcher.nav @type="subnav" as |nav|>
56
+ <nav.component uk-switcher @divider={{true}} as |tab|>
57
+ {{#if inviewModel.buildingWithErrors.errorList.length}}
58
+ <tab.item>
59
+ {{t "ember-gwr.issues.switcher.issues"}}
60
+ </tab.item>
61
+ {{/if}}
62
+ {{#if inviewModel.entrancesWithErrors.length}}
63
+ <tab.item>
64
+ <div class="uk-flex-inline uk-flex-middle">
65
+ {{t "ember-gwr.issues.switcher.entrances"}}
66
+ <ModelErrors::ErrorIndicator
67
+ @errorCount={{inviewModel.entranceErrorCount}}
68
+ />
69
+ </div>
70
+ </tab.item>
71
+ {{/if}}
72
+ {{#if inviewModel.dwellingsWithErrors.length}}
73
+ <tab.item>
74
+ <div class="uk-flex-inline uk-flex-middle">
75
+ {{t "ember-gwr.issues.switcher.dwellings"}}
76
+ <ModelErrors::ErrorIndicator
77
+ @errorCount={{inviewModel.dwellingErrorCount}}
78
+ />
79
+ </div>
80
+ </tab.item>
81
+ {{/if}}
82
+ </nav.component>
83
+ </switcher.nav>
84
+ <switcher.content as |content|>
85
+ {{#if inviewModel.buildingWithErrors.errorList.length}}
86
+ <content.item>
87
+ <li>
88
+ <BuildingErrorList />
89
+ </li>
90
+ </content.item>
91
+ {{/if}}
92
+ {{#if inviewModel.entrancesWithErrors.length}}
93
+ <content.item>
94
+ <ul class="uk-list uk-list-divider uk-list-large">
95
+ {{#each inviewModel.entrancesWithErrors as |entrance|}}
96
+ <ModelErrors
97
+ @model={{entrance}}
98
+ @modelId={{entrance.EDID}}
99
+ @errorModel={{entrance}}
100
+ @linkRoute="building.edit.entrance.edit"
101
+ @linkModels={{array
102
+ this.project.EPROID
103
+ building.EGID
104
+ entrance.EDID
105
+ }}
106
+ @modelDescription={{entrance.fullAddressText}}
107
+ @smallHeaderIdWidth={{true}}
108
+ />
109
+ {{/each}}
110
+ </ul>
111
+ </content.item>
112
+ {{/if}}
113
+ {{#if inviewModel.dwellingsWithErrors.length}}
114
+ <content.item>
115
+ <ul class="uk-list uk-list-divider uk-list-large">
116
+ {{#each inviewModel.dwellingsWithErrors as |dwelling|}}
117
+ <ModelErrors
118
+ @model={{dwelling.dwelling}}
119
+ @modelId={{dwelling.dwelling.EWID}}
120
+ @errorModel={{dwelling.dwelling}}
121
+ @linkRoute="building.edit.dwelling.edit"
122
+ @linkModels={{array
123
+ this.project.EPROID
124
+ building.EGID
125
+ dwelling.dwelling.EWID
126
+ }}
127
+ @modelDescription={{concat
128
+ (t "ember-gwr.models.entrance" count=1)
129
+ " "
130
+ dwelling.EDID
131
+ }}
132
+ @smallHeaderIdWidth={{true}}
133
+ />
134
+ {{/each}}
135
+ </ul>
136
+ </content.item>
137
+ {{/if}}
138
+ </switcher.content>
139
+ </UkSwitcher>
140
+ {{else}}
141
+ <ModelErrors::Skeleton />
142
+ {{/if}}
143
+ </ModelErrors>
144
+ {{/let}}
145
+ </ModelInview>
146
+ {{/each}}
147
+ </ul>
148
+ </div>
149
+ {{/if}}
161
150
  {{/if}}
@@ -22,7 +22,7 @@
22
22
  @onStatusCorrection={{this.correctState}}
23
23
  @getChangeParameters={{this.getChangeParameters}}
24
24
  @getCorrectionParameters={{this.getCorrectionParameters}}
25
- @getChangeHint={{this.getChangeHint}}
25
+ @getChangeHint={{fn this.gwr.getChangeHint this.constructionProject.cacheClass}}
26
26
  @modelStatusField="projectStatus"
27
27
  as |Field changeset|
28
28
  >
@@ -62,13 +62,18 @@
62
62
  @attr="typeOfConstructionProject"
63
63
  @gwrEnumOptions={{this.choiceOptions.typeOfConstructionProjectOptions}}
64
64
  @on-update={{fn (mut this.typeOfConstructionProject)}}
65
- @hint={{t "ember-gwr.linkedBuildings.buildingDisabledForInfrastructure"}}
65
+ @hint={{if
66
+ (eq this.typeOfConstructionProject 6010)
67
+ (t "ember-gwr.linkedBuildings.buildingDisabledForInfrastructure")
68
+ (if (eq this.typeOfConstructionProject 6011)
69
+ (t "ember-gwr.linkedBuildings.superstructureInfo"))
70
+ }}
66
71
  />
67
72
 
68
73
  {{#if (eq this.typeOfConstructionProject 6010)}}
69
74
  <LinkedModels
70
75
  @models={{this.workWithoutBuildings}}
71
- @modelName="building-work"
76
+ @modelName="building-work-infrastructure"
72
77
  @removeLink={{if (gt this.project.work.length 1) this.removeWorkLink}}
73
78
  @addLink={{this.addWorkLink}}
74
79
  as |model|
@@ -168,49 +173,67 @@
168
173
  @required={{true}}
169
174
  />
170
175
  </div>
171
- {{#if this.project.buildingPermitIssueDate}}
172
- <div class={{spacingClass}}>
173
- <Field @inputType="date" @attr="buildingPermitIssueDate" />
174
- </div>
175
- {{/if}}
176
- {{#unless this.project.isNew}}
177
- {{#if this.project.projectStartDate}}
178
- <div class={{spacingClass}}>
179
- <Field @inputType="date" @attr="projectStartDate" />
180
- </div>
181
- {{/if}}
182
- {{#if this.project.projectCompletionDate}}
183
- <div class={{spacingClass}}>
184
- <Field @inputType="date" @attr="projectCompletionDate" />
185
- </div>
186
- {{/if}}
187
- {{#if this.project.projectSuspensionDate}}
188
- <div class={{spacingClass}}>
189
- <Field @inputType="date" @attr="projectSuspensionDate" />
190
- </div>
191
- {{/if}}
192
- {{#if this.project.constructionAuthorisationDeniedDate}}
193
- <div class={{spacingClass}}>
194
- <Field
195
- @inputType="date"
196
- @attr="constructionAuthorisationDeniedDate"
197
- />
198
- </div>
199
- {{/if}}
200
- {{#if this.project.cancellationDate}}
201
- <div class={{spacingClass}}>
202
- <Field @inputType="date" @attr="cancellationDate" />
203
- </div>
204
- {{/if}}
205
- {{#if this.project.withdrawalDate}}
206
- <div class={{spacingClass}}>
207
- <Field @inputType="date" @attr="withdrawalDate" />
208
- </div>
209
- {{/if}}
210
- {{/unless}}
176
+ <div
177
+ class="{{spacingClass}}
178
+ {{if (not (show-model-field
179
+ "buildingPermitIssueDate" changeset this.import
180
+ )) "uk-hidden"}}"
181
+ >
182
+ <Field @inputType="date" @attr="buildingPermitIssueDate" />
183
+ </div>
184
+ <div class="{{spacingClass}}
185
+ {{if (not (show-model-field
186
+ "projectStartDate" changeset this.import
187
+ )) "uk-hidden"}}"
188
+ >
189
+ <Field @inputType="date" @attr="projectStartDate" />
190
+ </div>
191
+ <div class="{{spacingClass}}
192
+ {{if (not (show-model-field
193
+ "projectCompletionDate" changeset this.import
194
+ )) "uk-hidden"}}"
195
+ >
196
+ <Field @inputType="date" @attr="projectCompletionDate" />
197
+ </div>
198
+ <div class="{{spacingClass}}
199
+ {{if (not (show-model-field
200
+ "projectSuspensionDate" changeset this.import
201
+ )) "uk-hidden"}}"
202
+ >
203
+ <Field @inputType="date" @attr="projectSuspensionDate" />
204
+ </div>
205
+ <div class="{{spacingClass}}
206
+ {{if (not (show-model-field
207
+ "constructionAuthorisationDeniedDate" changeset this.import
208
+ )) "uk-hidden"}}"
209
+ >
210
+ <Field
211
+ @inputType="date"
212
+ @attr="constructionAuthorisationDeniedDate"
213
+ />
214
+ </div>
215
+ <div class="{{spacingClass}}
216
+ {{if (not (show-model-field
217
+ "cancellationDate" changeset this.import
218
+ )) "uk-hidden"}}"
219
+ >
220
+ <Field @inputType="date" @attr="cancellationDate" />
221
+ </div>
222
+ <div class="{{spacingClass}}
223
+ {{if (not (show-model-field
224
+ "withdrawalDate" changeset this.import
225
+ )) "uk-hidden"}}"
226
+ >
227
+ <Field @inputType="date" @attr="withdrawalDate" />
228
+ </div>
211
229
  {{/let}}
212
230
  </div>
213
- {{#unless this.project.isNew}}
231
+ {{#if (or
232
+ (not this.project.isNew)
233
+ (show-model-field
234
+ "durationOfConstructionPhase" changeset this.import)
235
+ )
236
+ }}
214
237
  <Field
215
238
  @type="number"
216
239
  @attr="durationOfConstructionPhase"
@@ -218,7 +241,7 @@
218
241
  "ember-gwr.constructionProject.fields.durationOfConstructionPhase.hint"
219
242
  }}
220
243
  />
221
- {{/unless}}
244
+ {{/if}}
222
245
  <h3>
223
246
  {{t "ember-gwr.components.modelForm.realEstateHeading"}}
224
247
  </h3>
@@ -235,25 +258,30 @@
235
258
  @attr="typeOfClient"
236
259
  @gwrEnumOptions={{this.choiceOptions.typeOfClientOptions}}
237
260
  />
261
+ {{#if (compute this.isClientMismatch changeset)}}
262
+ <div class="uk-alert uk-alert-danger" >
263
+ {{t "ember-gwr.constructionProject.fields.typeOfClientAlert"}}
264
+ </div>
265
+ {{/if}}
238
266
  {{#if
239
267
  (or
240
- (not-eq changeset.typeOfClient 6161)
268
+ (eq changeset.typeOfClient 6161)
241
269
  (and
242
270
  this.import
243
- this.import.data.client.identification.organisationIdentification.organisationName
271
+ this.import.data.client.identification.personIdentification.officialName
244
272
  )
245
273
  )
246
274
  }}
247
275
  <div class="uk-flex uk-margin">
248
276
  <div class="uk-width-1-2 uk-margin-small-right">
249
277
  <Field
250
- @attr="client.identification.organisationIdentification.organisationName"
278
+ @attr="client.identification.personIdentification.officialName"
251
279
  @noMargin={{true}}
252
280
  />
253
281
  </div>
254
282
  <div class="uk-width-1-2">
255
283
  <Field
256
- @attr="client.identification.organisationIdentification.organisationAdditionalName"
284
+ @attr="client.identification.personIdentification.firstName"
257
285
  @noMargin={{true}}
258
286
  />
259
287
  </div>
@@ -262,13 +290,13 @@
262
290
  <div class="uk-flex uk-margin">
263
291
  <div class="uk-width-1-2 uk-margin-small-right">
264
292
  <Field
265
- @attr="client.identification.personIdentification.officialName"
293
+ @attr="client.identification.organisationIdentification.organisationName"
266
294
  @noMargin={{true}}
267
295
  />
268
296
  </div>
269
297
  <div class="uk-width-1-2">
270
298
  <Field
271
- @attr="client.identification.personIdentification.firstName"
299
+ @attr="client.identification.organisationIdentification.organisationAdditionalName"
272
300
  @noMargin={{true}}
273
301
  />
274
302
  </div>
@@ -287,7 +315,10 @@
287
315
  </div>
288
316
  </div>
289
317
  <Field @attr="client.address.addressLine2" />
290
- {{#if (eq changeset.client.address.country.countryNameShort "ch")}}
318
+ {{#if (or
319
+ (eq changeset.client.address.country.countryNameShort "ch")
320
+ (and this.import this.import.data.client.address.swissZipCode)
321
+ )}}
291
322
  <div class="{{unless this.import "uk-flex"}} uk-margin">
292
323
  <div class={{if this.import "uk-margin" "uk-width-1-2 uk-margin-small-right"}}>
293
324
  <Field
@@ -304,7 +335,10 @@
304
335
  />
305
336
  </div>
306
337
  </div>
307
- {{else if changeset.client.address.country.countryNameShort}}
338
+ {{else if (or
339
+ changeset.client.address.country.countryNameShort
340
+ (and this.import this.import.data.client.address.foreignZipCode)
341
+ )}}
308
342
  <Field
309
343
  @type="number"
310
344
  @attr="client.address.foreignZipCode"
@@ -11,26 +11,11 @@
11
11
  @models={{this.fetchBuildings.lastSuccessful.value}}
12
12
  @modelName="building"
13
13
  @removeLink={{this.removeBuildingLink}}
14
- @searchRoute={{if
15
- (eq this.project.typeOfConstructionProject 6011)
16
- "search-building"
17
- undefined
18
- }}
19
- @searchModels={{if
20
- (eq this.project.typeOfConstructionProject 6011)
21
- (array @model)
22
- undefined
23
- }}
24
- @newRoute={{if
25
- (eq this.project.typeOfConstructionProject 6011)
26
- "building.new"
27
- undefined
28
- }}
29
- @newModels={{if
30
- (eq this.project.typeOfConstructionProject 6011)
31
- (array @model)
32
- undefined
33
- }} as |model|
14
+ @searchRoute="search-building"
15
+ @searchModels={{array @model}}
16
+ @newRoute="building.new"
17
+ @newModels={{array @model}}
18
+ as |model|
34
19
  >
35
20
  <td class="uk-table-shrink">
36
21
  <LinkTo
@@ -61,5 +46,13 @@
61
46
  }}
62
47
  </td>
63
48
  </LinkedModels>
49
+ <div class="uk-flex uk-flex-middle uk-flex-center">
50
+ <div>
51
+ <span uk-icon="info" class="uk-margin-small-right"/>
52
+ </div>
53
+ <div>
54
+ {{t "ember-gwr.components.linkedModels.buildingInfo"}}
55
+ </div>
56
+ </div>
64
57
  {{/if}}
65
58
  </div>
@@ -22,23 +22,29 @@
22
22
  class="uk-margin-remove"
23
23
  >
24
24
  <div class="uk-flex uk-flex-between uk-flex-middle">
25
- <span class="uk-flex-inline uk-flex-middle">
26
- <span uk-icon="icon: info" class="uk-margin-small-right"></span>
27
- <span>
28
- {{t "ember-gwr.nav.housingStatInfo"}}
29
- </span>
30
- </span>
31
- <a
32
- class="uk-button uk-button-default"
33
- href={{this.config.housingStatLink}}
34
- target="_blank"
35
- rel="noopener noreferrer"
36
- >
37
- {{t "ember-gwr.nav.housingStatLink"}}
38
- </a>
39
- </div>
40
- <div>
41
- {{t "ember-gwr.nav.deletionInfo"}}
25
+ <div class="uk-flex uk-flex-middle uk-width-expand uk-margin-right">
26
+ <div class="uk-flex-none uk-margin-right">
27
+ <span uk-icon="icon: info"></span>
28
+ </div>
29
+ <div>
30
+ <div>
31
+ {{t "ember-gwr.nav.housingStatInfo"}}
32
+ </div>
33
+ <div>
34
+ {{t "ember-gwr.nav.deletionInfo"}}
35
+ </div>
36
+ </div>
37
+ </div>
38
+ <div class="uk-width-auto">
39
+ <a
40
+ class="uk-button uk-button-default"
41
+ href={{housing-stat-link}}
42
+ target="_blank"
43
+ rel="noopener noreferrer"
44
+ >
45
+ {{t "ember-gwr.nav.housingStatLink"}}
46
+ </a>
47
+ </div>
42
48
  </div>
43
49
  </div>
44
50
  </div>
@@ -1,3 +1,9 @@
1
+ <BackRoute
2
+ @backRoute="project.linked-buildings"
3
+ @backModel={{@model}}
4
+ @backText={{t "ember-gwr.building.backToProject"}}
5
+ />
6
+
1
7
  <h1>
2
8
  {{t "ember-gwr.searchBuilding.heading"}}
3
9
  </h1>
@@ -1,3 +1,9 @@
1
+ <BackRoute
2
+ @backRoute="project"
3
+ @backModel={{@model}}
4
+ @backText={{t "ember-gwr.building.backToProject"}}
5
+ />
6
+
1
7
  <h1>
2
8
  {{t "ember-gwr.searchProject.heading"}}
3
9
  </h1>
package/addon/utils.js ADDED
@@ -0,0 +1,8 @@
1
+ export function isIsoDate(value) {
2
+ const isoDateRegExp = new RegExp("^[0-9]{4}-[0-9]{2}-[0-9]{2}$");
3
+ return (
4
+ typeof value === "string" &&
5
+ isoDateRegExp.test(value) &&
6
+ !isNaN(new Date(value))
7
+ );
8
+ }
@@ -7,6 +7,7 @@ import {
7
7
 
8
8
  import buildingEntranceValidation from "./building-entrance";
9
9
  import { coordinatesValidation } from "./coordinates";
10
+ import realestateIdentification from "./realestate-identification";
10
11
 
11
12
  export function buildingWorkValidation(isNew = false) {
12
13
  const validations = {
@@ -117,6 +118,7 @@ export function buildingWorkValidation(isNew = false) {
117
118
  },
118
119
  buildingFreeText1: validateLength({ max: 32, allowBlank: true }),
119
120
  buildingFreeText2: validateLength({ max: 32, allowBlank: true }),
121
+ ...realestateIdentification,
120
122
  },
121
123
  };
122
124
 
@@ -25,11 +25,6 @@ export default {
25
25
  on: "floorType",
26
26
  states: [3101, 3401],
27
27
  }),
28
- validatePresenceState({
29
- presence: false,
30
- on: "floorType",
31
- states: [3100],
32
- }),
33
28
  validateRangeState({
34
29
  range: [1, 99],
35
30
  on: "floorType",