@projectcaluma/ember-form 12.6.0 → 12.8.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -22,4 +22,10 @@
22
22
  {{option.label}}
23
23
  {{/if}}
24
24
  </label>
25
- {{/each}}
25
+ {{/each}}
26
+ {{#if (and @field.optional @field.answer.value)}}
27
+ <br />
28
+ <a href="" data-test-radio-reset {{on "click" this.reset}}>
29
+ {{t "caluma.form.power-select.reset"}}
30
+ </a>
31
+ {{/if}}
@@ -0,0 +1,11 @@
1
+ import { action } from "@ember/object";
2
+ import Component from "@glimmer/component";
3
+
4
+ export default class CfFieldInpuRadio extends Component {
5
+ @action
6
+ reset(event) {
7
+ event.preventDefault();
8
+
9
+ this.args.onSave(null);
10
+ }
11
+ }
@@ -49,7 +49,7 @@
49
49
  {{#if this.save.last.error}}
50
50
  <div uk-dropdown="pos: bottom-left" class="uk-padding-small">
51
51
  <div class="uk-alert uk-alert-danger uk-margin-small">
52
- {{t "caluma.form.error.intro"}}
52
+ {{this.errorIntroText}}
53
53
  </div>
54
54
  <p class="uk-text-meta uk-margin-small">
55
55
  {{t "caluma.form.error.details"}}
@@ -1,4 +1,5 @@
1
1
  import { action } from "@ember/object";
2
+ import { service } from "@ember/service";
2
3
  import { macroCondition, isTesting } from "@embroider/macros";
3
4
  import Component from "@glimmer/component";
4
5
  import { timeout, restartableTask } from "ember-concurrency";
@@ -18,6 +19,8 @@ import { hasQuestionType } from "@projectcaluma/ember-core/helpers/has-question-
18
19
  * @argument {Field} field The field data model to render
19
20
  */
20
21
  export default class CfFieldComponent extends Component {
22
+ @service intl;
23
+
21
24
  @action
22
25
  registerComponent() {
23
26
  this.args.field._components.add(this);
@@ -55,6 +58,17 @@ export default class CfFieldComponent extends Component {
55
58
  );
56
59
  }
57
60
 
61
+ get errorIntroText() {
62
+ const _errors = this.save.last.error.errors ?? [];
63
+ if (_errors.some((e) => e?.code === "network_error")) {
64
+ return this.intl.t("caluma.form.error.offline");
65
+ }
66
+ if (_errors.some((e) => e?.message.includes("code='invalid'"))) {
67
+ return this.intl.t("caluma.form.error.invalid");
68
+ }
69
+ return this.intl.t("caluma.form.error.technical-error");
70
+ }
71
+
58
72
  get saveIndicatorVisible() {
59
73
  return !hasQuestionType(this.args.field?.question, "action-button");
60
74
  }
@@ -20,6 +20,7 @@ module.exports = {
20
20
  { name: "ember-flatpickr" },
21
21
  { name: "ember-in-viewport" },
22
22
  { name: "ember-math-helpers" },
23
+ { name: "ember-truth-helpers" },
23
24
  { name: "ember-power-select" },
24
25
  ],
25
26
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@projectcaluma/ember-form",
3
- "version": "12.6.0",
3
+ "version": "12.8.0",
4
4
  "description": "Ember addon for rendering Caluma forms.",
5
5
  "keywords": [
6
6
  "ember-addon"
@@ -9,67 +9,81 @@
9
9
  "homepage": "https://docs.caluma.io/ember-caluma",
10
10
  "repository": "github:projectcaluma/ember-caluma",
11
11
  "dependencies": {
12
+ "@babel/core": "^7.23.6",
12
13
  "@ember/string": "^3.1.1",
13
- "@embroider/macros": "^1.13.0",
14
- "@embroider/util": "^1.12.0",
14
+ "@embroider/macros": "^1.13.4",
15
+ "@embroider/util": "^1.12.1",
15
16
  "@glimmer/component": "^1.1.2",
16
17
  "@glimmer/tracking": "^1.1.2",
17
18
  "ember-apollo-client": "~4.0.2",
18
- "ember-auto-import": "^2.6.3",
19
+ "ember-auto-import": "^2.7.1",
19
20
  "ember-autoresize-modifier": "^0.7.0",
20
- "ember-cli-babel": "^7.26.11",
21
- "ember-cli-htmlbars": "^6.2.0",
21
+ "ember-cli-babel": "^8.2.0",
22
+ "ember-cli-htmlbars": "^6.3.0",
22
23
  "ember-cli-showdown": "^7.0.0",
23
24
  "ember-composable-helpers": "^5.0.0",
24
- "ember-concurrency": "^3.0.0",
25
+ "ember-concurrency": "^3.1.1",
25
26
  "ember-fetch": "^8.1.2",
26
27
  "ember-flatpickr": "^4.0.0",
27
28
  "ember-in-viewport": "^4.1.0",
28
- "ember-intl": "^5.7.2",
29
- "ember-math-helpers": "^3.0.0",
30
- "ember-power-select": "^7.1.0",
31
- "ember-resources": "^6.4.0",
32
- "ember-uikit": "^8.0.0",
29
+ "ember-intl": "^6.4.0",
30
+ "ember-math-helpers": "^4.0.0",
31
+ "ember-power-select": "^7.2.0",
32
+ "ember-resources": "^6.4.2",
33
+ "ember-truth-helpers": "^4.0.3",
34
+ "ember-uikit": "^9.0.0",
33
35
  "ember-validators": "^4.1.2",
34
36
  "graphql": "^15.8.0",
35
37
  "jexl": "^2.3.0",
36
38
  "lodash.isequal": "^4.5.0",
37
- "luxon": "^3.3.0",
39
+ "luxon": "^3.4.4",
38
40
  "tracked-toolbox": "^2.0.0",
39
- "@projectcaluma/ember-core": "^12.6.0"
41
+ "@projectcaluma/ember-core": "^12.8.0"
40
42
  },
41
43
  "devDependencies": {
42
44
  "@ember/optional-features": "2.0.0",
43
- "@ember/test-helpers": "3.2.0",
44
- "@embroider/test-setup": "3.0.1",
45
- "@faker-js/faker": "8.0.2",
45
+ "@ember/test-helpers": "3.2.1",
46
+ "@embroider/test-setup": "3.0.3",
47
+ "@faker-js/faker": "8.3.1",
46
48
  "broccoli-asset-rev": "3.0.0",
47
- "ember-cli": "4.12.2",
48
- "ember-cli-code-coverage": "2.0.0",
49
+ "ember-cli": "5.5.0",
50
+ "ember-cli-clean-css": "3.0.0",
51
+ "ember-cli-code-coverage": "2.0.3",
49
52
  "ember-cli-dependency-checker": "3.3.2",
50
53
  "ember-cli-inject-live-reload": "2.1.0",
51
- "ember-cli-mirage": "3.0.0-alpha.3",
54
+ "ember-cli-mirage": "3.0.2",
52
55
  "ember-cli-sri": "2.1.1",
53
56
  "ember-cli-terser": "4.0.2",
54
57
  "ember-load-initializers": "2.1.2",
55
- "ember-qunit": "7.0.0",
56
- "ember-resolver": "11.0.0",
57
- "ember-source": "4.12.3",
58
+ "ember-qunit": "8.0.2",
59
+ "ember-resolver": "11.0.1",
60
+ "ember-source": "5.5.0",
58
61
  "ember-source-channel-url": "3.0.0",
59
- "ember-try": "2.0.0",
62
+ "ember-try": "3.0.0",
60
63
  "loader.js": "4.7.0",
61
- "miragejs": "0.1.47",
62
- "qunit": "2.19.4",
63
- "qunit-dom": "2.0.0",
64
- "uikit": "3.16.26",
65
- "uuid": "9.0.0",
64
+ "miragejs": "0.1.48",
65
+ "qunit": "2.20.0",
66
+ "qunit-dom": "3.0.0",
67
+ "uikit": "3.17.11",
68
+ "uuid": "9.0.1",
66
69
  "webpack": "5.89.0",
67
- "@projectcaluma/ember-testing": "12.6.0",
68
- "@projectcaluma/ember-workflow": "12.6.0"
70
+ "@projectcaluma/ember-testing": "12.8.0",
71
+ "@projectcaluma/ember-workflow": "12.8.0"
69
72
  },
70
73
  "peerDependencies": {
71
74
  "ember-source": "^4.0.0",
72
- "@projectcaluma/ember-workflow": "^12.6.0"
75
+ "@projectcaluma/ember-workflow": "^12.8.0"
76
+ },
77
+ "dependenciesMeta": {
78
+ "@projectcaluma/ember-core": {
79
+ "injected": true
80
+ },
81
+ "@projectcaluma/ember-testing": {
82
+ "injected": true
83
+ },
84
+ "@projectcaluma/ember-workflow": {
85
+ "injected": true
86
+ }
73
87
  },
74
88
  "peerDependenciesMeta": {
75
89
  "@projectcaluma/ember-workflow": {
@@ -77,7 +91,7 @@
77
91
  }
78
92
  },
79
93
  "engines": {
80
- "node": "14.* || 16.* || >= 18"
94
+ "node": ">= 18"
81
95
  },
82
96
  "ember": {
83
97
  "edition": "octane"
@@ -13,8 +13,10 @@ caluma:
13
13
  info: "Mehr Informationen"
14
14
 
15
15
  error:
16
- intro: "Oh nein, auf unserer Seite ist etwas schief gelaufen. Ihre Antwort konnte nicht gespeichert werden."
17
16
  details: "Technische Details:"
17
+ technical-error: "Oh nein, auf unserer Seite ist etwas schief gelaufen. Ihre Antwort konnte nicht gespeichert werden."
18
+ offline: "Ihre Antwort konnte nicht gespeichert werden, da Sie offline sind. Bitte überprüfen Sie Ihre Internetverbindung und versuchen Sie es erneut."
19
+ invalid: "Ihre Antwort konnte nicht gespeichert werden, weil die Validierung fehlgeschlagen ist. Bitte überprüfen Sie Ihre Eingaben und versuchen Sie es erneut."
18
20
 
19
21
  navigation:
20
22
  next: "Weiter"
@@ -38,6 +40,7 @@ caluma:
38
40
  options-empty: "Keine Optionen vorhanden"
39
41
  search-placeholder: "Hier tippen um zu suchen"
40
42
  search-empty: "Keine Optionen gefunden"
43
+ reset: "Zurücksetzen"
41
44
 
42
45
  validation:
43
46
  blank: "Dieses Feld darf nicht leer gelassen werden"
@@ -13,8 +13,10 @@ caluma:
13
13
  info: "More information"
14
14
 
15
15
  error:
16
- intro: "Oh no, something went wrong on our side. Your answer could not be saved."
17
16
  details: "Technical details:"
17
+ technical-error: "Oh no, something went wrong on our side. Your answer could not be saved."
18
+ offline: "Your answer could not be saved because you are offline. Please check your internet connection and try again."
19
+ invalid: "Your answer could not be saved because the validation failed. Please check your entries and try again."
18
20
 
19
21
  navigation:
20
22
  next: "Next"
@@ -38,6 +40,7 @@ caluma:
38
40
  options-empty: "No options available"
39
41
  search-placeholder: "Type here to search options"
40
42
  search-empty: "Search didn't match any options"
43
+ reset: "Reset"
41
44
 
42
45
  validation:
43
46
  blank: "This field can't be blank"
@@ -13,8 +13,10 @@ caluma:
13
13
  info: "Plus d'informations"
14
14
 
15
15
  error:
16
- intro: "Oh non, quelque chose a mal tourné de notre côté. Votre réponse n'a pas pu être sauvegardée."
17
16
  details: "Détails techniques :"
17
+ technical-error: "Oh non, quelque chose a mal tourné de notre côté. Votre réponse n'a pas pu être sauvegardée."
18
+ offline: "Votre réponse n'a pas pu être enregistrée car vous êtes hors ligne. Veuillez vérifier votre connexion Internet et réessayer."
19
+ invalid: "Votre réponse n'a pas pu être enregistrée car la validation a échoué. Veuillez vérifier vos saisies et réessayer."
18
20
 
19
21
  navigation:
20
22
  next: "suivante"
@@ -38,6 +40,7 @@ caluma:
38
40
  options-empty: "Pas d'options disponibles"
39
41
  search-placeholder: "Tapez ici pour rechercher"
40
42
  search-empty: "Pas d'options trouvées"
43
+ reset: "Réinitialiser"
41
44
 
42
45
  validation:
43
46
  blank: "Ce champ ne doit pas être laissé vide"
@@ -0,0 +1,10 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "declarationDir": "declarations",
5
+ "emitDeclarationOnly": true,
6
+ "noEmit": false,
7
+ "rootDir": "."
8
+ },
9
+ "include": ["addon", "addon-test-support"]
10
+ }