-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Introduce Section Alias condition const #19633
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
6 commits
Select commit
Hold shift + click to select a range
ce5d95f
Refactor section conditions into subfolders
madsrasmussen 920503c
use const
madsrasmussen 50dafc5
fix build
madsrasmussen 4765bc2
Refactor section alias condition to use constant
madsrasmussen 8f2f8d8
Merge branch 'main' into v16/feature/section-alias-const
madsrasmussen 198f92d
Merge branch 'main' into v16/feature/section-alias-const
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
1 change: 0 additions & 1 deletion
1
src/Umbraco.Web.UI.Client/examples/collection/collection/card-view/index.ts
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
src/Umbraco.Web.UI.Client/examples/collection/collection/table-view/index.ts
This file was deleted.
Oops, something went wrong.
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
3 changes: 2 additions & 1 deletion
3
src/Umbraco.Web.UI.Client/src/packages/core/section/conditions/constants.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 |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| export const UMB_SECTION_USER_PERMISSION_CONDITION_ALIAS = 'Umb.Condition.SectionUserPermission'; | ||
| export * from './section-alias/constants.js'; | ||
| export * from './section-user-permission/constants.js'; |
20 changes: 3 additions & 17 deletions
20
src/Umbraco.Web.UI.Client/src/packages/core/section/conditions/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 |
|---|---|---|
| @@ -1,18 +1,4 @@ | ||
| import { UMB_SECTION_USER_PERMISSION_CONDITION_ALIAS } from './constants.js'; | ||
| import { UmbSectionAliasCondition } from './section-alias.condition.js'; | ||
| import { UmbSectionUserPermissionCondition } from './section-user-permission.condition.js'; | ||
| import { manifests as sectionAliasManifests } from './section-alias/manifests.js'; | ||
| import { manifests as sectionUserPermissionManifests } from './section-user-permission/manifests.js'; | ||
|
|
||
| export const manifests: Array<UmbExtensionManifest> = [ | ||
| { | ||
| type: 'condition', | ||
| name: 'Section User Permission Condition', | ||
| alias: UMB_SECTION_USER_PERMISSION_CONDITION_ALIAS, | ||
| api: UmbSectionUserPermissionCondition, | ||
| }, | ||
| { | ||
| type: 'condition', | ||
| name: 'Section Alias Condition', | ||
| alias: 'Umb.Condition.SectionAlias', | ||
| api: UmbSectionAliasCondition, | ||
| }, | ||
| ]; | ||
| export const manifests: Array<UmbExtensionManifest> = [...sectionAliasManifests, ...sectionUserPermissionManifests]; |
1 change: 1 addition & 0 deletions
1
src/Umbraco.Web.UI.Client/src/packages/core/section/conditions/section-alias/constants.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 @@ | ||
| export const UMB_SECTION_ALIAS_CONDITION_ALIAS = 'Umb.Condition.SectionAlias'; |
11 changes: 11 additions & 0 deletions
11
src/Umbraco.Web.UI.Client/src/packages/core/section/conditions/section-alias/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,11 @@ | ||
| import { UMB_SECTION_ALIAS_CONDITION_ALIAS } from './constants.js'; | ||
| import { UmbSectionAliasCondition } from './section-alias.condition.js'; | ||
|
|
||
| export const manifests: Array<UmbExtensionManifest> = [ | ||
| { | ||
| type: 'condition', | ||
| name: 'Section Alias Condition', | ||
| alias: UMB_SECTION_ALIAS_CONDITION_ALIAS, | ||
| api: UmbSectionAliasCondition, | ||
| }, | ||
| ]; |
6 changes: 3 additions & 3 deletions
6
...ion/conditions/section-alias.condition.ts → .../section-alias/section-alias.condition.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
22 changes: 22 additions & 0 deletions
22
src/Umbraco.Web.UI.Client/src/packages/core/section/conditions/section-alias/types.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,22 @@ | ||
| import type { UMB_SECTION_ALIAS_CONDITION_ALIAS } from './constants.js'; | ||
| import type { UmbConditionConfigBase } from '@umbraco-cms/backoffice/extension-api'; | ||
|
|
||
| export type SectionAliasConditionConfig = UmbConditionConfigBase<typeof UMB_SECTION_ALIAS_CONDITION_ALIAS> & { | ||
| /** | ||
| * Define the section that this extension should be available in | ||
| * @example "Umb.Section.Content" | ||
| */ | ||
| match: string; | ||
| /** | ||
| * Define one or more workspaces that this extension should be available in | ||
| * @example | ||
| * ["Umb.Section.Content", "Umb.Section.Media"] | ||
| */ | ||
| oneOf?: Array<string>; | ||
| }; | ||
|
|
||
| declare global { | ||
| interface UmbExtensionConditionConfigMap { | ||
| UmbSectionAliasConditionConfig: SectionAliasConditionConfig; | ||
| } | ||
| } |
1 change: 1 addition & 0 deletions
1
...o.Web.UI.Client/src/packages/core/section/conditions/section-user-permission/constants.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 @@ | ||
| export const UMB_SECTION_USER_PERMISSION_CONDITION_ALIAS = 'Umb.Condition.SectionUserPermission'; |
11 changes: 11 additions & 0 deletions
11
...o.Web.UI.Client/src/packages/core/section/conditions/section-user-permission/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,11 @@ | ||
| import { UmbSectionUserPermissionCondition } from './section-user-permission.condition.js'; | ||
| import { UMB_SECTION_USER_PERMISSION_CONDITION_ALIAS } from './constants.js'; | ||
|
|
||
| export const manifests: Array<UmbExtensionManifest> = [ | ||
| { | ||
| type: 'condition', | ||
| name: 'Section User Permission Condition', | ||
| alias: UMB_SECTION_USER_PERMISSION_CONDITION_ALIAS, | ||
| api: UmbSectionUserPermissionCondition, | ||
| }, | ||
| ]; |
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
2 changes: 1 addition & 1 deletion
2
...ions/section-user-permission.condition.ts → ...sion/section-user-permission.condition.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
20 changes: 20 additions & 0 deletions
20
...braco.Web.UI.Client/src/packages/core/section/conditions/section-user-permission/types.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 type { UMB_SECTION_USER_PERMISSION_CONDITION_ALIAS } from './constants.js'; | ||
| import type { UmbConditionConfigBase } from '@umbraco-cms/backoffice/extension-api'; | ||
|
|
||
| export type UmbSectionUserPermissionConditionConfig = UmbConditionConfigBase< | ||
| typeof UMB_SECTION_USER_PERMISSION_CONDITION_ALIAS | ||
| > & { | ||
| /** | ||
| * | ||
| * | ||
| * @example | ||
| * "Umb.Section.Content" | ||
| */ | ||
| match: string; | ||
| }; | ||
|
|
||
| declare global { | ||
| interface UmbExtensionConditionConfigMap { | ||
| UmbSectionUserPermissionConditionConfig: UmbSectionUserPermissionConditionConfig; | ||
| } | ||
| } |
37 changes: 2 additions & 35 deletions
37
src/Umbraco.Web.UI.Client/src/packages/core/section/conditions/types.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 |
|---|---|---|
| @@ -1,35 +1,2 @@ | ||
| import type { UMB_SECTION_USER_PERMISSION_CONDITION_ALIAS } from './constants.js'; | ||
| import type { UmbConditionConfigBase } from '@umbraco-cms/backoffice/extension-api'; | ||
|
|
||
| export type UmbSectionUserPermissionConditionConfig = UmbConditionConfigBase< | ||
| typeof UMB_SECTION_USER_PERMISSION_CONDITION_ALIAS | ||
| > & { | ||
| /** | ||
| * | ||
| * | ||
| * @example | ||
| * "Umb.Section.Content" | ||
| */ | ||
| match: string; | ||
| }; | ||
|
|
||
| export type SectionAliasConditionConfig = UmbConditionConfigBase<'Umb.Condition.SectionAlias'> & { | ||
| /** | ||
| * Define the section that this extension should be available in | ||
| * @example "Umb.Section.Content" | ||
| */ | ||
| match: string; | ||
| /** | ||
| * Define one or more workspaces that this extension should be available in | ||
| * @example | ||
| * ["Umb.Section.Content", "Umb.Section.Media"] | ||
| */ | ||
| oneOf?: Array<string>; | ||
| }; | ||
|
|
||
| declare global { | ||
| interface UmbExtensionConditionConfigMap { | ||
| UmbSectionUserPermissionConditionConfig: UmbSectionUserPermissionConditionConfig; | ||
| UmbSectionAliasConditionConfig: SectionAliasConditionConfig; | ||
| } | ||
| } | ||
| export type * from './section-alias/types.js'; | ||
| export type * from './section-user-permission/types.js'; |
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
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
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
Oops, something went wrong.
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.