@projectcaluma/ember-form 14.4.3 → 14.5.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.
@@ -105,6 +105,12 @@ export default class CfFieldComponent extends Component {
|
|
105
105
|
|
106
106
|
yield this.args.field.validate.perform();
|
107
107
|
|
108
|
+
if (this.args.field.isInvalid) {
|
109
|
+
// If the frontend validation fails, we don't need to try saving the value
|
110
|
+
// to the backend as the backend will throw an error as well.
|
111
|
+
return;
|
112
|
+
}
|
113
|
+
|
108
114
|
return yield this.args.field.save.unlinked().perform();
|
109
115
|
}
|
110
116
|
|
package/addon/lib/field.js
CHANGED
@@ -636,6 +636,12 @@ export default class Field extends Base {
|
|
636
636
|
this.answer.pushIntoStore();
|
637
637
|
}
|
638
638
|
|
639
|
+
if (this._errors.filter(({ type }) => type === "format").length) {
|
640
|
+
// If we previously had a format validator error but now the request
|
641
|
+
// succeeded, we need to remove said error again.
|
642
|
+
this._errors = this._errors.filter(({ type }) => type !== "format");
|
643
|
+
}
|
644
|
+
|
639
645
|
return response;
|
640
646
|
} catch (e) {
|
641
647
|
const validationError = e.errors.find(
|
@@ -652,7 +658,6 @@ export default class Field extends Base {
|
|
652
658
|
},
|
653
659
|
];
|
654
660
|
} else {
|
655
|
-
this._errors = [];
|
656
661
|
throw e;
|
657
662
|
}
|
658
663
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@projectcaluma/ember-form",
|
3
|
-
"version": "14.
|
3
|
+
"version": "14.5.0",
|
4
4
|
"description": "Ember addon for rendering Caluma forms.",
|
5
5
|
"keywords": [
|
6
6
|
"ember-addon"
|
@@ -41,7 +41,7 @@
|
|
41
41
|
"luxon": "^3.5.0",
|
42
42
|
"reactiveweb": "^1.3.0",
|
43
43
|
"tracked-toolbox": "^2.0.0",
|
44
|
-
"@projectcaluma/ember-core": "^14.
|
44
|
+
"@projectcaluma/ember-core": "^14.5.0"
|
45
45
|
},
|
46
46
|
"devDependencies": {
|
47
47
|
"@ember/optional-features": "2.2.0",
|
@@ -72,12 +72,12 @@
|
|
72
72
|
"uikit": "3.23.13",
|
73
73
|
"uuid": "13.0.0",
|
74
74
|
"webpack": "5.101.3",
|
75
|
-
"@projectcaluma/ember-
|
76
|
-
"@projectcaluma/ember-
|
75
|
+
"@projectcaluma/ember-testing": "14.5.0",
|
76
|
+
"@projectcaluma/ember-workflow": "14.5.0"
|
77
77
|
},
|
78
78
|
"peerDependencies": {
|
79
79
|
"ember-source": ">= 4.0.0",
|
80
|
-
"@projectcaluma/ember-workflow": "^14.
|
80
|
+
"@projectcaluma/ember-workflow": "^14.5.0"
|
81
81
|
},
|
82
82
|
"dependenciesMeta": {
|
83
83
|
"@projectcaluma/ember-core": {
|