ember-ebau-gwr 6.0.0 → 6.0.2

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 CHANGED
@@ -1,3 +1,21 @@
1
+ ## [6.0.2](https://github.com/adfinis-sygroup/ember-ebau-gwr/compare/v6.0.1...v6.0.2) (2022-09-21)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **global:** minor ui change ([524b789](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/524b78955f723ba24f17547136afe02a82dc09ed))
7
+ * **projects:** fix instance link querying by eproid ([e1fff2e](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/e1fff2ed40b5b33b9ed3d8b1aea41b688749a59b))
8
+ * **quarterly-closure:** fix fetching of status after closure ([4f19d91](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/4f19d91b797c34631d7741e5dcbb698dc7cb427c))
9
+ * **search:** make search pagination optional ([3e883e9](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/3e883e96bb9d624c90b57029db44346d15902047))
10
+ * **status:** fix lifecycle error links for global views ([801936b](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/801936bdf11c40a67fdcd5f5024a5edfa9ff1365))
11
+
12
+ ## [6.0.1](https://github.com/adfinis-sygroup/ember-ebau-gwr/compare/v6.0.0...v6.0.1) (2022-09-19)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * **search:** separate project and building search validations ([0510045](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/0510045b6d2f09615afcc241f1a61aaa4ddd95eb))
18
+
1
19
  # [6.0.0](https://github.com/adfinis-sygroup/ember-ebau-gwr/compare/v5.0.4...v6.0.0) (2022-09-16)
2
20
 
3
21
 
@@ -7,6 +7,7 @@
7
7
  class="uk-text-danger uk-text-small"
8
8
  @route={{@errors.linkToRoute}}
9
9
  @models={{@errors.linkToModels}}
10
+ @query={{@errors.linkToQuery}}
10
11
  >
11
12
  {{@errors.linkToText}}
12
13
  </LinkTo>
@@ -33,7 +33,7 @@ export default class QuarterlyClosureStatus extends Component {
33
33
 
34
34
  const notificationType =
35
35
  NOTIFICATION_TYPES[this.quarterlyClosure.status.type];
36
- this.notification[notificationType](
36
+ this.notification[notificationType]?.(
37
37
  this.quarterlyClosure.status.shortLabel
38
38
  );
39
39
  } catch (error) {
@@ -1,16 +1,17 @@
1
- <div>
1
+ <div class="ember-ebau-gwr-quarterly-closure-status">
2
2
  <div class="uk-flex uk-flex-middle">
3
- <span class="uk-text-bold margin-right-xs">
3
+ <div
4
+ class="uk-text-bold uk-text-meta uk-text-emphasis uk-text-uppercase margin-right-xs"
5
+ >
4
6
  {{t "ember-gwr.quarterlyClosure.status.label"}}
5
- </span>
7
+ </div>
6
8
  <FaIcon class={{this.statusClass.text}}
7
9
  @icon={{this.statusClass.icon}}
8
10
  @prefix={{this.statusClass.prefix}}
9
- @fixedWidth={{true}}
10
11
  @size="sm"
11
12
  />
12
13
  </div>
13
- <div>
14
+ <div class="uk-text-meta uk-text-emphasis">
14
15
  {{this.quarterlyClosure.status.label}}
15
16
  </div>
16
17
  </div>
@@ -10,6 +10,7 @@ export default class SearchComponent extends Component {
10
10
  @tracked page = 1;
11
11
  @tracked searchResults = null;
12
12
  @tracked hasMoreResults = false;
13
+ @tracked rawQuery = {};
13
14
 
14
15
  @service notification;
15
16
  @service intl;
@@ -53,6 +54,11 @@ export default class SearchComponent extends Component {
53
54
  lookupValidator(validations),
54
55
  validations
55
56
  );
57
+
58
+ this.rawQuery = baseQuery;
59
+ if (this.args.paginate) {
60
+ this.onSubmit.perform();
61
+ }
56
62
  }
57
63
 
58
64
  @dropTask
@@ -61,11 +67,15 @@ export default class SearchComponent extends Component {
61
67
  this.rawQuery = {
62
68
  ...this.rawQuery,
63
69
  ..._query?.pendingData,
64
- page: this.page,
70
+ ...(this.args.paginate ? { page: this.page } : {}),
65
71
  };
66
72
 
67
73
  const _results = yield this.args.service.search(this.rawQuery);
68
- if (!_results || _results.length < this.config.pageSize) {
74
+ if (
75
+ !this.args.paginate ||
76
+ !_results ||
77
+ _results.length < this.config.pageSize
78
+ ) {
69
79
  this.hasMoreResults = false;
70
80
  } else {
71
81
  this.hasMoreResults = true;
@@ -4,6 +4,7 @@ import { inject as service } from "@ember/service";
4
4
  import { tracked } from "@glimmer/tracking";
5
5
  import { task, dropTask, lastValue } from "ember-concurrency";
6
6
  import { periodOfConstructionOptions } from "ember-ebau-gwr/models/options";
7
+ import SearchBuildingValidations from "ember-ebau-gwr/validations/search-building";
7
8
 
8
9
  export default class SearchBuildingController extends Controller {
9
10
  @service constructionProject;
@@ -20,6 +21,8 @@ export default class SearchBuildingController extends Controller {
20
21
  queryParams = ["projectId"];
21
22
  @tracked projectId = null;
22
23
 
24
+ validations = SearchBuildingValidations;
25
+
23
26
  get baseQuery() {
24
27
  return {
25
28
  streetLang: this.street?.language,
@@ -3,6 +3,7 @@ import { action } from "@ember/object";
3
3
  import { inject as service } from "@ember/service";
4
4
  import { dropTask, lastValue } from "ember-concurrency";
5
5
  import { projectStatusOptions } from "ember-ebau-gwr/models/options";
6
+ import SearchProjectValidations from "ember-ebau-gwr/validations/search-project";
6
7
 
7
8
  export default class SearchProjectController extends Controller {
8
9
  @service constructionProject;
@@ -12,6 +13,8 @@ export default class SearchProjectController extends Controller {
12
13
  @service notification;
13
14
  @service config;
14
15
 
16
+ validations = SearchProjectValidations;
17
+
15
18
  get baseQuery() {
16
19
  return {
17
20
  constructionSurveyDeptNumber:
@@ -33,10 +36,12 @@ export default class SearchProjectController extends Controller {
33
36
  @lastValue("fetchInstanceLinks") links;
34
37
  @dropTask
35
38
  *fetchInstanceLinks(projects) {
39
+ if (!projects) {
40
+ return [];
41
+ }
42
+
36
43
  const links = yield this.store.query("gwr-link", {
37
- filter: {
38
- eproid: projects.map(({ EPROID }) => EPROID),
39
- },
44
+ eproid__in: projects.map(({ EPROID }) => EPROID).join(","),
40
45
  });
41
46
  const instanceLinks = yield this.config.fetchInstanceLinks(
42
47
  links.map(({ localId }) => localId)
@@ -155,8 +155,7 @@ export default class GwrService extends Service {
155
155
  ? "building.edit.dwelling.edit"
156
156
  : "building.edit.form",
157
157
  linkToModels: [
158
- instanceId,
159
- projectId,
158
+ ...(instanceId ? [instanceId] : []),
160
159
  buildingId,
161
160
  ...(dwellingId ? [dwellingId] : []),
162
161
  ],
@@ -172,6 +171,7 @@ export default class GwrService extends Service {
172
171
  linkToTextAfter: this.intl.t(`ember-gwr.lifeCycles.statusError`, {
173
172
  states: this.concatStates(states),
174
173
  }),
174
+ linkToQuery: projectId ? { projectId } : {},
175
175
  };
176
176
  }
177
177
 
@@ -119,13 +119,12 @@ export default class QuarterlyClosureService extends Service {
119
119
  return null;
120
120
  }
121
121
 
122
- const response = await this.authFetch.fetch(
122
+ await this.authFetch.fetch(
123
123
  `/constructionsurveydepts/${this.constructionSurveyDeptNumber}/closeQuarterlySurvey`,
124
124
  { method: "put" }
125
125
  );
126
- this.quarterlyClosureStatus = new QuarterlyClosureStatus(
127
- await response.text()
128
- );
126
+
127
+ await this.pollProgressStatus();
129
128
  }
130
129
 
131
130
  async checkQuarterlySurveyDept() {
@@ -1,12 +1,12 @@
1
- <div class="uk-padding">
2
- <h1 class="uk-text-center">
1
+ <div class="uk-padding-large">
2
+ <h1>
3
3
  {{t "ember-gwr.globalLandingPage.heading"}}
4
4
  </h1>
5
- <h4 class="uk-text-center uk-margin-remove-top uk-margin-large">
5
+ <h4 class="uk-margin-remove-top uk-margin-medium-bottom">
6
6
  {{t "ember-gwr.globalLandingPage.infoText"}}
7
7
  </h4>
8
8
 
9
- <div uk-grid class="uk-child-width-1-1 uk-child-width-1-3@m">
9
+ <div uk-grid class="uk-child-width-1-1 uk-child-width-1-3@m uk-padding-remove-left">
10
10
  <TitleCard
11
11
  @title={{t "ember-gwr.globalLandingPage.searchProject"}}
12
12
  @route="search-project"
@@ -21,6 +21,8 @@
21
21
  @extendedSearch={{true}}
22
22
  @service={{this.building}}
23
23
  @baseQuery={{this.baseQuery}}
24
+ @paginate={{true}}
25
+ @validations={{this.validations}}
24
26
  @idField="EGID"
25
27
  >
26
28
  <:filters as |Filters|>
@@ -20,7 +20,9 @@
20
20
  <Search
21
21
  @service={{this.constructionProject}}
22
22
  @baseQuery={{this.baseQuery}}
23
+ @paginate={{true}}
23
24
  @extendedSearch={{true}}
25
+ @validations={{this.validations}}
24
26
  @idField="EPROID"
25
27
  @onSearch={{perform this.fetchInstanceLinks}}
26
28
  >
@@ -1,23 +1,8 @@
1
- import {
2
- validatePresence,
3
- validateNumber,
4
- } from "ember-changeset-validations/validators";
1
+ import { validatePresence } from "ember-changeset-validations/validators";
5
2
 
6
3
  import { realestateIdentificationValidation } from "./realestate-identification";
7
4
 
8
5
  export default {
9
- EPROID: validateNumber({
10
- integer: true,
11
- gte: 1,
12
- lte: 900000000,
13
- allowBlank: true,
14
- }),
15
- EGID: validateNumber({
16
- integer: true,
17
- gte: 1,
18
- lte: 900000000,
19
- allowBlank: true,
20
- }),
21
6
  ...realestateIdentificationValidation(),
22
7
  createDate: {
23
8
  dateTo: validatePresence({
@@ -0,0 +1,10 @@
1
+ import { validateNumber } from "ember-changeset-validations/validators";
2
+
3
+ export default {
4
+ EGID: validateNumber({
5
+ integer: true,
6
+ gte: 1,
7
+ lte: 900000000,
8
+ allowBlank: true,
9
+ }),
10
+ };
@@ -0,0 +1,10 @@
1
+ import { validateNumber } from "ember-changeset-validations/validators";
2
+
3
+ export default {
4
+ EPROID: validateNumber({
5
+ integer: true,
6
+ gte: 1,
7
+ lte: 900000000,
8
+ allowBlank: true,
9
+ }),
10
+ };
@@ -114,11 +114,10 @@ $ember-ebau-gwr-required-color: $alert-danger-color !default;
114
114
  margin-top: 100px;
115
115
 
116
116
  .title-card-text {
117
- @extend .uk-text-default;
117
+ @extend .uk-text-large, .uk-text-light;
118
118
  white-space: pre-line;
119
119
  line-height: 1.5;
120
- margin-top: 5px;
121
- font-weight: 400;
120
+ margin-top: 10px;
122
121
  }
123
122
  }
124
123
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ember-ebau-gwr",
3
- "version": "6.0.0",
3
+ "version": "6.0.2",
4
4
  "description": "Ember engine to integrate ebau-gwr into an ember app.",
5
5
  "keywords": [
6
6
  "ember-addon",
@@ -34,7 +34,7 @@ ember-gwr:
34
34
  690: Kopieren der Daten in den Snapshot
35
35
  691: Erzwungener Abschluss von BFS
36
36
  short:
37
- processing: Eine Anfrage ist noch nicht verarbeitet
37
+ processing: Anfrage noch nicht verarbeitet
38
38
  610: Quartalsabschluss initialisiert
39
39
  620: Abschluss erforderlich
40
40
  630: Fehler müssen korrigiert werden