Skip to content

Commit

Permalink
Merge branch 'v15/dev' into contrib
Browse files Browse the repository at this point in the history
  • Loading branch information
nul800sebastiaan committed Nov 12, 2024
2 parents 0c668ee + f916229 commit 178c5dc
Show file tree
Hide file tree
Showing 16 changed files with 39 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.Factories;
using Umbraco.Cms.Api.Management.ViewModels.MemberType;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Services.ContentTypeEditing;
using Umbraco.Cms.Web.Common.Authorization;

namespace Umbraco.Cms.Api.Management.Controllers.MemberType;

[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessMemberTypes)]
public class AvailableCompositionMemberTypeController : MemberTypeControllerBase
{
private readonly IMemberTypeEditingService _memberTypeEditingService;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.ViewModels.MemberType;
using Umbraco.Cms.Core.Mapping;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;

namespace Umbraco.Cms.Api.Management.Controllers.MemberType;

[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessMemberTypes)]
public class CompositionReferenceMemberTypeController : MemberTypeControllerBase
{
private readonly IMemberTypeService _memberTypeService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
namespace Umbraco.Cms.Api.Management.Controllers.MemberType;

[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessMemberTypes)]
public class ConfigurationMemberTypeController : MemberTypeControllerBase
{
private readonly IConfigurationPresentationFactory _configurationPresentationFactory;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;

namespace Umbraco.Cms.Api.Management.Controllers.MemberType;

[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessMemberTypes)]
public class CopyMemberTypeController : MemberTypeControllerBase
{
private readonly IMemberTypeService _memberTypeService;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.Factories;
Expand All @@ -9,10 +10,12 @@
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Services.ContentTypeEditing;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;

namespace Umbraco.Cms.Api.Management.Controllers.MemberType;

[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessMemberTypes)]
public class CreateMemberTypeController : MemberTypeControllerBase
{
private readonly IMemberTypeEditingPresentationFactory _memberTypeEditingPresentationFactory;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;

namespace Umbraco.Cms.Api.Management.Controllers.MemberType;

[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessMemberTypes)]
public class DeleteMemberTypeController : MemberTypeControllerBase
{
private readonly IMemberTypeService _memberTypeService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Umbraco.Cms.Api.Management.Controllers.MemberType;

[VersionedApiBackOfficeRoute(Constants.UdiEntityType.MemberType)]
[ApiExplorerSettings(GroupName = "Member Type")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessMemberTypes)]
[Authorize(Policy = AuthorizationPolicies.TreeAccessMembersOrMemberTypes)]
public abstract class MemberTypeControllerBase : ManagementApiControllerBase
{
protected IActionResult OperationStatusResult(ContentTypeOperationStatus status)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Umbraco.Cms.Api.Management.Controllers.MemberType.Tree;

[VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Tree}/{Constants.UdiEntityType.MemberType}")]
[ApiExplorerSettings(GroupName = "Member Type")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessMemberTypes)]
[Authorize(Policy = AuthorizationPolicies.TreeAccessMembersOrMemberTypes)]
public class MemberTypeTreeControllerBase : NamedEntityTreeControllerBase<MemberTypeTreeItemResponseModel>
{
private readonly IMemberTypeService _memberTypeService;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.Factories;
Expand All @@ -10,10 +11,12 @@
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Services.ContentTypeEditing;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;

namespace Umbraco.Cms.Api.Management.Controllers.MemberType;

[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessMemberTypes)]
public class UpdateMemberTypeController : MemberTypeControllerBase
{
private readonly IMemberTypeEditingPresentationFactory _memberTypeEditingPresentationFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ void AddAllowedApplicationsPolicy(string policyName, params string[] allowedClai
AddAllowedApplicationsPolicy(AuthorizationPolicies.TreeAccessMediaOrMediaTypes, Constants.Applications.Media, Constants.Applications.Settings);
AddAllowedApplicationsPolicy(AuthorizationPolicies.TreeAccessMemberGroups, Constants.Applications.Members);
AddAllowedApplicationsPolicy(AuthorizationPolicies.TreeAccessMemberTypes, Constants.Applications.Settings);
AddAllowedApplicationsPolicy(AuthorizationPolicies.TreeAccessMembersOrMemberTypes, Constants.Applications.Settings, Constants.Applications.Members);
AddAllowedApplicationsPolicy(AuthorizationPolicies.TreeAccessPartialViews, Constants.Applications.Settings);
AddAllowedApplicationsPolicy(AuthorizationPolicies.TreeAccessRelationTypes, Constants.Applications.Settings);
AddAllowedApplicationsPolicy(AuthorizationPolicies.TreeAccessScripts, Constants.Applications.Settings);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public static class AuthorizationPolicies
public const string TreeAccessDictionaryOrTemplates = nameof(TreeAccessDictionaryOrTemplates);
public const string TreeAccessDocumentOrMediaOrContentTypes = nameof(TreeAccessDocumentOrMediaOrContentTypes);
public const string TreeAccessStylesheetsOrDocumentOrMediaOrMember = nameof(TreeAccessStylesheetsOrDocumentOrMediaOrMember);
public const string TreeAccessMembersOrMemberTypes = nameof(TreeAccessMembersOrMemberTypes);

// other
public const string DictionaryPermissionByResource = nameof(DictionaryPermissionByResource);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ export class UmbContentTypeWorkspaceViewEditGroupElement extends UmbLitElement {
?disabled=${!this._hasOwnerContainer}
@blur=${this.#blurGroup}
@change=${this.#renameGroup}
${this._group!.name === '' ? umbFocus() : nothing}></uui-input>
${this._group!.name === '' ? umbFocus() : nothing}
auto-width></uui-input>
</div>
</div>
<div slot="header-actions">
Expand Down Expand Up @@ -208,10 +209,10 @@ export class UmbContentTypeWorkspaceViewEditGroupElement extends UmbLitElement {
<uui-input
type="number"
label=${this.localize.term('sort_sortOrder')}
.value=${this.group!.sortOrder ?? 0}
.value=${this.group!.sortOrder.toString()}
?disabled=${!this._hasOwnerContainer}
@change=${(e: UUIInputEvent) =>
this._singleValueUpdate('sortOrder', parseInt(e.target.value as string) || 0)}></uui-input>
this._singleValueUpdate('sortOrder', parseInt(e.target.value as string) ?? 0)}></uui-input>
`,
)}
</div>
Expand Down Expand Up @@ -245,7 +246,7 @@ export class UmbContentTypeWorkspaceViewEditGroupElement extends UmbLitElement {
#group-name {
--uui-input-border-color: transparent;
width: 100%;
min-width: 200px;
}
uui-input[type='number'] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,8 @@ export class UmbContentTypeDesignEditorPropertyElement extends UmbLitElement {
.value=${this.property.description}
@input=${(e: CustomEvent) => {
if (e.target) this.#singleValueUpdate('description', (e.target as HTMLInputElement).value);
}}></uui-textarea>
}}
auto-height></uui-textarea>
</p>
</div>
<uui-button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ export class UmbSectionSidebarMenuElement<
manifest?: ManifestType;

renderHeader() {
/*
Notice we are not using the UUI-H3 here, we would need to wrap it into uui-text for this to take action,
but it does look odd so lets return to this later. I have made a few corrections especially for this component. [NL]
*/
return html`<h3>${this.localize.string(this.manifest?.meta?.label ?? '')}</h3>`;
}

Expand All @@ -44,7 +48,9 @@ export class UmbSectionSidebarMenuElement<
UmbTextStyles,
css`
h3 {
margin: var(--uui-size-5) 0;
padding: var(--uui-size-4) var(--uui-size-8);
font-size: 15px;
}
`,
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,8 @@ export class UmbPropertyTypeWorkspaceViewSettingsElement extends UmbLitElement i
@input=${this.#onDescriptionChange}
label=${this.localize.term('placeholders_enterDescription')}
placeholder=${this.localize.term('placeholders_enterDescription')}
.value=${this._data?.description}></uui-textarea>
.value=${this._data?.description}
auto-height></uui-textarea>
</div>
<umb-form-validation-message>
<umb-data-type-flow-input
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ export class UmbDocumentWorkspaceViewInfoLinksElement extends UmbLitElement {

async #requestUrls() {
if (this._isNew) return;

if (!this._unique) throw new Error('Document unique is required');
if (!this._unique) return;

const { data } = await this.#documentUrlRepository.requestItems([this._unique]);

Expand Down

0 comments on commit 178c5dc

Please sign in to comment.