-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Feature: Media Type Create Options #18196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
4161a01
use extension point for media type create options
madsrasmussen 58a04ab
register collection action
madsrasmussen 0505f5f
Update manifests.ts
madsrasmussen 03532cc
Merge branch 'v15/dev' into v15/feature/media-type-create-options
madsrasmussen 4b6d1e0
Update manifests.ts
madsrasmussen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
27 changes: 0 additions & 27 deletions
27
...braco.Web.UI.Client/src/packages/media/media-types/entity-actions/create/create.action.ts
This file was deleted.
Oops, something went wrong.
20 changes: 20 additions & 0 deletions
20
...edia/media-types/entity-actions/create/default/default-media-type-create-option-action.ts
This file contains hidden or 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,20 @@ | ||
| import { UMB_CREATE_MEDIA_TYPE_WORKSPACE_PATH_PATTERN } from '../../../paths.js'; | ||
| import type { UmbMediaTypeFolderEntityType, UmbMediaTypeRootEntityType } from '../../../entity.js'; | ||
| import { UmbEntityCreateOptionActionBase } from '@umbraco-cms/backoffice/entity-create-option-action'; | ||
| import type { MetaEntityCreateOptionAction } from '@umbraco-cms/backoffice/entity-create-option-action'; | ||
|
|
||
| export class UmbDefaultMediaTypeCreateOptionAction extends UmbEntityCreateOptionActionBase<MetaEntityCreateOptionAction> { | ||
| override async getHref() { | ||
| const parentEntityType = this.args.entityType as UmbMediaTypeRootEntityType | UmbMediaTypeFolderEntityType; | ||
| if (!parentEntityType) throw new Error('Entity type is required to create a document type'); | ||
|
|
||
| const parentUnique = this.args.unique ?? null; | ||
|
|
||
| return UMB_CREATE_MEDIA_TYPE_WORKSPACE_PATH_PATTERN.generateAbsolute({ | ||
| parentEntityType, | ||
| parentUnique, | ||
| }); | ||
| } | ||
| } | ||
|
|
||
| export { UmbDefaultMediaTypeCreateOptionAction as api }; |
17 changes: 17 additions & 0 deletions
17
...o.Web.UI.Client/src/packages/media/media-types/entity-actions/create/default/manifests.ts
This file contains hidden or 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,17 @@ | ||
| import { UMB_MEDIA_TYPE_FOLDER_ENTITY_TYPE, UMB_MEDIA_TYPE_ROOT_ENTITY_TYPE } from '../../../entity.js'; | ||
| import type { UmbExtensionManifestKind } from '@umbraco-cms/backoffice/extension-registry'; | ||
|
|
||
| export const manifests: Array<UmbExtensionManifest | UmbExtensionManifestKind> = [ | ||
| { | ||
| type: 'entityCreateOptionAction', | ||
| alias: 'Umb.EntityCreateOptionAction.MediaType.Default', | ||
| name: 'Default Media Type Entity Create Option Action', | ||
| weight: 1200, | ||
| api: () => import('./default-media-type-create-option-action.js'), | ||
| forEntityTypes: [UMB_MEDIA_TYPE_ROOT_ENTITY_TYPE, UMB_MEDIA_TYPE_FOLDER_ENTITY_TYPE], | ||
| meta: { | ||
| icon: 'icon-add', | ||
| label: '#actions_create', | ||
| }, | ||
| }, | ||
| ]; |
19 changes: 19 additions & 0 deletions
19
...co.Web.UI.Client/src/packages/media/media-types/entity-actions/create/folder/manifests.ts
This file contains hidden or 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 @@ | ||
| import { UMB_MEDIA_TYPE_FOLDER_ENTITY_TYPE, UMB_MEDIA_TYPE_ROOT_ENTITY_TYPE } from '../../../entity.js'; | ||
| import { UMB_MEDIA_TYPE_FOLDER_REPOSITORY_ALIAS } from '../../../constants.js'; | ||
| import type { UmbExtensionManifestKind } from '@umbraco-cms/backoffice/extension-registry'; | ||
|
|
||
| export const manifests: Array<UmbExtensionManifest | UmbExtensionManifestKind> = [ | ||
| { | ||
| type: 'entityCreateOptionAction', | ||
| kind: 'folder', | ||
| alias: 'Umb.EntityCreateOptionAction.MediaType.Folder', | ||
| name: 'Media Type Folder Entity Create Option Action', | ||
| forEntityTypes: [UMB_MEDIA_TYPE_ROOT_ENTITY_TYPE, UMB_MEDIA_TYPE_FOLDER_ENTITY_TYPE], | ||
| meta: { | ||
| icon: 'icon-folder', | ||
| label: '#create_folder', | ||
| description: '#create_folderDescription', | ||
| folderRepositoryAlias: UMB_MEDIA_TYPE_FOLDER_REPOSITORY_ALIAS, | ||
| }, | ||
| }, | ||
| ]; |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
17 changes: 17 additions & 0 deletions
17
...ent/src/packages/media/media-types/tree/tree-item-children/collection/action/manifests.ts
This file contains hidden or 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,17 @@ | ||
| import { UMB_MEDIA_TYPE_TREE_ITEM_CHILDREN_COLLECTION_ALIAS } from '../constants.js'; | ||
| import { UMB_COLLECTION_ALIAS_CONDITION } from '@umbraco-cms/backoffice/collection'; | ||
|
|
||
| export const manifests: Array<UmbExtensionManifest> = [ | ||
| { | ||
| type: 'collectionAction', | ||
| kind: 'create', | ||
| name: 'Media Type Tree Item Children Collection Create Action', | ||
| alias: 'Umb.CollectionAction.MediaTypeTreeItemChildren.Create', | ||
| conditions: [ | ||
| { | ||
| alias: UMB_COLLECTION_ALIAS_CONDITION, | ||
| match: UMB_MEDIA_TYPE_TREE_ITEM_CHILDREN_COLLECTION_ALIAS, | ||
| }, | ||
| ], | ||
| }, | ||
| ]; |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.