Skip to content

Commit 743ce92

Browse files
Rafał Dzięgielewskigitbook-bot
authored andcommitted
GITBOOK-96: what's new + small fixes
1 parent 9ba9571 commit 743ce92

35 files changed

+1112
-384
lines changed
Loading
Loading
Loading

SUMMARY.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
* [Mongoose](installation/adapters/mongoose.md)
2525
* [Community Adapters](installation/adapters/community-adapters/README.md)
2626
* [AdonisJS](https://github.com/chirgjin/adminjs-adonis)
27-
* [Troubleshooting](installation/troubleshooting.md)
27+
* [What's new in v7?](installation/whats-new-in-v7.md)
28+
* [Migration Guide v7](installation/migration-guide-v7.md)
2829

2930
## Basics
3031

@@ -46,6 +47,7 @@
4647
* [Edit](basics/api/edit.md)
4748
* [Delete](basics/api/delete.md)
4849
* [Bulk Delete](basics/api/bulk-delete.md)
50+
* [Themes](basics/themes.md)
4951

5052
## UI Customization
5153

basics/api/list.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ description: allows you to list and filer all the records for a given resource
2828

2929
**Example** 
3030

31-
__[_https://demo.adminjs.com_/admin/api/resources/Admin/actions/list?direction=desc\&sortBy=\_id\&filters.email=admin\&page=1](https://demo.adminjs.com/admin/api/resources/Admin/actions/list?direction=desc\&sortBy=\_id\&filters.email=admin\&page=1)
31+
[_https://demo.adminjs.com_/admin/api/resources/Admin/actions/list?direction=desc\&sortBy=\_id\&filters.email=admin\&page=1](https://demo.adminjs.com/admin/api/resources/Admin/actions/list?direction=desc\&sortBy=\_id\&filters.email=admin\&page=1)
3232

3333
```json
3434
{

basics/features/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Features should be included in `features` section of your resource, example:
88

99
<pre class="language-typescript"><code class="lang-typescript"><strong>import { ResourceWithOptions } from 'adminjs';
1010
</strong><strong>
11-
</strong><strong>import User from './user.entity';
11+
</strong><strong>import User from './user.entity.js';
1212
</strong><strong>
1313
</strong><strong>const UserResource: ResourceWithOptions = {
1414
</strong><strong> resource: User,

basics/features/import-and-export.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@ Then add one line (`features`) to resource entry in AdminJS config.
1717
```javascript
1818
import importExportFeature from '@adminjs/import-export';
1919

20+
import componentLoader from './component-loader.js';
2021
...
2122

2223
{
2324
resource: Entity,
2425
features: [
25-
importExportFeature(),
26+
importExportFeature({ componentLoader }),
2627
],
2728
}
2829
```

basics/features/leaflet-maps.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ The feature goes inside `features` in your resource specification. Take a look a
6868
```typescript
6969
import leafletFeatures, { getLeafletDist } from '@adminjs/leaflet';
7070
// other imports
71-
import Marker from './marker.entity';
71+
import Marker from './marker.entity.js';
7272

7373
// Other code - remember to set up the common configuration!
7474

@@ -144,7 +144,7 @@ The feature goes inside `features` in your resource specification. Take a look a
144144
```typescript
145145
import leafletFeatures, { getLeafletDist } from '@adminjs/leaflet';
146146
// other imports
147-
import MapEntity from './map.entity';
147+
import MapEntity from './map.entity.js';
148148

149149
// Other code - remember to set up the common configuration!
150150

@@ -233,7 +233,10 @@ An example application can be found in [@adminjs/leaflet GitHub repository](http
233233

234234
```bash
235235
$ git clone https://github.com/SoftwareBrothers/adminjs-leaflet.git
236-
$ cd adminjs-leaflet/example-app
236+
$ cd adminjs-leaflet
237+
$ yarn install
238+
$ yarn build
239+
$ cd example-app
237240
$ yarn install
238241
$ docker-compose up -d
239242
$ yarn start

basics/features/logger.md

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ Then we have to define `Log` entity - the place we will track changes. Below yo
2222
{% tab title="Sequelize" %}
2323
```typescript
2424
import { DataTypes, Model } from 'sequelize';
25-
import db from './sequelize.connection';
26-
import User from './user.entity';
25+
26+
import db from './sequelize.connection.js';
27+
import User from './user.entity.js';
2728

2829
export interface ILog = {
2930
id: number;
@@ -224,7 +225,7 @@ export const LogModel = model<Log>('Log', LogSchema);
224225

225226
{% tab title="ObjectionJS" %}
226227
```typescript
227-
import { BaseModel } from '../utils/base-model';
228+
import { BaseModel } from '../utils/base-model.js';
228229

229230
class Log extends BaseModel {
230231
id: number;
@@ -286,12 +287,15 @@ To get logger to work, add extra property to resource config. Below you can find
286287

287288
```javascript
288289
import loggerFeature from '@adminjs/logger';
289-
import ResourceModel from './resource.entity';
290+
291+
import ResourceModel from './resource.entity.js';
292+
import componentLoader from './component-loader.js';
290293

291294
export default {
292295
resource: ResourceModel,
293296
features: [
294297
loggerFeature({
298+
componentLoader,
295299
propertiesMapping: {
296300
user: 'userId',
297301
},
@@ -308,22 +312,23 @@ To have Log resource appear in AdminJS panel, we have to define it first.&#x20;
308312

309313
```javascript
310314
import { createLoggerResource } from '@adminjs/logger';
311-
import Log from './logs.entity';
315+
316+
import Log from './logs.entity.js';
312317

313318
const config = {
314-
resource: Log,
315-
featureOptions: {
316-
propertiesMapping: {
317-
recordTitle: 'title' //field to store logged record's title
318-
},
319-
userIdAttribute: 'id', //primary key currently logged user
320-
resourceOptions: {
321-
navigation: {
322-
name: 'SectionName',
323-
icon: 'iconName'
324-
}
325-
}
319+
resource: Log,
320+
featureOptions: {
321+
propertiesMapping: {
322+
recordTitle: 'title' //field to store logged record's title
323+
,
324+
userIdAttribute: 'id', //primary key currently logged user
325+
resourceOptions: {
326+
navigation: {
327+
name: 'SectionName',
328+
icon: 'iconName'
329+
}
326330
}
331+
}
327332
}
328333

329334
export default createLoggerResource(config)

basics/features/password.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ Next step is to add feature option to user resource
1717
```javascript
1818
import argon2 from 'argon2';
1919
import passwordsFeature from '@adminjs/passwords';
20-
import User from './models/user';
20+
21+
import User from './models/user.js';
22+
import componentLoader from './component-loader.js';
2123

2224
const adminJsOptions = {
2325
resources: [
@@ -29,6 +31,7 @@ const adminJsOptions = {
2931
},
3032
features: [
3133
passwordsFeature({
34+
componentLoader,
3235
properties: {
3336
encryptedPassword: 'password',
3437
password: 'newPassword'

0 commit comments

Comments
 (0)