Headless CMS and Content Managment Hub
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

54 lines
1.7 KiB

// ==========================================================================
// Squidex Headless CMS
// ==========================================================================
// Copyright (c) Squidex UG (haftungsbeschraenkt)
// All rights reserved. Licensed under the MIT license.
// ==========================================================================
using System.ComponentModel.DataAnnotations;
using System.Linq;
using Squidex.Domain.Apps.Core.Apps;
using Squidex.Domain.Apps.Entities.Apps.Commands;
using Squidex.Infrastructure.Collections;
namespace Squidex.Areas.Api.Controllers.Apps.Models
{
public sealed class UpdateAppSettingsDto
{
/// <summary>
/// The configured app patterns.
/// </summary>
[Required]
public PatternDto[] Patterns { get; set; }
/// <summary>
/// The configured UI editors.
/// </summary>
[Required]
public EditorDto[] Editors { get; set; }
/// <summary>
/// Hide the scheduler for content items.
/// </summary>
public bool HideScheduler { get; set; }
/// <summary>
/// Hide the datetime mode button.
/// </summary>
public bool HideDateTimeModeButton { get; set; }
public UpdateAppSettings ToCommand()
{
return new UpdateAppSettings
{
Settings = new AppSettings
{
Editors = Editors?.Select(x => x.ToEditor()).ToImmutableList()!,
HideScheduler = HideScheduler,
HideDateTimeModeButton = HideDateTimeModeButton,
Patterns = Patterns?.Select(x => x.ToPattern()).ToImmutableList()!
}
};
}
}
}