@antelopejs/dms 0.20.9-next.983.g0bd3fa6 → 0.21.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.
- package/frontend-vue/layers/dms-auth/app/build/composables/useAuthFormError.ts +3 -17
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/2fa.vue +1 -1
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/forgot-validation.vue +1 -1
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/validate.vue +1 -1
- package/package.json +4 -4
|
@@ -6,8 +6,6 @@ import {
|
|
|
6
6
|
} from "#dms-core/app/composables/useFieldErrors";
|
|
7
7
|
import { resolveApiErrorMessage } from "#dms-core/app/composables/resolveApiError";
|
|
8
8
|
|
|
9
|
-
const CORE_ERROR_KEY = "error.500.description";
|
|
10
|
-
|
|
11
9
|
export interface AuthFormError {
|
|
12
10
|
title: string;
|
|
13
11
|
description: string;
|
|
@@ -42,23 +40,12 @@ export interface AuthFieldErrorTarget {
|
|
|
42
40
|
*/
|
|
43
41
|
export function useAuthFormError() {
|
|
44
42
|
const errorPresenter = useApiErrorPresenter();
|
|
45
|
-
const { i18n } = getPluginI18n();
|
|
46
43
|
const formError = ref<AuthFormError | null>(null);
|
|
47
44
|
|
|
48
|
-
|
|
49
|
-
* A page served to a visitor carries only the messages its render read,
|
|
50
|
-
* and the presenter's lookups do not complete that catalog: the error
|
|
51
|
-
* messages are loaded before any is resolved.
|
|
52
|
-
*/
|
|
53
|
-
async function loadErrorMessages(): Promise<void> {
|
|
54
|
-
if (!i18n.te(CORE_ERROR_KEY)) await i18n.setLocale(i18n.locale.value);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
async function showFormError(
|
|
45
|
+
function showFormError(
|
|
58
46
|
error: Parameters<typeof resolveApiErrorMessage>[0],
|
|
59
47
|
titleKey: string,
|
|
60
|
-
):
|
|
61
|
-
await loadErrorMessages();
|
|
48
|
+
): void {
|
|
62
49
|
const notice = errorPresenter.resolveError(error, {
|
|
63
50
|
fallbackKey: titleKey,
|
|
64
51
|
});
|
|
@@ -98,10 +85,9 @@ export function useAuthFormError() {
|
|
|
98
85
|
});
|
|
99
86
|
const form = target.form?.value;
|
|
100
87
|
if (fields.length === 0 || (!target.show && !form)) {
|
|
101
|
-
|
|
88
|
+
showFormError(error, titleKey);
|
|
102
89
|
return false;
|
|
103
90
|
}
|
|
104
|
-
await loadErrorMessages();
|
|
105
91
|
clearFormError();
|
|
106
92
|
const messages = fields.map((entry) => ({
|
|
107
93
|
name: entry.field,
|
|
@@ -132,7 +132,7 @@ async function requestForgotPassword() {
|
|
|
132
132
|
color: "success",
|
|
133
133
|
});
|
|
134
134
|
} catch (error: unknown) {
|
|
135
|
-
|
|
135
|
+
showFormError(error, "page.validate.error_title");
|
|
136
136
|
} finally {
|
|
137
137
|
isLoading.value = false;
|
|
138
138
|
}
|
|
@@ -117,7 +117,7 @@ async function requestEmailValidation() {
|
|
|
117
117
|
color: "success",
|
|
118
118
|
});
|
|
119
119
|
} catch (error: unknown) {
|
|
120
|
-
|
|
120
|
+
showFormError(error, "page.validate.error_title");
|
|
121
121
|
} finally {
|
|
122
122
|
isLoading.value = false;
|
|
123
123
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antelopejs/dms",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"description": "AntelopeJS DMS. Plug in your PostgreSQL, MySQL, MariaDB, MongoDB or RethinkDB database and your coding agent builds a back office and analytics dashboard as typed TypeScript. Real-time updates on the data the DMS manages.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"antelopejs",
|
|
@@ -112,8 +112,8 @@
|
|
|
112
112
|
"ua-parser-js": "^2.0.9",
|
|
113
113
|
"zod": "^3.25.0",
|
|
114
114
|
"zod-to-json-schema": "~3.24.6",
|
|
115
|
-
"@antelopejs/interface-dms
|
|
116
|
-
"@antelopejs/interface-dms": "^0.
|
|
115
|
+
"@antelopejs/interface-dms": "^0.14.4",
|
|
116
|
+
"@antelopejs/interface-dms-builder": "^0.6.0"
|
|
117
117
|
},
|
|
118
118
|
"devDependencies": {
|
|
119
119
|
"@antelopejs/api": "~1.7.0",
|
|
@@ -209,7 +209,7 @@
|
|
|
209
209
|
"optional": true
|
|
210
210
|
}
|
|
211
211
|
},
|
|
212
|
-
"gitHead": "
|
|
212
|
+
"gitHead": "c4fb69c31ae2ad734d7f9a8e8fa36006ea0ec1bf",
|
|
213
213
|
"scripts": {
|
|
214
214
|
"build": "pnpm --filter @antelopejs/interface-dms --filter @antelopejs/interface-dms-builder build && rimraf dist && antelopejs-tsc && tsc-alias && tsc -p bin/tsconfig.types.json",
|
|
215
215
|
"dev": "ajs project run --inspect -w -p playground",
|