@projectcaluma/ember-form 14.1.0 → 14.2.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.
@@ -89,11 +89,10 @@ export default class CfFieldInputFilesComponent extends Component {
89
89
  await Promise.all(newFiles.map((file) => uploadFunction(file)));
90
90
 
91
91
  this.args.field.answer.value = savedAnswerValue;
92
- } catch (error) {
92
+ } catch {
93
93
  await this.args.onSave([]);
94
94
  this.args.field._errors = [{ type: "uploadFailed" }];
95
95
  } finally {
96
- // eslint-disable-next-line require-atomic-updates
97
96
  target.value = "";
98
97
  }
99
98
  }
@@ -106,7 +105,7 @@ export default class CfFieldInputFilesComponent extends Component {
106
105
 
107
106
  try {
108
107
  await this.args.onSave(remainingFiles);
109
- } catch (error) {
108
+ } catch {
110
109
  this.args.field._errors = [{ type: "deleteFailed" }];
111
110
  }
112
111
  }
@@ -111,7 +111,7 @@ export default class CfFieldInputTableComponent extends Component {
111
111
  this.documentToEditIsNew = false;
112
112
 
113
113
  yield this.close.perform();
114
- } catch (e) {
114
+ } catch {
115
115
  this.notification.danger(
116
116
  this.intl.t("caluma.form.notification.table.add.error"),
117
117
  );
@@ -55,8 +55,12 @@
55
55
  <p class="uk-text-meta uk-margin-small">
56
56
  {{t "caluma.form.error.details"}}
57
57
  </p>
58
- <pre class="uk-margin-remove">
59
- {{~format-graphql-error this.save.last.error~}}
58
+ <pre
59
+ class="uk-margin-remove"
60
+ >
61
+ {{~format-graphql-error
62
+ this.save.last.error
63
+ ~}}
60
64
  </pre>
61
65
  </div>
62
66
  {{/if}}
@@ -87,21 +87,16 @@ export default class CfFieldComponent extends Component {
87
87
  *
88
88
  * @method save
89
89
  * @param {String|Number|String[]} value The new value to save to the field
90
- * @param {Boolean} bypassTimeout Whether to bypass the timeout
91
90
  */
92
91
  @restartableTask
93
- *save(value, bypassTimeout = false) {
92
+ *save(value) {
94
93
  if (typeof this.args.onSave === "function") {
95
94
  return yield this.args.onSave(this.args.field, value);
96
95
  }
97
96
 
98
97
  /* istanbul ignore next */
99
- if (macroCondition(isTesting())) {
100
- // no timeout
101
- } else {
102
- if (!bypassTimeout) {
103
- yield timeout(500);
104
- }
98
+ if (macroCondition(!isTesting())) {
99
+ yield timeout(500);
105
100
  }
106
101
 
107
102
  if (this.args.field.answer) {
@@ -101,6 +101,12 @@ fragment SimpleQuestion on Question {
101
101
  }
102
102
  hintText
103
103
  }
104
+ ... on DynamicChoiceQuestion {
105
+ hintText
106
+ }
107
+ ... on DynamicMultipleChoiceQuestion {
108
+ hintText
109
+ }
104
110
  ... on DateQuestion {
105
111
  dateDefaultAnswer: defaultAnswer {
106
112
  id
@@ -6,7 +6,7 @@ export function formatGraphqlErrorObject(error) {
6
6
  const { line, column } = error.locations[error.locations.length - 1];
7
7
 
8
8
  return `${path}:${line}:${column}: ${error.message}`;
9
- } catch (e) {
9
+ } catch {
10
10
  return null;
11
11
  }
12
12
  }
@@ -286,7 +286,7 @@ export default class Field extends Base {
286
286
  this.question.raw.calcExpression,
287
287
  this.jexlContext,
288
288
  );
289
- } catch (error) {
289
+ } catch {
290
290
  return null;
291
291
  }
292
292
  }
@@ -45,7 +45,7 @@ export default class CalumaStoreService extends Service {
45
45
  this._store.forEach((obj) => destroy(obj));
46
46
 
47
47
  // `this._store` is not an ember array but a native map
48
- // eslint-disable-next-line ember/no-array-prototype-extensions
48
+
49
49
  this._store.clear();
50
50
  }
51
51
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@projectcaluma/ember-form",
3
- "version": "14.1.0",
3
+ "version": "14.2.0",
4
4
  "description": "Ember addon for rendering Caluma forms.",
5
5
  "keywords": [
6
6
  "ember-addon"
@@ -41,13 +41,13 @@
41
41
  "luxon": "^3.5.0",
42
42
  "reactiveweb": "^1.3.0",
43
43
  "tracked-toolbox": "^2.0.0",
44
- "@projectcaluma/ember-core": "^14.1.0"
44
+ "@projectcaluma/ember-core": "^14.2.0"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@ember/optional-features": "2.2.0",
48
48
  "@ember/test-helpers": "4.0.4",
49
49
  "@embroider/test-setup": "4.0.0",
50
- "@faker-js/faker": "9.4.0",
50
+ "@faker-js/faker": "9.7.0",
51
51
  "broccoli-asset-rev": "3.0.0",
52
52
  "ember-cli": "6.1.0",
53
53
  "ember-cli-clean-css": "3.0.0",
@@ -59,25 +59,25 @@
59
59
  "ember-cli-sri": "2.1.1",
60
60
  "ember-cli-terser": "4.0.2",
61
61
  "ember-load-initializers": "3.0.1",
62
- "ember-qunit": "9.0.1",
62
+ "ember-qunit": "9.0.2",
63
63
  "ember-resolver": "13.1.0",
64
64
  "ember-source": "6.1.0",
65
65
  "ember-source-channel-url": "3.0.0",
66
- "ember-try": "3.0.0",
66
+ "ember-try": "4.0.0",
67
67
  "loader.js": "4.7.0",
68
68
  "miragejs": "0.1.48",
69
- "qunit": "2.23.1",
69
+ "qunit": "2.24.1",
70
70
  "qunit-dom": "3.4.0",
71
- "sass": "1.83.4",
72
- "uikit": "3.22.0",
73
- "uuid": "11.0.5",
74
- "webpack": "5.97.1",
75
- "@projectcaluma/ember-workflow": "14.1.0",
76
- "@projectcaluma/ember-testing": "14.1.0"
71
+ "sass": "1.88.0",
72
+ "uikit": "3.23.7",
73
+ "uuid": "11.1.0",
74
+ "webpack": "5.99.8",
75
+ "@projectcaluma/ember-workflow": "14.2.0",
76
+ "@projectcaluma/ember-testing": "14.2.0"
77
77
  },
78
78
  "peerDependencies": {
79
79
  "ember-source": ">= 4.0.0",
80
- "@projectcaluma/ember-workflow": "^14.1.0"
80
+ "@projectcaluma/ember-workflow": "^14.2.0"
81
81
  },
82
82
  "dependenciesMeta": {
83
83
  "@projectcaluma/ember-core": {