@projectcaluma/ember-form 11.1.3 → 11.1.4
Sign up to get free protection for your applications and to get access to all the features.
@@ -91,4 +91,11 @@ export default class CfFieldComponent extends Component {
|
|
91
91
|
|
92
92
|
return yield this.args.field.save.unlinked().perform();
|
93
93
|
}
|
94
|
+
|
95
|
+
@action
|
96
|
+
refreshDynamicOptions() {
|
97
|
+
if (this.args.field.question.isDynamic) {
|
98
|
+
this.args.field.question.dynamicOptions.retry();
|
99
|
+
}
|
100
|
+
}
|
94
101
|
}
|
package/addon/lib/question.js
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
import { assert } from "@ember/debug";
|
2
2
|
import { camelize } from "@ember/string";
|
3
3
|
import { queryManager } from "ember-apollo-client";
|
4
|
-
import {
|
5
|
-
import { trackedTask } from "ember-resources/util/ember-concurrency";
|
4
|
+
import { trackedFunction } from "ember-resources/util/function";
|
6
5
|
import { cached } from "tracked-toolbox";
|
7
6
|
|
8
7
|
import getDynamicOptions from "@projectcaluma/ember-form/gql/queries/dynamic-options.graphql";
|
@@ -51,18 +50,10 @@ export default class Question extends Base {
|
|
51
50
|
return this.raw.slug;
|
52
51
|
}
|
53
52
|
|
54
|
-
|
55
|
-
* Load all dynamic options for this question
|
56
|
-
*
|
57
|
-
* @method loadDynamicOptions.perform
|
58
|
-
* @return {Object[]} The dynamic options
|
59
|
-
* @public
|
60
|
-
*/
|
61
|
-
@dropTask
|
62
|
-
*loadDynamicOptions() {
|
53
|
+
dynamicOptions = trackedFunction(this, async () => {
|
63
54
|
if (!this.isDynamic) return;
|
64
55
|
|
65
|
-
const [question] =
|
56
|
+
const [question] = await this.apollo.query(
|
66
57
|
{
|
67
58
|
query: getDynamicOptions,
|
68
59
|
fetchPolicy: "network-only",
|
@@ -80,9 +71,7 @@ export default class Question extends Base {
|
|
80
71
|
question.node.dynamicChoiceOptions ??
|
81
72
|
question.node.dynamicMultipleChoiceOptions
|
82
73
|
);
|
83
|
-
}
|
84
|
-
|
85
|
-
dynamicOptions = trackedTask(this, this.loadDynamicOptions, () => []);
|
74
|
+
});
|
86
75
|
|
87
76
|
get dynamicChoiceOptions() {
|
88
77
|
return this.dynamicOptions.value ?? [];
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@projectcaluma/ember-form",
|
3
|
-
"version": "11.1.
|
3
|
+
"version": "11.1.4",
|
4
4
|
"description": "Ember addon for rendering Caluma forms.",
|
5
5
|
"keywords": [
|
6
6
|
"ember-addon"
|
@@ -44,10 +44,10 @@
|
|
44
44
|
},
|
45
45
|
"devDependencies": {
|
46
46
|
"@ember/optional-features": "2.0.0",
|
47
|
-
"@ember/test-helpers": "2.
|
47
|
+
"@ember/test-helpers": "2.9.3",
|
48
48
|
"@embroider/test-setup": "2.1.1",
|
49
49
|
"@faker-js/faker": "7.6.0",
|
50
|
-
"@projectcaluma/ember-testing": "11.1.
|
50
|
+
"@projectcaluma/ember-testing": "11.1.4",
|
51
51
|
"@projectcaluma/ember-workflow": "^11.1.3",
|
52
52
|
"broccoli-asset-rev": "3.0.0",
|
53
53
|
"ember-cli": "4.11.0",
|
@@ -58,15 +58,16 @@
|
|
58
58
|
"ember-cli-sri": "2.1.1",
|
59
59
|
"ember-cli-terser": "4.0.2",
|
60
60
|
"ember-load-initializers": "2.1.2",
|
61
|
-
"ember-qunit": "6.
|
61
|
+
"ember-qunit": "6.2.0",
|
62
62
|
"ember-resolver": "10.0.0",
|
63
|
-
"ember-source": "4.
|
63
|
+
"ember-source": "4.12.0",
|
64
64
|
"ember-source-channel-url": "3.0.0",
|
65
65
|
"ember-try": "2.0.0",
|
66
66
|
"loader.js": "4.7.0",
|
67
67
|
"miragejs": "0.1.47",
|
68
68
|
"qunit": "2.19.4",
|
69
69
|
"qunit-dom": "2.0.0",
|
70
|
+
"uikit": "3.16.13",
|
70
71
|
"uuid": "9.0.0",
|
71
72
|
"webpack": "5.77.0"
|
72
73
|
},
|