Directus dataprovider package for refine.
refine offers lots of out-of-the box functionality for rapid development, without compromising extreme customizability. Use-cases include, but are not limited to admin panels, B2B applications and dashboards.
A big thanks to Directus for providing the API and js SDK and to @tspvivek for the initial implementation of the package.
For more detailed information and usage, refer to the refine data provider documentation. see below notes for more information.
npm install @workatease/refine-directus
| refine-core version | refine-directus version |
|---|---|
| 3.84.0 or before | 1.0.11 |
| 3.85.0 after | 1.0.12 |
Use below login details in example
username: demo@demo.com
password: 123456
url: https://refine.dev/docs/examples/data-provider/directus/
To enable perform archive instead of delete with DeleteButton pass metaData={softDelete:true,field:value} in DeleteButton
if no field is passed then default status field will be used and set to archived
example:
<DeleteButton
hideText
size="small"
recordItemId={record.id}
metaData={{ softDelete: true }}
/>
<DeleteButton
hideText
size="small"
recordItemId={record.id}
metaData={{ softDelete: true, isDeleted: "true" }}
/>
App.tsx
import { Directus, authProvider,dataProvider } from '@workatease/refine-directus';
function App() {
const directus = new Directus<MyCollections>("https://url");
return (
<Refine
routerProvider={routerProvider}
dataProvider={dataProvider(directus)}
authProvider={authProvider(directus)} // optional - can use your own auth provider
...
/>
);
}
All Tests are run against the latest version of Directus Cloud.
difference From the actual Library
- Removing hardcoded filter from the data provider for flexibility if status field is not present in the table
status: { _neq: 'archived' } orQuery support added to the data provider- soft delete parameter changed and added support to add custom field for soft delete
make changes packages JSON file package name changeupdate directus sdk to latest versionadd auth provider- add upload utils without react dependency
- add live provider with help of extension in directus 9 link
- update examples files
automate integration with directus server
- update library version
- "@directus/sdk": "^10.3.1"
- "@pankod/refine-core": "3.90.6"
- Auth provider to redirect with the default redirect url
- Added rnd value to the url to avoid caching issue in Auth provider
- Added rnd value to the url to avoid caching issue
- update library version
- "@directus/sdk": "^10.1.4"
- "@pankod/refine-core": "3.69.0"
- now support filter startwith, endswith, nstartswith, nendswith
- Data provider will support soft delete with metaData={softDelete:true,field:value} in DeleteButton
- Default AuthProvider added to the package