Skip to content

Commit 3e15883

Browse files
committed
Improve documentation for headless usage
1 parent 27b6fb3 commit 3e15883

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

docs_headless/src/content/docs/SoftDeleteDataProvider.md

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ layout: default
33
title: "Soft Delete Setup"
44
---
55

6-
The soft delete feature is an [Enterprise Edition add-on](https://react-admin-ee.marmelab.com/documentation/ra-soft-delete) that allows you to "delete" records without actually removing them from your database.
6+
The soft delete feature is an [Enterprise Edition add-on](https://react-admin-ee.marmelab.com/documentation/ra-core-ee) that allows you to "delete" records without actually removing them from your database.
77

88
Use it to:
99

@@ -12,14 +12,12 @@ Use it to:
1212
- Restore archived items individually or in bulk
1313
- Track who deleted what and when
1414

15-
It provides drop-in replacements for DeleteButton and BulkDeleteButton.
16-
1715
## Installation
1816

1917
```bash
20-
npm install --save @react-admin/ra-soft-delete
18+
npm install --save @react-admin/ra-core-ee
2119
# or
22-
yarn add @react-admin/ra-soft-delete
20+
yarn add @react-admin/ra-core-ee
2321
```
2422

2523
You will need an active Enterprise Edition license to use this package. Please refer to the [Enterprise Edition documentation](https://react-admin-ee.marmelab.com) for more details.
@@ -28,8 +26,8 @@ You will need an active Enterprise Edition license to use this package. Please r
2826

2927
### Methods
3028

31-
`ra-soft-delete` relies on the `dataProvider` to soft-delete, restore or view deleted records.
32-
In order to use the `ra-soft-delete`, you must add a few new methods to your data provider:
29+
The Soft Delete features of `ra-core-ee` rely on the `dataProvider` to soft-delete, restore or view deleted records.
30+
In order to use those features, you must add a few new methods to your data provider:
3331

3432
- `softDelete` performs the soft deletion of the provided record.
3533
- `softDeleteMany` performs the soft deletion of the provided records.
@@ -95,18 +93,18 @@ const dataProviderWithSoftDelete: SoftDeleteDataProvider = {
9593
};
9694
```
9795

98-
**Tip**: `ra-soft-delete` automatically populates the `authorId` parameter using `authProvider.getIdentity()` if it is implemented. It will use the `id` field of the returned identity object. Otherwise this field will be left blank.
96+
**Tip**: `ra-core-ee` automatically populates the `authorId` parameter using `authProvider.getIdentity()` if it is implemented. It will use the `id` field of the returned identity object. Otherwise this field will be left blank.
9997

10098
**Tip**: Deleted records are immutable, so you don't need to implement an `updateDeleted` method.
10199

102-
Once your provider has all soft-delete methods, pass it to the `<Admin>` component and you're ready to start using `ra-soft-delete`.
100+
Once your provider has all soft-delete methods, pass it to the [`<CoreAdmin>`](./CoreAdmin.md) component and you're ready to start using the Soft Delete feature.
103101

104102
```tsx
105103
// in src/App.tsx
106-
import { Admin } from 'react-admin';
104+
import { CoreAdmin } from 'ra-core';
107105
import { dataProvider } from './dataProvider';
108106

109-
const App = () => <Admin dataProvider={dataProvider}>{/* ... */}</Admin>;
107+
const App = () => <CoreAdmin dataProvider={dataProvider}>{/* ... */}</CoreAdmin>;
110108
```
111109

112110
### Deleted Record Structure
@@ -138,15 +136,15 @@ Here is an example of a deleted record:
138136

139137
### Builders
140138

141-
`ra-soft-delete` comes with two built-in implementations that will add soft delete capabilities to your data provider without any specific backend requirements. You can choose the one that best fits your needs:
139+
`ra-core-ee` comes with two built-in implementations that will add soft delete capabilities to your data provider without any specific backend requirements. You can choose the one that best fits your needs:
142140

143141
- [`addSoftDeleteBasedOnResource`](./addSoftDeleteBasedOnResource.md) stores the deleted records for all resources in a single resource. This resource is named `deleted_records` by default.
144142

145143
With this builder, all deleted records disappear from their original resource when soft-deleted, and are recreated in the `deleted_records` resource.
146144

147145
```tsx
148146
// in src/dataProvider.ts
149-
import { addSoftDeleteBasedOnResource } from '@react-admin/ra-soft-delete';
147+
import { addSoftDeleteBasedOnResource } from '@react-admin/ra-core-ee';
150148
import baseDataProvider from './baseDataProvider';
151149

152150
export const dataProvider = addSoftDeleteBasedOnResource(
@@ -163,7 +161,7 @@ export const dataProvider = addSoftDeleteBasedOnResource(
163161

164162
```tsx
165163
// in src/dataProvider.ts
166-
import { addSoftDeleteInPlace } from '@react-admin/ra-soft-delete';
164+
import { addSoftDeleteInPlace } from '@react-admin/ra-core-ee';
167165
import baseDataProvider from './baseDataProvider';
168166

169167
export const dataProvider = addSoftDeleteInPlace(
@@ -201,7 +199,7 @@ Each data provider verb has its own hook so you can use them in custom component
201199

202200
## `createMany`
203201

204-
`ra-soft-delete` provides a default implementation of the `createMany` method that simply calls `create` multiple times. However, some data providers may be able to create multiple records at once, which can greatly improve performances.
202+
`ra-core-ee` provides a default implementation of the `createMany` method that simply calls `create` multiple times. However, some data providers may be able to create multiple records at once, which can greatly improve performances.
205203

206204
```tsx
207205
const dataProviderWithCreateMany = {

0 commit comments

Comments
 (0)