@projectcaluma/ember-form 12.5.0 → 12.7.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@projectcaluma/ember-form",
3
- "version": "12.5.0",
3
+ "version": "12.7.0",
4
4
  "description": "Ember addon for rendering Caluma forms.",
5
5
  "keywords": [
6
6
  "ember-addon"
@@ -9,67 +9,80 @@
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.3",
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.0",
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-uikit": "^9.0.0",
33
34
  "ember-validators": "^4.1.2",
34
35
  "graphql": "^15.8.0",
35
36
  "jexl": "^2.3.0",
36
37
  "lodash.isequal": "^4.5.0",
37
- "luxon": "^3.3.0",
38
+ "luxon": "^3.4.4",
38
39
  "tracked-toolbox": "^2.0.0",
39
- "@projectcaluma/ember-core": "^12.5.0"
40
+ "@projectcaluma/ember-core": "^12.7.0"
40
41
  },
41
42
  "devDependencies": {
42
43
  "@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",
44
+ "@ember/test-helpers": "3.2.1",
45
+ "@embroider/test-setup": "3.0.3",
46
+ "@faker-js/faker": "8.3.1",
46
47
  "broccoli-asset-rev": "3.0.0",
47
- "ember-cli": "4.12.2",
48
- "ember-cli-code-coverage": "2.0.0",
48
+ "ember-cli": "5.5.0",
49
+ "ember-cli-clean-css": "3.0.0",
50
+ "ember-cli-code-coverage": "2.0.3",
49
51
  "ember-cli-dependency-checker": "3.3.2",
50
52
  "ember-cli-inject-live-reload": "2.1.0",
51
- "ember-cli-mirage": "3.0.0-alpha.3",
53
+ "ember-cli-mirage": "3.0.2",
52
54
  "ember-cli-sri": "2.1.1",
53
55
  "ember-cli-terser": "4.0.2",
54
56
  "ember-load-initializers": "2.1.2",
55
- "ember-qunit": "7.0.0",
56
- "ember-resolver": "11.0.0",
57
- "ember-source": "4.12.3",
57
+ "ember-qunit": "8.0.2",
58
+ "ember-resolver": "11.0.1",
59
+ "ember-source": "5.5.0",
58
60
  "ember-source-channel-url": "3.0.0",
59
- "ember-try": "2.0.0",
61
+ "ember-try": "3.0.0",
60
62
  "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",
66
- "webpack": "5.88.2",
67
- "@projectcaluma/ember-testing": "12.5.0",
68
- "@projectcaluma/ember-workflow": "12.5.0"
63
+ "miragejs": "0.1.48",
64
+ "qunit": "2.20.0",
65
+ "qunit-dom": "3.0.0",
66
+ "uikit": "3.17.11",
67
+ "uuid": "9.0.1",
68
+ "webpack": "5.89.0",
69
+ "@projectcaluma/ember-workflow": "12.7.0",
70
+ "@projectcaluma/ember-testing": "12.7.0"
69
71
  },
70
72
  "peerDependencies": {
71
73
  "ember-source": "^4.0.0",
72
- "@projectcaluma/ember-workflow": "^12.5.0"
74
+ "@projectcaluma/ember-workflow": "^12.7.0"
75
+ },
76
+ "dependenciesMeta": {
77
+ "@projectcaluma/ember-core": {
78
+ "injected": true
79
+ },
80
+ "@projectcaluma/ember-testing": {
81
+ "injected": true
82
+ },
83
+ "@projectcaluma/ember-workflow": {
84
+ "injected": true
85
+ }
73
86
  },
74
87
  "peerDependenciesMeta": {
75
88
  "@projectcaluma/ember-workflow": {
@@ -77,7 +90,7 @@
77
90
  }
78
91
  },
79
92
  "engines": {
80
- "node": "14.* || 16.* || >= 18"
93
+ "node": ">= 18"
81
94
  },
82
95
  "ember": {
83
96
  "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"
@@ -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"
@@ -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"
@@ -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
+ }