Skip to content

Commit

Permalink
Improve structure of code blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasdax98 committed Jan 30, 2024
1 parent c34f71c commit 506433f
Showing 1 changed file with 22 additions and 17 deletions.
39 changes: 22 additions & 17 deletions docs/docs/migration/migration-from-v5-to-v6.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,22 +90,29 @@ The `JobStatus` enum was renamed to `KubernetesJobStatus`.
}
```

5. Replace `ContentScopeModule` with `UserPermissionsModule` :
5. Replace `ContentScopeModule` with `UserPermissionsModule`

Remove `ContentScopeModule`:

```diff
- ContentScopeModule.forRoot({
- ...
- }),
+ UserPermissionsModule.forRootAsync({
+ useFactory: (userService: UserService, accessControlService: AccessControlService) => ({
+ availablePermissions: [/* Array of strings defined in interface Permission */],
+ availableContentScopes: [/* Array of content Scopes */],
+ userService,
+ accessControlService,
+ }),
+ inject: [UserService, AccessControlService],
+ imports: [/* Modules which provide the services injected in useFactory */],
+ }),
```

Add `UserPermissionsModule`:

```ts
UserPermissionsModule.forRootAsync({
useFactory: (userService: UserService, accessControlService: AccessControlService) => ({
availablePermissions: [/* Array of strings defined in interface Permission */],
availableContentScopes: [/* Array of content Scopes */],
userService,
accessControlService,
}),
inject: [UserService, AccessControlService],
imports: [/* Modules which provide the services injected in useFactory */],
}),
```

6. Rename and add Decorators
Expand Down Expand Up @@ -251,12 +258,10 @@ This was removed because it was often unwanted and overridden.

2. You can remove workarounds like

```tsx
<FinalForm
onAfterSubmit={() => {
//don't go back automatically
}}
/>
```diff
- onAfterSubmit={() => {
- //don't go back automatically
- }}
```

### @comet/admin-icons
Expand Down

0 comments on commit 506433f

Please sign in to comment.