@projectcaluma/ember-core 9.2.0 → 10.1.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.
|
@@ -20,6 +20,8 @@ export default class PrivateResolver extends Helper {
|
|
|
20
20
|
? identifiers[0]
|
|
21
21
|
: identifiers;
|
|
22
22
|
|
|
23
|
+
if (!identifier) return null;
|
|
24
|
+
|
|
23
25
|
// The parameter for the helper changed so we need to recompute and store
|
|
24
26
|
// the new parameter to remember it at the next computation
|
|
25
27
|
if (identifier !== this._identifier) {
|
|
@@ -2,6 +2,7 @@ import { assert } from "@ember/debug";
|
|
|
2
2
|
import { once } from "@ember/runloop";
|
|
3
3
|
import Service, { inject as service } from "@ember/service";
|
|
4
4
|
import { camelize } from "@ember/string";
|
|
5
|
+
import { task } from "ember-concurrency";
|
|
5
6
|
import { pluralize } from "ember-inflector";
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -9,23 +10,24 @@ import { pluralize } from "ember-inflector";
|
|
|
9
10
|
*
|
|
10
11
|
* @function typeResolver
|
|
11
12
|
* @param {"group"|"user"} type The type of the objects to resolve
|
|
12
|
-
* @returns {Function} The decorator function that returns
|
|
13
|
+
* @returns {Function} The decorator function that returns an enqueued task to resolve the requested objects
|
|
13
14
|
*/
|
|
14
15
|
function typeResolver(type) {
|
|
15
|
-
return function () {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
16
|
+
return task(function* () {
|
|
17
|
+
const identifiers = [...this[type].identifiers];
|
|
18
|
+
const callbacks = [...this[type].callbacks];
|
|
19
|
+
|
|
20
|
+
this[type] = undefined;
|
|
21
|
+
|
|
22
|
+
if (!identifiers.length) return;
|
|
23
|
+
|
|
24
|
+
const methodName = camelize(`resolve-${pluralize(type)}`);
|
|
25
|
+
const result = yield this.calumaOptions[methodName]?.(identifiers);
|
|
26
|
+
|
|
27
|
+
yield Promise.all(callbacks.map((callback) => callback(result)));
|
|
28
|
+
|
|
29
|
+
return result;
|
|
30
|
+
}).enqueue();
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
export default class PrivateSchedulerService extends Service {
|
|
@@ -72,6 +74,18 @@ export default class PrivateSchedulerService extends Service {
|
|
|
72
74
|
typeResolverName in this
|
|
73
75
|
);
|
|
74
76
|
|
|
75
|
-
once(this,
|
|
77
|
+
once(this[typeResolverName], "perform");
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
resolve(identifiers, type) {
|
|
81
|
+
const typeResolverName = camelize(`resolve-${type}`);
|
|
82
|
+
|
|
83
|
+
if (!this[type]) {
|
|
84
|
+
this[type] = { identifiers: new Set(), callbacks: new Set() };
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
identifiers.forEach((identifier) => this[type].identifiers.add(identifier));
|
|
88
|
+
|
|
89
|
+
return this[typeResolverName]?.perform();
|
|
76
90
|
}
|
|
77
91
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import Service, { inject as service } from "@ember/service";
|
|
2
|
+
import { tracked } from "@glimmer/tracking";
|
|
2
3
|
|
|
3
4
|
import slugify from "@projectcaluma/ember-core/utils/slugify";
|
|
4
5
|
|
|
@@ -14,6 +15,8 @@ import slugify from "@projectcaluma/ember-core/utils/slugify";
|
|
|
14
15
|
export default class CalumaOptionsService extends Service {
|
|
15
16
|
@service intl;
|
|
16
17
|
|
|
18
|
+
@tracked currentGroupId;
|
|
19
|
+
|
|
17
20
|
constructor(...args) {
|
|
18
21
|
super(...args);
|
|
19
22
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@projectcaluma/ember-core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.1.0",
|
|
4
4
|
"description": "Ember core addon for working with Caluma.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon"
|
|
@@ -14,16 +14,17 @@
|
|
|
14
14
|
"test:ember-compatibility": "ember try:each"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@apollo/client": "^3.
|
|
17
|
+
"@apollo/client": "^3.5.6",
|
|
18
18
|
"@glimmer/tracking": "^1.0.4",
|
|
19
19
|
"ember-apollo-client": "^3.2.0",
|
|
20
20
|
"ember-auto-import": "^2.2.3",
|
|
21
21
|
"ember-changeset-validations": "^3.16.0",
|
|
22
22
|
"ember-cli-babel": "^7.26.6",
|
|
23
|
-
"ember-cli-htmlbars": "^6.0.
|
|
23
|
+
"ember-cli-htmlbars": "^6.0.1",
|
|
24
24
|
"ember-concurrency": "^2.2.0",
|
|
25
25
|
"ember-concurrency-decorators": "^2.0.3",
|
|
26
26
|
"ember-fetch": "^8.0.4",
|
|
27
|
+
"ember-inflector": "^4.0.2",
|
|
27
28
|
"ember-intl": "^5.7.0",
|
|
28
29
|
"graphql": "^15.6.1",
|
|
29
30
|
"graphql-tag": "^2.12.6",
|
|
@@ -32,17 +33,17 @@
|
|
|
32
33
|
"lodash.clonedeep": "^4.5.0",
|
|
33
34
|
"moment": "^2.29.1",
|
|
34
35
|
"proxy-polyfill": "^0.3.2",
|
|
35
|
-
"slugify": "^1.6.
|
|
36
|
+
"slugify": "^1.6.3"
|
|
36
37
|
},
|
|
37
38
|
"devDependencies": {
|
|
38
39
|
"@ember/optional-features": "2.0.0",
|
|
39
|
-
"@ember/render-modifiers": "2.0.
|
|
40
|
+
"@ember/render-modifiers": "2.0.2",
|
|
40
41
|
"@ember/test-helpers": "2.6.0",
|
|
41
|
-
"@embroider/test-setup": "0.
|
|
42
|
+
"@embroider/test-setup": "0.48.1",
|
|
42
43
|
"@glimmer/component": "1.0.4",
|
|
43
|
-
"@projectcaluma/ember-testing": "
|
|
44
|
+
"@projectcaluma/ember-testing": "10.0.0",
|
|
44
45
|
"broccoli-asset-rev": "3.0.0",
|
|
45
|
-
"ember-cli": "3.28.
|
|
46
|
+
"ember-cli": "3.28.4",
|
|
46
47
|
"ember-cli-code-coverage": "1.0.3",
|
|
47
48
|
"ember-cli-dependency-checker": "3.2.0",
|
|
48
49
|
"ember-cli-inject-live-reload": "2.1.0",
|
|
@@ -55,7 +56,7 @@
|
|
|
55
56
|
"ember-maybe-import-regenerator": "1.0.0",
|
|
56
57
|
"ember-qunit": "5.1.5",
|
|
57
58
|
"ember-resolver": "8.0.3",
|
|
58
|
-
"ember-source": "3.28.
|
|
59
|
+
"ember-source": "3.28.8",
|
|
59
60
|
"ember-source-channel-url": "3.0.0",
|
|
60
61
|
"ember-try": "2.0.0",
|
|
61
62
|
"faker": "5.5.3",
|
|
@@ -63,10 +64,10 @@
|
|
|
63
64
|
"npm-run-all": "4.1.5",
|
|
64
65
|
"qunit": "2.17.2",
|
|
65
66
|
"qunit-dom": "2.0.0",
|
|
66
|
-
"webpack": "5.
|
|
67
|
+
"webpack": "5.65.0"
|
|
67
68
|
},
|
|
68
69
|
"engines": {
|
|
69
|
-
"node": "
|
|
70
|
+
"node": "12.* || 14.* || >= 16"
|
|
70
71
|
},
|
|
71
72
|
"ember": {
|
|
72
73
|
"edition": "octane"
|