mirror of https://github.com/Squidex/squidex.git
committed by
GitHub
150 changed files with 1993 additions and 1354 deletions
@ -0,0 +1,57 @@ |
|||||
|
// ==========================================================================
|
||||
|
// Squidex Headless CMS
|
||||
|
// ==========================================================================
|
||||
|
// Copyright (c) Squidex UG (haftungsbeschraenkt)
|
||||
|
// All rights reserved. Licensed under the MIT license.
|
||||
|
// ==========================================================================
|
||||
|
|
||||
|
using System.Threading.Tasks; |
||||
|
using NodaTime; |
||||
|
using Squidex.Domain.Apps.Entities.Contents.Commands; |
||||
|
using Squidex.Domain.Apps.Entities.Contents.Repositories; |
||||
|
using Squidex.Infrastructure; |
||||
|
using Squidex.Infrastructure.Commands; |
||||
|
using Squidex.Infrastructure.Timers; |
||||
|
|
||||
|
namespace Squidex.Domain.Apps.Entities.Contents |
||||
|
{ |
||||
|
public sealed class ContentScheduler : IRunnable |
||||
|
{ |
||||
|
private readonly CompletionTimer timer; |
||||
|
private readonly IContentRepository contentRepository; |
||||
|
private readonly ICommandBus commandBus; |
||||
|
private readonly IClock clock; |
||||
|
|
||||
|
public ContentScheduler( |
||||
|
IContentRepository contentRepository, |
||||
|
ICommandBus commandBus, |
||||
|
IClock clock) |
||||
|
{ |
||||
|
Guard.NotNull(contentRepository, nameof(contentRepository)); |
||||
|
Guard.NotNull(commandBus, nameof(commandBus)); |
||||
|
Guard.NotNull(clock, nameof(clock)); |
||||
|
|
||||
|
this.contentRepository = contentRepository; |
||||
|
this.commandBus = commandBus; |
||||
|
this.clock = clock; |
||||
|
|
||||
|
timer = new CompletionTimer(5000, x => PublishAsync()); |
||||
|
} |
||||
|
|
||||
|
public void Run() |
||||
|
{ |
||||
|
} |
||||
|
|
||||
|
private Task PublishAsync() |
||||
|
{ |
||||
|
var now = clock.GetCurrentInstant(); |
||||
|
|
||||
|
return contentRepository.QueryScheduledWithoutDataAsync(now, content => |
||||
|
{ |
||||
|
var command = new ChangeContentStatus { ContentId = content.Id, Status = content.ScheduledTo.Value, Actor = content.ScheduledBy }; |
||||
|
|
||||
|
return commandBus.PublishAsync(command); |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -1,17 +1,18 @@ |
|||||
// ==========================================================================
|
// ==========================================================================
|
||||
// Squidex Headless CMS
|
// Squidex Headless CMS
|
||||
// ==========================================================================
|
// ==========================================================================
|
||||
// Copyright (c) Squidex UG (haftungsbeschränkt)
|
// Copyright (c) Squidex UG (haftungsbeschraenkt)
|
||||
// All rights reserved. Licensed under the MIT license.
|
// All rights reserved. Licensed under the MIT license.
|
||||
// ==========================================================================
|
// ==========================================================================
|
||||
|
|
||||
using System; |
using System; |
||||
using Squidex.Infrastructure; |
using Squidex.Infrastructure; |
||||
|
using Squidex.Infrastructure.Commands; |
||||
|
|
||||
namespace Squidex.Domain.Apps.Entities |
namespace Squidex.Domain.Apps.Entities |
||||
{ |
{ |
||||
public abstract class AppCommand : SquidexCommand |
public interface IAppCommand : ICommand |
||||
{ |
{ |
||||
public NamedId<Guid> AppId { get; set; } |
NamedId<Guid> AppId { get; set; } |
||||
} |
} |
||||
} |
} |
||||
@ -1,17 +1,18 @@ |
|||||
// ==========================================================================
|
// ==========================================================================
|
||||
// Squidex Headless CMS
|
// Squidex Headless CMS
|
||||
// ==========================================================================
|
// ==========================================================================
|
||||
// Copyright (c) Squidex UG (haftungsbeschränkt)
|
// Copyright (c) Squidex UG (haftungsbeschraenkt)
|
||||
// All rights reserved. Licensed under the MIT license.
|
// All rights reserved. Licensed under the MIT license.
|
||||
// ==========================================================================
|
// ==========================================================================
|
||||
|
|
||||
using System; |
using System; |
||||
using Squidex.Infrastructure; |
using Squidex.Infrastructure; |
||||
|
using Squidex.Infrastructure.Commands; |
||||
|
|
||||
namespace Squidex.Domain.Apps.Entities |
namespace Squidex.Domain.Apps.Entities |
||||
{ |
{ |
||||
public abstract class SchemaCommand : AppCommand |
public interface ISchemaCommand : ICommand |
||||
{ |
{ |
||||
public NamedId<Guid> SchemaId { get; set; } |
NamedId<Guid> SchemaId { get; set; } |
||||
} |
} |
||||
} |
} |
||||
@ -1,22 +1,30 @@ |
|||||
@import '_vars'; |
@import '_vars'; |
||||
@import '_mixins'; |
@import '_mixins'; |
||||
|
|
||||
.content { |
.content-status { |
||||
& { |
& { |
||||
cursor: pointer; |
vertical-align: middle; |
||||
} |
} |
||||
|
|
||||
&-published { |
&-published { |
||||
& { |
color: $color-theme-green; |
||||
@include circle(.5rem); |
} |
||||
display: inline-block; |
|
||||
border: 0; |
&-draft { |
||||
background: $color-theme-green; |
color: $color-text-decent; |
||||
margin-left: .4rem; |
} |
||||
} |
|
||||
|
&-archived { |
||||
|
color: $color-theme-error; |
||||
|
} |
||||
|
|
||||
&.unpublished { |
&-tooltip { |
||||
background: $color-theme-error; |
@include border-radius; |
||||
} |
background: $color-tooltip; |
||||
|
border: 0; |
||||
|
font-size: .9rem; |
||||
|
font-weight: normal; |
||||
|
color: $color-dark-foreground; |
||||
|
padding: .75rem; |
||||
} |
} |
||||
} |
} |
||||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue