ember-ebau-gwr 6.0.3 → 6.0.4

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,12 @@
1
+ ## [6.0.4](https://github.com/adfinis-sygroup/ember-ebau-gwr/compare/v6.0.3...v6.0.4) (2022-10-10)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **qc:** sort projects in quarterly closure by creation date ([b162f30](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/b162f305705cd632a07494e459de68634564f24e))
7
+ * **search:** prevent project link query for empty search results ([f22664b](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/f22664b273892cadcae42a288e9cc1e4b23238ba))
8
+ * **search:** start pagination at index 0 ([c37b411](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/c37b41150b8b405582c6e4d19672fc7647c356e1))
9
+
1
10
  ## [6.0.3](https://github.com/adfinis-sygroup/ember-ebau-gwr/compare/v6.0.2...v6.0.3) (2022-09-29)
2
11
 
3
12
 
@@ -9,6 +9,7 @@ export default class SurveyDepartmentErrors extends Component {
9
9
  @service constructionProject;
10
10
  @service notification;
11
11
  @service intl;
12
+ @service config;
12
13
 
13
14
  @tracked errors = trackedFunction(this, async () => {
14
15
  try {
@@ -16,6 +17,8 @@ export default class SurveyDepartmentErrors extends Component {
16
17
  constructionSurveyDeptNumber:
17
18
  this.quarterlyClosure.constructionSurveyDeptNumber,
18
19
  hasError: true,
20
+ sortColumn: this.config.quarterlyClosureSortColumn,
21
+ sortDirection: this.config.quarterlyClosureSortDirection,
19
22
  });
20
23
  } catch (error) {
21
24
  console.error(error);
@@ -7,7 +7,7 @@ import { dropTask } from "ember-concurrency";
7
7
  import ExtendedSearchValidations from "ember-ebau-gwr/validations/extended-search-fields";
8
8
 
9
9
  export default class SearchComponent extends Component {
10
- @tracked page = 1;
10
+ @tracked page = 0;
11
11
  @tracked searchResults = null;
12
12
  @tracked hasMoreResults = false;
13
13
  @tracked rawQuery = {};
@@ -82,7 +82,7 @@ export default class SearchComponent extends Component {
82
82
  }
83
83
 
84
84
  this.searchResults =
85
- this.page === 1 ? _results : this.searchResults.concat(_results);
85
+ this.page === 0 ? _results : this.searchResults.concat(_results);
86
86
 
87
87
  yield this.args.onSearch?.(this.searchResults);
88
88
  } catch (error) {
@@ -96,7 +96,7 @@ export default class SearchComponent extends Component {
96
96
  @dropTask
97
97
  *onSubmit(args) {
98
98
  this.searchResults = [];
99
- this.page = 1;
99
+ this.page = 0;
100
100
  yield this.search.perform(args);
101
101
  }
102
102
 
@@ -36,13 +36,14 @@ export default class SearchProjectController extends Controller {
36
36
  @lastValue("fetchInstanceLinks") links;
37
37
  @dropTask
38
38
  *fetchInstanceLinks(projects) {
39
- if (!projects) {
40
- return [];
41
- }
39
+ if (!projects?.length) return [];
42
40
 
43
41
  const links = yield this.store.query("gwr-link", {
44
42
  eproid__in: projects.map(({ EPROID }) => EPROID).join(","),
45
43
  });
44
+
45
+ if (!links.length) return [];
46
+
46
47
  const instanceLinks = yield this.config.fetchInstanceLinks(
47
48
  links.map(({ localId }) => localId)
48
49
  );
@@ -82,7 +82,7 @@ export default class GwrService extends Service {
82
82
  .replace(/\r?\n|\r/g, "");
83
83
 
84
84
  const queryParams = new URLSearchParams({
85
- ...(query.page
85
+ ...(query.page !== null && query.page !== undefined
86
86
  ? {
87
87
  page: query.page,
88
88
  size: this.pageSize,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ember-ebau-gwr",
3
- "version": "6.0.3",
3
+ "version": "6.0.4",
4
4
  "description": "Ember engine to integrate ebau-gwr into an ember app.",
5
5
  "keywords": [
6
6
  "ember-addon",