ember-ebau-gwr 7.4.3 → 7.4.5

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 (46) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +2 -2
  3. package/addon/components/login-modal.js +2 -2
  4. package/addon/components/model-form/field.js +1 -1
  5. package/addon/components/model-form/header/status-selector.js +7 -7
  6. package/addon/components/model-form.js +3 -3
  7. package/addon/components/project-nav.js +3 -3
  8. package/addon/components/quarterly-closure/close-survey-button.js +3 -3
  9. package/addon/components/quarterly-closure/error-list/project-errors.js +7 -3
  10. package/addon/components/quarterly-closure/error-list/survey-department-errors.js +2 -2
  11. package/addon/components/search.js +2 -2
  12. package/addon/components/validated-form-error.js +1 -1
  13. package/addon/controllers/building/edit/dwelling/edit.js +10 -10
  14. package/addon/controllers/building/edit/dwellings.js +4 -4
  15. package/addon/controllers/building/edit/entrance/edit/index.js +7 -7
  16. package/addon/controllers/building/edit/entrance/edit/link-street.js +6 -6
  17. package/addon/controllers/building/edit/entrances.js +4 -4
  18. package/addon/controllers/building/edit/form.js +12 -12
  19. package/addon/controllers/project/errors.js +9 -10
  20. package/addon/controllers/project/form.js +18 -18
  21. package/addon/controllers/project/linked-buildings.js +5 -5
  22. package/addon/controllers/search-building.js +8 -8
  23. package/addon/controllers/search-project.js +3 -3
  24. package/addon/helpers/current-quarter.js +1 -1
  25. package/addon/models/building.js +1 -1
  26. package/addon/models/buildings-list.js +1 -1
  27. package/addon/models/construction-project.js +14 -14
  28. package/addon/models/dwelling.js +8 -5
  29. package/addon/models/municipalities.js +103 -0
  30. package/addon/models/xml-model.js +2 -2
  31. package/addon/modifiers/in-viewport.js +2 -2
  32. package/addon/modifiers/inverse-background.js +1 -1
  33. package/addon/resources/import.js +4 -5
  34. package/addon/services/auth-fetch.js +2 -2
  35. package/addon/services/building-entrance.js +10 -10
  36. package/addon/services/building.js +38 -38
  37. package/addon/services/construction-project.js +49 -49
  38. package/addon/services/dwelling.js +16 -16
  39. package/addon/services/gwr.js +6 -6
  40. package/addon/services/quarterly-closure.js +9 -9
  41. package/addon/services/xml.js +1 -1
  42. package/addon/utils.js +2 -2
  43. package/addon/validators/range-state.js +1 -1
  44. package/package.json +53 -49
  45. package/tsconfig.declarations.json +10 -0
  46. package/app/mirage-models/gwr-link.js +0 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [7.4.5](https://github.com/inosca/ember-ebau-gwr/compare/v7.4.4...v7.4.5) (2024-01-30)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * add gr municipalities ([f2e54e2](https://github.com/inosca/ember-ebau-gwr/commit/f2e54e2e678eda2d26b9dbdaf1b909661ac8195a))
7
+
8
+ ## [7.4.4](https://github.com/inosca/ember-ebau-gwr/compare/v7.4.3...v7.4.4) (2023-12-12)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **deps:** update dependencies ([7fe9406](https://github.com/inosca/ember-ebau-gwr/commit/7fe94068e746f065bd6ab4b4d72e416276636795))
14
+
1
15
  ## [7.4.3](https://github.com/inosca/ember-ebau-gwr/compare/v7.4.2...v7.4.3) (2023-09-21)
2
16
 
3
17
 
package/README.md CHANGED
@@ -6,9 +6,9 @@ Ember Engine for the [inosca/ebau-gwr](https://github.com/inosca/ebau-gwr) backe
6
6
 
7
7
  ```
8
8
  # start a local CORS proxy
9
- yarn proxy
9
+ pnpm proxy
10
10
  # start dev server
11
- yarn start
11
+ pnpm start
12
12
  ```
13
13
 
14
14
  ## Compatibility
@@ -21,7 +21,7 @@ export default class LoginModalComponent extends Component {
21
21
  const token = await this.authFetch.housingStatToken.perform(
22
22
  this.username,
23
23
  this.password,
24
- this.municipality
24
+ this.municipality,
25
25
  );
26
26
  if (token) {
27
27
  this.authFetch.showAuthModal = false;
@@ -41,7 +41,7 @@ export default class LoginModalComponent extends Component {
41
41
  get sortedMunicipalities() {
42
42
  const municipalities = this.municipalities;
43
43
  municipalities.sort((a, b) =>
44
- a.name < b.name ? -1 : a.name > b.name ? 1 : 0
44
+ a.name < b.name ? -1 : a.name > b.name ? 1 : 0,
45
45
  );
46
46
  return municipalities;
47
47
  }
@@ -87,7 +87,7 @@ export default class ModelFormFieldComponent extends Component {
87
87
  const sortBy = this.args.sortBy;
88
88
  if (sortBy) {
89
89
  options = options.sort((a, b) =>
90
- a[sortBy].localeCompare(b[sortBy], this.intl.primaryLocale)
90
+ a[sortBy].localeCompare(b[sortBy], this.intl.primaryLocale),
91
91
  );
92
92
  }
93
93
 
@@ -25,16 +25,16 @@ export default class ModelFormHeaderStatusSelectorComponent extends Component {
25
25
  this.changesetChange = new Changeset(
26
26
  this.args.model,
27
27
  lookupValidator(statusValidationsChange),
28
- statusValidationsChange
28
+ statusValidationsChange,
29
29
  );
30
30
  const statusValidationsCorrection = statusValidation(
31
31
  this.args.modelName,
32
- false
32
+ false,
33
33
  );
34
34
  this.changesetCorrection = new Changeset(
35
35
  this.args.model,
36
36
  lookupValidator(statusValidationsCorrection),
37
- statusValidationsCorrection
37
+ statusValidationsCorrection,
38
38
  );
39
39
 
40
40
  this.modelStatus = this.args.model[this.args.modelStatusField];
@@ -54,7 +54,7 @@ export default class ModelFormHeaderStatusSelectorComponent extends Component {
54
54
  return this.args.modelStatusOptions.map((option) => ({
55
55
  status: option,
56
56
  label: this.intl.t(
57
- `ember-gwr.lifeCycles.${this.args.modelName}.statusOptions.${option}`
57
+ `ember-gwr.lifeCycles.${this.args.modelName}.statusOptions.${option}`,
58
58
  ),
59
59
  }));
60
60
  }
@@ -89,8 +89,8 @@ export default class ModelFormHeaderStatusSelectorComponent extends Component {
89
89
  const errorsField = !parameters.length
90
90
  ? "errors"
91
91
  : isChange
92
- ? "changeErrors"
93
- : "correctionErrors";
92
+ ? "changeErrors"
93
+ : "correctionErrors";
94
94
 
95
95
  const changeset = isChange
96
96
  ? this.changesetChange
@@ -120,7 +120,7 @@ export default class ModelFormHeaderStatusSelectorComponent extends Component {
120
120
  ? this.args.onStatusChange.perform(
121
121
  this.modelStatus,
122
122
  this.newStatus,
123
- this.isCascading
123
+ this.isCascading,
124
124
  )
125
125
  : this.args.onStatusCorrection.perform(this.newStatus);
126
126
 
@@ -63,7 +63,7 @@ export default class ModelFormComponent extends Component {
63
63
 
64
64
  finishImport() {
65
65
  this.notification.success(
66
- this.intl.t("ember-gwr.components.modelForm.diff.resolved")
66
+ this.intl.t("ember-gwr.components.modelForm.diff.resolved"),
67
67
  );
68
68
  this.router.externalRouter.transitionTo({
69
69
  queryParams: { import: false, index: undefined },
@@ -112,8 +112,8 @@ export default class ModelFormComponent extends Component {
112
112
  typeof value === "object"
113
113
  ? deepMerge(original[key], objectToApply[key])
114
114
  : isIsoDate(value) // Date casts necessary for import
115
- ? (original[key] = new Date(value))
116
- : (original[key] = value);
115
+ ? (original[key] = new Date(value))
116
+ : (original[key] = value);
117
117
  }
118
118
  });
119
119
  };
@@ -8,19 +8,19 @@ export default class ProjectNavComponent extends Component {
8
8
  get buildingTabInfoText() {
9
9
  if (!this.args.activeProjectId) {
10
10
  return this.intl.t(
11
- "ember-gwr.linkedBuildings.buildingDisabledForNewProject"
11
+ "ember-gwr.linkedBuildings.buildingDisabledForNewProject",
12
12
  );
13
13
  }
14
14
 
15
15
  const project = this.args.instanceId
16
16
  ? this.args.projects.find(
17
- (project) => project.EPROID === this.args.activeProjectId
17
+ (project) => project.EPROID === this.args.activeProjectId,
18
18
  )
19
19
  : this.args.projects[0];
20
20
 
21
21
  return project?.typeOfConstructionProject === 6010
22
22
  ? this.intl.t(
23
- "ember-gwr.linkedBuildings.buildingDisabledForInfrastructure"
23
+ "ember-gwr.linkedBuildings.buildingDisabledForInfrastructure",
24
24
  )
25
25
  : null;
26
26
  }
@@ -22,7 +22,7 @@ export default class QuarterlyClosureStatus extends Component {
22
22
 
23
23
  get disabledButton() {
24
24
  return ![620, 630, 650, 651, 663, 665].includes(
25
- this.quarterlyClosure.status.id
25
+ this.quarterlyClosure.status.id,
26
26
  );
27
27
  }
28
28
 
@@ -34,12 +34,12 @@ export default class QuarterlyClosureStatus extends Component {
34
34
  const notificationType =
35
35
  NOTIFICATION_TYPES[this.quarterlyClosure.status.type];
36
36
  this.notification[notificationType]?.(
37
- this.quarterlyClosure.status.shortLabel
37
+ this.quarterlyClosure.status.shortLabel,
38
38
  );
39
39
  } catch (error) {
40
40
  console.error(error);
41
41
  this.notification.danger(
42
- this.intl.t("ember-gwr.quarterlyClosure.closure.error")
42
+ this.intl.t("ember-gwr.quarterlyClosure.closure.error"),
43
43
  );
44
44
  }
45
45
  }
@@ -23,7 +23,9 @@ export default class SurveyDepartmentErrors extends Component {
23
23
  } catch (error) {
24
24
  console.error(error);
25
25
  this.notification.danger(
26
- this.intl.t("ember-gwr.quarterlyClosure.components.projectErrors.error")
26
+ this.intl.t(
27
+ "ember-gwr.quarterlyClosure.components.projectErrors.error",
28
+ ),
27
29
  );
28
30
  }
29
31
  });
@@ -32,12 +34,14 @@ export default class SurveyDepartmentErrors extends Component {
32
34
  *performQualityCheck(project) {
33
35
  try {
34
36
  return yield this.quarterlyClosure.checkConstructionProject(
35
- project.EPROID
37
+ project.EPROID,
36
38
  );
37
39
  } catch (error) {
38
40
  console.error(error);
39
41
  this.notification.danger(
40
- this.intl.t("ember-gwr.quarterlyClosure.components.projectErrors.error")
42
+ this.intl.t(
43
+ "ember-gwr.quarterlyClosure.components.projectErrors.error",
44
+ ),
41
45
  );
42
46
  }
43
47
  }
@@ -20,8 +20,8 @@ export default class SurveyDepartmentErrors extends Component {
20
20
  console.error(error);
21
21
  this.notification.danger(
22
22
  this.intl.t(
23
- "ember-gwr.quarterlyClosure.components.departmentErrors.error"
24
- )
23
+ "ember-gwr.quarterlyClosure.components.departmentErrors.error",
24
+ ),
25
25
  );
26
26
  }
27
27
  });
@@ -53,7 +53,7 @@ export default class SearchComponent extends Component {
53
53
  this.changeset = new Changeset(
54
54
  baseQuery,
55
55
  lookupValidator(validations),
56
- validations
56
+ validations,
57
57
  );
58
58
 
59
59
  this.rawQuery = baseQuery;
@@ -91,7 +91,7 @@ export default class SearchComponent extends Component {
91
91
  } catch (error) {
92
92
  console.error(error);
93
93
  this.notification.danger(
94
- this.intl.t("ember-gwr.generalErrors.searchError")
94
+ this.intl.t("ember-gwr.generalErrors.searchError"),
95
95
  );
96
96
  }
97
97
  }
@@ -7,7 +7,7 @@ export default class ValidatedFormErrorComponent extends Component {
7
7
  get errorString() {
8
8
  return this.args.errors
9
9
  ?.map((error) =>
10
- this.intl.t(`ember-gwr.validation-errors.${error.type}`, error.context)
10
+ this.intl.t(`ember-gwr.validation-errors.${error.type}`, error.context),
11
11
  )
12
12
  .join(", ");
13
13
  }
@@ -24,7 +24,7 @@ export default class BuildingEditDwellingEditController extends ImportController
24
24
 
25
25
  get nextValidStates() {
26
26
  const states = this.dwellingAPI.nextValidStates(
27
- this.dwelling.dwellingStatus
27
+ this.dwelling.dwellingStatus,
28
28
  );
29
29
  return states;
30
30
  }
@@ -47,7 +47,7 @@ export default class BuildingEditDwellingEditController extends ImportController
47
47
 
48
48
  const { EDID, dwelling } = yield this.dwellingAPI.getFromCacheOrApi(
49
49
  this.model.dwellingId,
50
- this.model.buildingId
50
+ this.model.buildingId,
51
51
  );
52
52
  dwelling.oldEDID = EDID;
53
53
 
@@ -73,13 +73,13 @@ export default class BuildingEditDwellingEditController extends ImportController
73
73
  *fetchEntrances() {
74
74
  try {
75
75
  const building = yield this.building.getFromCacheOrApi(
76
- this.model.buildingId
76
+ this.model.buildingId,
77
77
  );
78
78
  return building.buildingEntrance;
79
79
  } catch (error) {
80
80
  console.error(error);
81
81
  this.notification.danger(
82
- this.intl.t("ember-gwr.building.entrances.error")
82
+ this.intl.t("ember-gwr.building.entrances.error"),
83
83
  );
84
84
  }
85
85
  }
@@ -97,7 +97,7 @@ export default class BuildingEditDwellingEditController extends ImportController
97
97
  if (this.dwelling.isNew) {
98
98
  const dwelling = yield this.dwellingAPI.create(
99
99
  this.dwelling,
100
- this.model.buildingId
100
+ this.model.buildingId,
101
101
  );
102
102
  this.router.transitionTo("building.edit.dwelling.edit", dwelling.EWID);
103
103
  } else {
@@ -105,7 +105,7 @@ export default class BuildingEditDwellingEditController extends ImportController
105
105
  if (this.dwelling.oldEDID !== this.dwelling.EDID) {
106
106
  yield this.dwellingAPI.reallocate(
107
107
  this.model.buildingId,
108
- this.dwelling
108
+ this.dwelling,
109
109
  );
110
110
  }
111
111
  }
@@ -134,7 +134,7 @@ export default class BuildingEditDwellingEditController extends ImportController
134
134
  1,
135
135
  true,
136
136
  this.dwelling,
137
- this.model.buildingId
137
+ this.model.buildingId,
138
138
  );
139
139
 
140
140
  // execute transition(s)
@@ -145,10 +145,10 @@ export default class BuildingEditDwellingEditController extends ImportController
145
145
  1,
146
146
  false,
147
147
  this.dwelling,
148
- this.model.buildingId
148
+ this.model.buildingId,
149
149
  );
150
150
  yield this.dwellingAPI.clearCache(
151
- this.dwellingAPI.cacheKey(this.dwelling)
151
+ this.dwellingAPI.cacheKey(this.dwelling),
152
152
  );
153
153
  this.fetchDwelling.perform(); // reload for errors;
154
154
  this.notification.success(this.intl.t("ember-gwr.dwelling.saveSuccess"));
@@ -172,7 +172,7 @@ export default class BuildingEditDwellingEditController extends ImportController
172
172
  try {
173
173
  yield this.dwellingAPI.update(this.dwelling, this.model.buildingId);
174
174
  yield this.dwellingAPI.clearCache(
175
- this.dwellingAPI.cacheKey(this.dwelling)
175
+ this.dwellingAPI.cacheKey(this.dwelling),
176
176
  );
177
177
  this.fetchDwelling.perform(); // reload for errors;
178
178
 
@@ -17,12 +17,12 @@ export default class BuildingEditDwellingsController extends Controller {
17
17
  entrance.dwelling.map((dwelling) => {
18
18
  dwelling.buildingEntrance = entrance;
19
19
  return dwelling;
20
- })
20
+ }),
21
21
  );
22
22
  } catch (error) {
23
23
  console.error(error);
24
24
  this.notification.danger(
25
- this.intl.t("ember-gwr.building.dwellings.error")
25
+ this.intl.t("ember-gwr.building.dwellings.error"),
26
26
  );
27
27
  }
28
28
  }
@@ -33,12 +33,12 @@ export default class BuildingEditDwellingsController extends Controller {
33
33
  await this.dwelling.deactivate(this.model, dwelling.EWID);
34
34
  await this.fetchDwellings.perform();
35
35
  this.notification.success(
36
- this.intl.t("ember-gwr.building.dwellings.removeLinkSuccess")
36
+ this.intl.t("ember-gwr.building.dwellings.removeLinkSuccess"),
37
37
  );
38
38
  } catch (error) {
39
39
  console.error(error);
40
40
  this.notification.danger(
41
- this.intl.t("ember-gwr.building.dwellings.removeLinkError")
41
+ this.intl.t("ember-gwr.building.dwellings.removeLinkError"),
42
42
  );
43
43
  }
44
44
  }
@@ -29,7 +29,7 @@ export default class BuildingEditEntranceEditIndexController extends ImportContr
29
29
  }
30
30
  const buildingEntrance = yield this.buildingEntranceAPI.getFromCacheOrApi(
31
31
  this.model.entranceId,
32
- this.model.buildingId
32
+ this.model.buildingId,
33
33
  );
34
34
 
35
35
  buildingEntrance.EGID = this.model.buildingId;
@@ -37,7 +37,7 @@ export default class BuildingEditEntranceEditIndexController extends ImportContr
37
37
  } catch (error) {
38
38
  console.error(error);
39
39
  this.notification.danger(
40
- this.intl.t("ember-gwr.buildingEntrance.loadingError")
40
+ this.intl.t("ember-gwr.buildingEntrance.loadingError"),
41
41
  );
42
42
  }
