@projectcaluma/ember-testing 11.0.0-beta.6 → 11.0.0-beta.9

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,31 @@
1
+ # [@projectcaluma/ember-testing-v11.0.0-beta.9](https://github.com/projectcaluma/ember-caluma/compare/@projectcaluma/ember-testing-v11.0.0-beta.8...@projectcaluma/ember-testing-v11.0.0-beta.9) (2022-06-09)
2
+
3
+
4
+ ### Features
5
+
6
+ * **caluma:** use new filter syntax of caluma ([7a00c03](https://github.com/projectcaluma/ember-caluma/commit/7a00c03a103933d9e48dd88adb7382441a298742))
7
+
8
+
9
+ ### BREAKING CHANGES
10
+
11
+ * **caluma:** `ember-caluma` now requires Caluma version >=
12
+ 8.0.0-beta.6
13
+
14
+ # [@projectcaluma/ember-testing-v11.0.0-beta.8](https://github.com/projectcaluma/ember-caluma/compare/@projectcaluma/ember-testing-v11.0.0-beta.7...@projectcaluma/ember-testing-v11.0.0-beta.8) (2022-05-13)
15
+
16
+
17
+ ### Features
18
+
19
+ * **distribution:** add status for skipped inquiries ([1f93c92](https://github.com/projectcaluma/ember-caluma/commit/1f93c92d76b697954ec54aefa12348c84cd0abf9))
20
+
21
+ # [@projectcaluma/ember-testing-v11.0.0-beta.7](https://github.com/projectcaluma/ember-caluma/compare/@projectcaluma/ember-testing-v11.0.0-beta.6...@projectcaluma/ember-testing-v11.0.0-beta.7) (2022-05-09)
22
+
23
+
24
+ ### Features
25
+
26
+ * **distribution:** allow displaying more information in the answer ([9de7f01](https://github.com/projectcaluma/ember-caluma/commit/9de7f0149406a0a326ba59ca0abe27860a64f2a1))
27
+ * **distribution:** improve edit and answer inquiry UI and UX ([6cd2dee](https://github.com/projectcaluma/ember-caluma/commit/6cd2dee45dde245064a0ac013160093bc783789c))
28
+
1
29
  # [@projectcaluma/ember-testing-v11.0.0-beta.6](https://github.com/projectcaluma/ember-caluma/compare/@projectcaluma/ember-testing-v11.0.0-beta.5...@projectcaluma/ember-testing-v11.0.0-beta.6) (2022-04-07)
2
30
 
3
31
 
@@ -6,25 +6,18 @@ export default class BaseFilter {
6
6
  }
7
7
 
8
8
  _getFilterFns(rawFilters) {
9
- const filters = Array.isArray(rawFilters)
10
- ? // new format
11
- rawFilters
12
- .filter((filter) => Object.keys(filter).length !== 0) // filter out empty filters
13
- .map((filter) => {
14
- const entries = Object.entries(filter);
15
- const key = entries[0][0];
16
- const value = entries[0][1];
17
- const options = entries
18
- .slice(1)
19
- .reduce((opts, [k, v]) => ({ ...opts, [k]: v }), {});
9
+ const filters = rawFilters
10
+ .filter((filter) => Object.keys(filter).length !== 0) // filter out empty filters
11
+ .map((filter) => {
12
+ const entries = Object.entries(filter);
13
+ const key = entries[0][0];
14
+ const value = entries[0][1];
15
+ const options = entries
16
+ .slice(1)
17
+ .reduce((opts, [k, v]) => ({ ...opts, [k]: v }), {});
20
18
 
21
- return { key, value, options };
22
- })
23
- : // old format
24
- Object.entries(rawFilters).map(([key, value]) => ({
25
- key,
26
- value,
27
- }));
19
+ return { key, value, options };
20
+ });
28
21
 
29
22
  return filters.map(({ key, value, options = {} }) => {
30
23
  const fn = this[key];
@@ -53,7 +46,7 @@ export default class BaseFilter {
53
46
  }
54
47
 
55
48
  filter(records, filters) {
56
- return this._getFilterFns(filters?.filter ?? filters ?? []).reduce(
49
+ return this._getFilterFns(filters?.filter ?? []).reduce(
57
50
  (recs, fn) => fn(recs),
58
51
  this.sort(records, filters?.order)
59
52
  );
@@ -64,7 +57,11 @@ export default class BaseFilter {
64
57
  }
65
58
 
66
59
  slug(records, value) {
67
- return records.filter(({ slug }) => slug === value);
60
+ return this.slugs(records, [value]);
61
+ }
62
+
63
+ slugs(records, values) {
64
+ return records.filter(({ slug }) => values.includes(slug));
68
65
  }
69
66
 
70
67
  id(records, value) {
@@ -102,6 +102,10 @@ export default class WorkItemMock extends BaseMock {
102
102
  addressedGroups: workItem.addressedGroups,
103
103
  });
104
104
  } else if (taskId === "complete-distribution") {
105
+ this.collection
106
+ .where({ caseId, status: "READY", taskId: "inquiry" })
107
+ .update({ status: "SKIPPED" });
108
+
105
109
  this.collection
106
110
  .where({ caseId, status: "READY" })
107
111
  .update({ status: "CANCELED" });