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.
- package/CHANGELOG.md +24 -0
- package/addon/components/back-route.hbs +10 -0
- package/addon/components/linked-models.hbs +11 -5
- package/addon/components/model-errors/error-indicator.hbs +3 -1
- package/addon/components/model-errors/header.hbs +4 -2
- package/addon/components/model-errors.hbs +1 -0
- package/addon/components/model-form/field.js +5 -2
- package/addon/components/model-form/header/actions.hbs +5 -3
- package/addon/components/model-form.js +9 -1
- package/addon/components/model-inview.hbs +8 -0
- package/addon/components/model-inview.js +12 -0
- package/addon/components/sub-nav.hbs +5 -10
- package/addon/controllers/building/edit/dwelling/edit.js +2 -2
- package/addon/controllers/building/edit/form.js +0 -5
- package/addon/controllers/project/errors.js +25 -29
- package/addon/controllers/project/form.js +25 -5
- package/addon/controllers/project.js +1 -1
- package/addon/helpers/housing-stat-link.js +13 -0
- package/addon/helpers/show-model-field.js +13 -0
- package/addon/models/building.js +1 -1
- package/addon/models/construction-project.js +1 -1
- package/addon/models/options.js +251 -1
- package/addon/services/building.js +182 -192
- package/addon/services/construction-project.js +134 -145
- package/addon/services/gwr.js +4 -0
- package/addon/templates/building/edit/dwelling/edit.hbs +25 -22
- package/addon/templates/building/edit/entrance/edit/index.hbs +1 -2
- package/addon/templates/building/edit/form.hbs +38 -16
- package/addon/templates/project/errors.hbs +121 -132
- package/addon/templates/project/form.hbs +87 -53
- package/addon/templates/project/linked-buildings.hbs +13 -20
- package/addon/templates/project.hbs +23 -17
- package/addon/templates/search-building.hbs +6 -0
- package/addon/templates/search-project.hbs +6 -0
- package/addon/utils.js +8 -0
- package/addon/validations/building-work.js +2 -0
- package/addon/validations/dwelling.js +0 -5
- package/app/styles/ember-ebau-gwr.scss +8 -0
- package/config/environment.js +3 -0
- package/package.json +1 -1
- package/translations/building/de.yaml +3 -5
- package/translations/construction-project/de.yaml +256 -4
- package/translations/de.yaml +21 -3
- package/translations/dwelling/de.yaml +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
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
|
+
|
|
1
25
|
## [3.1.1](https://github.com/adfinis-sygroup/ember-ebau-gwr/compare/v3.1.0...v3.1.1) (2021-10-01)
|
|
2
26
|
|
|
3
27
|
|
|
@@ -51,11 +51,15 @@
|
|
|
51
51
|
<LinkTo
|
|
52
52
|
@route={{@searchRoute}}
|
|
53
53
|
@models={{or @searchModels (array)}}
|
|
54
|
-
>
|
|
55
|
-
{{
|
|
56
|
-
"ember-gwr.components.linkedModels.
|
|
57
|
-
|
|
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}}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
{{#unless @noHeader}}
|
|
2
2
|
<div class="uk-flex-inline uk-flex-top uk-width-expand">
|
|
3
|
-
<div
|
|
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}}
|
|
@@ -2,6 +2,7 @@ import { get, action } from "@ember/object";
|
|
|
2
2
|
import { inject as service } from "@ember/service";
|
|
3
3
|
import Component from "@glimmer/component";
|
|
4
4
|
import { tracked } from "@glimmer/tracking";
|
|
5
|
+
import { isIsoDate } from "ember-ebau-gwr/utils";
|
|
5
6
|
|
|
6
7
|
export const converstionTypeMapping = {
|
|
7
8
|
number: Number,
|
|
@@ -35,7 +36,8 @@ export default class ModelFormFieldComponent extends Component {
|
|
|
35
36
|
if (this.args.importData) {
|
|
36
37
|
return (
|
|
37
38
|
!this.diffResolved &&
|
|
38
|
-
this.importValue &&
|
|
39
|
+
this.importValue !== null &&
|
|
40
|
+
this.importValue !== undefined &&
|
|
39
41
|
this.importValue !== this.value
|
|
40
42
|
);
|
|
41
43
|
}
|
|
@@ -101,7 +103,8 @@ export default class ModelFormFieldComponent extends Component {
|
|
|
101
103
|
if (this.args.update) {
|
|
102
104
|
this.args.update(attr, value);
|
|
103
105
|
} else {
|
|
104
|
-
|
|
106
|
+
// Date casts necessary for import
|
|
107
|
+
this.args.model.set(attr, isIsoDate(value) ? new Date(value) : value);
|
|
105
108
|
|
|
106
109
|
if (this.args.importData) {
|
|
107
110
|
this.diffResolved = true;
|
|
@@ -83,6 +83,7 @@
|
|
|
83
83
|
class="uk-button uk-text-left uk-highlight-hover
|
|
84
84
|
{{if @import "uk-text-muted" "uk-text-secondary"}}
|
|
85
85
|
uk-width-1-1 uk-background-default uk-padding-remove"
|
|
86
|
+
{{on "click" (fn (mut this.showImportModal) true)}}
|
|
86
87
|
>
|
|
87
88
|
{{t "ember-gwr.components.modelForm.importFromCaluma"}}
|
|
88
89
|
</LinkTo>
|
|
@@ -90,13 +91,14 @@
|
|
|
90
91
|
{{/if}}
|
|
91
92
|
{{#if @hasStatus}}
|
|
92
93
|
<li>
|
|
93
|
-
<
|
|
94
|
+
<a
|
|
95
|
+
href="#ember-ebau-gwr-status"
|
|
96
|
+
uk-scroll
|
|
94
97
|
class="uk-button uk-text-left uk-highlight-hover uk-text-secondary uk-width-1-1 uk-background-default uk-padding-remove"
|
|
95
|
-
type="button"
|
|
96
98
|
{{on "click" @openStatus}}
|
|
97
99
|
>
|
|
98
100
|
{{t "ember-gwr.components.modelForm.changeStatus"}}
|
|
99
|
-
</
|
|
101
|
+
</a>
|
|
100
102
|
</li>
|
|
101
103
|
{{/if}}
|
|
102
104
|
</ul>
|
|
@@ -3,6 +3,7 @@ import { inject as service } from "@ember/service";
|
|
|
3
3
|
import Component from "@glimmer/component";
|
|
4
4
|
import { tracked } from "@glimmer/tracking";
|
|
5
5
|
import { dropTask } from "ember-concurrency-decorators";
|
|
6
|
+
import { isIsoDate } from "ember-ebau-gwr/utils";
|
|
6
7
|
|
|
7
8
|
export default class ModelFormComponent extends Component {
|
|
8
9
|
@service router;
|
|
@@ -65,9 +66,16 @@ export default class ModelFormComponent extends Component {
|
|
|
65
66
|
// set here...
|
|
66
67
|
const deepMerge = (original, objectToApply) => {
|
|
67
68
|
Object.entries(objectToApply).forEach(([key, value]) => {
|
|
68
|
-
if (
|
|
69
|
+
if (
|
|
70
|
+
original !== null &&
|
|
71
|
+
original !== undefined &&
|
|
72
|
+
value !== null &&
|
|
73
|
+
value !== undefined
|
|
74
|
+
) {
|
|
69
75
|
typeof value === "object"
|
|
70
76
|
? deepMerge(original[key], objectToApply[key])
|
|
77
|
+
: isIsoDate(value) // Date casts necessary for import
|
|
78
|
+
? (original[key] = new Date(value))
|
|
71
79
|
: (original[key] = value);
|
|
72
80
|
}
|
|
73
81
|
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import Component from "@glimmer/component";
|
|
2
|
+
import { tracked } from "@glimmer/tracking";
|
|
3
|
+
import { task } from "ember-concurrency-decorators";
|
|
4
|
+
|
|
5
|
+
export default class ModelInviewComponent extends Component {
|
|
6
|
+
@tracked fetchedModel;
|
|
7
|
+
|
|
8
|
+
@task
|
|
9
|
+
*fetch(model) {
|
|
10
|
+
this.fetchedModel = yield this.args.fetchModel(model);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
{{#unless this.isHidden}}
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
>
|
|
8
|
-
<span uk-icon="icon: arrow-left"></span>
|
|
9
|
-
{{@backText}}
|
|
10
|
-
</LinkTo>
|
|
11
|
-
{{/if}}
|
|
2
|
+
<BackRoute
|
|
3
|
+
@backRoute={{@backRoute}}
|
|
4
|
+
@backModel={{@backModel}}
|
|
5
|
+
@backText={{@backText}}
|
|
6
|
+
/>
|
|
12
7
|
<UkTab ...attributes as |Tab|>
|
|
13
8
|
{{#each @links as |link|}}
|
|
14
9
|
<Tab.link-item @route={{link.route}} @models={{link.models}}>
|
|
@@ -105,10 +105,10 @@ export default class BuildingEditDwellingEditController extends ImportController
|
|
|
105
105
|
this.model.buildingId,
|
|
106
106
|
this.dwelling
|
|
107
107
|
);
|
|
108
|
-
// Ensure dwelling list is refreshed
|
|
109
|
-
this.building.clearCache(this.model.buildingId);
|
|
110
108
|
}
|
|
111
109
|
}
|
|
110
|
+
// Ensure dwelling list is refreshed
|
|
111
|
+
this.building.clearCache(this.model.buildingId);
|
|
112
112
|
this.errors = [];
|
|
113
113
|
this.notification.success(this.intl.t("ember-gwr.dwelling.saveSuccess"));
|
|
114
114
|
} catch (error) {
|
|
@@ -202,9 +202,4 @@ export default class BuildingFormController extends ImportController {
|
|
|
202
202
|
getCorrectionParameters(newStatus) {
|
|
203
203
|
return this.buildingAPI.getCorrectionParameters(newStatus);
|
|
204
204
|
}
|
|
205
|
-
|
|
206
|
-
@action
|
|
207
|
-
getChangeHint(currentStatus, newStatus) {
|
|
208
|
-
return this.buildingAPI.getChangeHint(currentStatus, newStatus);
|
|
209
|
-
}
|
|
210
205
|
}
|
|
@@ -16,11 +16,6 @@ export default class ProjectErrorsController extends Controller {
|
|
|
16
16
|
@service notification;
|
|
17
17
|
|
|
18
18
|
@tracked projectErrorCount = 0;
|
|
19
|
-
@tracked buildingErrorCount = {};
|
|
20
|
-
@tracked entranceErrorCount = {};
|
|
21
|
-
@tracked dwellingErrorCount = {};
|
|
22
|
-
|
|
23
|
-
@tracked buildings = {};
|
|
24
19
|
|
|
25
20
|
@lastValue("fetchProject") project;
|
|
26
21
|
@restartableTask
|
|
@@ -34,34 +29,36 @@ export default class ProjectErrorsController extends Controller {
|
|
|
34
29
|
return project;
|
|
35
30
|
}
|
|
36
31
|
|
|
32
|
+
get workBuildings() {
|
|
33
|
+
return this.project.work
|
|
34
|
+
.filter((w) => !w.building.isNew)
|
|
35
|
+
.map((w) => w.building);
|
|
36
|
+
}
|
|
37
|
+
|
|
37
38
|
@enqueueTask
|
|
38
39
|
*fetchModel(buildingId) {
|
|
39
40
|
// building response only contains entrances
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
};
|
|
41
|
+
const buildingWithErrors = yield this.building.getFromCacheOrApi(
|
|
42
|
+
buildingId
|
|
43
|
+
);
|
|
44
|
+
const buildingErrorCount = buildingWithErrors.errorList?.length ?? 0;
|
|
45
45
|
|
|
46
46
|
// response contains both entrances and dwellings
|
|
47
47
|
const projectBuilding = this.project.work.find(
|
|
48
48
|
(buildingWork) => buildingWork.building.EGID === buildingId
|
|
49
49
|
).building;
|
|
50
50
|
|
|
51
|
-
const
|
|
51
|
+
const entrancesWithErrors = yield Promise.all(
|
|
52
52
|
projectBuilding.buildingEntrance.map((entrance) =>
|
|
53
53
|
this.buildingEntrance.getFromCacheOrApi(entrance.EDID, buildingId)
|
|
54
54
|
)
|
|
55
55
|
);
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
.map((entrance) => entrance.errorList?.length ?? 0)
|
|
61
|
-
.reduce((a, b) => a + b, 0),
|
|
62
|
-
};
|
|
57
|
+
const entranceErrorCount = entrancesWithErrors
|
|
58
|
+
.map((entrance) => entrance.errorList?.length ?? 0)
|
|
59
|
+
.reduce((a, b) => a + b, 0);
|
|
63
60
|
|
|
64
|
-
const
|
|
61
|
+
const dwellingsWithErrors = (yield Promise.all(
|
|
65
62
|
projectBuilding.buildingEntrance.map((entrance) => {
|
|
66
63
|
return Promise.all(
|
|
67
64
|
entrance.dwelling.map((dwelling) =>
|
|
@@ -71,18 +68,17 @@ export default class ProjectErrorsController extends Controller {
|
|
|
71
68
|
})
|
|
72
69
|
)).flat();
|
|
73
70
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
.map((dwelling) => dwelling.errorList?.length ?? 0)
|
|
78
|
-
.reduce((a, b) => a + b, 0),
|
|
79
|
-
};
|
|
71
|
+
const dwellingErrorCount = dwellingsWithErrors
|
|
72
|
+
.map((dwelling) => dwelling.dwelling.errorList?.length ?? 0)
|
|
73
|
+
.reduce((a, b) => a + b, 0);
|
|
80
74
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
75
|
+
return {
|
|
76
|
+
buildingWithErrors,
|
|
77
|
+
buildingErrorCount,
|
|
78
|
+
entrancesWithErrors,
|
|
79
|
+
entranceErrorCount,
|
|
80
|
+
dwellingsWithErrors,
|
|
81
|
+
dwellingErrorCount,
|
|
84
82
|
};
|
|
85
|
-
|
|
86
|
-
return building;
|
|
87
83
|
}
|
|
88
84
|
}
|
|
@@ -208,11 +208,6 @@ export default class ProjectFormController extends ImportController {
|
|
|
208
208
|
return this.constructionProject.getCorrectionParameters(newStatus);
|
|
209
209
|
}
|
|
210
210
|
|
|
211
|
-
@action
|
|
212
|
-
getChangeHint(currentStatus, newStatus) {
|
|
213
|
-
return this.constructionProject.getChangeHint(currentStatus, newStatus);
|
|
214
|
-
}
|
|
215
|
-
|
|
216
211
|
@action
|
|
217
212
|
updateWork(work, attr, value) {
|
|
218
213
|
work[attr] = value;
|
|
@@ -305,6 +300,12 @@ export default class ProjectFormController extends ImportController {
|
|
|
305
300
|
@action
|
|
306
301
|
cancelTypeOfConstructionProjectChange() {
|
|
307
302
|
this.showConfirmationDialog = false;
|
|
303
|
+
// Reset the type of construction project set on model during submit
|
|
304
|
+
// This ensures that the buildings tab is correctly (in)activated
|
|
305
|
+
this.project.typeOfConstructionProject =
|
|
306
|
+
this.typeOfConstructionProject === 6011 ? 6010 : 6011;
|
|
307
|
+
|
|
308
|
+
this.typeOfConstructionProject = this.project.typeOfConstructionProject;
|
|
308
309
|
}
|
|
309
310
|
|
|
310
311
|
get workWithoutBuildings() {
|
|
@@ -314,4 +315,23 @@ export default class ProjectFormController extends ImportController {
|
|
|
314
315
|
get workWithBuildings() {
|
|
315
316
|
return this.project.work.filter((work) => !work.building.isNew);
|
|
316
317
|
}
|
|
318
|
+
|
|
319
|
+
@action
|
|
320
|
+
isClientMismatch(changeset) {
|
|
321
|
+
const personNamePath =
|
|
322
|
+
"client.identification.personIdentification.officialName";
|
|
323
|
+
const organisationNamePath =
|
|
324
|
+
"client.identification.organisationIdentification.organisationName";
|
|
325
|
+
|
|
326
|
+
const conditionHolds = (isEqual, v, w) => (isEqual ? v === w : v !== w);
|
|
327
|
+
const isMismatch = (value, isEqual, path) =>
|
|
328
|
+
conditionHolds(isEqual, changeset.get("typeOfClient"), value) && changeset
|
|
329
|
+
? changeset.get(path)
|
|
330
|
+
: false;
|
|
331
|
+
|
|
332
|
+
return (
|
|
333
|
+
isMismatch(6161, true, organisationNamePath) ||
|
|
334
|
+
isMismatch(6161, false, personNamePath)
|
|
335
|
+
);
|
|
336
|
+
}
|
|
317
337
|
}
|
|
@@ -65,6 +65,6 @@ export default class ProjectController extends Controller {
|
|
|
65
65
|
.peekAll("gwr-link")
|
|
66
66
|
.find(({ eproid }) => Number(eproid) === this.activeProject);
|
|
67
67
|
await link.destroyRecord();
|
|
68
|
-
await this.constructionProject.all.perform();
|
|
68
|
+
await this.constructionProject.all.perform(this.model);
|
|
69
69
|
}
|
|
70
70
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import Helper from "@ember/component/helper";
|
|
2
|
+
import { inject as service } from "@ember/service";
|
|
3
|
+
import ENV from "ember-ebau-gwr/config/environment";
|
|
4
|
+
|
|
5
|
+
export default class HousingStatLink extends Helper {
|
|
6
|
+
@service config;
|
|
7
|
+
|
|
8
|
+
compute() {
|
|
9
|
+
return this.config.isTestEnvironment === false
|
|
10
|
+
? ENV.housingStatLinkProd
|
|
11
|
+
: ENV.housingStatLinkTest;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { helper } from "@ember/component/helper";
|
|
2
|
+
import { get } from "@ember/object";
|
|
3
|
+
|
|
4
|
+
function showModelField([field, changeset, importData]) {
|
|
5
|
+
const isSet = (value) => value !== undefined && value !== null;
|
|
6
|
+
|
|
7
|
+
return changeset
|
|
8
|
+
? isSet(changeset.get(field)) ||
|
|
9
|
+
(importData && isSet(get(importData.data, field)))
|
|
10
|
+
: false;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default helper(showModelField);
|
package/addon/models/building.js
CHANGED
|
@@ -325,7 +325,7 @@ export default class Building extends XMLModel {
|
|
|
325
325
|
[this.STATUS_NOT_REALIZED]: [],
|
|
326
326
|
};
|
|
327
327
|
|
|
328
|
-
static
|
|
328
|
+
static transitionHint = {
|
|
329
329
|
[this.STATUS_PROJECTED]: {
|
|
330
330
|
[this.STATUS_APPROVED]: true,
|
|
331
331
|
[this.STATUS_NOT_REALIZED]: true,
|