-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Add changesets for DAM scoping (PR #976) --------- Co-authored-by: Johannes Obermair <48853629+johnnyomair@users.noreply.github.com> Co-authored-by: Johannes Obermair <johannes.obermair@vivid-planet.com>
- Loading branch information
1 parent
a93bb3f
commit 9d3e855
Showing
4 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"@comet/cms-api": major | ||
--- | ||
|
||
Remove `File` entity export | ||
|
||
Depending on your use case, you may either use the created file entity in the application code, or the `FileInterface` export instead. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
"@comet/cms-api": major | ||
--- | ||
|
||
Change `FilesService.upload` method signature | ||
|
||
The method now accepts an options object as first argument, and a second `scope` argument. | ||
|
||
**Before** | ||
|
||
```ts | ||
await filesService.upload(file, folderId); | ||
``` | ||
|
||
**After** | ||
|
||
```ts | ||
await filesService.upload({ file, folderId }, scope); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"@comet/cms-api": major | ||
--- | ||
|
||
Remove `Folder` entity export | ||
|
||
Depending on your use case, you may either use the created folder entity in the application code, or the `FolderInterface` export instead. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
"@comet/cms-admin": major | ||
"@comet/cms-api": major | ||
--- | ||
|
||
Add scoping to the DAM | ||
|
||
The DAM scoping can be enabled optionally. You can still use the DAM without scoping. | ||
|
||
To enable DAM scoping, you must | ||
|
||
In the API: | ||
|
||
- Create a DAM folder entity using `createFolderEntity({ Scope: DamScope });` | ||
- Create a DAM file entity using `createFileEntity({ Scope: DamScope, Folder: DamFolder });` | ||
- Pass the `Scope` DTO and the `File` and `Folder` entities when intializing the `DamModule` | ||
|
||
In the Admin: | ||
|
||
- Set `scopeParts` in the `DamConfigProvider` (e.g. `<DamConfigProvider value={{ scopeParts: ["domain"] }}>`) | ||
- Render the content scope indicator in the `DamPage` | ||
```tsx | ||
<DamPage renderContentScopeIndicator={(scope) => <ContentScopeIndicator scope={scope} />} /> | ||
``` | ||
|
||
You can access the current DAM scope in the Admin using the `useDamScope()` hook. | ||
|
||
See Demo for an example on how to enable DAM scoping. |