ember-ebau-gwr 2.5.1 → 3.0.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/.github/workflows/test.yml +3 -3
- package/CHANGELOG.md +101 -0
- package/addon/components/import-modal/building-data.hbs +64 -0
- package/addon/components/import-modal/dwelling-data.hbs +30 -0
- package/addon/components/import-modal/entrance-data.hbs +14 -0
- package/addon/components/import-modal.hbs +54 -0
- package/addon/components/import-modal.js +6 -0
- package/addon/components/link-building-modal.hbs +17 -14
- package/addon/components/link-building-modal.js +11 -1
- package/addon/components/link-street.hbs +83 -0
- package/addon/components/link-street.js +6 -0
- package/addon/components/linked-models.hbs +16 -2
- package/addon/components/linked-models.js +6 -0
- package/addon/components/linked-projects.hbs +2 -1
- package/addon/components/linked-projects.js +6 -0
- package/addon/components/model-form/date.hbs +1 -0
- package/addon/components/model-form/date.js +6 -6
- package/addon/components/model-form/diff.hbs +40 -27
- package/addon/components/model-form/field.hbs +13 -8
- package/addon/components/model-form/field.js +22 -6
- package/addon/components/model-form/header/actions.hbs +67 -35
- package/addon/components/model-form/header/actions.js +6 -0
- package/addon/components/model-form/header/status-selector.hbs +22 -5
- package/addon/components/model-form/header/status-selector.js +19 -4
- package/addon/components/model-form/header.hbs +10 -4
- package/addon/components/model-form.hbs +14 -9
- package/addon/components/model-form.js +20 -6
- package/addon/components/project-form/date.hbs +1 -1
- package/addon/components/project-form/field.hbs +1 -1
- package/addon/components/project-form/field.js +1 -1
- package/addon/components/search/filters.hbs +1 -1
- package/addon/components/search/filters.js +3 -3
- package/addon/controllers/building/edit/dwelling/edit.js +61 -5
- package/addon/controllers/building/edit/dwellings.js +3 -0
- package/addon/controllers/building/edit/entrance/edit/index.js +22 -8
- package/addon/controllers/building/edit/entrance/edit/link-street.js +30 -6
- package/addon/controllers/building/edit/entrances.js +18 -2
- package/addon/controllers/building/edit/form.js +109 -27
- package/addon/controllers/import.js +70 -0
- package/addon/controllers/project/form.js +221 -20
- package/addon/controllers/project/linked-buildings.js +20 -1
- package/addon/controllers/project.js +19 -0
- package/addon/controllers/search-building.js +17 -0
- package/addon/helpers/is-unset.js +7 -0
- package/addon/models/building-entrance.js +4 -5
- package/addon/models/building-work.js +11 -9
- package/addon/models/building.js +171 -114
- package/addon/models/client.js +1 -1
- package/addon/models/construction-project.js +148 -66
- package/addon/models/construction-projects-list.js +1 -1
- package/addon/models/dwelling.js +60 -66
- package/addon/models/identification.js +4 -17
- package/addon/models/options.js +1 -0
- package/addon/models/realestate-identification.js +8 -14
- package/addon/models.js +1 -2
- package/addon/routes/building/edit/dwelling/new.js +3 -0
- package/addon/routes/building/edit/entrance/edit/index.js +7 -0
- package/addon/routes/building/edit/entrance/edit/link-street.js +8 -1
- package/addon/routes/building/edit/entrance/new.js +12 -2
- package/addon/routes/building/edit/index.js +13 -1
- package/addon/routes/building/edit.js +5 -1
- package/addon/routes/building/new.js +25 -0
- package/addon/routes/project/form.js +5 -0
- package/addon/routes/project/new.js +3 -2
- package/addon/services/building-entrance.js +1 -1
- package/addon/services/building.js +412 -55
- package/addon/services/construction-project.js +637 -5
- package/addon/services/dwelling.js +238 -5
- package/addon/services/gwr.js +4 -2
- package/addon/templates/building/edit/dwelling/edit.hbs +20 -13
- package/addon/templates/building/edit/entrance/edit/index.hbs +16 -60
- package/addon/templates/building/edit/entrance/edit/link-street.hbs +9 -4
- package/addon/templates/building/edit/entrances.hbs +6 -3
- package/addon/templates/building/edit/form.hbs +130 -77
- package/addon/templates/project/errors.hbs +128 -126
- package/addon/templates/project/form.hbs +179 -71
- package/addon/templates/project/linked-buildings.hbs +20 -4
- package/addon/templates/project.hbs +40 -5
- package/addon/templates/search-building.hbs +9 -0
- package/addon/templates/search-project.hbs +4 -0
- package/addon/validations/building-entrance.js +5 -0
- package/addon/validations/building-work.js +30 -10
- package/addon/validations/construction-project.js +12 -0
- package/addon/validations/coordinates.js +7 -5
- package/addon/validations/dwelling.js +10 -0
- package/addon/validations/realestate-identification.js +39 -0
- package/addon/validations/status/status-building-change.js +10 -1
- package/addon/validations/status/status-building-correction.js +13 -3
- package/addon/validations/status/status-dwelling-change.js +20 -12
- package/addon/validations/status/status-dwelling-correction.js +19 -11
- package/addon/validations/status/status-project-change.js +24 -4
- package/addon/validations/status/status-project-correction.js +31 -10
- package/addon/xml/helpers.js +4 -0
- package/addon/xml/templates/building.js +35 -21
- package/addon/xml/templates/construction-project.js +3 -4
- package/addon/xml/templates/dwelling.js +7 -0
- package/app/styles/ember-ebau-gwr.scss +36 -6
- package/package.json +9 -5
- package/translations/building/de.yaml +42 -6
- package/translations/building-entrance/de.yaml +6 -11
- package/translations/construction-project/de.yaml +13 -5
- package/translations/de.yaml +72 -5
- package/translations/dwelling/de.yaml +7 -4
- package/addon/validators/presence-nested.js +0 -47
|
@@ -1,26 +1,32 @@
|
|
|
1
|
-
import Controller from "@ember/controller";
|
|
2
1
|
import { action } from "@ember/object";
|
|
3
2
|
import { inject as service } from "@ember/service";
|
|
4
3
|
import { tracked } from "@glimmer/tracking";
|
|
5
4
|
import { task, dropTask, lastValue } from "ember-concurrency-decorators";
|
|
5
|
+
import ImportController from "ember-ebau-gwr/controllers/import";
|
|
6
|
+
import BuildingWork from "ember-ebau-gwr/models/building-work";
|
|
7
|
+
import ConstructionProject from "ember-ebau-gwr/models/construction-project";
|
|
6
8
|
import Options from "ember-ebau-gwr/models/options";
|
|
7
9
|
import ConstructionProjectValidations from "ember-ebau-gwr/validations/construction-project";
|
|
8
10
|
|
|
9
|
-
export default class ProjectFormController extends
|
|
10
|
-
|
|
11
|
+
export default class ProjectFormController extends ImportController {
|
|
12
|
+
importModelName = "project";
|
|
11
13
|
ConstructionProjectValidations = ConstructionProjectValidations;
|
|
14
|
+
kindOfWorkOptions = BuildingWork.kindOfWorkOptions;
|
|
12
15
|
|
|
13
16
|
@service constructionProject;
|
|
17
|
+
@service building;
|
|
18
|
+
@service dwelling;
|
|
14
19
|
@service config;
|
|
15
|
-
@service dataImport;
|
|
16
20
|
@service store;
|
|
17
21
|
@service router;
|
|
18
22
|
@service intl;
|
|
19
23
|
@service notification;
|
|
20
24
|
|
|
21
|
-
@tracked
|
|
22
|
-
@tracked
|
|
25
|
+
@tracked buildingWork;
|
|
26
|
+
@tracked typeOfConstructionProject;
|
|
27
|
+
@tracked removedWork = [];
|
|
23
28
|
@tracked errors;
|
|
29
|
+
@tracked showConfirmationDialog = false;
|
|
24
30
|
|
|
25
31
|
choiceOptions = Options;
|
|
26
32
|
|
|
@@ -38,23 +44,24 @@ export default class ProjectFormController extends Controller {
|
|
|
38
44
|
@lastValue("fetchProject") project;
|
|
39
45
|
@task
|
|
40
46
|
*fetchProject() {
|
|
47
|
+
yield this.fetchCalumaData.perform();
|
|
48
|
+
// Add a new default work for new projects so we don't have to
|
|
49
|
+
// validate if the user has attached a work or not.
|
|
50
|
+
if (this.model.project?.isNew && !this.model.project?.work.length) {
|
|
51
|
+
this.model.project.work = [new BuildingWork()];
|
|
52
|
+
}
|
|
41
53
|
const project = this.model.project?.isNew
|
|
42
54
|
? this.model.project
|
|
43
55
|
: yield this.constructionProject.getFromCacheOrApi(this.model.projectId);
|
|
44
|
-
this.
|
|
56
|
+
this.buildingWork = project.work.filter((work) => !work.building.isNew);
|
|
57
|
+
this.typeOfConstructionProject = project.typeOfConstructionProject;
|
|
45
58
|
this.errors = [];
|
|
46
59
|
return project;
|
|
47
60
|
}
|
|
48
61
|
|
|
49
|
-
@lastValue("fetchCalumaData") importData;
|
|
50
|
-
@task
|
|
51
|
-
*fetchCalumaData() {
|
|
52
|
-
return yield this.dataImport.fetchProject(this.model.instanceId);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
62
|
@action
|
|
56
63
|
cancelMerge() {
|
|
57
|
-
this.
|
|
64
|
+
this.resetImport();
|
|
58
65
|
this.fetchProject.perform();
|
|
59
66
|
}
|
|
60
67
|
|
|
@@ -72,13 +79,50 @@ export default class ProjectFormController extends Controller {
|
|
|
72
79
|
yield this.constructionProject.all.perform(this.model.instanceId);
|
|
73
80
|
this.transitionToRoute("project.form", project.EPROID);
|
|
74
81
|
} else {
|
|
82
|
+
if (
|
|
83
|
+
(this.typeOfConstructionProject === 6010 &&
|
|
84
|
+
this.workWithBuildings.length) ||
|
|
85
|
+
// If typeOfConstruction === hochbau we only display the alert
|
|
86
|
+
// if we have additional works beside the default work
|
|
87
|
+
(this.typeOfConstructionProject === 6011 &&
|
|
88
|
+
this.workWithoutBuildings.length > 1)
|
|
89
|
+
) {
|
|
90
|
+
this.showConfirmationDialog = true;
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (this.typeOfConstructionProject === 6010) {
|
|
95
|
+
const added = this.project.work.filter((work) => work.isNew);
|
|
96
|
+
yield Promise.all(
|
|
97
|
+
added.map((work) =>
|
|
98
|
+
this.constructionProject.addWorkToProject(
|
|
99
|
+
this.model.projectId,
|
|
100
|
+
work
|
|
101
|
+
)
|
|
102
|
+
)
|
|
103
|
+
);
|
|
104
|
+
|
|
105
|
+
yield Promise.all(
|
|
106
|
+
this.removedWork.map((work) =>
|
|
107
|
+
this.constructionProject.removeWorkFromProject(
|
|
108
|
+
this.model.projectId,
|
|
109
|
+
work.ARBID
|
|
110
|
+
)
|
|
111
|
+
)
|
|
112
|
+
);
|
|
113
|
+
this.removedWork = [];
|
|
114
|
+
}
|
|
75
115
|
yield this.constructionProject.update(this.project);
|
|
76
116
|
}
|
|
77
|
-
|
|
117
|
+
|
|
118
|
+
this.resetImport();
|
|
78
119
|
this.errors = [];
|
|
79
120
|
this.notification.success(
|
|
80
121
|
this.intl.t("ember-gwr.constructionProject.saveSuccess")
|
|
81
122
|
);
|
|
123
|
+
// refresh work list
|
|
124
|
+
this.constructionProject.clearCache(this.model.projectId);
|
|
125
|
+
this.fetchProject.perform();
|
|
82
126
|
} catch (error) {
|
|
83
127
|
this.errors = error;
|
|
84
128
|
this.notification.danger(
|
|
@@ -87,13 +131,45 @@ export default class ProjectFormController extends Controller {
|
|
|
87
131
|
}
|
|
88
132
|
}
|
|
89
133
|
|
|
134
|
+
concatStates(states) {
|
|
135
|
+
if (states.length === 1) {
|
|
136
|
+
return this.intl.t(`ember-gwr.lifeCycles.states.${states[0]}`);
|
|
137
|
+
}
|
|
138
|
+
const tail = states.pop();
|
|
139
|
+
return `${states
|
|
140
|
+
.map((state) => this.intl.t(`ember-gwr.lifeCycles.states.${state}`))
|
|
141
|
+
.join(", ")} ${this.intl.t("ember-gwr.general.or")} ${this.intl.t(
|
|
142
|
+
`ember-gwr.lifeCycles.states.${tail}`
|
|
143
|
+
)}`;
|
|
144
|
+
}
|
|
145
|
+
|
|
90
146
|
@task
|
|
91
|
-
*transitionState(currentStatus, newStatus) {
|
|
147
|
+
*transitionState(currentStatus, newStatus, isCascading) {
|
|
92
148
|
try {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
149
|
+
const transition =
|
|
150
|
+
ConstructionProject.projectTransitionMapping[currentStatus][newStatus];
|
|
151
|
+
|
|
152
|
+
// reload in case linked objects have been updated
|
|
153
|
+
const project = yield this.constructionProject.get(this.model.projectId);
|
|
154
|
+
this.project.work = project.work;
|
|
155
|
+
|
|
156
|
+
// execute dry-run, throws error if requirements don't hold
|
|
157
|
+
yield this.constructionProject[transition](
|
|
158
|
+
transition,
|
|
159
|
+
3,
|
|
160
|
+
true,
|
|
161
|
+
this.project
|
|
162
|
+
);
|
|
163
|
+
|
|
164
|
+
// execute transition(s)
|
|
165
|
+
// cascade level:
|
|
166
|
+
// 3: execute transition on linked buildings and dwellings
|
|
167
|
+
// 1: only perform transition on project
|
|
168
|
+
yield this.constructionProject[transition](
|
|
169
|
+
transition,
|
|
170
|
+
isCascading ? 3 : 1,
|
|
171
|
+
false,
|
|
172
|
+
this.project
|
|
97
173
|
);
|
|
98
174
|
yield this.constructionProject.clearCache(this.model.projectId);
|
|
99
175
|
this.fetchProject.perform(); // reload for errors;
|
|
@@ -105,6 +181,24 @@ export default class ProjectFormController extends Controller {
|
|
|
105
181
|
this.notification.danger(
|
|
106
182
|
this.intl.t("ember-gwr.constructionProject.saveError")
|
|
107
183
|
);
|
|
184
|
+
|
|
185
|
+
if (error.isLifeCycleError) {
|
|
186
|
+
const errorType = error.dwellingId
|
|
187
|
+
? "statusErrorDwelling"
|
|
188
|
+
: "statusErrorBuilding";
|
|
189
|
+
throw [
|
|
190
|
+
this.intl.t(`ember-gwr.lifeCycles.${errorType}`, {
|
|
191
|
+
dwellingId: error.dwellingId,
|
|
192
|
+
buildingId: error.buildingId,
|
|
193
|
+
states: this.concatStates(error.states),
|
|
194
|
+
href: error.dwellingId
|
|
195
|
+
? `/${this.model.instanceId}/${this.project.EPROID}/building/${error.buildingId}/dwelling/${error.dwellingId}`
|
|
196
|
+
: `/${this.model.instanceId}/${this.project.EPROID}/building/${error.buildingId}/form`,
|
|
197
|
+
htmlSafe: true,
|
|
198
|
+
}),
|
|
199
|
+
];
|
|
200
|
+
}
|
|
201
|
+
|
|
108
202
|
throw error;
|
|
109
203
|
}
|
|
110
204
|
}
|
|
@@ -139,4 +233,111 @@ export default class ProjectFormController extends Controller {
|
|
|
139
233
|
getCorrectionParameters(newStatus) {
|
|
140
234
|
return this.constructionProject.getCorrectionParameters(newStatus);
|
|
141
235
|
}
|
|
236
|
+
|
|
237
|
+
@action
|
|
238
|
+
getChangeHint(currentStatus, newStatus) {
|
|
239
|
+
return this.constructionProject.getChangeHint(currentStatus, newStatus);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
@action
|
|
243
|
+
updateWork(work, attr, value) {
|
|
244
|
+
work[attr] = value;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
@action
|
|
248
|
+
removeWorkLink(buildingWork) {
|
|
249
|
+
if (!buildingWork.isNew) {
|
|
250
|
+
this.removedWork = [...this.removedWork, buildingWork];
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
this.project.work = this.project.work.filter(
|
|
254
|
+
(work) => work !== buildingWork
|
|
255
|
+
);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
@action
|
|
259
|
+
addWorkLink() {
|
|
260
|
+
this.project.work = [...this.project.work, new BuildingWork()];
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
@task
|
|
264
|
+
*addDefaultWork() {
|
|
265
|
+
const buildingWork = yield this.constructionProject.addDefaultWork(
|
|
266
|
+
this.project.EPROID
|
|
267
|
+
);
|
|
268
|
+
this.project.work = [...this.project.work, buildingWork];
|
|
269
|
+
return buildingWork;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
@task
|
|
273
|
+
*removeBuildings() {
|
|
274
|
+
return yield Promise.all(
|
|
275
|
+
this.workWithBuildings.map(async (work) => {
|
|
276
|
+
await this.building.unbindBuildingFromConstructionProject(
|
|
277
|
+
this.project.EPROID,
|
|
278
|
+
work.building.EGID
|
|
279
|
+
);
|
|
280
|
+
// locally remove building from work list
|
|
281
|
+
// so that it runs through second save check
|
|
282
|
+
this.project.work = this.project.work.filter((w) => w !== work);
|
|
283
|
+
})
|
|
284
|
+
);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
@task
|
|
288
|
+
*removeWork() {
|
|
289
|
+
// always create default work of type "Neubau" to
|
|
290
|
+
// prevent errors from API, remove all others
|
|
291
|
+
const defaultWork = yield this.addDefaultWork.perform();
|
|
292
|
+
return yield Promise.all(
|
|
293
|
+
this.workWithoutBuildings.map(async (work) => {
|
|
294
|
+
if (work.ARBID !== defaultWork.ARBID) {
|
|
295
|
+
if (!work.isNew) {
|
|
296
|
+
await this.constructionProject.removeWorkFromProject(
|
|
297
|
+
this.project.EPROID,
|
|
298
|
+
work.ARBID
|
|
299
|
+
);
|
|
300
|
+
}
|
|
301
|
+
// locally remove work from work list
|
|
302
|
+
// so that it runs through second save check
|
|
303
|
+
this.project.work = this.project.work.filter((w) => w !== work);
|
|
304
|
+
}
|
|
305
|
+
})
|
|
306
|
+
);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
@task
|
|
310
|
+
*processTypeOfConstructionProjectChange() {
|
|
311
|
+
this.showConfirmationDialog = false;
|
|
312
|
+
|
|
313
|
+
if (
|
|
314
|
+
this.typeOfConstructionProject === 6010 &&
|
|
315
|
+
this.workWithBuildings.length
|
|
316
|
+
) {
|
|
317
|
+
if (!this.workWithoutBuildings.length) {
|
|
318
|
+
yield this.addDefaultWork.perform();
|
|
319
|
+
}
|
|
320
|
+
yield this.removeBuildings.perform();
|
|
321
|
+
} else if (
|
|
322
|
+
this.typeOfConstructionProject === 6011 &&
|
|
323
|
+
this.workWithoutBuildings.length
|
|
324
|
+
) {
|
|
325
|
+
yield this.removeWork.perform();
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
this.saveProject.perform();
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
@action
|
|
332
|
+
cancelTypeOfConstructionProjectChange() {
|
|
333
|
+
this.showConfirmationDialog = false;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
get workWithoutBuildings() {
|
|
337
|
+
return this.project.work.filter((work) => work.building.isNew);
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
get workWithBuildings() {
|
|
341
|
+
return this.project.work.filter((work) => !work.building.isNew);
|
|
342
|
+
}
|
|
142
343
|
}
|
|
@@ -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-decorators";
|
|
5
6
|
|
|
6
7
|
export default class ProjectLinkedBuildingsController extends Controller {
|
|
@@ -9,13 +10,24 @@ export default class ProjectLinkedBuildingsController extends Controller {
|
|
|
9
10
|
@service intl;
|
|
10
11
|
@service notification;
|
|
11
12
|
|
|
13
|
+
@tracked workWithBuildings;
|
|
14
|
+
@tracked workWithoutBuildings;
|
|
15
|
+
@tracked project;
|
|
16
|
+
|
|
12
17
|
@task
|
|
13
18
|
*fetchBuildings() {
|
|
14
19
|
try {
|
|
15
20
|
const project = yield this.constructionProject.getFromCacheOrApi(
|
|
16
21
|
this.model
|
|
17
22
|
);
|
|
18
|
-
|
|
23
|
+
this.project = project;
|
|
24
|
+
this.workWithoutBuildings = project.work.filter(
|
|
25
|
+
(work) => work.building.isNew
|
|
26
|
+
);
|
|
27
|
+
this.workWithBuildings = project.work.filter(
|
|
28
|
+
(work) => !work.building.isNew
|
|
29
|
+
);
|
|
30
|
+
return this.workWithBuildings;
|
|
19
31
|
} catch (error) {
|
|
20
32
|
console.error(error);
|
|
21
33
|
this.notification.danger(this.intl.t("ember-gwr.linkedBuildings.error"));
|
|
@@ -29,6 +41,13 @@ export default class ProjectLinkedBuildingsController extends Controller {
|
|
|
29
41
|
this.model,
|
|
30
42
|
EGID
|
|
31
43
|
);
|
|
44
|
+
|
|
45
|
+
if (
|
|
46
|
+
!this.workWithoutBuildings.length &&
|
|
47
|
+
this.workWithBuildings.length === 1
|
|
48
|
+
) {
|
|
49
|
+
await this.constructionProject.addDefaultWork(this.model);
|
|
50
|
+
}
|
|
32
51
|
await this.fetchBuildings.perform();
|
|
33
52
|
} catch (error) {
|
|
34
53
|
console.error(error);
|
|
@@ -5,7 +5,9 @@ import { inject as service } from "@ember/service";
|
|
|
5
5
|
export default class ProjectController extends Controller {
|
|
6
6
|
@service router;
|
|
7
7
|
@service store;
|
|
8
|
+
@service config;
|
|
8
9
|
@service constructionProject;
|
|
10
|
+
@service intl;
|
|
9
11
|
|
|
10
12
|
get displayLandingPage() {
|
|
11
13
|
return (
|
|
@@ -15,6 +17,23 @@ export default class ProjectController extends Controller {
|
|
|
15
17
|
);
|
|
16
18
|
}
|
|
17
19
|
|
|
20
|
+
get buildingTabInfoText() {
|
|
21
|
+
if (!this.activeProject) {
|
|
22
|
+
return this.intl.t(
|
|
23
|
+
"ember-gwr.linkedBuildings.buildingDisabledForNewProject"
|
|
24
|
+
);
|
|
25
|
+
} else if (
|
|
26
|
+
this.projects.find((project) => project.EPROID === this.activeProject)
|
|
27
|
+
?.typeOfConstructionProject !== 6011
|
|
28
|
+
) {
|
|
29
|
+
return this.intl.t(
|
|
30
|
+
"ember-gwr.linkedBuildings.buildingDisabledForInfrastructure"
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
|
|
18
37
|
get activeProject() {
|
|
19
38
|
return Number(this.router.currentRoute.params.project_id);
|
|
20
39
|
}
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
|
|
11
11
|
export default class SearchBuildingController extends Controller {
|
|
12
12
|
@service building;
|
|
13
|
+
@service constructionProject;
|
|
13
14
|
@service intl;
|
|
14
15
|
@service notification;
|
|
15
16
|
|
|
@@ -39,6 +40,22 @@ export default class SearchBuildingController extends Controller {
|
|
|
39
40
|
EGID,
|
|
40
41
|
buildingWork
|
|
41
42
|
);
|
|
43
|
+
|
|
44
|
+
// refresh work list
|
|
45
|
+
const project = yield this.constructionProject.get(this.model);
|
|
46
|
+
|
|
47
|
+
// remove default work
|
|
48
|
+
yield Promise.all(
|
|
49
|
+
project.work.map((work) =>
|
|
50
|
+
work.building.isNew
|
|
51
|
+
? this.constructionProject.removeWorkFromProject(
|
|
52
|
+
this.model,
|
|
53
|
+
work.ARBID
|
|
54
|
+
)
|
|
55
|
+
: work
|
|
56
|
+
)
|
|
57
|
+
);
|
|
58
|
+
|
|
42
59
|
this.activeBuilding = null;
|
|
43
60
|
this.transitionToRoute("project.linked-buildings", this.model);
|
|
44
61
|
this.notification.success(
|
|
@@ -55,9 +55,7 @@ export default class BuildingEntrance extends XMLModel {
|
|
|
55
55
|
|
|
56
56
|
static template = `
|
|
57
57
|
{{#if model.isNew}}
|
|
58
|
-
{{
|
|
59
|
-
<ns2:buildingEntranceNo>{{model.buildingEntranceNo}}</ns2:buildingEntranceNo>
|
|
60
|
-
{{/if}}
|
|
58
|
+
{{{modelField model "buildingEntranceNo"}}}
|
|
61
59
|
<ns2:isOfficialAddress>{{model.isOfficialAddress}}</ns2:isOfficialAddress>
|
|
62
60
|
{{> Street model=model.street}}
|
|
63
61
|
{{> Locality model=model.locality}}
|
|
@@ -68,9 +66,10 @@ export default class BuildingEntrance extends XMLModel {
|
|
|
68
66
|
<ns2:isOfficialAddress>{{model.isOfficialAddress}}</ns2:isOfficialAddress>
|
|
69
67
|
{{> Street model=model.street}}
|
|
70
68
|
{{> Locality model=model.locality}}
|
|
71
|
-
{{! This is not wokrking for some reason}}
|
|
72
|
-
{{> Coordinates model=model.coordinates}}
|
|
73
69
|
</ns2:buildingEntrance>
|
|
74
70
|
{{/if}}
|
|
75
71
|
`;
|
|
72
|
+
|
|
73
|
+
static DEACTIVATION_ERROR =
|
|
74
|
+
"Cannot deactivate an entrance while active dwellings are still linked to it";
|
|
76
75
|
}
|
|
@@ -41,15 +41,17 @@ export default class BuildingWork extends XMLModel {
|
|
|
41
41
|
static template = `
|
|
42
42
|
<ns2:work>
|
|
43
43
|
<ns2:kindOfWork>{{model.kindOfWork}}</ns2:kindOfWork>
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
44
|
+
{{#if (eq model.kindOfWork 6002)}}
|
|
45
|
+
<ns2:energeticRestauration>{{model.energeticRestauration}}</ns2:energeticRestauration>
|
|
46
|
+
<ns2:renovationHeatingsystem>{{model.renovationHeatingsystem}}</ns2:renovationHeatingsystem>
|
|
47
|
+
<ns2:innerConversionRenovation>{{model.innerConversionRenovation}}</ns2:innerConversionRenovation>
|
|
48
|
+
<ns2:conversion>{{model.conversion}}</ns2:conversion>
|
|
49
|
+
<ns2:extensionHeighteningHeated>{{model.extensionHeighteningHeated}}</ns2:extensionHeighteningHeated>
|
|
50
|
+
<ns2:extensionHeighteningNotHeated>{{model.extensionHeighteningNotHeated}}</ns2:extensionHeighteningNotHeated>
|
|
51
|
+
<ns2:thermicSolarFacility>{{model.thermicSolarFacility}}</ns2:thermicSolarFacility>
|
|
52
|
+
<ns2:photovoltaicSolarFacility>{{model.photovoltaicSolarFacility}}</ns2:photovoltaicSolarFacility>
|
|
53
|
+
<ns2:otherWorks>{{model.otherWorks}}</ns2:otherWorks>
|
|
54
|
+
{{/if}}
|
|
53
55
|
</ns2:work>
|
|
54
56
|
`;
|
|
55
57
|
|