43
43
  }
@@ -54,28 +54,28 @@ export default class BuildingEditEntranceEditIndexController extends ImportContr
54
54
  if (this.buildingEntrance.isNew) {
55
55
  const buildingEntrance = yield this.buildingEntranceAPI.create(
56
56
  this.buildingEntrance,
57
- this.model.buildingId
57
+ this.model.buildingId,
58
58
  );
59
59
  this.router.transitionTo(
60
60
  "building.edit.entrance.edit",
61
- buildingEntrance.EDID
61
+ buildingEntrance.EDID,
62
62
  );
63
63
  } else {
64
64
  yield this.buildingEntranceAPI.update(
65
65
  this.buildingEntrance,
66
- this.model.buildingId
66
+ this.model.buildingId,
67
67
  );
68
68
  }
69
69
  // Ensure building entrance list is refreshed
70
70
  this.building.clearCache(this.model.buildingId);
71
71
  this.errors = [];
72
72
  this.notification.success(
73
- this.intl.t("ember-gwr.buildingEntrance.saveSuccess")
73
+ this.intl.t("ember-gwr.buildingEntrance.saveSuccess"),
74
74
  );
75
75
  } catch (error) {
76
76
  this.errors = error;
77
77
  this.notification.danger(
78
- this.intl.t("ember-gwr.buildingEntrance.saveError")
78
+ this.intl.t("ember-gwr.buildingEntrance.saveError"),
79
79
  );
80
80
  }
