|
|
@ -7,7 +7,9 @@ |
|
|
|
|
|
|
|
|
using System.Collections.Generic; |
|
|
using System.Collections.Generic; |
|
|
using System.ComponentModel.DataAnnotations; |
|
|
using System.ComponentModel.DataAnnotations; |
|
|
|
|
|
using System.Linq; |
|
|
using Squidex.Domain.Apps.Core.Contents; |
|
|
using Squidex.Domain.Apps.Core.Contents; |
|
|
|
|
|
using Squidex.Infrastructure.Reflection; |
|
|
|
|
|
|
|
|
namespace Squidex.Areas.Api.Controllers.Apps.Models |
|
|
namespace Squidex.Areas.Api.Controllers.Apps.Models |
|
|
{ |
|
|
{ |
|
|
@ -28,5 +30,29 @@ namespace Squidex.Areas.Api.Controllers.Apps.Models |
|
|
/// Indicates if updates should not be allowed.
|
|
|
/// Indicates if updates should not be allowed.
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
public bool NoUpdate { get; set; } |
|
|
public bool NoUpdate { get; set; } |
|
|
|
|
|
|
|
|
|
|
|
public static WorkflowStepDto FromWorkflowStep(WorkflowStep step) |
|
|
|
|
|
{ |
|
|
|
|
|
if (step == null) |
|
|
|
|
|
{ |
|
|
|
|
|
return null; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return SimpleMapper.Map(step, new WorkflowStepDto |
|
|
|
|
|
{ |
|
|
|
|
|
Transitions = step.Transitions.ToDictionary( |
|
|
|
|
|
y => y.Key, |
|
|
|
|
|
y => WorkflowTransitionDto.FromWorkflowTransition(y.Value)) |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public WorkflowStep ToStep() |
|
|
|
|
|
{ |
|
|
|
|
|
return new WorkflowStep( |
|
|
|
|
|
Transitions?.ToDictionary( |
|
|
|
|
|
y => y.Key, |
|
|
|
|
|
y => y.Value?.ToTransition()), |
|
|
|
|
|
Color, NoUpdate); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|