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
@@ -116,7 +116,257 @@ export const projectStatusOptions = [
116
116
  6709,
117
117
  ];
118
118
 
119
- export const countryOptions = ["ch", "de"];
119
+ export const countryOptions = [
120
+ "af",
121
+ "eg",
122
+ "ax",
123
+ "al",
124
+ "dz",
125
+ "as",
126
+ "ad",
127
+ "ao",
128
+ "ai",
129
+ "aq",
130
+ "ag",
131
+ "gq",
132
+ "ar",
133
+ "am",
134
+ "aw",
135
+ "az",
136
+ "et",
137
+ "au",
138
+ "bs",
139
+ "bh",
140
+ "bd",
141
+ "bb",
142
+ "by",
143
+ "be",
144
+ "bz",
145
+ "bj",
146
+ "bm",
147
+ "bt",
148
+ "bo",
149
+ "bq",
150
+ "ba",
151
+ "bw",
152
+ "bv",
153
+ "br",
154
+ "io",
155
+ "bn",
156
+ "bg",
157
+ "bf",
158
+ "bi",
159
+ "cl",
160
+ "cn",
161
+ "ck",
162
+ "cr",
163
+ "cw",
164
+ "dk",
165
+ "cd",
166
+ "de",
167
+ "dm",
168
+ "do",
169
+ "dj",
170
+ "ec",
171
+ "ci",
172
+ "sv",
173
+ "er",
174
+ "ee",
175
+ "sz",
176
+ "fk",
177
+ "fo",
178
+ "fj",
179
+ "fi",
180
+ "fr",
181
+ "tf",
182
+ "gf",
183
+ "pf",
184
+ "ga",
185
+ "gm",
186
+ "ge",
187
+ "gh",
188
+ "gi",
189
+ "gd",
190
+ "gr",
191
+ "gl",
192
+ "gp",
193
+ "gu",
194
+ "gt",
195
+ "gg",
196
+ "gw",
197
+ "gn",
198
+ "gy",
199
+ "ht",
200
+ "hm",
201
+ "hn",
202
+ "hk",
203
+ "in",
204
+ "id",
205
+ "im",
206
+ "iq",
207
+ "ir",
208
+ "ie",
209
+ "is",
210
+ "il",
211
+ "it",
212
+ "jm",
213
+ "jp",
214
+ "ye",
215
+ "je",
216
+ "jo",
217
+ "vg",
218
+ "vi",
219
+ "ky",
220
+ "kh",
221
+ "cm",
222
+ "ca",
223
+ "cv",
224
+ "kz",
225
+ "qa",
226
+ "ke",
227
+ "kg",
228
+ "ki",
229
+ "cc",
230
+ "co",
231
+ "km",
232
+ "xk",
233
+ "hr",
234
+ "cu",
235
+ "kw",
236
+ "la",
237
+ "ls",
238
+ "lv",
239
+ "lb",
240
+ "lr",
241
+ "ly",
242
+ "li",
243
+ "lt",
244
+ "lu",
245
+ "mo",
246
+ "mg",
247
+ "mw",
248
+ "my",
249
+ "mv",
250
+ "ml",
251
+ "mt",
252
+ "ma",
253
+ "mh",
254
+ "mq",
255
+ "mr",
256
+ "mu",
257
+ "yt",
258
+ "mx",
259
+ "fm",
260
+ "md",
261
+ "mc",
262
+ "mn",
263
+ "me",
264
+ "ms",
265
+ "mz",
266
+ "mm",
267
+ "na",
268
+ "nr",
269
+ "np",
270
+ "nc",
271
+ "nz",
272
+ "ni",
273
+ "nl",
274
+ "ng",
275
+ "ne",
276
+ "nu",
277
+ "kp",
278
+ "mp",
279
+ "mk",
280
+ "nf",
281
+ "no",
282
+ "om",
283
+ "at",
284
+ "tl",
285
+ "pk",
286
+ "ps",
287
+ "pw",
288
+ "pa",
289
+ "pg",
290
+ "py",
291
+ "pe",
292
+ "ph",
293
+ "pn",
294
+ "pl",
295
+ "pt",
296
+ "pr",
297
+ "cg",
298
+ "re",
299
+ "rw",
300
+ "ro",
301
+ "ru",
302
+ "mf",
303
+ "sb",
304
+ "zm",
305
+ "ws",
306
+ "bl",
307
+ "sm",
308
+ "st",
309
+ "sa",
310
+ "se",
311
+ "ch",
312
+ "sn",
313
+ "rs",
314
+ "sc",
315
+ "sl",
316
+ "zw",
317
+ "sg",
318
+ "sx",
319
+ "sk",
320
+ "si",
321
+ "so",
322
+ "es",
323
+ "lk",
324
+ "sh",
325
+ "kn",
326
+ "lc",
327
+ "pm",
328
+ "vc",
329
+ "za",
330
+ "sd",
331
+ "gs",
332
+ "kr",
333
+ "ss",
334
+ "sr",
335
+ "sj",
336
+ "sy",
337
+ "tj",
338
+ "tw",
339
+ "tz",
340
+ "th",
341
+ "tg",
342
+ "tk",
343
+ "to",
344
+ "tt",
345
+ "td",
346
+ "cz",
347
+ "tn",
348
+ "tr",
349
+ "tm",
350
+ "tc",
351
+ "tv",
352
+ "ug",
353
+ "ua",
354
+ "hu",
355
+ "uy",
356
+ "uz",
357
+ "vu",
358
+ "va",
359
+ "ve",
360
+ "ae",
361
+ "gb",
362
+ "us",
363
+ "vn",
364
+ "wf",
365
+ "cx",
366
+ "eh",
367
+ "cf",
368
+ "cy",
369
+ ];
120
370
 
