282 lines
11 KiB
Markdown
282 lines
11 KiB
Markdown
# @refinedev/react-location
|
|
|
|
## 3.36.2
|
|
|
|
### Patch Changes
|
|
|
|
- [#3126](https://github.com/refinedev/refine/pull/3126) [`ccaf8bde357`](https://github.com/refinedev/refine/commit/ccaf8bde35737558de69953b5b0c7de64df351cd) Thanks [@thaihuynhxyz](https://github.com/thaihuynhxyz)! - fix: react extract incorrect resource from encoded pathname
|
|
|
|
## 3.36.1
|
|
|
|
### Patch Changes
|
|
|
|
- [#3126](https://github.com/refinedev/refine/pull/3126) [`ccaf8bde357`](https://github.com/refinedev/refine/commit/ccaf8bde35737558de69953b5b0c7de64df351cd) Thanks [@thaihuynhxyz](https://github.com/thaihuynhxyz)! - fix: react extract incorrect resource from encoded pathname
|
|
|
|
## 3.36.0
|
|
|
|
### Minor Changes
|
|
|
|
- Added ability to manage the initial route of **refine** by binding `initialRoute` variable to `RouterComponent` component.
|
|
|
|
- Added support for fallback/404 with `catchAll` and `ErrorComponent`.
|
|
|
|
## 3.35.0
|
|
|
|
### Minor Changes
|
|
|
|
- Added ability to manage the initial route of **refine** by binding `initialRoute` variable to `RouterComponent` component.
|
|
|
|
- Added support for fallback/404 with `catchAll` and `ErrorComponent`.
|
|
|
|
## 3.34.0
|
|
|
|
### Minor Changes
|
|
|
|
- [#2486](https://github.com/refinedev/refine/pull/2486) [`ee4d0d112a`](https://github.com/refinedev/refine/commit/ee4d0d112a7742fc799cd11ffe2eb3c5165d7bcb) Thanks [@aliemir](https://github.com/aliemir)! - Added ability to manage the initial route of **refine** by binding `initialRoute` variable to `RouterComponent` component.
|
|
|
|
- [#2486](https://github.com/refinedev/refine/pull/2486) [`ee4d0d112a`](https://github.com/refinedev/refine/commit/ee4d0d112a7742fc799cd11ffe2eb3c5165d7bcb) Thanks [@aliemir](https://github.com/aliemir)! - Added support for fallback/404 with `catchAll` and `ErrorComponent`.
|
|
|
|
## 3.33.0
|
|
|
|
### Minor Changes
|
|
|
|
- Update type declaration generation with `tsc` instead of `tsup` for better navigation throughout projects source code.
|
|
|
|
## 3.32.0
|
|
|
|
### Minor Changes
|
|
|
|
- [#2440](https://github.com/refinedev/refine/pull/2440) [`0150dcd070`](https://github.com/refinedev/refine/commit/0150dcd0700253f1c4908e7e5f2e178bb122e9af) Thanks [@aliemir](https://github.com/aliemir)! - Update type declaration generation with `tsc` instead of `tsup` for better navigation throughout projects source code.
|
|
|
|
## 3.31.3
|
|
|
|
### Patch Changes
|
|
|
|
- Fixed default login page is `<LoginPage>`.
|
|
|
|
* 🎉 Added `AuthPage` component to the `refine` app. This page is used to login, register, forgot password and update password. Login page is default page and old `LoginPage` component is deprecated.
|
|
|
|
# New Auth Hooks
|
|
|
|
📌 Added `useRegister` hook. This hook is used to register new user. `useRegister` falls into register function of [`AuthProvider`](https://refine.dev/docs/core/providers/auth-provider/).
|
|
|
|
📌 Added `useForgotPassword` hook. This hook is used to forgot password. `useForgotPassword` falls into `forgotPassword` function of [`AuthProvider`](https://refine.dev/docs/core/providers/auth-provider/).
|
|
|
|
📌 Added `useUpdatePassword` hook. This hook is used to update password. `useUpdatePassword` falls into `updatePassword` function of [`AuthProvider`](https://refine.dev/docs/core/providers/auth-provider/).
|
|
|
|
```diff
|
|
- <LoginPage>
|
|
+ <AuthPage>
|
|
```
|
|
|
|
# New `AuthPage` props:
|
|
|
|
```info
|
|
interface IAuthPageProps extends IAuthCommonProps {
|
|
type?: "login" | "register" | "forgotPassword" | "updatePassword";
|
|
}
|
|
|
|
interface IAuthCommonProps {
|
|
submitButton?: React.ReactNode;
|
|
registerLink?: React.ReactNode;
|
|
loginLink?: React.ReactNode;
|
|
forgotPasswordLink?: React.ReactNode;
|
|
updatePasswordLink?: React.ReactNode;
|
|
backLink?: React.ReactNode;
|
|
providers?: IProvider[];
|
|
}
|
|
|
|
interface IProvider {
|
|
name: string;
|
|
icon?: React.ReactNode;
|
|
label?: string;
|
|
}
|
|
```
|
|
|
|
## 3.31.2
|
|
|
|
### Patch Changes
|
|
|
|
- [#2415](https://github.com/refinedev/refine/pull/2415) [`f7c98f0ef9`](https://github.com/refinedev/refine/commit/f7c98f0ef9743fbee2cc44206548cf2da3ceb01c) Thanks [@biskuvit](https://github.com/biskuvit)! - Fixed default login page is `<LoginPage>`.
|
|
|
|
## 3.31.1
|
|
|
|
### Patch Changes
|
|
|
|
- [#2299](https://github.com/refinedev/refine/pull/2299) [`a02cb9e8ef`](https://github.com/refinedev/refine/commit/a02cb9e8ef20f14194d772720442208930e3aa40) Thanks [@biskuvit](https://github.com/biskuvit)! - 🎉 Added `AuthPage` to the `refine` app. This page is used to login, register, forgot password and update password. Login page is default page and old `LoginPage` component is deprecated.
|
|
|
|
# New Auth Hooks
|
|
|
|
📌 Added `useRegister` hook. This hook is used to register new user. `useRegister` falls into register function of [`AuthProvider`](https://refine.dev/docs/core/providers/auth-provider/).
|
|
|
|
📌 Added `useForgotPassword` hook. This hook is used to forgot password. `useForgotPassword` falls into `forgotPassword` function of [`AuthProvider`](https://refine.dev/docs/core/providers/auth-provider/).
|
|
|
|
📌 Added `useUpdatePassword` hook. This hook is used to update password. `useUpdatePassword` falls into `updatePassword` function of [`AuthProvider`](https://refine.dev/docs/core/providers/auth-provider/).
|
|
|
|
```diff
|
|
- <LoginPage>
|
|
+ <AuthPage>
|
|
```
|
|
|
|
# New `AuthPage` props:
|
|
|
|
```info
|
|
interface IAuthPageProps extends IAuthCommonProps {
|
|
type?: "login" | "register" | "forgotPassword" | "updatePassword";
|
|
}
|
|
|
|
interface IAuthCommonProps {
|
|
registerLink?: React.ReactNode;
|
|
loginLink?: React.ReactNode;
|
|
forgotPasswordLink?: React.ReactNode;
|
|
updatePasswordLink?: React.ReactNode;
|
|
backLink?: React.ReactNode;
|
|
providers?: IProvider[];
|
|
}
|
|
|
|
interface IProvider {
|
|
name: string;
|
|
icon?: React.ReactNode;
|
|
label?: string;
|
|
}
|
|
```
|
|
|
|
# Add `AuthPage` as a default page to Routers
|
|
|
|
📌 Added `AuthPage` to the `refine-nextjs-router`. Default page is `AuthPage`.
|
|
|
|
📌 Added `AuthPage` to the `refine-react-location`. Default page is `AuthPage`.
|
|
|
|
📌 Added `AuthPage` to the `refine-react-router-v6`. Default page is `AuthPage`.
|
|
|
|
📌 Added `AuthPage` to the `refine-remix-router`. Default page is `AuthPage`.
|
|
|
|
## 3.31.0
|
|
|
|
### Minor Changes
|
|
|
|
- Add React@18 support 🚀
|
|
|
|
## 3.30.0
|
|
|
|
### Minor Changes
|
|
|
|
- [#1718](https://github.com/refinedev/refine/pull/1718) [`b38620d842`](https://github.com/refinedev/refine/commit/b38620d84237e13212811daada7b49ee654c70eb) Thanks [@omeraplak](https://github.com/omeraplak)! - Add React@18 support 🚀
|
|
|
|
## 3.29.0
|
|
|
|
### Minor Changes
|
|
|
|
- Pass the full `resource` to the `accessControlProvider` can method. This will enable Attribute Based Access Control (ABAC), for example granting permissions based on the value of a field in the resource object.
|
|
|
|
```ts
|
|
const App: React.FC = () => {
|
|
<Refine
|
|
// other providers and props
|
|
accessControlProvider={{
|
|
can: async ({ resource, action, params }) => {
|
|
if (resource === "posts" && action === "edit") {
|
|
return Promise.resolve({
|
|
can: false,
|
|
reason: "Unauthorized",
|
|
});
|
|
}
|
|
|
|
// or you can access directly *resource object
|
|
// const resourceName = params?.resource?.name;
|
|
// const anyUsefulOption = params?.resource?.options?.yourUsefulOption;
|
|
// if (resourceName === "posts" && anyUsefulOption === true && action === "edit") {
|
|
// return Promise.resolve({
|
|
// can: false,
|
|
// reason: "Unauthorized",
|
|
// });
|
|
// }
|
|
|
|
return Promise.resolve({ can: true });
|
|
},
|
|
}}
|
|
/>;
|
|
};
|
|
```
|
|
|
|
## 3.28.0
|
|
|
|
### Minor Changes
|
|
|
|
- [`e78b181b12`](https://github.com/refinedev/refine/commit/e78b181b12adb35e516c19b5382a211e10476add) Thanks [@omeraplak](https://github.com/omeraplak)! - Pass the full `resource` to the `accessControlProvider` can method. This will enable Attribute Based Access Control (ABAC), for example granting permissions based on the value of a field in the resource object.
|
|
|
|
```ts
|
|
const App: React.FC = () => {
|
|
<Refine
|
|
// other providers and props
|
|
accessControlProvider={{
|
|
can: async ({ resource, action, params }) => {
|
|
if (resource === "posts" && action === "edit") {
|
|
return Promise.resolve({
|
|
can: false,
|
|
reason: "Unauthorized",
|
|
});
|
|
}
|
|
|
|
// or you can access directly *resource object
|
|
// const resourceName = params?.resource?.name;
|
|
// const anyUsefulOption = params?.resource?.options?.yourUsefulOption;
|
|
// if (resourceName === "posts" && anyUsefulOption === true && action === "edit") {
|
|
// return Promise.resolve({
|
|
// can: false,
|
|
// reason: "Unauthorized",
|
|
// });
|
|
// }
|
|
|
|
return Promise.resolve({ can: true });
|
|
},
|
|
}}
|
|
/>;
|
|
};
|
|
```
|
|
|
|
## 3.27.0
|
|
|
|
### Minor Changes
|
|
|
|
- All of the refine packages have dependencies on the `@pankod/refine-core` package. So far we have managed these dependencies with `peerDependencies` + `dependencies` but this causes issues like #2183. (having more than one @pankod/refine-core version in node_modules and creating different instances)
|
|
|
|
Managing as `peerDependencies` + `devDependencies` seems like the best way for now to avoid such issues.
|
|
|
|
### Patch Changes
|
|
|
|
- Fix adding the current path to the `to` parameter when redirecting to the login page after `logout` - #2211
|
|
|
|
## 3.26.0
|
|
|
|
### Minor Changes
|
|
|
|
- [#2217](https://github.com/refinedev/refine/pull/2217) [`b4aae00f77`](https://github.com/refinedev/refine/commit/b4aae00f77a2476d847994db21298ae25e4cf6e5) Thanks [@omeraplak](https://github.com/omeraplak)! - All of the refine packages have dependencies on the `@pankod/refine-core` package. So far we have managed these dependencies with `peerDependencies` + `dependencies` but this causes issues like #2183. (having more than one @pankod/refine-core version in node_modules and creating different instances)
|
|
|
|
Managing as `peerDependencies` + `devDependencies` seems like the best way for now to avoid such issues.
|
|
|
|
## 3.25.3
|
|
|
|
### Patch Changes
|
|
|
|
- [#2214](https://github.com/refinedev/refine/pull/2214) [`91db05caf7`](https://github.com/refinedev/refine/commit/91db05caf796025d2ad4f64221541cc1fc5f9c5d) Thanks [@omeraplak](https://github.com/omeraplak)! - Fix adding the current path to the `to` parameter when redirecting to the login page after `logout` - #2211
|
|
|
|
## 3.25.2
|
|
|
|
### Patch Changes
|
|
|
|
- Fixed a bug that caused `<ErrorComponent/>` to does not appear in the `404` state
|
|
|
|
## 3.25.1
|
|
|
|
### Patch Changes
|
|
|
|
- [#1918](https://github.com/refinedev/refine/pull/1918) [`b8a4093fda`](https://github.com/refinedev/refine/commit/b8a4093fdabab3d1ff821182ee5b96e2c74a9ecd) Thanks [@biskuvit](https://github.com/biskuvit)! - Fixed a bug that caused `<ErrorComponent/>` to does not appear in the `404` state
|
|
|
|
## 3.22.2
|
|
|
|
### Patch Changes
|
|
|
|
- Updated dependencies [[`2deb19babf`](https://github.com/refinedev/refine/commit/2deb19babfc6db5b00b111ec29aa5ece4c371bbc)]:
|
|
- @pankod/refine-core@3.23.2
|