muffin-admin 8.5.4 → 8.5.6

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.
@@ -28,7 +28,7 @@ import { AdminModal, PayloadButtons, useConfirmation } from "../common";
28
28
  import { HelpLink } from "../common/HelpLink";
29
29
  import { useMuffinAdminOpts } from "../hooks";
30
30
  import { useAction } from "../hooks/useAction";
31
- import { buildIcon, findBuilder, requestHeaders } from "../utils";
31
+ import { buildIcon, findBuilder, prepareFilters, requestHeaders } from "../utils";
32
32
  export function ActionButton(_a) {
33
33
  var { paths, confirm, file } = _a, props = __rest(_a, ["paths", "confirm", "file"]);
34
34
  const translate = useTranslate();
@@ -42,7 +42,7 @@ export function ActionButton(_a) {
42
42
  const onHandle = (payload) => __awaiter(this, void 0, void 0, function* () {
43
43
  const process = confirm ? yield confirmation.confirm({ message: confirmMessage }) : true;
44
44
  if (process)
45
- yield mutate({ record, payload });
45
+ mutate({ record, payload });
46
46
  });
47
47
  return _jsx(ActionButtonBase, Object.assign({}, props, { isPending: isPending, onHandle: onHandle }));
48
48
  }
@@ -111,6 +111,6 @@ function FileButton({ path, record, label, icon, filterValues, }) {
111
111
  if (authorization)
112
112
  url += `&t=${authorization}`;
113
113
  if (Object.keys(filterValues).length)
114
- url += `&where=${JSON.stringify(filterValues)}`;
114
+ url += `&where=${prepareFilters(filterValues)}`;
115
115
  return (_jsx(Button, { href: url, label: label, component: Link, children: buildIcon(icon) }));
116
116
  }
@@ -18,7 +18,7 @@ var __rest = (this && this.__rest) || function (s, e) {
18
18
  }
19
19
  return t;
20
20
  };
21
- import { makeRequest, setupAdmin } from "./utils";
21
+ import { makeRequest, prepareFilters, setupAdmin } from "./utils";
22
22
  export function MuffinDataprovider(apiUrl) {
23
23
  function request(url, options) {
24
24
  return __awaiter(this, void 0, void 0, function* () {
@@ -33,12 +33,8 @@ export function MuffinDataprovider(apiUrl) {
33
33
  getList: (resource, params) => __awaiter(this, void 0, void 0, function* () {
34
34
  const { filter, pagination, sort } = params;
35
35
  const query = {};
36
- if (filter) {
37
- query.where = JSON.stringify(Object.entries(filter).reduce((acc, [key, value]) => {
38
- acc[key] = Array.isArray(value) ? { $in: value } : value;
39
- return acc;
40
- }, {}));
41
- }
36
+ if (filter)
37
+ query.where = prepareFilters(filter);
42
38
  if (pagination) {
43
39
  const { page, perPage: limit } = pagination;
44
40
  query.limit = limit;
package/dist/i18n/ru.js CHANGED
@@ -3,4 +3,5 @@ const muffinRussianMessages = Object.assign(Object.assign({}, raRussianMessages)
3
3
  instructions: "Инструкции",
4
4
  how_to_use_admin: "Как использовать админку?",
5
5
  } });
6
+ muffinRussianMessages.ra.action.edit = "Изменить";
6
7
  export default muffinRussianMessages;
package/dist/index.d.ts CHANGED
@@ -18,4 +18,4 @@ export * from "./fields";
18
18
  export * from "./hooks";
19
19
  export * from "./types";
20
20
  export declare function initAdmin(prefix?: string, containerId?: string): Promise<void>;
21
- export declare const VERSION = "8.5.4";
21
+ export declare const VERSION = "8.5.6";
package/dist/index.js CHANGED
@@ -41,4 +41,4 @@ export function initAdmin() {
41
41
  root.render(_jsx(MuffinAdminContext.Provider, { value: adminOpts, children: _jsx(MuffinAdmin, {}) }));
42
42
  });
43
43
  }
44
- export const VERSION = "8.5.4";
44
+ export const VERSION = "8.5.6";