Minor Changes
-
Ability to disable server-side pagination on
useTable
anduseList
hooks.Implementation
Added
hasPagination
property touseTable
to enable/disable pagination. UpdateduseList
config with no pagination option. SethasPagination
tofalse
to disable pagination.useTable
hook uses theuseList
hook under the hood and propagates thehasPagination
property to it. Also setting pagination related return values toundefined
for better type check on the user side.Use Cases
In some data providers, some of the resources might not support pagination which was not supported prior to these changes. To handle the pagination on the client-side or to disable completely, users can set
hasPagination
tofalse
.
Patch Changes
-
Added
actions
translate support for CRUD operations (list
,create
,edit
,show
) in theuseBreadcrumb
useBreadcrumb
hook.#️⃣ First, We need to add the
actions
key to the translation file."actions": { "list": "List", "create": "Create", "edit": "Edit", "show": "Show" },
#️⃣ If you don't provide the
actions
key,useBreadcrumb
will try to find thebuttons
key in thetranslation
file for backward compatibility."buttons": { "list": "List", "create": "Create", "edit": "Edit", "show": "Show" },
🎉 You can check the code part of this pull request to see how it works here👇🏼
const key = `actions.${action}`; const actionLabel = translate(key); if (actionLabel === key) { console.warn( `Breadcrumb missing translate key for the "${action}" action. Please add "actions.${action}" key to your translation file. For more information, see https://refine.dev/docs/core/hooks/useBreadcrumb/#i18n-support`, ); breadcrumbs.push({ label: translate(`buttons.${action}`, humanizeString(action)), }); } else { breadcrumbs.push({ label: translate(key, humanizeString(action)), }); }