Add restore functionality for template management and enhance related components
Implemented a new endpoint for restoring templates to their last applied state, allowing users to revert changes made since the last application. Updated the ScheduleTemplate class to include a snapshot of the last applied state, enabling rollback capabilities. Enhanced the frontend with a restore button in the ChannelDetail component, providing users with a confirmation prompt before executing the restore action. Localization updates were made to support new UI strings in both English and Russian, improving the overall user experience in template management.
This commit is contained in:
1 parent
a302750de6
commit
0fd4e762f4
21 files changed
+2227
-133
No files matched your search
Generated
+1410
File diff suppressed because it is too large.
Load diff
+27
@@ -0,0 +1,27 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace TeleWave.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class TemplateAppliedSnapshot : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "AppliedSnapshotJson",
|
||||
table: "ScheduleTemplates",
|
||||
type: "jsonb",
|
||||
nullable: true
|
||||
);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(name: "AppliedSnapshotJson", table: "ScheduleTemplates");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -944,6 +944,9 @@ namespace TeleWave.Infrastructure.Migrations
|
||||
b.Property<int>("AppliedRevision")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("AppliedSnapshotJson")
|
||||
.HasColumnType("jsonb");
|
||||
|
||||
b.Property<Guid>("ChannelId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
|
||||
+1
@@ -11,6 +11,7 @@ public class ScheduleTemplateConfiguration : IEntityTypeConfiguration<ScheduleTe
|
||||
{
|
||||
builder.Property(x => x.Name).IsRequired().HasMaxLength(256);
|
||||
builder.Property(x => x.RulesJson).HasColumnType("jsonb");
|
||||
builder.Property(x => x.AppliedSnapshotJson).HasColumnType("jsonb");
|
||||
builder.HasIndex(x => x.ChannelId);
|
||||
|
||||
builder
|
||||
|
||||
Reference in new issue
Block a user