121
371
  export const languageOptions = { de: 9901, fr: 9903, it: 9904 };
122
372
 
@@ -153,37 +153,36 @@ export default class BuildingService extends GwrService {
153
153
  buildingWork
154
154
  ) {
155
155
  await Promise.all(
156
- buildingWork.building.buildingEntrance.map(
157
- async (buildingEntrance) =>
158
- await Promise.all(
159
- buildingEntrance.dwelling.map(async (dwelling) => {
160
- if (
161
- [Dwelling.STATUS_PROJECTED, Dwelling.STATUS_APPROVED].includes(
162
- dwelling.dwellingStatus
163
- )
164
- ) {
165
- await this.dwelling.setToApprovedDwelling(
166
- "setToApprovedDwelling",
167
- cascadeLevel - 1,
168
- isDryRun,
169
- dwelling,
170
- buildingWork.building.EGID
171
- );
172
- } else {
173
- // Display message with link to dwelling with issue
174
- const states =
175
- cascadeLevel > 1
176
- ? [Dwelling.STATUS_PROJECTED, Dwelling.STATUS_APPROVED]
177
- : [Dwelling.STATUS_APPROVED];
178
- throw {
179
- isLifeCycleError: true,
180
- dwellingId: dwelling.EWID,
181
- buildingId: buildingWork.building.EGID,
182
- states,
183
- };
184
- }
185
- })
186
- )
156
+ buildingWork.building.buildingEntrance.map((buildingEntrance) =>
157
+ Promise.all(
158
+ buildingEntrance.dwelling.map(async (dwelling) => {
159
+ if (
160
+ [Dwelling.STATUS_PROJECTED, Dwelling.STATUS_APPROVED].includes(
161
+ dwelling.dwellingStatus
162
+ )
163
+ ) {
164
+ await this.dwelling.setToApprovedDwelling(
165
+ "setToApprovedDwelling",
166
+ cascadeLevel - 1,
167
+ isDryRun,
168
+ dwelling,
169
+ buildingWork.building.EGID
170
+ );
171
+ } else {
172
+ // Display message with link to dwelling with issue
173
+ const states =
174
+ cascadeLevel > 1
175
+ ? [Dwelling.STATUS_PROJECTED, Dwelling.STATUS_APPROVED]
176
+ : [Dwelling.STATUS_APPROVED];
177
+ throw {
178
+ isLifeCycleError: true,
179
+ dwellingId: dwelling.EWID,
180
+ buildingId: buildingWork.building.EGID,
181
+ states,
182
+ };
183
+ }
184
+ })
185
+ )
187
186
  )
188
187
  );
189
188
 
@@ -215,29 +214,28 @@ export default class BuildingService extends GwrService {
215
214
  buildingWork
216
215
  ) {
217
216
  await Promise.all(
218
- buildingWork.building.buildingEntrance.map(
219
- async (buildingEntrance) =>
220
- await Promise.all(
221
- buildingEntrance.dwelling.map(async (dwelling) => {
222
- if (
223
- ![
217
+ buildingWork.building.buildingEntrance.map((buildingEntrance) =>
218
+ Promise.all(
219
+ buildingEntrance.dwelling.map(async (dwelling) => {
220
+ if (
221
+ ![
222
+ Dwelling.STATUS_APPROVED,
223
+ Dwelling.STATUS_CONSTRUCTION_STARTED,
224
+ ].includes(dwelling.dwellingStatus)
225
+ ) {
226
+ // Display message with link to dwelling with issue
227
+ throw {
228
+ isLifeCycleError: true,
229
+ dwellingId: dwelling.EWID,
230
+ buildingId: buildingWork.building.EGID,
231
+ states: [
224
232
  Dwelling.STATUS_APPROVED,
225
233
  Dwelling.STATUS_CONSTRUCTION_STARTED,
226
- ].includes(dwelling.dwellingStatus)
227
- ) {
228
- // Display message with link to dwelling with issue
229
- throw {
230
- isLifeCycleError: true,
231
- dwellingId: dwelling.EWID,
232
- buildingId: buildingWork.building.EGID,
233
- states: [
234
- Dwelling.STATUS_APPROVED,
235
- Dwelling.STATUS_CONSTRUCTION_STARTED,
236
- ],
237
- };
238
- }
239
- })
240
- )
234
+ ],
235
+ };
236
+ }
237
+ })
238
+ )
241
239
  )
242
240
  );
243
241
 
@@ -271,31 +269,30 @@ export default class BuildingService extends GwrService {
271
269
  buildingWork
272
270
  ) {
273
271
  await Promise.all(
274
- buildingWork.building.buildingEntrance.map(
275
- async (buildingEntrance) =>
276
- await Promise.all(
277
- buildingEntrance.dwelling.map(async (dwelling) => {
278
- if (
279
- ![
272
+ buildingWork.building.buildingEntrance.map((buildingEntrance) =>
273
+ Promise.all(
274
+ buildingEntrance.dwelling.map(async (dwelling) => {
275
+ if (
276
+ ![
277
+ Dwelling.STATUS_APPROVED,
278
+ Dwelling.STATUS_CONSTRUCTION_STARTED,
279
+ Dwelling.STATUS_COMPLETED,
280
+ ].includes(dwelling.dwellingStatus)
281
+ ) {
282
+ // Display message with link to dwelling with issue
283
+ throw {
284
+ isLifeCycleError: true,
285
+ dwellingId: dwelling.EWID,
286
+ buildingId: buildingWork.building.EGID,
287
+ states: [
280
288
  Dwelling.STATUS_APPROVED,
281
289
  Dwelling.STATUS_CONSTRUCTION_STARTED,
282
290
  Dwelling.STATUS_COMPLETED,
283
- ].includes(dwelling.dwellingStatus)
284
- ) {
285
- // Display message with link to dwelling with issue
286
- throw {
287
- isLifeCycleError: true,
288
- dwellingId: dwelling.EWID,
289
- buildingId: buildingWork.building.EGID,
290
- states: [
291
- Dwelling.STATUS_APPROVED,
292
- Dwelling.STATUS_CONSTRUCTION_STARTED,
293
- Dwelling.STATUS_COMPLETED,
294
- ],
295
- };
296
- }
297
- })
298
- )
291
+ ],
292
+ };
293
+ }
294
+ })
295
+ )
299
296
  )
300
297
  );
301
298
 
@@ -327,47 +324,46 @@ export default class BuildingService extends GwrService {
327
324
  buildingWork
328
325
  ) {
329
326
  await Promise.all(
330
- buildingWork.building.buildingEntrance.map(
331
- async (buildingEntrance) =>
332
- await Promise.all(
333
- buildingEntrance.dwelling.map(async (dwelling) => {
334
- if (
335
- [
336
- Dwelling.STATUS_COMPLETED,
337
- Dwelling.STATUS_UNUSABLE,
338
- Dwelling.STATUS_DEMOLISHED,
339
- ].includes(dwelling.dwellingStatus)
340
- ) {
341
- if (dwelling.dwellingStatus !== Dwelling.STATUS_DEMOLISHED) {
342
- dwelling.yearOfDemolition =
343
- buildingWork.building.yearOfDemolition;
344
- }
345
- await this.dwelling.setToDemolishedDwelling(
346
- "setToDemolishedDwelling",
347
- cascadeLevel - 1,
348
- isDryRun,
349
- dwelling,
350
- buildingWork.building.EGID
351
- );
352
- } else {
353
- // Display message with link to dwelling with issue
354
- const states =
355
- cascadeLevel > 1
356
- ? [
357
- Dwelling.STATUS_COMPLETED,
358
- Dwelling.STATUS_UNUSABLE,
359
- Dwelling.STATUS_DEMOLISHED,
360
- ]
361
- : [Dwelling.STATUS_DEMOLISHED];
362
- throw {
363
- isLifeCycleError: true,
364
- dwellingId: dwelling.EWID,
365
- buildingId: buildingWork.building.EGID,
366
- states,
367
- };
327
+ buildingWork.building.buildingEntrance.map((buildingEntrance) =>
328
+ Promise.all(
329
+ buildingEntrance.dwelling.map(async (dwelling) => {
330
+ if (
331
+ [
332
+ Dwelling.STATUS_COMPLETED,
333
+ Dwelling.STATUS_UNUSABLE,
334
+ Dwelling.STATUS_DEMOLISHED,
335
+ ].includes(dwelling.dwellingStatus)
336
+ ) {
337
+ if (dwelling.dwellingStatus !== Dwelling.STATUS_DEMOLISHED) {
338
+ dwelling.yearOfDemolition =
339
+ buildingWork.building.yearOfDemolition;
368
340
  }
369
- })
370
- )
341
+ await this.dwelling.setToDemolishedDwelling(
342
+ "setToDemolishedDwelling",
343
+ cascadeLevel - 1,
344
+ isDryRun,
345
+ dwelling,
346
+ buildingWork.building.EGID
347
+ );
348
+ } else {
349
+ // Display message with link to dwelling with issue
350
+ const states =
351
+ cascadeLevel > 1
352
+ ? [
353
+ Dwelling.STATUS_COMPLETED,
354
+ Dwelling.STATUS_UNUSABLE,
355
+ Dwelling.STATUS_DEMOLISHED,
356
+ ]
357
+ : [Dwelling.STATUS_DEMOLISHED];
358
+ throw {
359
+ isLifeCycleError: true,
360
+ dwellingId: dwelling.EWID,
361
+ buildingId: buildingWork.building.EGID,
362
+ states,
363
+ };
364
+ }
365
+ })
366
+ )
371
367
  )
372
368
  );
373
369
 
@@ -399,45 +395,44 @@ export default class BuildingService extends GwrService {
399
395
  buildingWork
400
396
  ) {
401
397
  await Promise.all(
402
- buildingWork.building.buildingEntrance.map(
403
- async (buildingEntrance) =>
404
- await Promise.all(
405
- buildingEntrance.dwelling.map(async (dwelling) => {
406
- if (
407
- [
408
- Dwelling.STATUS_PROJECTED,
409
- Dwelling.STATUS_APPROVED,
410
- Dwelling.STATUS_CONSTRUCTION_STARTED,
411
- Dwelling.STATUS_NOT_REALIZED,
412
- ].includes(dwelling.dwellingStatus)
413
- ) {
414
- await this.dwelling.setToNotRealizedDwelling(
415
- "setToNotRealizedDwelling",
416
- cascadeLevel - 1,
417
- isDryRun,
418
- dwelling,
419
- buildingWork.building.EGID
420
- );
421
- } else {
422
- // Display message with link to dwelling with issue
423
- const states =
424
- cascadeLevel > 1
425
- ? [
426
- Dwelling.STATUS_PROJECTED,
427
- Dwelling.STATUS_APPROVED,
428
- Dwelling.STATUS_CONSTRUCTION_STARTED,
429
- Dwelling.STATUS_NOT_REALIZED,
430
- ]
431
- : [Dwelling.STATUS_NOT_REALIZED];
432
- throw {
433
- isLifeCycleError: true,
434
- dwellingId: dwelling.EWID,
435
- buildingId: buildingWork.building.EGID,
436
- states,
437
- };
438
- }
439
- })
440
- )
398
+ buildingWork.building.buildingEntrance.map((buildingEntrance) =>
399
+ Promise.all(
400
+ buildingEntrance.dwelling.map(async (dwelling) => {
401
+ if (
402
+ [
403
+ Dwelling.STATUS_PROJECTED,
404
+ Dwelling.STATUS_APPROVED,
405
+ Dwelling.STATUS_CONSTRUCTION_STARTED,
406
+ Dwelling.STATUS_NOT_REALIZED,
407
+ ].includes(dwelling.dwellingStatus)
408
+ ) {
409
+ await this.dwelling.setToNotRealizedDwelling(
410
+ "setToNotRealizedDwelling",
411
+ cascadeLevel - 1,
412
+ isDryRun,
413
+ dwelling,
414
+ buildingWork.building.EGID
415
+ );
416
+ } else {
417
+ // Display message with link to dwelling with issue
418
+ const states =
419
+ cascadeLevel > 1
420
+ ? [
421
+ Dwelling.STATUS_PROJECTED,
422
+ Dwelling.STATUS_APPROVED,
423
+ Dwelling.STATUS_CONSTRUCTION_STARTED,
424
+ Dwelling.STATUS_NOT_REALIZED,
425
+ ]
426
+ : [Dwelling.STATUS_NOT_REALIZED];
427
+ throw {
428
+ isLifeCycleError: true,
429
+ dwellingId: dwelling.EWID,
430
+ buildingId: buildingWork.building.EGID,
431
+ states,
432
+ };
433
+ }
434
+ })
435
+ )
441
436
  )
442
437
  );
443
438
 
@@ -469,41 +464,40 @@ export default class BuildingService extends GwrService {
469
464
  buildingWork
470
465
  ) {
471
466
  await Promise.all(
472
- buildingWork.building.buildingEntrance.map(
473
- async (buildingEntrance) =>
474
- await Promise.all(
475
- buildingEntrance.dwelling.map(async (dwelling) => {
476
- if (
477
- [
478
- Dwelling.STATUS_CONSTRUCTION_STARTED,
479
- Dwelling.STATUS_UNUSABLE,
480
- ].includes(dwelling.dwellingStatus)
481
- ) {
482
- await this.dwelling.setToUnusableDwelling(
483
- "setToUnusableDwelling",
484
- cascadeLevel - 1,
485
- isDryRun,
486
- dwelling,
487
- buildingWork.building.EGID
488
- );
489
- } else {
490
- // Display message with link to dwelling with issue
491
- const states =
492
- cascadeLevel > 1
493
- ? [
494
- Dwelling.STATUS_CONSTRUCTION_STARTED,
495
- Dwelling.STATUS_UNUSABLE,
496
- ]
497
- : [Dwelling.STATUS_UNUSABLE];
498
- throw {
499
- isLifeCycleError: true,
500
- dwellingId: dwelling.EWID,
501
- buildingId: buildingWork.building.EGID,
502
- states,
503
- };
504
- }
505
- })
506
- )
467
+ buildingWork.building.buildingEntrance.map((buildingEntrance) =>
468
+ Promise.all(
469
+ buildingEntrance.dwelling.map(async (dwelling) => {
470
+ if (
471
+ [
472
+ Dwelling.STATUS_CONSTRUCTION_STARTED,
473
+ Dwelling.STATUS_UNUSABLE,
474
+ ].includes(dwelling.dwellingStatus)
475
+ ) {
476
+ await this.dwelling.setToUnusableDwelling(
477
+ "setToUnusableDwelling",
478
+ cascadeLevel - 1,
479
+ isDryRun,
480
+ dwelling,
481
+ buildingWork.building.EGID
482
+ );
483
+ } else {
484
+ // Display message with link to dwelling with issue
485
+ const states =
486
+ cascadeLevel > 1
487
+ ? [
488
+ Dwelling.STATUS_CONSTRUCTION_STARTED,
489
+ Dwelling.STATUS_UNUSABLE,
490
+ ]
491
+ : [Dwelling.STATUS_UNUSABLE];
492
+ throw {
493
+ isLifeCycleError: true,
494
+ dwellingId: dwelling.EWID,
495
+ buildingId: buildingWork.building.EGID,
496
+ states,
497
+ };
498
+ }
499
+ })
500
+ )
507
501
  )
508
502
  );
509
503
 
@@ -564,8 +558,4 @@ export default class BuildingService extends GwrService {
564
558
  getCorrectionParameters(newStatus) {
565
559
  return Building.buildingTransitionParametersMapping[newStatus];
566
560
  }
567
-
568
- getChangeHint(currentStatus, newStatus) {
569
- return Building.buildingTransitionHint[currentStatus][newStatus];
570
- }
571
561
  }