@adminforth/i18n 3.1.2 → 3.1.4

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/build.log CHANGED
@@ -20,5 +20,5 @@ custom/package.json
20
20
  custom/pnpm-lock.yaml
21
21
  custom/tsconfig.json
22
22
 
23
- sent 45,330 bytes received 305 bytes 91,270.00 bytes/sec
24
- total size is 44,178 speedup is 0.97
23
+ sent 45,486 bytes received 305 bytes 91,582.00 bytes/sec
24
+ total size is 44,318 speedup is 0.97
@@ -40,6 +40,10 @@ const selectedLanguage = ref('');
40
40
  const coreStore = useCoreStore();
41
41
 
42
42
  watch(() => selectedLanguage.value, async (newVal) => {
43
+ // Select clears its value while the user types a search, the language stays until another one is picked
44
+ if (!newVal) {
45
+ return;
46
+ }
43
47
  await setLang({ setLocaleMessage, locale }, props.meta.pluginInstanceId, newVal);
44
48
  coreStore.getPublicConfig();
45
49
  coreStore.getLoginFormConfig();
@@ -40,6 +40,10 @@ const selectedLanguage = ref('');
40
40
  const coreStore = useCoreStore();
41
41
 
42
42
  watch(() => selectedLanguage.value, async (newVal) => {
43
+ // Select clears its value while the user types a search, the language stays until another one is picked
44
+ if (!newVal) {
45
+ return;
46
+ }
43
47
  await setLang({ setLocaleMessage, locale }, props.meta.pluginInstanceId, newVal);
44
48
  coreStore.getPublicConfig();
45
49
  coreStore.getLoginFormConfig();
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import { Filters, suggestIfTypo, AdminForthDataTypes, RAMLock, filtersTools, AdminForthFilterOperators, interpretResource, ActionCheckSource, AllowedActionsEnum } from "adminforth";
10
+ import { Filters, suggestIfTypo, AdminForthDataTypes, RAMLock, filtersTools, AdminForthFilterOperators, interpretResource, ActionCheckSource, AllowedActionsEnum, rejectApiRawFilters } from "adminforth";
11
11
  import { I18nBase, getCountryCodeFromLangCode, getPrimaryLanguageCode, requiresSlavicPlurals, SLAVIC_PLURAL_EXAMPLES, SLAVIC_PLURAL_FORMS, SLAVIC_PLURAL_FORMS_HINT, SOURCE_LANGUAGE } from './base.js';
12
12
  import { z } from "zod";
13
13
  import iso6391 from 'iso-639-1';
@@ -949,6 +949,10 @@ export default class I18nPlugin extends I18nBase {
949
949
  handler: (_a) => __awaiter(this, [_a], void 0, function* ({ body, adminUser, headers, query, cookies, requestUrl, response }) {
950
950
  var _b, _c;
951
951
  const resource = this.resourceConfig;
952
+ const rawFilterError = rejectApiRawFilters(body.filters);
953
+ if (rawFilterError) {
954
+ return rawFilterError;
955
+ }
952
956
  for (const hook of ((_c = (_b = resource.hooks) === null || _b === void 0 ? void 0 : _b.list) === null || _c === void 0 ? void 0 : _c.beforeDatasourceRequest) || []) {
953
957
  const filterTools = filtersTools.get(body);
954
958
  body.filtersTools = filterTools;
package/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- import AdminForth, { Filters, suggestIfTypo, AdminForthDataTypes, RAMLock, filtersTools, AdminForthFilterOperators, interpretResource, ActionCheckSource, AllowedActionsEnum } from "adminforth";
1
+ import AdminForth, { Filters, suggestIfTypo, AdminForthDataTypes, RAMLock, filtersTools, AdminForthFilterOperators, interpretResource, ActionCheckSource, AllowedActionsEnum, rejectApiRawFilters } from "adminforth";
2
2
  import type { IAdminForth, IHttpServer, AdminForthComponentDeclaration, AdminForthResourceColumn, AdminForthResource, BeforeLoginConfirmationFunction, AdminForthConfigMenuItem, AdminUser } from "adminforth";
3
3
  import type { PluginOptions, SupportedLanguage } from './types.js';
4
4
  import { I18nBase, getCountryCodeFromLangCode, getPrimaryLanguageCode, requiresSlavicPlurals, SLAVIC_PLURAL_EXAMPLES, SLAVIC_PLURAL_FORMS, SLAVIC_PLURAL_FORMS_HINT, SOURCE_LANGUAGE } from './base.js';
@@ -1178,6 +1178,10 @@ export default class I18nPlugin extends I18nBase<PluginOptions> {
1178
1178
  request_schema: getFilteredIdsBodySchema,
1179
1179
  handler: async ({ body, adminUser, headers, query, cookies, requestUrl, response }) => {
1180
1180
  const resource = this.resourceConfig;
1181
+ const rawFilterError = rejectApiRawFilters(body.filters);
1182
+ if (rawFilterError) {
1183
+ return rawFilterError;
1184
+ }
1181
1185
 
1182
1186
  for (const hook of resource.hooks?.list?.beforeDatasourceRequest || []) {
1183
1187
  const filterTools = filtersTools.get(body);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/i18n",
3
- "version": "3.1.2",
3
+ "version": "3.1.4",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",