diff --git a/src/Umbraco.Cms.Api.Delivery/Umbraco.Cms.Api.Delivery.csproj b/src/Umbraco.Cms.Api.Delivery/Umbraco.Cms.Api.Delivery.csproj index a37f74f541..0306dab5af 100644 --- a/src/Umbraco.Cms.Api.Delivery/Umbraco.Cms.Api.Delivery.csproj +++ b/src/Umbraco.Cms.Api.Delivery/Umbraco.Cms.Api.Delivery.csproj @@ -6,7 +6,6 @@ - diff --git a/src/Umbraco.Cms.Persistence.EFCore.SqlServer/Migrations/20230622184303_InitialCreate.Designer.cs b/src/Umbraco.Cms.Persistence.EFCore.SqlServer/Migrations/20230622184303_InitialCreate.Designer.cs index 602cd3a279..d0de28b0db 100644 --- a/src/Umbraco.Cms.Persistence.EFCore.SqlServer/Migrations/20230622184303_InitialCreate.Designer.cs +++ b/src/Umbraco.Cms.Persistence.EFCore.SqlServer/Migrations/20230622184303_InitialCreate.Designer.cs @@ -17,250 +17,7 @@ namespace Umbraco.Cms.Persistence.EFCore.SqlServer.Migrations /// protected override void BuildTargetModel(ModelBuilder modelBuilder) { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "7.0.7") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("nvarchar(450)"); - - b.Property("ClientId") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ClientSecret") - .HasColumnType("nvarchar(max)"); - - b.Property("ConcurrencyToken") - .IsConcurrencyToken() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("ConsentType") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("DisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("DisplayNames") - .HasColumnType("nvarchar(max)"); - - b.Property("Permissions") - .HasColumnType("nvarchar(max)"); - - b.Property("PostLogoutRedirectUris") - .HasColumnType("nvarchar(max)"); - - b.Property("Properties") - .HasColumnType("nvarchar(max)"); - - b.Property("RedirectUris") - .HasColumnType("nvarchar(max)"); - - b.Property("Requirements") - .HasColumnType("nvarchar(max)"); - - b.Property("Type") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("Id"); - - b.HasIndex("ClientId") - .IsUnique() - .HasFilter("[ClientId] IS NOT NULL"); - - b.ToTable("umbracoOpenIddictApplications", (string)null); - }); - - modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("nvarchar(450)"); - - b.Property("ApplicationId") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyToken") - .IsConcurrencyToken() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("CreationDate") - .HasColumnType("datetime2"); - - b.Property("Properties") - .HasColumnType("nvarchar(max)"); - - b.Property("Scopes") - .HasColumnType("nvarchar(max)"); - - b.Property("Status") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Subject") - .HasMaxLength(400) - .HasColumnType("nvarchar(400)"); - - b.Property("Type") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("Id"); - - b.HasIndex("ApplicationId", "Status", "Subject", "Type"); - - b.ToTable("umbracoOpenIddictAuthorizations", (string)null); - }); - - modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreScope", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyToken") - .IsConcurrencyToken() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("Descriptions") - .HasColumnType("nvarchar(max)"); - - b.Property("DisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("DisplayNames") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Properties") - .HasColumnType("nvarchar(max)"); - - b.Property("Resources") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasFilter("[Name] IS NOT NULL"); - - b.ToTable("umbracoOpenIddictScopes", (string)null); - }); - - modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreToken", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("nvarchar(450)"); - - b.Property("ApplicationId") - .HasColumnType("nvarchar(450)"); - - b.Property("AuthorizationId") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyToken") - .IsConcurrencyToken() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("CreationDate") - .HasColumnType("datetime2"); - - b.Property("ExpirationDate") - .HasColumnType("datetime2"); - - b.Property("Payload") - .HasColumnType("nvarchar(max)"); - - b.Property("Properties") - .HasColumnType("nvarchar(max)"); - - b.Property("RedemptionDate") - .HasColumnType("datetime2"); - - b.Property("ReferenceId") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Status") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Subject") - .HasMaxLength(400) - .HasColumnType("nvarchar(400)"); - - b.Property("Type") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("Id"); - - b.HasIndex("AuthorizationId"); - - b.HasIndex("ReferenceId") - .IsUnique() - .HasFilter("[ReferenceId] IS NOT NULL"); - - b.HasIndex("ApplicationId", "Status", "Subject", "Type"); - - b.ToTable("umbracoOpenIddictTokens", (string)null); - }); - - modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b => - { - b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", "Application") - .WithMany("Authorizations") - .HasForeignKey("ApplicationId"); - - b.Navigation("Application"); - }); - - modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreToken", b => - { - b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", "Application") - .WithMany("Tokens") - .HasForeignKey("ApplicationId"); - - b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", "Authorization") - .WithMany("Tokens") - .HasForeignKey("AuthorizationId"); - - b.Navigation("Application"); - - b.Navigation("Authorization"); - }); - - modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", b => - { - b.Navigation("Authorizations"); - - b.Navigation("Tokens"); - }); - - modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b => - { - b.Navigation("Tokens"); - }); -#pragma warning restore 612, 618 } } } diff --git a/src/Umbraco.Cms.Persistence.EFCore.SqlServer/Migrations/20230622184303_InitialCreate.cs b/src/Umbraco.Cms.Persistence.EFCore.SqlServer/Migrations/20230622184303_InitialCreate.cs index 9bf5191959..bade2aa8db 100644 --- a/src/Umbraco.Cms.Persistence.EFCore.SqlServer/Migrations/20230622184303_InitialCreate.cs +++ b/src/Umbraco.Cms.Persistence.EFCore.SqlServer/Migrations/20230622184303_InitialCreate.cs @@ -11,156 +11,13 @@ namespace Umbraco.Cms.Persistence.EFCore.SqlServer.Migrations /// protected override void Up(MigrationBuilder migrationBuilder) { - migrationBuilder.CreateTable( - name: "umbracoOpenIddictApplications", - columns: table => new - { - Id = table.Column(type: "nvarchar(450)", nullable: false), - ClientId = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), - ClientSecret = table.Column(type: "nvarchar(max)", nullable: true), - ConcurrencyToken = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), - ConsentType = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), - DisplayName = table.Column(type: "nvarchar(max)", nullable: true), - DisplayNames = table.Column(type: "nvarchar(max)", nullable: true), - Permissions = table.Column(type: "nvarchar(max)", nullable: true), - PostLogoutRedirectUris = table.Column(type: "nvarchar(max)", nullable: true), - Properties = table.Column(type: "nvarchar(max)", nullable: true), - RedirectUris = table.Column(type: "nvarchar(max)", nullable: true), - Requirements = table.Column(type: "nvarchar(max)", nullable: true), - Type = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_umbracoOpenIddictApplications", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "umbracoOpenIddictScopes", - columns: table => new - { - Id = table.Column(type: "nvarchar(450)", nullable: false), - ConcurrencyToken = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), - Description = table.Column(type: "nvarchar(max)", nullable: true), - Descriptions = table.Column(type: "nvarchar(max)", nullable: true), - DisplayName = table.Column(type: "nvarchar(max)", nullable: true), - DisplayNames = table.Column(type: "nvarchar(max)", nullable: true), - Name = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), - Properties = table.Column(type: "nvarchar(max)", nullable: true), - Resources = table.Column(type: "nvarchar(max)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_umbracoOpenIddictScopes", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "umbracoOpenIddictAuthorizations", - columns: table => new - { - Id = table.Column(type: "nvarchar(450)", nullable: false), - ApplicationId = table.Column(type: "nvarchar(450)", nullable: true), - ConcurrencyToken = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), - CreationDate = table.Column(type: "datetime2", nullable: true), - Properties = table.Column(type: "nvarchar(max)", nullable: true), - Scopes = table.Column(type: "nvarchar(max)", nullable: true), - Status = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), - Subject = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: true), - Type = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_umbracoOpenIddictAuthorizations", x => x.Id); - table.ForeignKey( - name: "FK_umbracoOpenIddictAuthorizations_umbracoOpenIddictApplications_ApplicationId", - column: x => x.ApplicationId, - principalTable: "umbracoOpenIddictApplications", - principalColumn: "Id"); - }); - - migrationBuilder.CreateTable( - name: "umbracoOpenIddictTokens", - columns: table => new - { - Id = table.Column(type: "nvarchar(450)", nullable: false), - ApplicationId = table.Column(type: "nvarchar(450)", nullable: true), - AuthorizationId = table.Column(type: "nvarchar(450)", nullable: true), - ConcurrencyToken = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), - CreationDate = table.Column(type: "datetime2", nullable: true), - ExpirationDate = table.Column(type: "datetime2", nullable: true), - Payload = table.Column(type: "nvarchar(max)", nullable: true), - Properties = table.Column(type: "nvarchar(max)", nullable: true), - RedemptionDate = table.Column(type: "datetime2", nullable: true), - ReferenceId = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), - Status = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), - Subject = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: true), - Type = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_umbracoOpenIddictTokens", x => x.Id); - table.ForeignKey( - name: "FK_umbracoOpenIddictTokens_umbracoOpenIddictApplications_ApplicationId", - column: x => x.ApplicationId, - principalTable: "umbracoOpenIddictApplications", - principalColumn: "Id"); - table.ForeignKey( - name: "FK_umbracoOpenIddictTokens_umbracoOpenIddictAuthorizations_AuthorizationId", - column: x => x.AuthorizationId, - principalTable: "umbracoOpenIddictAuthorizations", - principalColumn: "Id"); - }); - - migrationBuilder.CreateIndex( - name: "IX_umbracoOpenIddictApplications_ClientId", - table: "umbracoOpenIddictApplications", - column: "ClientId", - unique: true, - filter: "[ClientId] IS NOT NULL"); - - migrationBuilder.CreateIndex( - name: "IX_umbracoOpenIddictAuthorizations_ApplicationId_Status_Subject_Type", - table: "umbracoOpenIddictAuthorizations", - columns: new[] { "ApplicationId", "Status", "Subject", "Type" }); - - migrationBuilder.CreateIndex( - name: "IX_umbracoOpenIddictScopes_Name", - table: "umbracoOpenIddictScopes", - column: "Name", - unique: true, - filter: "[Name] IS NOT NULL"); - - migrationBuilder.CreateIndex( - name: "IX_umbracoOpenIddictTokens_ApplicationId_Status_Subject_Type", - table: "umbracoOpenIddictTokens", - columns: new[] { "ApplicationId", "Status", "Subject", "Type" }); - - migrationBuilder.CreateIndex( - name: "IX_umbracoOpenIddictTokens_AuthorizationId", - table: "umbracoOpenIddictTokens", - column: "AuthorizationId"); - - migrationBuilder.CreateIndex( - name: "IX_umbracoOpenIddictTokens_ReferenceId", - table: "umbracoOpenIddictTokens", - column: "ReferenceId", - unique: true, - filter: "[ReferenceId] IS NOT NULL"); + // No op. Existing tables are added by npoco. This will only create the history table. } /// protected override void Down(MigrationBuilder migrationBuilder) { - migrationBuilder.DropTable( - name: "umbracoOpenIddictScopes"); - migrationBuilder.DropTable( - name: "umbracoOpenIddictTokens"); - - migrationBuilder.DropTable( - name: "umbracoOpenIddictAuthorizations"); - - migrationBuilder.DropTable( - name: "umbracoOpenIddictApplications"); } } } diff --git a/src/Umbraco.Cms.Persistence.EFCore.SqlServer/Migrations/20230807654321_AddOpenIddict.Designer.cs b/src/Umbraco.Cms.Persistence.EFCore.SqlServer/Migrations/20230807654321_AddOpenIddict.Designer.cs new file mode 100644 index 0000000000..1c28fab7bd --- /dev/null +++ b/src/Umbraco.Cms.Persistence.EFCore.SqlServer/Migrations/20230807654321_AddOpenIddict.Designer.cs @@ -0,0 +1,266 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace Umbraco.Cms.Persistence.EFCore.SqlServer.Migrations +{ + [DbContext(typeof(UmbracoDbContext))] + [Migration("20230807654321_AddOpenIddict")] + partial class AddOpenIddict + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "7.0.7") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); + + modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("nvarchar(450)"); + + b.Property("ClientId") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("ClientSecret") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ConsentType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayNames") + .HasColumnType("nvarchar(max)"); + + b.Property("Permissions") + .HasColumnType("nvarchar(max)"); + + b.Property("PostLogoutRedirectUris") + .HasColumnType("nvarchar(max)"); + + b.Property("Properties") + .HasColumnType("nvarchar(max)"); + + b.Property("RedirectUris") + .HasColumnType("nvarchar(max)"); + + b.Property("Requirements") + .HasColumnType("nvarchar(max)"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("ClientId") + .IsUnique() + .HasFilter("[ClientId] IS NOT NULL"); + + b.ToTable("umbracoOpenIddictApplications", (string)null); + }); + + modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("nvarchar(450)"); + + b.Property("ApplicationId") + .HasColumnType("nvarchar(450)"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("Properties") + .HasColumnType("nvarchar(max)"); + + b.Property("Scopes") + .HasColumnType("nvarchar(max)"); + + b.Property("Status") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Subject") + .HasMaxLength(400) + .HasColumnType("nvarchar(400)"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationId", "Status", "Subject", "Type"); + + b.ToTable("umbracoOpenIddictAuthorizations", (string)null); + }); + + modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("nvarchar(450)"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Descriptions") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayNames") + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Properties") + .HasColumnType("nvarchar(max)"); + + b.Property("Resources") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique() + .HasFilter("[Name] IS NOT NULL"); + + b.ToTable("umbracoOpenIddictScopes", (string)null); + }); + + modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreToken", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("nvarchar(450)"); + + b.Property("ApplicationId") + .HasColumnType("nvarchar(450)"); + + b.Property("AuthorizationId") + .HasColumnType("nvarchar(450)"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("ExpirationDate") + .HasColumnType("datetime2"); + + b.Property("Payload") + .HasColumnType("nvarchar(max)"); + + b.Property("Properties") + .HasColumnType("nvarchar(max)"); + + b.Property("RedemptionDate") + .HasColumnType("datetime2"); + + b.Property("ReferenceId") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("Status") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Subject") + .HasMaxLength(400) + .HasColumnType("nvarchar(400)"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("AuthorizationId"); + + b.HasIndex("ReferenceId") + .IsUnique() + .HasFilter("[ReferenceId] IS NOT NULL"); + + b.HasIndex("ApplicationId", "Status", "Subject", "Type"); + + b.ToTable("umbracoOpenIddictTokens", (string)null); + }); + + modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b => + { + b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", "Application") + .WithMany("Authorizations") + .HasForeignKey("ApplicationId"); + + b.Navigation("Application"); + }); + + modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreToken", b => + { + b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", "Application") + .WithMany("Tokens") + .HasForeignKey("ApplicationId"); + + b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", "Authorization") + .WithMany("Tokens") + .HasForeignKey("AuthorizationId"); + + b.Navigation("Application"); + + b.Navigation("Authorization"); + }); + + modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", b => + { + b.Navigation("Authorizations"); + + b.Navigation("Tokens"); + }); + + modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b => + { + b.Navigation("Tokens"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/Umbraco.Cms.Persistence.EFCore.SqlServer/Migrations/20230807654321_AddOpenIddict.cs b/src/Umbraco.Cms.Persistence.EFCore.SqlServer/Migrations/20230807654321_AddOpenIddict.cs new file mode 100644 index 0000000000..84e6be3fee --- /dev/null +++ b/src/Umbraco.Cms.Persistence.EFCore.SqlServer/Migrations/20230807654321_AddOpenIddict.cs @@ -0,0 +1,166 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Umbraco.Cms.Persistence.EFCore.SqlServer.Migrations +{ + /// + public partial class AddOpenIddict : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "umbracoOpenIddictApplications", + columns: table => new + { + Id = table.Column(type: "nvarchar(450)", nullable: false), + ClientId = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), + ClientSecret = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyToken = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + ConsentType = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + DisplayName = table.Column(type: "nvarchar(max)", nullable: true), + DisplayNames = table.Column(type: "nvarchar(max)", nullable: true), + Permissions = table.Column(type: "nvarchar(max)", nullable: true), + PostLogoutRedirectUris = table.Column(type: "nvarchar(max)", nullable: true), + Properties = table.Column(type: "nvarchar(max)", nullable: true), + RedirectUris = table.Column(type: "nvarchar(max)", nullable: true), + Requirements = table.Column(type: "nvarchar(max)", nullable: true), + Type = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_umbracoOpenIddictApplications", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "umbracoOpenIddictScopes", + columns: table => new + { + Id = table.Column(type: "nvarchar(450)", nullable: false), + ConcurrencyToken = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Description = table.Column(type: "nvarchar(max)", nullable: true), + Descriptions = table.Column(type: "nvarchar(max)", nullable: true), + DisplayName = table.Column(type: "nvarchar(max)", nullable: true), + DisplayNames = table.Column(type: "nvarchar(max)", nullable: true), + Name = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), + Properties = table.Column(type: "nvarchar(max)", nullable: true), + Resources = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_umbracoOpenIddictScopes", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "umbracoOpenIddictAuthorizations", + columns: table => new + { + Id = table.Column(type: "nvarchar(450)", nullable: false), + ApplicationId = table.Column(type: "nvarchar(450)", nullable: true), + ConcurrencyToken = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + CreationDate = table.Column(type: "datetime2", nullable: true), + Properties = table.Column(type: "nvarchar(max)", nullable: true), + Scopes = table.Column(type: "nvarchar(max)", nullable: true), + Status = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Subject = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: true), + Type = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_umbracoOpenIddictAuthorizations", x => x.Id); + table.ForeignKey( + name: "FK_umbracoOpenIddictAuthorizations_umbracoOpenIddictApplications_ApplicationId", + column: x => x.ApplicationId, + principalTable: "umbracoOpenIddictApplications", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "umbracoOpenIddictTokens", + columns: table => new + { + Id = table.Column(type: "nvarchar(450)", nullable: false), + ApplicationId = table.Column(type: "nvarchar(450)", nullable: true), + AuthorizationId = table.Column(type: "nvarchar(450)", nullable: true), + ConcurrencyToken = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + CreationDate = table.Column(type: "datetime2", nullable: true), + ExpirationDate = table.Column(type: "datetime2", nullable: true), + Payload = table.Column(type: "nvarchar(max)", nullable: true), + Properties = table.Column(type: "nvarchar(max)", nullable: true), + RedemptionDate = table.Column(type: "datetime2", nullable: true), + ReferenceId = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), + Status = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Subject = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: true), + Type = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_umbracoOpenIddictTokens", x => x.Id); + table.ForeignKey( + name: "FK_umbracoOpenIddictTokens_umbracoOpenIddictApplications_ApplicationId", + column: x => x.ApplicationId, + principalTable: "umbracoOpenIddictApplications", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_umbracoOpenIddictTokens_umbracoOpenIddictAuthorizations_AuthorizationId", + column: x => x.AuthorizationId, + principalTable: "umbracoOpenIddictAuthorizations", + principalColumn: "Id"); + }); + + migrationBuilder.CreateIndex( + name: "IX_umbracoOpenIddictApplications_ClientId", + table: "umbracoOpenIddictApplications", + column: "ClientId", + unique: true, + filter: "[ClientId] IS NOT NULL"); + + migrationBuilder.CreateIndex( + name: "IX_umbracoOpenIddictAuthorizations_ApplicationId_Status_Subject_Type", + table: "umbracoOpenIddictAuthorizations", + columns: new[] { "ApplicationId", "Status", "Subject", "Type" }); + + migrationBuilder.CreateIndex( + name: "IX_umbracoOpenIddictScopes_Name", + table: "umbracoOpenIddictScopes", + column: "Name", + unique: true, + filter: "[Name] IS NOT NULL"); + + migrationBuilder.CreateIndex( + name: "IX_umbracoOpenIddictTokens_ApplicationId_Status_Subject_Type", + table: "umbracoOpenIddictTokens", + columns: new[] { "ApplicationId", "Status", "Subject", "Type" }); + + migrationBuilder.CreateIndex( + name: "IX_umbracoOpenIddictTokens_AuthorizationId", + table: "umbracoOpenIddictTokens", + column: "AuthorizationId"); + + migrationBuilder.CreateIndex( + name: "IX_umbracoOpenIddictTokens_ReferenceId", + table: "umbracoOpenIddictTokens", + column: "ReferenceId", + unique: true, + filter: "[ReferenceId] IS NOT NULL"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "umbracoOpenIddictScopes"); + + migrationBuilder.DropTable( + name: "umbracoOpenIddictTokens"); + + migrationBuilder.DropTable( + name: "umbracoOpenIddictAuthorizations"); + + migrationBuilder.DropTable( + name: "umbracoOpenIddictApplications"); + } + } +} diff --git a/src/Umbraco.Cms.Persistence.EFCore.SqlServer/Migrations/UmbracoOpenIddictDbContextModelSnapshot.cs b/src/Umbraco.Cms.Persistence.EFCore.SqlServer/Migrations/UmbracoDbContextModelSnapshot.cs similarity index 99% rename from src/Umbraco.Cms.Persistence.EFCore.SqlServer/Migrations/UmbracoOpenIddictDbContextModelSnapshot.cs rename to src/Umbraco.Cms.Persistence.EFCore.SqlServer/Migrations/UmbracoDbContextModelSnapshot.cs index fcaa36348f..727f602b80 100644 --- a/src/Umbraco.Cms.Persistence.EFCore.SqlServer/Migrations/UmbracoOpenIddictDbContextModelSnapshot.cs +++ b/src/Umbraco.Cms.Persistence.EFCore.SqlServer/Migrations/UmbracoDbContextModelSnapshot.cs @@ -11,7 +11,7 @@ using Umbraco.Cms.Persistence.EFCore; namespace Umbraco.Cms.Persistence.EFCore.SqlServer.Migrations { [DbContext(typeof(UmbracoDbContext))] - partial class UmbracoOpenIddictDbContextModelSnapshot : ModelSnapshot + partial class UmbracoDbContextModelSnapshot : ModelSnapshot { protected override void BuildModel(ModelBuilder modelBuilder) { diff --git a/src/Umbraco.Cms.Persistence.EFCore.SqlServer/SqlServerMigrationProvider.cs b/src/Umbraco.Cms.Persistence.EFCore.SqlServer/SqlServerMigrationProvider.cs index 45e431eb8f..bac08556a3 100644 --- a/src/Umbraco.Cms.Persistence.EFCore.SqlServer/SqlServerMigrationProvider.cs +++ b/src/Umbraco.Cms.Persistence.EFCore.SqlServer/SqlServerMigrationProvider.cs @@ -28,6 +28,7 @@ public class SqlServerMigrationProvider : IMigrationProvider migration switch { EFCoreMigration.InitialCreate => typeof(Migrations.InitialCreate), + EFCoreMigration.AddOpenIddict => typeof(Migrations.AddOpenIddict), _ => throw new ArgumentOutOfRangeException(nameof(migration), $@"Not expected migration value: {migration}") }; } diff --git a/src/Umbraco.Cms.Persistence.EFCore.SqlServer/Umbraco.Cms.Persistence.EFCore.SqlServer.csproj b/src/Umbraco.Cms.Persistence.EFCore.SqlServer/Umbraco.Cms.Persistence.EFCore.SqlServer.csproj index 6e8268dc2a..7236286419 100644 --- a/src/Umbraco.Cms.Persistence.EFCore.SqlServer/Umbraco.Cms.Persistence.EFCore.SqlServer.csproj +++ b/src/Umbraco.Cms.Persistence.EFCore.SqlServer/Umbraco.Cms.Persistence.EFCore.SqlServer.csproj @@ -7,7 +7,7 @@ - + diff --git a/src/Umbraco.Cms.Persistence.EFCore.Sqlite/Migrations/20230622183638_InitialCreate.Designer.cs b/src/Umbraco.Cms.Persistence.EFCore.Sqlite/Migrations/20230622183638_InitialCreate.Designer.cs index 611f1c31cb..ec99f4b1ba 100644 --- a/src/Umbraco.Cms.Persistence.EFCore.Sqlite/Migrations/20230622183638_InitialCreate.Designer.cs +++ b/src/Umbraco.Cms.Persistence.EFCore.Sqlite/Migrations/20230622183638_InitialCreate.Designer.cs @@ -16,243 +16,7 @@ namespace Umbraco.Cms.Persistence.EFCore.Sqlite.Migrations /// protected override void BuildTargetModel(ModelBuilder modelBuilder) { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "7.0.7"); - modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property("ClientId") - .HasMaxLength(100) - .HasColumnType("TEXT"); - - b.Property("ClientSecret") - .HasColumnType("TEXT"); - - b.Property("ConcurrencyToken") - .IsConcurrencyToken() - .HasMaxLength(50) - .HasColumnType("TEXT"); - - b.Property("ConsentType") - .HasMaxLength(50) - .HasColumnType("TEXT"); - - b.Property("DisplayName") - .HasColumnType("TEXT"); - - b.Property("DisplayNames") - .HasColumnType("TEXT"); - - b.Property("Permissions") - .HasColumnType("TEXT"); - - b.Property("PostLogoutRedirectUris") - .HasColumnType("TEXT"); - - b.Property("Properties") - .HasColumnType("TEXT"); - - b.Property("RedirectUris") - .HasColumnType("TEXT"); - - b.Property("Requirements") - .HasColumnType("TEXT"); - - b.Property("Type") - .HasMaxLength(50) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("ClientId") - .IsUnique(); - - b.ToTable("umbracoOpenIddictApplications", (string)null); - }); - - modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property("ApplicationId") - .HasColumnType("TEXT"); - - b.Property("ConcurrencyToken") - .IsConcurrencyToken() - .HasMaxLength(50) - .HasColumnType("TEXT"); - - b.Property("CreationDate") - .HasColumnType("TEXT"); - - b.Property("Properties") - .HasColumnType("TEXT"); - - b.Property("Scopes") - .HasColumnType("TEXT"); - - b.Property("Status") - .HasMaxLength(50) - .HasColumnType("TEXT"); - - b.Property("Subject") - .HasMaxLength(400) - .HasColumnType("TEXT"); - - b.Property("Type") - .HasMaxLength(50) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("ApplicationId", "Status", "Subject", "Type"); - - b.ToTable("umbracoOpenIddictAuthorizations", (string)null); - }); - - modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreScope", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property("ConcurrencyToken") - .IsConcurrencyToken() - .HasMaxLength(50) - .HasColumnType("TEXT"); - - b.Property("Description") - .HasColumnType("TEXT"); - - b.Property("Descriptions") - .HasColumnType("TEXT"); - - b.Property("DisplayName") - .HasColumnType("TEXT"); - - b.Property("DisplayNames") - .HasColumnType("TEXT"); - - b.Property("Name") - .HasMaxLength(200) - .HasColumnType("TEXT"); - - b.Property("Properties") - .HasColumnType("TEXT"); - - b.Property("Resources") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("umbracoOpenIddictScopes", (string)null); - }); - - modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreToken", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property("ApplicationId") - .HasColumnType("TEXT"); - - b.Property("AuthorizationId") - .HasColumnType("TEXT"); - - b.Property("ConcurrencyToken") - .IsConcurrencyToken() - .HasMaxLength(50) - .HasColumnType("TEXT"); - - b.Property("CreationDate") - .HasColumnType("TEXT"); - - b.Property("ExpirationDate") - .HasColumnType("TEXT"); - - b.Property("Payload") - .HasColumnType("TEXT"); - - b.Property("Properties") - .HasColumnType("TEXT"); - - b.Property("RedemptionDate") - .HasColumnType("TEXT"); - - b.Property("ReferenceId") - .HasMaxLength(100) - .HasColumnType("TEXT"); - - b.Property("Status") - .HasMaxLength(50) - .HasColumnType("TEXT"); - - b.Property("Subject") - .HasMaxLength(400) - .HasColumnType("TEXT"); - - b.Property("Type") - .HasMaxLength(50) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("AuthorizationId"); - - b.HasIndex("ReferenceId") - .IsUnique(); - - b.HasIndex("ApplicationId", "Status", "Subject", "Type"); - - b.ToTable("umbracoOpenIddictTokens", (string)null); - }); - - modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b => - { - b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", "Application") - .WithMany("Authorizations") - .HasForeignKey("ApplicationId"); - - b.Navigation("Application"); - }); - - modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreToken", b => - { - b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", "Application") - .WithMany("Tokens") - .HasForeignKey("ApplicationId"); - - b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", "Authorization") - .WithMany("Tokens") - .HasForeignKey("AuthorizationId"); - - b.Navigation("Application"); - - b.Navigation("Authorization"); - }); - - modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", b => - { - b.Navigation("Authorizations"); - - b.Navigation("Tokens"); - }); - - modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b => - { - b.Navigation("Tokens"); - }); -#pragma warning restore 612, 618 } } } diff --git a/src/Umbraco.Cms.Persistence.EFCore.Sqlite/Migrations/20230622183638_InitialCreate.cs b/src/Umbraco.Cms.Persistence.EFCore.Sqlite/Migrations/20230622183638_InitialCreate.cs index ea1b21ac3f..fcffe76bc8 100644 --- a/src/Umbraco.Cms.Persistence.EFCore.Sqlite/Migrations/20230622183638_InitialCreate.cs +++ b/src/Umbraco.Cms.Persistence.EFCore.Sqlite/Migrations/20230622183638_InitialCreate.cs @@ -11,153 +11,13 @@ namespace Umbraco.Cms.Persistence.EFCore.Sqlite.Migrations /// protected override void Up(MigrationBuilder migrationBuilder) { - migrationBuilder.CreateTable( - name: "umbracoOpenIddictApplications", - columns: table => new - { - Id = table.Column(type: "TEXT", nullable: false), - ClientId = table.Column(type: "TEXT", maxLength: 100, nullable: true), - ClientSecret = table.Column(type: "TEXT", nullable: true), - ConcurrencyToken = table.Column(type: "TEXT", maxLength: 50, nullable: true), - ConsentType = table.Column(type: "TEXT", maxLength: 50, nullable: true), - DisplayName = table.Column(type: "TEXT", nullable: true), - DisplayNames = table.Column(type: "TEXT", nullable: true), - Permissions = table.Column(type: "TEXT", nullable: true), - PostLogoutRedirectUris = table.Column(type: "TEXT", nullable: true), - Properties = table.Column(type: "TEXT", nullable: true), - RedirectUris = table.Column(type: "TEXT", nullable: true), - Requirements = table.Column(type: "TEXT", nullable: true), - Type = table.Column(type: "TEXT", maxLength: 50, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_umbracoOpenIddictApplications", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "umbracoOpenIddictScopes", - columns: table => new - { - Id = table.Column(type: "TEXT", nullable: false), - ConcurrencyToken = table.Column(type: "TEXT", maxLength: 50, nullable: true), - Description = table.Column(type: "TEXT", nullable: true), - Descriptions = table.Column(type: "TEXT", nullable: true), - DisplayName = table.Column(type: "TEXT", nullable: true), - DisplayNames = table.Column(type: "TEXT", nullable: true), - Name = table.Column(type: "TEXT", maxLength: 200, nullable: true), - Properties = table.Column(type: "TEXT", nullable: true), - Resources = table.Column(type: "TEXT", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_umbracoOpenIddictScopes", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "umbracoOpenIddictAuthorizations", - columns: table => new - { - Id = table.Column(type: "TEXT", nullable: false), - ApplicationId = table.Column(type: "TEXT", nullable: true), - ConcurrencyToken = table.Column(type: "TEXT", maxLength: 50, nullable: true), - CreationDate = table.Column(type: "TEXT", nullable: true), - Properties = table.Column(type: "TEXT", nullable: true), - Scopes = table.Column(type: "TEXT", nullable: true), - Status = table.Column(type: "TEXT", maxLength: 50, nullable: true), - Subject = table.Column(type: "TEXT", maxLength: 400, nullable: true), - Type = table.Column(type: "TEXT", maxLength: 50, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_umbracoOpenIddictAuthorizations", x => x.Id); - table.ForeignKey( - name: "FK_umbracoOpenIddictAuthorizations_umbracoOpenIddictApplications_ApplicationId", - column: x => x.ApplicationId, - principalTable: "umbracoOpenIddictApplications", - principalColumn: "Id"); - }); - - migrationBuilder.CreateTable( - name: "umbracoOpenIddictTokens", - columns: table => new - { - Id = table.Column(type: "TEXT", nullable: false), - ApplicationId = table.Column(type: "TEXT", nullable: true), - AuthorizationId = table.Column(type: "TEXT", nullable: true), - ConcurrencyToken = table.Column(type: "TEXT", maxLength: 50, nullable: true), - CreationDate = table.Column(type: "TEXT", nullable: true), - ExpirationDate = table.Column(type: "TEXT", nullable: true), - Payload = table.Column(type: "TEXT", nullable: true), - Properties = table.Column(type: "TEXT", nullable: true), - RedemptionDate = table.Column(type: "TEXT", nullable: true), - ReferenceId = table.Column(type: "TEXT", maxLength: 100, nullable: true), - Status = table.Column(type: "TEXT", maxLength: 50, nullable: true), - Subject = table.Column(type: "TEXT", maxLength: 400, nullable: true), - Type = table.Column(type: "TEXT", maxLength: 50, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_umbracoOpenIddictTokens", x => x.Id); - table.ForeignKey( - name: "FK_umbracoOpenIddictTokens_umbracoOpenIddictApplications_ApplicationId", - column: x => x.ApplicationId, - principalTable: "umbracoOpenIddictApplications", - principalColumn: "Id"); - table.ForeignKey( - name: "FK_umbracoOpenIddictTokens_umbracoOpenIddictAuthorizations_AuthorizationId", - column: x => x.AuthorizationId, - principalTable: "umbracoOpenIddictAuthorizations", - principalColumn: "Id"); - }); - - migrationBuilder.CreateIndex( - name: "IX_umbracoOpenIddictApplications_ClientId", - table: "umbracoOpenIddictApplications", - column: "ClientId", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_umbracoOpenIddictAuthorizations_ApplicationId_Status_Subject_Type", - table: "umbracoOpenIddictAuthorizations", - columns: new[] { "ApplicationId", "Status", "Subject", "Type" }); - - migrationBuilder.CreateIndex( - name: "IX_umbracoOpenIddictScopes_Name", - table: "umbracoOpenIddictScopes", - column: "Name", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_umbracoOpenIddictTokens_ApplicationId_Status_Subject_Type", - table: "umbracoOpenIddictTokens", - columns: new[] { "ApplicationId", "Status", "Subject", "Type" }); - - migrationBuilder.CreateIndex( - name: "IX_umbracoOpenIddictTokens_AuthorizationId", - table: "umbracoOpenIddictTokens", - column: "AuthorizationId"); - - migrationBuilder.CreateIndex( - name: "IX_umbracoOpenIddictTokens_ReferenceId", - table: "umbracoOpenIddictTokens", - column: "ReferenceId", - unique: true); + // No op. Existing tables are added by npoco. This will only create the history table. } /// protected override void Down(MigrationBuilder migrationBuilder) { - migrationBuilder.DropTable( - name: "umbracoOpenIddictScopes"); - migrationBuilder.DropTable( - name: "umbracoOpenIddictTokens"); - - migrationBuilder.DropTable( - name: "umbracoOpenIddictAuthorizations"); - - migrationBuilder.DropTable( - name: "umbracoOpenIddictApplications"); } } } diff --git a/src/Umbraco.Cms.Persistence.EFCore.Sqlite/Migrations/20230807123456_AddOpenIddict.Designer.cs b/src/Umbraco.Cms.Persistence.EFCore.Sqlite/Migrations/20230807123456_AddOpenIddict.Designer.cs new file mode 100644 index 0000000000..e061496e3c --- /dev/null +++ b/src/Umbraco.Cms.Persistence.EFCore.Sqlite/Migrations/20230807123456_AddOpenIddict.Designer.cs @@ -0,0 +1,258 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace Umbraco.Cms.Persistence.EFCore.Sqlite.Migrations +{ + [DbContext(typeof(UmbracoDbContext))] + [Migration("20230708123456_AddOpenIddict")] + partial class AddOpenIddict + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder.HasAnnotation("ProductVersion", "7.0.7"); + + modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("ClientId") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("ClientSecret") + .HasColumnType("TEXT"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("ConsentType") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("DisplayName") + .HasColumnType("TEXT"); + + b.Property("DisplayNames") + .HasColumnType("TEXT"); + + b.Property("Permissions") + .HasColumnType("TEXT"); + + b.Property("PostLogoutRedirectUris") + .HasColumnType("TEXT"); + + b.Property("Properties") + .HasColumnType("TEXT"); + + b.Property("RedirectUris") + .HasColumnType("TEXT"); + + b.Property("Requirements") + .HasColumnType("TEXT"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("ClientId") + .IsUnique(); + + b.ToTable("umbracoOpenIddictApplications", (string)null); + }); + + modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("ApplicationId") + .HasColumnType("TEXT"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("CreationDate") + .HasColumnType("TEXT"); + + b.Property("Properties") + .HasColumnType("TEXT"); + + b.Property("Scopes") + .HasColumnType("TEXT"); + + b.Property("Status") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("Subject") + .HasMaxLength(400) + .HasColumnType("TEXT"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationId", "Status", "Subject", "Type"); + + b.ToTable("umbracoOpenIddictAuthorizations", (string)null); + }); + + modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("Description") + .HasColumnType("TEXT"); + + b.Property("Descriptions") + .HasColumnType("TEXT"); + + b.Property("DisplayName") + .HasColumnType("TEXT"); + + b.Property("DisplayNames") + .HasColumnType("TEXT"); + + b.Property("Name") + .HasMaxLength(200) + .HasColumnType("TEXT"); + + b.Property("Properties") + .HasColumnType("TEXT"); + + b.Property("Resources") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("umbracoOpenIddictScopes", (string)null); + }); + + modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreToken", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("ApplicationId") + .HasColumnType("TEXT"); + + b.Property("AuthorizationId") + .HasColumnType("TEXT"); + + b.Property("ConcurrencyToken") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("CreationDate") + .HasColumnType("TEXT"); + + b.Property("ExpirationDate") + .HasColumnType("TEXT"); + + b.Property("Payload") + .HasColumnType("TEXT"); + + b.Property("Properties") + .HasColumnType("TEXT"); + + b.Property("RedemptionDate") + .HasColumnType("TEXT"); + + b.Property("ReferenceId") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("Status") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("Subject") + .HasMaxLength(400) + .HasColumnType("TEXT"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("AuthorizationId"); + + b.HasIndex("ReferenceId") + .IsUnique(); + + b.HasIndex("ApplicationId", "Status", "Subject", "Type"); + + b.ToTable("umbracoOpenIddictTokens", (string)null); + }); + + modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b => + { + b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", "Application") + .WithMany("Authorizations") + .HasForeignKey("ApplicationId"); + + b.Navigation("Application"); + }); + + modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreToken", b => + { + b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", "Application") + .WithMany("Tokens") + .HasForeignKey("ApplicationId"); + + b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", "Authorization") + .WithMany("Tokens") + .HasForeignKey("AuthorizationId"); + + b.Navigation("Application"); + + b.Navigation("Authorization"); + }); + + modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", b => + { + b.Navigation("Authorizations"); + + b.Navigation("Tokens"); + }); + + modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b => + { + b.Navigation("Tokens"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/Umbraco.Cms.Persistence.EFCore.Sqlite/Migrations/20230807123456_AddOpenIddict.cs b/src/Umbraco.Cms.Persistence.EFCore.Sqlite/Migrations/20230807123456_AddOpenIddict.cs new file mode 100644 index 0000000000..bfb3e6c49f --- /dev/null +++ b/src/Umbraco.Cms.Persistence.EFCore.Sqlite/Migrations/20230807123456_AddOpenIddict.cs @@ -0,0 +1,163 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Umbraco.Cms.Persistence.EFCore.Sqlite.Migrations +{ + /// + public partial class AddOpenIddict : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "umbracoOpenIddictApplications", + columns: table => new + { + Id = table.Column(type: "TEXT", nullable: false), + ClientId = table.Column(type: "TEXT", maxLength: 100, nullable: true), + ClientSecret = table.Column(type: "TEXT", nullable: true), + ConcurrencyToken = table.Column(type: "TEXT", maxLength: 50, nullable: true), + ConsentType = table.Column(type: "TEXT", maxLength: 50, nullable: true), + DisplayName = table.Column(type: "TEXT", nullable: true), + DisplayNames = table.Column(type: "TEXT", nullable: true), + Permissions = table.Column(type: "TEXT", nullable: true), + PostLogoutRedirectUris = table.Column(type: "TEXT", nullable: true), + Properties = table.Column(type: "TEXT", nullable: true), + RedirectUris = table.Column(type: "TEXT", nullable: true), + Requirements = table.Column(type: "TEXT", nullable: true), + Type = table.Column(type: "TEXT", maxLength: 50, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_umbracoOpenIddictApplications", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "umbracoOpenIddictScopes", + columns: table => new + { + Id = table.Column(type: "TEXT", nullable: false), + ConcurrencyToken = table.Column(type: "TEXT", maxLength: 50, nullable: true), + Description = table.Column(type: "TEXT", nullable: true), + Descriptions = table.Column(type: "TEXT", nullable: true), + DisplayName = table.Column(type: "TEXT", nullable: true), + DisplayNames = table.Column(type: "TEXT", nullable: true), + Name = table.Column(type: "TEXT", maxLength: 200, nullable: true), + Properties = table.Column(type: "TEXT", nullable: true), + Resources = table.Column(type: "TEXT", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_umbracoOpenIddictScopes", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "umbracoOpenIddictAuthorizations", + columns: table => new + { + Id = table.Column(type: "TEXT", nullable: false), + ApplicationId = table.Column(type: "TEXT", nullable: true), + ConcurrencyToken = table.Column(type: "TEXT", maxLength: 50, nullable: true), + CreationDate = table.Column(type: "TEXT", nullable: true), + Properties = table.Column(type: "TEXT", nullable: true), + Scopes = table.Column(type: "TEXT", nullable: true), + Status = table.Column(type: "TEXT", maxLength: 50, nullable: true), + Subject = table.Column(type: "TEXT", maxLength: 400, nullable: true), + Type = table.Column(type: "TEXT", maxLength: 50, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_umbracoOpenIddictAuthorizations", x => x.Id); + table.ForeignKey( + name: "FK_umbracoOpenIddictAuthorizations_umbracoOpenIddictApplications_ApplicationId", + column: x => x.ApplicationId, + principalTable: "umbracoOpenIddictApplications", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "umbracoOpenIddictTokens", + columns: table => new + { + Id = table.Column(type: "TEXT", nullable: false), + ApplicationId = table.Column(type: "TEXT", nullable: true), + AuthorizationId = table.Column(type: "TEXT", nullable: true), + ConcurrencyToken = table.Column(type: "TEXT", maxLength: 50, nullable: true), + CreationDate = table.Column(type: "TEXT", nullable: true), + ExpirationDate = table.Column(type: "TEXT", nullable: true), + Payload = table.Column(type: "TEXT", nullable: true), + Properties = table.Column(type: "TEXT", nullable: true), + RedemptionDate = table.Column(type: "TEXT", nullable: true), + ReferenceId = table.Column(type: "TEXT", maxLength: 100, nullable: true), + Status = table.Column(type: "TEXT", maxLength: 50, nullable: true), + Subject = table.Column(type: "TEXT", maxLength: 400, nullable: true), + Type = table.Column(type: "TEXT", maxLength: 50, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_umbracoOpenIddictTokens", x => x.Id); + table.ForeignKey( + name: "FK_umbracoOpenIddictTokens_umbracoOpenIddictApplications_ApplicationId", + column: x => x.ApplicationId, + principalTable: "umbracoOpenIddictApplications", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_umbracoOpenIddictTokens_umbracoOpenIddictAuthorizations_AuthorizationId", + column: x => x.AuthorizationId, + principalTable: "umbracoOpenIddictAuthorizations", + principalColumn: "Id"); + }); + + migrationBuilder.CreateIndex( + name: "IX_umbracoOpenIddictApplications_ClientId", + table: "umbracoOpenIddictApplications", + column: "ClientId", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_umbracoOpenIddictAuthorizations_ApplicationId_Status_Subject_Type", + table: "umbracoOpenIddictAuthorizations", + columns: new[] { "ApplicationId", "Status", "Subject", "Type" }); + + migrationBuilder.CreateIndex( + name: "IX_umbracoOpenIddictScopes_Name", + table: "umbracoOpenIddictScopes", + column: "Name", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_umbracoOpenIddictTokens_ApplicationId_Status_Subject_Type", + table: "umbracoOpenIddictTokens", + columns: new[] { "ApplicationId", "Status", "Subject", "Type" }); + + migrationBuilder.CreateIndex( + name: "IX_umbracoOpenIddictTokens_AuthorizationId", + table: "umbracoOpenIddictTokens", + column: "AuthorizationId"); + + migrationBuilder.CreateIndex( + name: "IX_umbracoOpenIddictTokens_ReferenceId", + table: "umbracoOpenIddictTokens", + column: "ReferenceId", + unique: true); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "umbracoOpenIddictScopes"); + + migrationBuilder.DropTable( + name: "umbracoOpenIddictTokens"); + + migrationBuilder.DropTable( + name: "umbracoOpenIddictAuthorizations"); + + migrationBuilder.DropTable( + name: "umbracoOpenIddictApplications"); + } + } +} diff --git a/src/Umbraco.Cms.Persistence.EFCore.Sqlite/Migrations/UmbracoOpenIddictDbContextModelSnapshot.cs b/src/Umbraco.Cms.Persistence.EFCore.Sqlite/Migrations/UmbracoDbContextModelSnapshot.cs similarity index 99% rename from src/Umbraco.Cms.Persistence.EFCore.Sqlite/Migrations/UmbracoOpenIddictDbContextModelSnapshot.cs rename to src/Umbraco.Cms.Persistence.EFCore.Sqlite/Migrations/UmbracoDbContextModelSnapshot.cs index da82993433..138647e7f3 100644 --- a/src/Umbraco.Cms.Persistence.EFCore.Sqlite/Migrations/UmbracoOpenIddictDbContextModelSnapshot.cs +++ b/src/Umbraco.Cms.Persistence.EFCore.Sqlite/Migrations/UmbracoDbContextModelSnapshot.cs @@ -10,7 +10,7 @@ using Umbraco.Cms.Persistence.EFCore; namespace Umbraco.Cms.Persistence.EFCore.Sqlite.Migrations { [DbContext(typeof(UmbracoDbContext))] - partial class UmbracoOpenIddictDbContextModelSnapshot : ModelSnapshot + partial class UmbracoDbContextModelSnapshot : ModelSnapshot { protected override void BuildModel(ModelBuilder modelBuilder) { diff --git a/src/Umbraco.Cms.Persistence.EFCore.Sqlite/SqliteMigrationProvider.cs b/src/Umbraco.Cms.Persistence.EFCore.Sqlite/SqliteMigrationProvider.cs index b3b9897f80..05d4024bb3 100644 --- a/src/Umbraco.Cms.Persistence.EFCore.Sqlite/SqliteMigrationProvider.cs +++ b/src/Umbraco.Cms.Persistence.EFCore.Sqlite/SqliteMigrationProvider.cs @@ -35,6 +35,7 @@ public class SqliteMigrationProvider : IMigrationProvider migration switch { EFCoreMigration.InitialCreate => typeof(Migrations.InitialCreate), + EFCoreMigration.AddOpenIddict => typeof(Migrations.AddOpenIddict), _ => throw new ArgumentOutOfRangeException(nameof(migration), $@"Not expected migration value: {migration}") }; } diff --git a/src/Umbraco.Cms.Persistence.EFCore.Sqlite/Umbraco.Cms.Persistence.EFCore.Sqlite.csproj b/src/Umbraco.Cms.Persistence.EFCore.Sqlite/Umbraco.Cms.Persistence.EFCore.Sqlite.csproj index 99ebc5306d..8903593eb0 100644 --- a/src/Umbraco.Cms.Persistence.EFCore.Sqlite/Umbraco.Cms.Persistence.EFCore.Sqlite.csproj +++ b/src/Umbraco.Cms.Persistence.EFCore.Sqlite/Umbraco.Cms.Persistence.EFCore.Sqlite.csproj @@ -8,6 +8,7 @@ + diff --git a/src/Umbraco.Cms.Persistence.EFCore/Composition/UmbracoEFCoreComposer.cs b/src/Umbraco.Cms.Persistence.EFCore/Composition/UmbracoEFCoreComposer.cs index f0f2416b32..ed9bcb4558 100644 --- a/src/Umbraco.Cms.Persistence.EFCore/Composition/UmbracoEFCoreComposer.cs +++ b/src/Umbraco.Cms.Persistence.EFCore/Composition/UmbracoEFCoreComposer.cs @@ -56,7 +56,10 @@ public class EFCoreCreateTablesNotificationHandler : INotificationAsyncHandler + + + diff --git a/src/Umbraco.Cms.Persistence.EFCore/UmbracoDbContext.cs b/src/Umbraco.Cms.Persistence.EFCore/UmbracoDbContext.cs index 2c940602ac..485a14465a 100644 --- a/src/Umbraco.Cms.Persistence.EFCore/UmbracoDbContext.cs +++ b/src/Umbraco.Cms.Persistence.EFCore/UmbracoDbContext.cs @@ -4,6 +4,7 @@ using Umbraco.Cms.Core; namespace Umbraco.Cms.Persistence.EFCore; +/// The Umbraco DB Context. Only for internal use. Can't be internal due to DI. /// /// To autogenerate migrations use the following commands /// and insure the 'src/Umbraco.Web.UI/appsettings.json' have a connection string set with the right provider. diff --git a/src/Umbraco.Cms.Persistence.Sqlite/Umbraco.Cms.Persistence.Sqlite.csproj b/src/Umbraco.Cms.Persistence.Sqlite/Umbraco.Cms.Persistence.Sqlite.csproj index 5c37b88d10..7743b2030a 100644 --- a/src/Umbraco.Cms.Persistence.Sqlite/Umbraco.Cms.Persistence.Sqlite.csproj +++ b/src/Umbraco.Cms.Persistence.Sqlite/Umbraco.Cms.Persistence.Sqlite.csproj @@ -6,6 +6,7 @@ + diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/bs.xml b/src/Umbraco.Core/EmbeddedResources/Lang/bs.xml index c22086a81a..212840974c 100644 --- a/src/Umbraco.Core/EmbeddedResources/Lang/bs.xml +++ b/src/Umbraco.Core/EmbeddedResources/Lang/bs.xml @@ -1948,7 +1948,7 @@ Da upravljate svojom web lokacijom, jednostavno otvorite Umbraco backoffice i po Novom korisniku je poslana pozivnica s detaljima o tome kako se prijaviti Umbraco. - Pozdrav i dobrodošli u Umbraco! Za samo 1 minut možete krenuti, mi - samo trebate postaviti lozinku i dodati sliku za svoj avatar. - + Pozdrav i dobrodošli u Umbraco! Za samo 1 minut možete krenuti, mi samo trebate postaviti lozinku. Dobrodošli u Umbraco! Nažalost, vaš poziv je istekao. Molimo kontaktirajte svoju administratora i zamolite ih da ga ponovo pošalju. - Ako otpremite svoju fotografiju, drugi korisnici će ga lako prepoznati - ti. Kliknite na krug iznad da otpremite svoju fotografiju. - Pisac Promjena Vaš profil @@ -2296,7 +2291,7 @@ Da upravljate svojom web lokacijom, jednostavno otvorite Umbraco backoffice i po 1: Recommended value --> Makro greške su postavljene na '%0%'. - Greške makroa su postavljene na '%0%' što će spriječiti potpuno učitavanje nekih ili svih stranica + Greške makroa su postavljene na '%0%' što će spriječiti potpuno učitavanje nekih ili svih stranica na vašem sajtu ako postoje greške u makroima. Ako ovo ispravite, vrijednost će biti postavljena na '%1%'. @@ -2339,7 +2338,7 @@ Was sind Inhaltsvorlagen? - Inhaltsvorlagen sind vordefinierte Inhalte die ausgewählt werden können + Inhaltsvorlagen sind vordefinierte Inhalte die ausgewählt werden können wenn Sie einen neuen Inhaltsknoten anlegen wollen. Wie erstelle ich eine Inhaltsvorlage? @@ -2381,7 +2380,7 @@ Dateien durch Packages erstellen lassen Dateien schreiben Medien Ordner stellen - + Element zurückgegeben Elemente zurückgegeben diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/en.xml b/src/Umbraco.Core/EmbeddedResources/Lang/en.xml index 58d6787768..4cfb05b4df 100644 --- a/src/Umbraco.Core/EmbeddedResources/Lang/en.xml +++ b/src/Umbraco.Core/EmbeddedResources/Lang/en.xml @@ -838,6 +838,7 @@ No items have been added Server Settings + Shared Show Show page on Send Size @@ -2127,14 +2128,11 @@ To manage your website, simply open the Umbraco backoffice and start adding cont Umbraco. Hello there and welcome to Umbraco! In just 1 minute you’ll be good to go, we - just need you to setup a password and add a picture for your avatar. + just need you to setup a password. Welcome to Umbraco! Unfortunately your invite has expired. Please contact your administrator and ask them to resend it. - Uploading a photo of yourself will make it easy for other users to recognize - you. Click the circle above to upload your photo. - Writer Change Your profile diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml b/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml index 38c4916e31..4ff519c855 100644 --- a/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml +++ b/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml @@ -2224,14 +2224,11 @@ To manage your website, simply open the Umbraco backoffice and start adding cont Umbraco. Hello there and welcome to Umbraco! In just 1 minute you’ll be good to go, we - just need you to setup a password and add a picture for your avatar. + just need you to setup a password. Welcome to Umbraco! Unfortunately your invite has expired. Please contact your administrator and ask them to resend it. - Uploading a photo of yourself will make it easy for other users to recognize - you. Click the circle above to upload your photo. - Writer Configure Two-Factor Change diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/es.xml b/src/Umbraco.Core/EmbeddedResources/Lang/es.xml index 4c42c035a5..25f183433a 100644 --- a/src/Umbraco.Core/EmbeddedResources/Lang/es.xml +++ b/src/Umbraco.Core/EmbeddedResources/Lang/es.xml @@ -1394,8 +1394,7 @@ Grupo de usuario ha sido invitado Se ha enviado una invitación al nuevo usuario con detalles sobre cómo acceder a Umbraco. - ¡Hola y bienvenido a Umbraco!. En un minuto todo estará listo para empezar, sólo necesitamos que configures tu contraseña y una imagen para tu avatar. - Sube una foto para que otros usuarios te reconozcan más fácilmente. + ¡Hola y bienvenido a Umbraco!. En un minuto todo estará listo para empezar, sólo necesitamos que configures tu contraseña. Redactor Cambiar Tu perfil diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/fr.xml b/src/Umbraco.Core/EmbeddedResources/Lang/fr.xml index 55dad6e986..604d51f23e 100644 --- a/src/Umbraco.Core/EmbeddedResources/Lang/fr.xml +++ b/src/Umbraco.Core/EmbeddedResources/Lang/fr.xml @@ -1795,9 +1795,8 @@ Pour gérer votre site, ouvrez simplement le backoffice Umbraco et commencez à Groupe d'utilisateurs a été invité Une invitation a été envoyée au nouvel utilisateur avec les détails concernant la connexion à Umbraco. - Bien le bonjour et bienvenue dans Umbraco! Vous serez prêt.e dans moins d'1 minute, vous devez encore simplement configurer votre mot de passe et ajouter une photo pour votre avatar. + Bien le bonjour et bienvenue dans Umbraco! Vous serez prêt.e dans moins d'1 minute, vous devez encore simplement configurer votre mot de passe. Bienvenue dans Umbraco! Malheureusement, votre invitation a expiré. Veuillez contacter votre administrateur et demandez-lui de vous l'envoyer à nouveau. - Chargez une photo afin que les autres utilisateurs puissent vous reconnaître facilement. Cliquez sur le cercle ci-dessus pour charger votre photo. Rédacteur Modifier Votre profil diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/hr.xml b/src/Umbraco.Core/EmbeddedResources/Lang/hr.xml index c3328dfead..b609cf6dee 100644 --- a/src/Umbraco.Core/EmbeddedResources/Lang/hr.xml +++ b/src/Umbraco.Core/EmbeddedResources/Lang/hr.xml @@ -1920,7 +1920,7 @@ Da bi upravljali svojom web lokacijom, jednostavno otvorite Umbraco backoffice i Grupa korisnika je pozvan Novom korisniku je poslana pozivnica s detaljima o tome kako se prijaviti u Umbraco. - Pozdrav i dobrodošli u Umbraco! Jedna minuta bit će vam potrebna da postavite svoju lozinku i dodate svoju profilnu sliku. + Pozdrav i dobrodošli u Umbraco! Jedna minuta bit će vam potrebna da postavite svoju lozinku. Dobrodošli u Umbraco! Nažalost pozivnica je istekla. Molimo kontaktirajte svog administratora i od njega tražite da ju ponovno pošalje. - AAko postavite svoju fotografiju, drugi korisnici će vas lako prepoznati. Kliknite krug iznad da biste prenijeli svoju fotografiju. Pisac Promjeni Vaš profil @@ -2250,7 +2249,7 @@ Da bi upravljali svojom web lokacijom, jednostavno otvorite Umbraco backoffice i 1: Recommended value --> Makro greške su postavljene na '%0%'. - Greške makroa su postavljene na '%0%' što će spriječiti potpuno učitavanje nekih ili svih stranica + Greške makroa su postavljene na '%0%' što će spriječiti potpuno učitavanje nekih ili svih stranica na vašem sajtu ako postoje greške u makroima. Ako ovo ispravite, vrijednost će biti postavljena na '%1%'. + diff --git a/src/Umbraco.Infrastructure/Migrations/EFCoreMigration.cs b/src/Umbraco.Infrastructure/Migrations/EFCoreMigration.cs index 8086b68f24..b6e80f8cdb 100644 --- a/src/Umbraco.Infrastructure/Migrations/EFCoreMigration.cs +++ b/src/Umbraco.Infrastructure/Migrations/EFCoreMigration.cs @@ -2,5 +2,6 @@ namespace Umbraco.Cms.Persistence.EFCore.Migrations; public enum EFCoreMigration { - InitialCreate = 0 + InitialCreate = 0, + AddOpenIddict = 1 } diff --git a/src/Umbraco.Infrastructure/Migrations/Install/DatabaseBuilder.cs b/src/Umbraco.Infrastructure/Migrations/Install/DatabaseBuilder.cs index c260b3e7c2..25dc48d23b 100644 --- a/src/Umbraco.Infrastructure/Migrations/Install/DatabaseBuilder.cs +++ b/src/Umbraco.Infrastructure/Migrations/Install/DatabaseBuilder.cs @@ -291,7 +291,10 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Install using (var scope = _scopeProvider.CreateCoreScope()) { var result = CreateSchemaAndData(scope); - scope.Notifications.Publish(new DatabaseSchemaAndDataCreatedNotification()); + if (result?.Success is true) + { + scope.Notifications.Publish(new DatabaseSchemaAndDataCreatedNotification(result!.RequiresUpgrade)); + } scope.Complete(); return result; } diff --git a/src/Umbraco.Infrastructure/Migrations/Notifications/DatabaseSchemaAndDataCreatedNotification.cs b/src/Umbraco.Infrastructure/Migrations/Notifications/DatabaseSchemaAndDataCreatedNotification.cs index 77ef6aaaea..80579d1e69 100644 --- a/src/Umbraco.Infrastructure/Migrations/Notifications/DatabaseSchemaAndDataCreatedNotification.cs +++ b/src/Umbraco.Infrastructure/Migrations/Notifications/DatabaseSchemaAndDataCreatedNotification.cs @@ -4,5 +4,8 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Notifications; public class DatabaseSchemaAndDataCreatedNotification : INotification { + public bool RequiresUpgrade { get; } + public DatabaseSchemaAndDataCreatedNotification(bool requiresUpgrade) + => RequiresUpgrade = requiresUpgrade; } diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_12_1_0/AddOpenIddict.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_12_1_0/AddOpenIddict.cs index 3bf188deff..a32334ece4 100644 --- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_12_1_0/AddOpenIddict.cs +++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_12_1_0/AddOpenIddict.cs @@ -15,6 +15,7 @@ public class AddOpenIddict : UnscopedMigrationBase protected override void Migrate() { _iefCoreMigrationExecutor.ExecuteSingleMigrationAsync(EFCoreMigration.InitialCreate).GetAwaiter().GetResult(); + _iefCoreMigrationExecutor.ExecuteSingleMigrationAsync(EFCoreMigration.AddOpenIddict).GetAwaiter().GetResult(); } } diff --git a/src/Umbraco.Infrastructure/Umbraco.Infrastructure.csproj b/src/Umbraco.Infrastructure/Umbraco.Infrastructure.csproj index a8d1a87702..c7db36c11e 100644 --- a/src/Umbraco.Infrastructure/Umbraco.Infrastructure.csproj +++ b/src/Umbraco.Infrastructure/Umbraco.Infrastructure.csproj @@ -16,11 +16,11 @@ - - - - - + + + + + @@ -38,8 +38,8 @@ - - + + diff --git a/src/Umbraco.Web.BackOffice/Controllers/UsersController.cs b/src/Umbraco.Web.BackOffice/Controllers/UsersController.cs index 2a16066707..6e65223e2b 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/UsersController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/UsersController.cs @@ -607,7 +607,7 @@ public class UsersController : BackOfficeNotificationsController var emailBody = _localizedTextService.Localize("user", "inviteEmailCopyFormat", // Ensure the culture of the found user is used for the email! UmbracoUserExtensions.GetUserCulture(to?.Language, _localizedTextService, _globalSettings), - new[] { userDisplay?.Name, from, message, inviteUri.ToString(), senderEmail }); + new[] { userDisplay?.Name, from, WebUtility.HtmlEncode(message)!.ReplaceLineEndings("
"), inviteUri.ToString(), senderEmail }); // This needs to be in the correct mailto format including the name, else // the name cannot be captured in the email sending notification. diff --git a/src/Umbraco.Web.BackOffice/Mapping/ContentMapDefinition.cs b/src/Umbraco.Web.BackOffice/Mapping/ContentMapDefinition.cs index 21961acb45..0bc4e9c1b7 100644 --- a/src/Umbraco.Web.BackOffice/Mapping/ContentMapDefinition.cs +++ b/src/Umbraco.Web.BackOffice/Mapping/ContentMapDefinition.cs @@ -1,6 +1,4 @@ using System.Globalization; -using System.Text.RegularExpressions; -using HeyRed.MarkdownSharp; using Microsoft.Extensions.Logging; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Actions; @@ -307,51 +305,6 @@ internal class ContentMapDefinition : IMapDefinition { Properties = context.MapEnumerable(source.Properties).WhereNotNull() }; - var markdown = new Markdown(); - var linkCheck = new Regex("]+>", RegexOptions.IgnoreCase); - var evaluator = new MatchEvaluator(AddRelNoReferrer); - foreach (TVariant variant in target.Variants) - { - foreach (Tab tab in variant.Tabs) - { - if (tab.Properties == null) - { - continue; - } - - foreach (ContentPropertyDisplay property in tab.Properties) - { - if (string.IsNullOrEmpty(property.Description)) - { - continue; - } - - var description = markdown.Transform(property.Description); - property.Description = linkCheck.Replace(description, evaluator); - } - } - } - } - - private string AddRelNoReferrer(Match m) - { - string result = m.Value; - if (!result.Contains("rel=", StringComparison.Ordinal)) - { - result = result.Replace(">", " rel=\"noreferrer\">"); - } - - if (!result.Contains("class=", StringComparison.Ordinal)) - { - result = result.Replace(">", " class=\"underline\">"); - } - - if (!result.Contains("target=", StringComparison.Ordinal)) - { - result = result.Replace(">", " target=\"_blank\">"); - } - - return result; } // Umbraco.Code.MapAll -Segment -Language -DisplayName -AdditionalPreviewUrls @@ -408,7 +361,7 @@ internal class ContentMapDefinition : IMapDefinition { currentUser = currentIUserBackofficeUser; } - else if (_backOfficeSecurityAccessor.BackOfficeSecurity?.CurrentUser is not null) + else if(_backOfficeSecurityAccessor.BackOfficeSecurity?.CurrentUser is not null) { currentUser = _backOfficeSecurityAccessor.BackOfficeSecurity.CurrentUser; } diff --git a/src/Umbraco.Web.BackOffice/Trees/ContentTypeTreeController.cs b/src/Umbraco.Web.BackOffice/Trees/ContentTypeTreeController.cs index 27c26004b9..f68b4f8783 100644 --- a/src/Umbraco.Web.BackOffice/Trees/ContentTypeTreeController.cs +++ b/src/Umbraco.Web.BackOffice/Trees/ContentTypeTreeController.cs @@ -63,8 +63,8 @@ public class ContentTypeTreeController : TreeController, ISearchableTree if (root is not null) { - //check if there are any types - root.HasChildren = _contentTypeService.GetAll().Any(); + // check if there are any types or containers + root.HasChildren = _contentTypeService.GetAll().Any() || _contentTypeService.GetContainers(Array.Empty()).Any(); } return root; diff --git a/src/Umbraco.Web.BackOffice/Umbraco.Web.BackOffice.csproj b/src/Umbraco.Web.BackOffice/Umbraco.Web.BackOffice.csproj index bfa65b3065..12364baaf1 100644 --- a/src/Umbraco.Web.BackOffice/Umbraco.Web.BackOffice.csproj +++ b/src/Umbraco.Web.BackOffice/Umbraco.Web.BackOffice.csproj @@ -8,6 +8,10 @@ + + + + diff --git a/src/Umbraco.Web.Common/Umbraco.Web.Common.csproj b/src/Umbraco.Web.Common/Umbraco.Web.Common.csproj index dc5fdde359..998ecaf180 100644 --- a/src/Umbraco.Web.Common/Umbraco.Web.Common.csproj +++ b/src/Umbraco.Web.Common/Umbraco.Web.Common.csproj @@ -10,8 +10,8 @@ - - + + diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/application/umblogin.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/application/umblogin.directive.js index 26019b53f5..1d195e8a1c 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/application/umblogin.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/application/umblogin.directive.js @@ -14,7 +14,7 @@ }); function UmbLoginController($scope, $location, currentUserResource, formHelper, - mediaHelper, umbRequestHelper, Upload, localizationService, + mediaHelper, umbRequestHelper, localizationService, userService, externalLoginInfo, externalLoginInfoService, resetPasswordCodeInfo, authResource, $q) { @@ -34,15 +34,6 @@ submitButton: "init" }; - vm.avatarFile = { - filesHolder: null, - uploadStatus: null, - uploadProgress: 0, - maxFileSize: Umbraco.Sys.ServerVariables.umbracoSettings.maxFileSize + "KB", - acceptedFileTypes: mediaHelper.formatFileTypes(Umbraco.Sys.ServerVariables.umbracoSettings.imageFileTypes), - uploaded: false - }; - vm.allowPasswordReset = Umbraco.Sys.ServerVariables.umbracoSettings.canSendRequiredEmail && Umbraco.Sys.ServerVariables.umbracoSettings.allowPasswordReset; vm.errorMsg = ""; const tempUrl = new URL(Umbraco.Sys.ServerVariables.umbracoUrls.externalLoginsUrl, window.location.origin); @@ -66,7 +57,6 @@ vm.$onInit = onInit; vm.togglePassword = togglePassword; - vm.changeAvatar = changeAvatar; vm.getStarted = getStarted; vm.inviteSavePassword = inviteSavePassword; vm.showLogin = showLogin; @@ -154,12 +144,6 @@ $(".password-text.show, .password-text.hide").toggle(); } - function changeAvatar(files, event) { - if (files && files.length > 0) { - upload(files[0]); - } - } - function getStarted() { $location.search('invite', null); if (vm.onLogin) { @@ -179,12 +163,17 @@ //success formHelper.resetForm({ scope: $scope, formCtrl: vm.inviteUserPasswordForm }); vm.invitedUserPasswordModel.buttonState = "success"; - //set the user and set them as logged in - vm.invitedUser = data; - userService.setAuthenticationSuccessful(data); + //set the user + vm.invitedUser = data; + + // hide the password form vm.inviteStep = 2; + // set the user as logged in, which will initialise the app flow in init.js + // and eventually redirect the user to the content section when it's ready + userService.setAuthenticationSuccessful(data); + }, function (err) { formHelper.resetForm({ scope: $scope, hasErrors: true, formCtrl: vm.inviteUserPasswordForm }); formHelper.handleError(err); @@ -379,69 +368,6 @@ }); } - function upload(file) { - - vm.avatarFile.uploadProgress = 0; - - Upload.upload({ - url: umbRequestHelper.getApiUrl("currentUserApiBaseUrl", "PostSetAvatar"), - fields: {}, - file: file - }).progress(function (evt) { - - if (vm.avatarFile.uploadStatus !== "done" && vm.avatarFile.uploadStatus !== "error") { - // set uploading status on file - vm.avatarFile.uploadStatus = "uploading"; - - // calculate progress in percentage - var progressPercentage = parseInt(100.0 * evt.loaded / evt.total, 10); - - // set percentage property on file - vm.avatarFile.uploadProgress = progressPercentage; - } - - }).success(function (data, status, headers, config) { - - vm.avatarFile.uploadProgress = 100; - - // set done status on file - vm.avatarFile.uploadStatus = "done"; - - vm.invitedUser.avatars = data; - - vm.avatarFile.uploaded = true; - - }).error(function (evt, status, headers, config) { - - // set status done - vm.avatarFile.uploadStatus = "error"; - - // If file not found, server will return a 404 and display this message - if (status === 404) { - vm.avatarFile.serverErrorMessage = "File not found"; - } - else if (status == 400) { - //it's a validation error - vm.avatarFile.serverErrorMessage = evt.message; - } - else { - //it's an unhandled error - //if the service returns a detailed error - if (evt.InnerException) { - vm.avatarFile.serverErrorMessage = evt.InnerException.ExceptionMessage; - - //Check if its the common "too large file" exception - if (evt.InnerException.StackTrace && evt.InnerException.StackTrace.indexOf("ValidateRequestEntityLength") > 0) { - vm.avatarFile.serverErrorMessage = "File too large to upload"; - } - - } else if (evt.Message) { - vm.avatarFile.serverErrorMessage = evt.Message; - } - } - }); - } - function show2FALoginDialog(viewPath) { vm.twoFactor.submitCallback = function submitCallback() { vm.onLogin(); diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/property/umbproperty.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/property/umbproperty.directive.js index ccc9f92caf..5a30f81d4b 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/property/umbproperty.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/property/umbproperty.directive.js @@ -4,96 +4,96 @@ * @restrict E **/ (function () { - 'use strict'; + 'use strict'; - angular - .module("umbraco.directives") - .component('umbProperty', { - templateUrl: 'views/components/property/umb-property.html', - controller: UmbPropertyController, - controllerAs: 'vm', - transclude: true, - require: { - parentUmbProperty: '?^^umbProperty', - parentForm: '?^^form' - }, - bindings: { - property: "=", + angular + .module("umbraco.directives") + .component('umbProperty', { + templateUrl: 'views/components/property/umb-property.html', + controller: UmbPropertyController, + controllerAs: 'vm', + transclude: true, + require: { + parentUmbProperty: '?^^umbProperty', + parentForm: '?^^form' + }, + bindings: { + property: "=", node: "<", - elementKey: "@", - // optional, if set this will be used for the property alias validation path (hack required because NC changes the actual property.alias :/) - propertyAlias: "@", - showInherit: "<", + elementKey: "@", + // optional, if set this will be used for the property alias validation path (hack required because NC changes the actual property.alias :/) + propertyAlias: "@", + showInherit: "<", inheritsFrom: "<", hideLabel: " s && s.vm && s.vm.constructor.name === "UmbPropertyController"); - vm.parentUmbProperty = found ? found.vm : null; - } + - if (vm.property.description) { - // split by lines containing only '--' - var descriptionParts = vm.property.description.split(/^--$/gim); - if (descriptionParts.length > 1) { - // if more than one part, we have an extended description, - // combine to one extended description, and remove leading linebreak - vm.property.extendedDescription = descriptionParts.splice(1).join("--").substring(1); - vm.property.extendedDescriptionVisible = false; + function UmbPropertyController($scope, userService, serverValidationManager, udiService, angularHelper) { - // set propertydescription to first part, and remove trailing linebreak - vm.property.description = descriptionParts[0].slice(0, -1); + const vm = this; + + vm.$onInit = onInit; + + vm.setDirty = function () { + // NOTE: We need to use scope because we haven't changd it to vm.propertyForm in the html and that + // might mean a breaking change. + $scope.propertyForm.$setDirty(); } - } - } - } + vm.setPropertyError = function (errorMsg) { + vm.property.propertyErrorMessage = errorMsg; + }; + + vm.propertyActions = []; + vm.setPropertyActions = function (actions) { + vm.propertyActions = actions; + }; + + // returns the validation path for the property to be used as the validation key for server side validation logic + vm.getValidationPath = function () { + + var parentValidationPath = vm.parentUmbProperty ? vm.parentUmbProperty.getValidationPath() : null; + var propAlias = vm.propertyAlias ? vm.propertyAlias : vm.property.alias; + // the elementKey will be empty when this is not a nested property + var valPath = vm.elementKey ? vm.elementKey + "/" + propAlias : propAlias; + return serverValidationManager.createPropertyValidationKey(valPath, parentValidationPath); + } + + function onInit() { + vm.controlLabelTitle = null; + if (Umbraco.Sys.ServerVariables.isDebuggingEnabled) { + userService.getCurrentUser().then(function (u) { + if (u.allowedSections.indexOf("settings") !== -1 ? true : false) { + vm.controlLabelTitle = vm.property.alias; + } + }); + } + + if (!vm.parentUmbProperty) { + // not found, then fallback to searching the scope chain, this may be needed when DOM inheritance isn't maintained but scope + // inheritance is (i.e.infinite editing) + var found = angularHelper.traverseScopeChain($scope, s => s && s.vm && s.vm.constructor.name === "UmbPropertyController"); + vm.parentUmbProperty = found ? found.vm : null; + } + + if (vm.property.description) { + // split by lines containing only '--' + var descriptionParts = vm.property.description.split(/^--$/gim); + if (descriptionParts.length > 1) { + // if more than one part, we have an extended description, + // combine to one extended description, and remove leading linebreak + vm.property.extendedDescription = descriptionParts.splice(1).join("--").substring(1); + vm.property.extendedDescriptionVisible = false; + + // set propertydescription to first part, and remove trailing linebreak + vm.property.description = descriptionParts[0].slice(0, -1); + } + } + } + + } })(); diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/tree/umbtreeitem.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/tree/umbtreeitem.directive.js index 3ec1756e6c..a3d1ef541c 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/tree/umbtreeitem.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/tree/umbtreeitem.directive.js @@ -32,16 +32,16 @@ angular.module("umbraco.directives") tree: '=', isDialog: '=' }, - + link: function (scope, element, attrs, umbTreeCtrl) { localizationService.localizeMany(["general_search", "visuallyHiddenTexts_openContextMenu"]).then(function (value) { scope.searchAltText = value[0]; scope.optionsText = value[1]; }); - + // updates the node's DOM/styles function setupNodeDom(node, tree) { - + //get the first div element element.children(":first") //set the padding @@ -61,14 +61,14 @@ angular.module("umbraco.directives") if (!node) { return ''; } - + // TODO: This is called constantly because as a method in a template it's re-evaluated pretty much all the time // it would be better if we could cache the processing. The problem is that some of these things are dynamic. //is this the current action node (this is not the same as the current selected node!) var actionNode = appState.getMenuState("currentNode"); - - var css = []; + + var css = []; if (node.cssClasses) { node.cssClasses.forEach(c => css.push(c)); } @@ -94,8 +94,8 @@ angular.module("umbraco.directives") if (actionNode.id === node.id && String(node.id) !== "-1") { css.push("active"); } - - // special handling of root nodes with id -1 + + // special handling of root nodes with id -1 // as there can be many nodes with id -1 in a tree we need to check the treeAlias instead if (String(node.id) === "-1" && actionNode.metaData.treeAlias === node.metaData.treeAlias) { css.push("active"); @@ -125,7 +125,7 @@ angular.module("umbraco.directives") }; /** - Method called when an item is clicked in the tree, this passes the + Method called when an item is clicked in the tree, this passes the DOM element, the tree node object and the original click and emits it as a treeNodeSelect element if there is a callback object defined on the tree @@ -149,7 +149,7 @@ angular.module("umbraco.directives") }; /** - Method called when an item is right-clicked in the tree, this passes the + Method called when an item is right-clicked in the tree, this passes the DOM element, the tree node object and the original click and emits it as a treeNodeSelect element if there is a callback object defined on the tree @@ -158,13 +158,17 @@ angular.module("umbraco.directives") if(ev.altKey) return false; umbTreeCtrl.emitEvent("treeNodeAltSelect", { element: element, tree: scope.tree, node: n, event: ev }); }; - + /** Method called when a node in the tree is expanded, when clicking the arrow takes the arrow DOM element and node data as parameters emits treeNodeCollapsing event if already expanded and treeNodeExpanding if collapsed */ - scope.load = function (node) { + scope.load = function (node, ev) { + if(ev){ + ev.stopPropagation(); + } + if (node.expanded && !node.metaData.isContainer) { umbTreeCtrl.emitEvent("treeNodeCollapsing", { tree: scope.tree, node: node, element: element }); node.expanded = false; @@ -199,7 +203,7 @@ angular.module("umbraco.directives") })); // Update tree icon if changed - evts.push(eventsService.on("editors.tree.icon.changed", function (e, args) { + evts.push(eventsService.on("editors.tree.icon.changed", function (e, args) { if (args.icon !== scope.node.icon && args.id === scope.node.id) { scope.node.icon = args.icon; } diff --git a/src/Umbraco.Web.UI.Client/src/common/filters/simpleMarkdown.filter.js b/src/Umbraco.Web.UI.Client/src/common/filters/simpleMarkdown.filter.js new file mode 100644 index 0000000000..58d5b0ed91 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/common/filters/simpleMarkdown.filter.js @@ -0,0 +1,20 @@ +/** +* @ngdoc filter +* @name umbraco.filters.simpleMarkdown +* @description +* Used when rendering a string as Markdown as HTML (i.e. with ng-bind-html). Allows use of **bold**, *italics*, ![images](url) and [links](url) +**/ +angular.module("umbraco.filters").filter('simpleMarkdown', function () { + return function (text) { + if (!text) { + return ''; + } + + return text + .replace(/\*\*(.*)\*\*/gim, '$1') + .replace(/\*(.*)\*/gim, '$1') + .replace(/!\[(.*?)\]\((.*?)\)/gim, "$1") + .replace(/\[(.*?)\]\((.*?)\)/gim, "$1") + .replace(/\n/g, '
').trim(); + }; +}); diff --git a/src/Umbraco.Web.UI.Client/src/common/filters/simpleMarkdown.filter.js.js b/src/Umbraco.Web.UI.Client/src/common/filters/simpleMarkdown.filter.js.js new file mode 100644 index 0000000000..d33b96916a --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/common/filters/simpleMarkdown.filter.js.js @@ -0,0 +1,20 @@ +/** +* @ngdoc filter +* @name umbraco.filters.simpleMarkdown +* @description +* Used when rendering a string as Markdown as HTML (i.e. with ng-bind-html). Allows use of **bold**, *italics*, ![images](url) and [links](url) +**/ +angular.module("umbraco.filters").filter('simpleMarkdown', function () { + return function (text) { + if (!text) { + return ''; + } + + return text + .replace(/\*\*(.*)\*\*/gim, '$1') + .replace(/\*(.*)\*/gim, '$1') + .replace(/!\[(.*?)\]\((.*?)\)/gim, "$1") + .replace(/\[(.*?)\]\((.*?)\)/gim, "$1") + .replace(/\n/g, '
').trim(); + }; +}); diff --git a/src/Umbraco.Web.UI.Client/src/views/components/application/umb-login.html b/src/Umbraco.Web.UI.Client/src/views/components/application/umb-login.html index b53e29c365..4a9dc85865 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/application/umb-login.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/application/umb-login.html @@ -14,90 +14,48 @@

Hi, {{vm.invitedUser.name}}

- Welcome to Umbraco! Just need to get your password and avatar setup and then you're good to go + Welcome to Umbraco! Just need to get your password setup and then you're good to go

-
- - - - Your new password cannot be blank! - Minimum {{vm.invitedUserPasswordModel.passwordPolicies.minPasswordLength}} characters - {{inviteUserPasswordForm.password.errorMsg}} - -
- -
- - - - Required - The confirmed password doesn't match the new password! - - -
- -
- - -
- -
- - -
- -
- - - - - - -
- {{ vm.avatarFile.serverErrorMessage }} +
+
+ + + + Your new password cannot be blank! + Minimum {{vm.invitedUserPasswordModel.passwordPolicies.minPasswordLength}} characters + {{inviteUserPasswordForm.password.errorMsg}} +
- + + +
+ + +
+
-
- -

Upload a photo

-

- Uploading a photo of yourself will make it easy for other users to recognize you. Click the circle above to upload your photo. -

-
- - +
+

+ Welcome...

-
+