81
81
  }
@@ -50,7 +50,7 @@ export default class BuildingEditEntranceLinkStreetController extends Controller
50
50
  return this.intl.t(
51
51
  `ember-gwr.buildingEntrance.${
52
52
  this.model.buildingId === "new" ? "backToBuilding" : "backToEntrance"
53
- }`
53
+ }`,
54
54
  );
55
55
  }
56
56
 
@@ -63,7 +63,7 @@ export default class BuildingEditEntranceLinkStreetController extends Controller
63
63
  } catch (error) {
64
64
  console.error(error);
65
65
  this.notification.danger(
66
- this.intl.t("ember-gwr.generalErrors.searchError")
66
+ this.intl.t("ember-gwr.generalErrors.searchError"),
67
67
  );
68
68
  }
69
69
  }
@@ -73,24 +73,24 @@ export default class BuildingEditEntranceLinkStreetController extends Controller
73
73
  try {
74
74
  const entrance = await this.buildingEntrance.getFromCacheOrApi(
75
75
  this.model.entranceId,
76
- this.model.buildingId
76
+ this.model.buildingId,
77
77
  );
78
78
  entrance.street = street;
79
79
  await this.buildingEntrance.setStreet(
80
80
  this.model.entranceId,
81
81
  this.model.buildingId,
82
- entrance
82
+ entrance,
83
83
  );
84
84
  // Ensure building entrance list is updated
85
85
  this.building.clearCache(this.model.buildingId);
86
86
  this.router.transitionTo(this.backRoute);
87
87
  this.notification.success(
88
- this.intl.t("ember-gwr.components.linkStreet.linkSuccess")
88
+ this.intl.t("ember-gwr.components.linkStreet.linkSuccess"),
89
89
  );
90
90
  } catch (error) {
91
91
  console.error(error);
92
92
  this.notification.danger(
93
- this.intl.t("ember-gwr.components.linkStreet.linkError")
93
+ this.intl.t("ember-gwr.components.linkStreet.linkError"),
94
94
  );
95
95
  }
96
96
  }
@@ -21,7 +21,7 @@ export default class BuildingEntrancesIndexController extends Controller {
21
21
  } catch (error) {
22
22
  console.error(error);
23
23
  this.notification.danger(
24
- this.intl.t("ember-gwr.building.entrances.error")
24
+ this.intl.t("ember-gwr.building.entrances.error"),
25
25
  );
26
26
  }
27
27
  }
@@ -32,7 +32,7 @@ export default class BuildingEntrancesIndexController extends Controller {
32
32
  await this.buildingEntrance.deactivate(EDID, this.model);
33
33
  await this.fetchEntrances.perform();
34
34
  this.notification.success(
35
- this.intl.t("ember-gwr.building.entrances.removeLinkSuccess")
35
+ this.intl.t("ember-gwr.building.entrances.removeLinkSuccess"),
36
36
  );
37
37
  } catch (error) {
38
38
  console.error(error);
@@ -45,8 +45,8 @@ export default class BuildingEntrancesIndexController extends Controller {
45
45
  error[0] === this.BuildingEntrance.DEACTIVATION_ERROR
46
46
  ? "building.entrances.attachedDwellingsError"
47
47
  : "linkedBuildings.removeLinkError"
48
- }`
49
- )
48
+ }`,
49
+ ),
50
50
  );
51
51
  }
52
52
  }
@@ -34,7 +34,7 @@ export default class BuildingFormController extends ImportController {
34
34
 
35
35
  get nextValidStates() {
36
36
  const states = this.buildingAPI.nextValidStates(
37
- this.building.buildingStatus
37
+ this.building.buildingStatus,
38
38
  );
39
39
  return states;
40
40
  }
@@ -67,12 +67,12 @@ export default class BuildingFormController extends ImportController {
67
67
  }
68
68
 
69
69
  const project = yield this.constructionProject.getFromCacheOrApi(
70
- this.model.projectId
70
+ this.model.projectId,
71
71
  );
72
72
 
73
73
  return project.work?.find(
74
74
  (buildingWork) =>
75
- buildingWork.building.EGID === Number(this.model.buildingId)
75
+ buildingWork.building.EGID === Number(this.model.buildingId),
76
76
  );
77
77
  } catch (error) {
78
78
  console.error(error);
@@ -89,7 +89,7 @@ export default class BuildingFormController extends ImportController {
89
89
  }
90
90
 
91
91
  const building = yield this.buildingAPI.getFromCacheOrApi(
92
- this.model.buildingId
92
+ this.model.buildingId,
93
93
  );
94
94
  return building;
95
95
  }
@@ -110,7 +110,7 @@ export default class BuildingFormController extends ImportController {
110
110
  if (this.buildingWork.isNew) {
111
111
  const building = yield this.buildingAPI.create(
112
112
  this.model.projectId,
113
- this.buildingWork
113
+ this.buildingWork,
114
114
  );
115
115
  EGID = building.EGID;
116
116
  } else {
@@ -119,14 +119,14 @@ export default class BuildingFormController extends ImportController {
119
119
  if (this.buildingWork.kindOfWork === 6002) {
120
120
  yield this.constructionProject.modifyWork(
121
121
  this.model.projectId,
122
- this.buildingWork
122
+ this.buildingWork,
123
123
  );
124
124
  }
125
125
  }
126
126
 
127
127
  // refresh work list
128
128
  const project = yield this.constructionProject.get(
129
- this.model.projectId
129
+ this.model.projectId,
130
130
  );
131
131
 
132
132
  // remove default work
@@ -137,10 +137,10 @@ export default class BuildingFormController extends ImportController {
137
137
  work.building.isNew
138
138
  ? this.constructionProject.removeWorkFromProject(
139
139
  this.model.projectId,
140
- work.ARBID
140
+ work.ARBID,
141
141
  )
142
- : work
143
- )
142
+ : work,
143
+ ),
144
144
  );
145
145
 
146
146
  // Clear cache so after transition we fetch the project form api
@@ -178,7 +178,7 @@ export default class BuildingFormController extends ImportController {
178
178
  transition,
179
179
  2,
180
180
  true,
181
- this.buildingWork
181
+ this.buildingWork,
182
182
  );
183
183
 
184
184
  // execute transition(s)
@@ -189,7 +189,7 @@ export default class BuildingFormController extends ImportController {
189
189
  transition,
190
190
  isCascading ? 2 : 1,
191
191
  false,
192
- this.buildingWork
192
+ this.buildingWork,
193
193
  );
194
194
 
195
195
  yield this.buildingAPI.clearCache(this.model.buildingId);
@@ -17,7 +17,7 @@ export default class ProjectErrorsController extends Controller {
17
17
  @restartableTask
18
18
  *fetchProject() {
19
19
  const project = yield this.constructionProject.getFromCacheOrApi(
20
- this.model.projectId
20
+ this.model.projectId,
21
21
  );
22
22
 
23
23
  this.projectErrorCount = project.errorList?.length ?? 0;
@@ -34,20 +34,19 @@ export default class ProjectErrorsController extends Controller {
34
34
  @enqueueTask
35
35
  *fetchModel(buildingId) {
36
36
  // building response only contains entrances
37
- const buildingWithErrors = yield this.building.getFromCacheOrApi(
38
- buildingId
39
- );
37
+ const buildingWithErrors =
38
+ yield this.building.getFromCacheOrApi(buildingId);
40
39
  const buildingErrorCount = buildingWithErrors.errorList?.length ?? 0;
41
40
 
42
41
  // response contains both entrances and dwellings
43
42
  const projectBuilding = this.project.work.find(
44
- (buildingWork) => buildingWork.building.EGID === buildingId
43
+ (buildingWork) => buildingWork.building.EGID === buildingId,
45
44
  ).building;
46
45
 
47
46
  const entrancesWithErrors = yield Promise.all(
48
47
  projectBuilding.buildingEntrance.map((entrance) =>
49
- this.buildingEntrance.getFromCacheOrApi(entrance.EDID, buildingId)
50
- )
48
+ this.buildingEntrance.getFromCacheOrApi(entrance.EDID, buildingId),
49
+ ),
51
50
  );
52
51
 
53
52
  const entranceErrorCount = entrancesWithErrors
@@ -58,10 +57,10 @@ export default class ProjectErrorsController extends Controller {
58
57
  projectBuilding.buildingEntrance.map((entrance) => {
59
58
  return Promise.all(
60
59
  entrance.dwelling.map((dwelling) =>
61
- this.dwelling.getFromCacheOrApi(dwelling.EWID, buildingId)
62
- )
60
+ this.dwelling.getFromCacheOrApi(dwelling.EWID, buildingId),
61
+ ),
63
62
  );
64
- })
63
+ }),
65
64
  )).flat();
66
65
 
67
66
  const dwellingErrorCount = dwellingsWithErrors