diff --git a/migrations/mysql/FilesDbContext/20221215125741_FilesDbContext_Upgrade1.Designer.cs b/migrations/mysql/FilesDbContext/20221215125741_FilesDbContext_Upgrade1.Designer.cs new file mode 100644 index 0000000000..dbc2ef24ff --- /dev/null +++ b/migrations/mysql/FilesDbContext/20221215125741_FilesDbContext_Upgrade1.Designer.cs @@ -0,0 +1,2587 @@ +// +using System; +using ASC.Files.Core.EF; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace ASC.Migrations.MySql.Migrations.FilesDb +{ + [DbContext(typeof(FilesDbContext))] + [Migration("20221215125741_FilesDbContext_Upgrade1")] + partial class FilesDbContext_Upgrade1 + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "6.0.7") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("ASC.Core.Common.EF.Model.DbTenant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Alias") + .IsRequired() + .HasColumnType("varchar(100)") + .HasColumnName("alias") + .UseCollation("utf8_general_ci") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Calls") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasColumnName("calls") + .HasDefaultValueSql("'1'"); + + b.Property("CreationDateTime") + .HasColumnType("datetime") + .HasColumnName("creationdatetime"); + + b.Property("Industry") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("industry") + .HasDefaultValueSql("'0'"); + + b.Property("Language") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("char(10)") + .HasColumnName("language") + .HasDefaultValueSql("'en-US'") + .UseCollation("utf8_general_ci") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("LastModified") + .HasColumnType("timestamp") + .HasColumnName("last_modified"); + + b.Property("MappedDomain") + .HasColumnType("varchar(100)") + .HasColumnName("mappeddomain") + .UseCollation("utf8_general_ci") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(255)") + .HasColumnName("name") + .UseCollation("utf8_general_ci") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("OwnerId") + .HasColumnType("varchar(38)") + .HasColumnName("owner_id") + .UseCollation("utf8_general_ci") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("PaymentId") + .HasColumnType("varchar(38)") + .HasColumnName("payment_id") + .UseCollation("utf8_general_ci") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Spam") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasColumnName("spam") + .HasDefaultValueSql("'1'"); + + b.Property("Status") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("status") + .HasDefaultValueSql("'0'"); + + b.Property("StatusChanged") + .HasColumnType("datetime") + .HasColumnName("statuschanged"); + + b.Property("TimeZone") + .HasColumnType("varchar(50)") + .HasColumnName("timezone") + .UseCollation("utf8_general_ci") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("TrustedDomainsEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("trusteddomainsenabled") + .HasDefaultValueSql("'1'"); + + b.Property("TrustedDomainsRaw") + .HasColumnType("varchar(1024)") + .HasColumnName("trusteddomains") + .UseCollation("utf8_general_ci") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Version") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("version") + .HasDefaultValueSql("'2'"); + + b.Property("Version_Changed") + .HasColumnType("datetime") + .HasColumnName("version_changed"); + + b.HasKey("Id"); + + b.HasIndex("Alias") + .IsUnique() + .HasDatabaseName("alias"); + + b.HasIndex("LastModified") + .HasDatabaseName("last_modified"); + + b.HasIndex("MappedDomain") + .HasDatabaseName("mappeddomain"); + + b.HasIndex("Version") + .HasDatabaseName("version"); + + b.ToTable("tenants_tenants", (string)null); + + b.HasAnnotation("MySql:CharSet", "utf8"); + + b.HasData( + new + { + Id = 1, + Alias = "localhost", + Calls = false, + CreationDateTime = new DateTime(2021, 3, 9, 17, 46, 59, 97, DateTimeKind.Utc).AddTicks(4317), + Industry = 0, + LastModified = new DateTime(2022, 7, 8, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "Web Office", + OwnerId = "66faa6e4-f133-11ea-b126-00ffeec8b4ef", + Spam = false, + Status = 0, + TrustedDomainsEnabled = 0, + Version = 0 + }); + }); + + modelBuilder.Entity("ASC.Core.Common.EF.Model.FilesConverts", b => + { + b.Property("Input") + .HasColumnType("varchar(50)") + .HasColumnName("input") + .UseCollation("utf8_general_ci") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Output") + .HasColumnType("varchar(50)") + .HasColumnName("output") + .UseCollation("utf8_general_ci") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Input", "Output") + .HasName("PRIMARY"); + + b.ToTable("files_converts", (string)null); + + b.HasAnnotation("MySql:CharSet", "utf8"); + + b.HasData( + new + { + Input = ".csv", + Output = ".ods" + }, + new + { + Input = ".csv", + Output = ".pdf" + }, + new + { + Input = ".csv", + Output = ".ots" + }, + new + { + Input = ".csv", + Output = ".xlsx" + }, + new + { + Input = ".csv", + Output = ".xlsm" + }, + new + { + Input = ".csv", + Output = ".xltm" + }, + new + { + Input = ".csv", + Output = ".xltx" + }, + new + { + Input = ".doc", + Output = ".docx" + }, + new + { + Input = ".doc", + Output = ".docm" + }, + new + { + Input = ".doc", + Output = ".dotm" + }, + new + { + Input = ".doc", + Output = ".dotx" + }, + new + { + Input = ".doc", + Output = ".epub" + }, + new + { + Input = ".doc", + Output = ".fb2" + }, + new + { + Input = ".doc", + Output = ".html" + }, + new + { + Input = ".doc", + Output = ".ott" + }, + new + { + Input = ".doc", + Output = ".odt" + }, + new + { + Input = ".doc", + Output = ".pdf" + }, + new + { + Input = ".doc", + Output = ".rtf" + }, + new + { + Input = ".doc", + Output = ".txt" + }, + new + { + Input = ".docm", + Output = ".docx" + }, + new + { + Input = ".docm", + Output = ".dotm" + }, + new + { + Input = ".docm", + Output = ".html" + }, + new + { + Input = ".docm", + Output = ".dotx" + }, + new + { + Input = ".docm", + Output = ".epub" + }, + new + { + Input = ".docm", + Output = ".fb2" + }, + new + { + Input = ".docm", + Output = ".ott" + }, + new + { + Input = ".docm", + Output = ".odt" + }, + new + { + Input = ".docm", + Output = ".pdf" + }, + new + { + Input = ".docm", + Output = ".rtf" + }, + new + { + Input = ".docm", + Output = ".txt" + }, + new + { + Input = ".doct", + Output = ".docx" + }, + new + { + Input = ".docx", + Output = ".odt" + }, + new + { + Input = ".docx", + Output = ".pdf" + }, + new + { + Input = ".docx", + Output = ".rtf" + }, + new + { + Input = ".docx", + Output = ".txt" + }, + new + { + Input = ".docx", + Output = ".html" + }, + new + { + Input = ".docx", + Output = ".dotm" + }, + new + { + Input = ".docx", + Output = ".dotx" + }, + new + { + Input = ".docx", + Output = ".epub" + }, + new + { + Input = ".docx", + Output = ".fb2" + }, + new + { + Input = ".docx", + Output = ".ott" + }, + new + { + Input = ".docx", + Output = ".docm" + }, + new + { + Input = ".docx", + Output = ".docxf" + }, + new + { + Input = ".docxf", + Output = ".docx" + }, + new + { + Input = ".docxf", + Output = ".odt" + }, + new + { + Input = ".docxf", + Output = ".oform" + }, + new + { + Input = ".docxf", + Output = ".pdf" + }, + new + { + Input = ".docxf", + Output = ".rtf" + }, + new + { + Input = ".docxf", + Output = ".txt" + }, + new + { + Input = ".docxf", + Output = ".dotx" + }, + new + { + Input = ".docxf", + Output = ".epub" + }, + new + { + Input = ".docxf", + Output = ".fb2" + }, + new + { + Input = ".docxf", + Output = ".html" + }, + new + { + Input = ".docxf", + Output = ".ott" + }, + new + { + Input = ".dot", + Output = ".docx" + }, + new + { + Input = ".dot", + Output = ".odt" + }, + new + { + Input = ".dot", + Output = ".pdf" + }, + new + { + Input = ".dot", + Output = ".rtf" + }, + new + { + Input = ".dot", + Output = ".txt" + }, + new + { + Input = ".dot", + Output = ".docm" + }, + new + { + Input = ".dot", + Output = ".dotm" + }, + new + { + Input = ".dot", + Output = ".dotx" + }, + new + { + Input = ".dot", + Output = ".epub" + }, + new + { + Input = ".dot", + Output = ".fb2" + }, + new + { + Input = ".dot", + Output = ".html" + }, + new + { + Input = ".dot", + Output = ".ott" + }, + new + { + Input = ".dotm", + Output = ".docx" + }, + new + { + Input = ".dotm", + Output = ".odt" + }, + new + { + Input = ".dotm", + Output = ".pdf" + }, + new + { + Input = ".dotm", + Output = ".rtf" + }, + new + { + Input = ".dotm", + Output = ".txt" + }, + new + { + Input = ".dotm", + Output = ".docm" + }, + new + { + Input = ".dotm", + Output = ".dotx" + }, + new + { + Input = ".dotm", + Output = ".epub" + }, + new + { + Input = ".dotm", + Output = ".fb2" + }, + new + { + Input = ".dotm", + Output = ".html" + }, + new + { + Input = ".dotm", + Output = ".ott" + }, + new + { + Input = ".dotx", + Output = ".docx" + }, + new + { + Input = ".dotx", + Output = ".odt" + }, + new + { + Input = ".dotx", + Output = ".pdf" + }, + new + { + Input = ".dotx", + Output = ".rtf" + }, + new + { + Input = ".dotx", + Output = ".txt" + }, + new + { + Input = ".dotx", + Output = ".docm" + }, + new + { + Input = ".dotx", + Output = ".dotm" + }, + new + { + Input = ".dotx", + Output = ".epub" + }, + new + { + Input = ".dotx", + Output = ".fb2" + }, + new + { + Input = ".dotx", + Output = ".html" + }, + new + { + Input = ".dotx", + Output = ".ott" + }, + new + { + Input = ".epub", + Output = ".docx" + }, + new + { + Input = ".epub", + Output = ".odt" + }, + new + { + Input = ".epub", + Output = ".pdf" + }, + new + { + Input = ".epub", + Output = ".rtf" + }, + new + { + Input = ".epub", + Output = ".txt" + }, + new + { + Input = ".epub", + Output = ".docm" + }, + new + { + Input = ".epub", + Output = ".dotm" + }, + new + { + Input = ".epub", + Output = ".dotx" + }, + new + { + Input = ".epub", + Output = ".fb2" + }, + new + { + Input = ".epub", + Output = ".html" + }, + new + { + Input = ".epub", + Output = ".ott" + }, + new + { + Input = ".fb2", + Output = ".docx" + }, + new + { + Input = ".fb2", + Output = ".odt" + }, + new + { + Input = ".fb2", + Output = ".pdf" + }, + new + { + Input = ".fb2", + Output = ".rtf" + }, + new + { + Input = ".fb2", + Output = ".txt" + }, + new + { + Input = ".fb2", + Output = ".docm" + }, + new + { + Input = ".fb2", + Output = ".dotm" + }, + new + { + Input = ".fb2", + Output = ".dotx" + }, + new + { + Input = ".fb2", + Output = ".epub" + }, + new + { + Input = ".fb2", + Output = ".html" + }, + new + { + Input = ".fb2", + Output = ".ott" + }, + new + { + Input = ".fodp", + Output = ".odp" + }, + new + { + Input = ".fodp", + Output = ".pdf" + }, + new + { + Input = ".fodp", + Output = ".pptx" + }, + new + { + Input = ".fodp", + Output = ".otp" + }, + new + { + Input = ".fodp", + Output = ".potm" + }, + new + { + Input = ".fodp", + Output = ".potx" + }, + new + { + Input = ".fodp", + Output = ".pptm" + }, + new + { + Input = ".fods", + Output = ".csv" + }, + new + { + Input = ".fods", + Output = ".ods" + }, + new + { + Input = ".fods", + Output = ".pdf" + }, + new + { + Input = ".fods", + Output = ".xlsx" + }, + new + { + Input = ".fods", + Output = ".xlsm" + }, + new + { + Input = ".fods", + Output = ".xltm" + }, + new + { + Input = ".fods", + Output = ".xltx" + }, + new + { + Input = ".fods", + Output = ".ots" + }, + new + { + Input = ".fodt", + Output = ".docx" + }, + new + { + Input = ".fodt", + Output = ".odt" + }, + new + { + Input = ".fodt", + Output = ".docm" + }, + new + { + Input = ".fodt", + Output = ".pdf" + }, + new + { + Input = ".fodt", + Output = ".rtf" + }, + new + { + Input = ".fodt", + Output = ".txt" + }, + new + { + Input = ".fodt", + Output = ".dotm" + }, + new + { + Input = ".fodt", + Output = ".dotx" + }, + new + { + Input = ".fodt", + Output = ".epub" + }, + new + { + Input = ".fodt", + Output = ".fb2" + }, + new + { + Input = ".fodt", + Output = ".html" + }, + new + { + Input = ".fodt", + Output = ".ott" + }, + new + { + Input = ".html", + Output = ".docx" + }, + new + { + Input = ".html", + Output = ".odt" + }, + new + { + Input = ".html", + Output = ".pdf" + }, + new + { + Input = ".html", + Output = ".rtf" + }, + new + { + Input = ".html", + Output = ".txt" + }, + new + { + Input = ".html", + Output = ".docm" + }, + new + { + Input = ".html", + Output = ".dotm" + }, + new + { + Input = ".html", + Output = ".dotx" + }, + new + { + Input = ".html", + Output = ".epub" + }, + new + { + Input = ".html", + Output = ".fb2" + }, + new + { + Input = ".html", + Output = ".ott" + }, + new + { + Input = ".mht", + Output = ".docx" + }, + new + { + Input = ".mht", + Output = ".odt" + }, + new + { + Input = ".mht", + Output = ".pdf" + }, + new + { + Input = ".mht", + Output = ".rtf" + }, + new + { + Input = ".mht", + Output = ".txt" + }, + new + { + Input = ".mht", + Output = ".docm" + }, + new + { + Input = ".mht", + Output = ".dotm" + }, + new + { + Input = ".mht", + Output = ".dotx" + }, + new + { + Input = ".mht", + Output = ".epub" + }, + new + { + Input = ".mht", + Output = ".fb2" + }, + new + { + Input = ".mht", + Output = ".ott" + }, + new + { + Input = ".odp", + Output = ".pdf" + }, + new + { + Input = ".odp", + Output = ".pptx" + }, + new + { + Input = ".odp", + Output = ".otp" + }, + new + { + Input = ".odp", + Output = ".potm" + }, + new + { + Input = ".odp", + Output = ".potx" + }, + new + { + Input = ".odp", + Output = ".pptm" + }, + new + { + Input = ".otp", + Output = ".odp" + }, + new + { + Input = ".otp", + Output = ".pdf" + }, + new + { + Input = ".otp", + Output = ".potm" + }, + new + { + Input = ".otp", + Output = ".potx" + }, + new + { + Input = ".otp", + Output = ".pptm" + }, + new + { + Input = ".otp", + Output = ".pptx" + }, + new + { + Input = ".ods", + Output = ".csv" + }, + new + { + Input = ".ods", + Output = ".pdf" + }, + new + { + Input = ".ods", + Output = ".xlsx" + }, + new + { + Input = ".ods", + Output = ".ots" + }, + new + { + Input = ".ods", + Output = ".xlsm" + }, + new + { + Input = ".ods", + Output = ".xltm" + }, + new + { + Input = ".ods", + Output = ".xltx" + }, + new + { + Input = ".ots", + Output = ".csv" + }, + new + { + Input = ".ots", + Output = ".ods" + }, + new + { + Input = ".ots", + Output = ".pdf" + }, + new + { + Input = ".ots", + Output = ".xlsm" + }, + new + { + Input = ".ots", + Output = ".xltm" + }, + new + { + Input = ".ots", + Output = ".xltx" + }, + new + { + Input = ".ots", + Output = ".xlsx" + }, + new + { + Input = ".oxps", + Output = ".pdf" + }, + new + { + Input = ".odt", + Output = ".docx" + }, + new + { + Input = ".odt", + Output = ".pdf" + }, + new + { + Input = ".odt", + Output = ".rtf" + }, + new + { + Input = ".odt", + Output = ".txt" + }, + new + { + Input = ".odt", + Output = ".docm" + }, + new + { + Input = ".odt", + Output = ".dotm" + }, + new + { + Input = ".odt", + Output = ".dotx" + }, + new + { + Input = ".odt", + Output = ".epub" + }, + new + { + Input = ".odt", + Output = ".fb2" + }, + new + { + Input = ".odt", + Output = ".html" + }, + new + { + Input = ".odt", + Output = ".ott" + }, + new + { + Input = ".ott", + Output = ".docx" + }, + new + { + Input = ".ott", + Output = ".odt" + }, + new + { + Input = ".ott", + Output = ".pdf" + }, + new + { + Input = ".ott", + Output = ".rtf" + }, + new + { + Input = ".ott", + Output = ".txt" + }, + new + { + Input = ".ott", + Output = ".docm" + }, + new + { + Input = ".ott", + Output = ".dotm" + }, + new + { + Input = ".ott", + Output = ".dotx" + }, + new + { + Input = ".ott", + Output = ".epub" + }, + new + { + Input = ".ott", + Output = ".fb2" + }, + new + { + Input = ".ott", + Output = ".html" + }, + new + { + Input = ".pot", + Output = ".odp" + }, + new + { + Input = ".pot", + Output = ".pdf" + }, + new + { + Input = ".pot", + Output = ".pptx" + }, + new + { + Input = ".pot", + Output = ".otp" + }, + new + { + Input = ".pot", + Output = ".potm" + }, + new + { + Input = ".pot", + Output = ".potx" + }, + new + { + Input = ".pot", + Output = ".pptm" + }, + new + { + Input = ".potm", + Output = ".odp" + }, + new + { + Input = ".potm", + Output = ".pdf" + }, + new + { + Input = ".potm", + Output = ".pptx" + }, + new + { + Input = ".potm", + Output = ".otp" + }, + new + { + Input = ".potm", + Output = ".potx" + }, + new + { + Input = ".potm", + Output = ".pptm" + }, + new + { + Input = ".potx", + Output = ".odp" + }, + new + { + Input = ".potx", + Output = ".pdf" + }, + new + { + Input = ".potx", + Output = ".pptx" + }, + new + { + Input = ".potx", + Output = ".otp" + }, + new + { + Input = ".potx", + Output = ".potm" + }, + new + { + Input = ".potx", + Output = ".pptm" + }, + new + { + Input = ".pps", + Output = ".odp" + }, + new + { + Input = ".pps", + Output = ".pdf" + }, + new + { + Input = ".pps", + Output = ".pptx" + }, + new + { + Input = ".pps", + Output = ".otp" + }, + new + { + Input = ".pps", + Output = ".potm" + }, + new + { + Input = ".pps", + Output = ".potx" + }, + new + { + Input = ".pps", + Output = ".pptm" + }, + new + { + Input = ".ppsm", + Output = ".odp" + }, + new + { + Input = ".ppsm", + Output = ".pdf" + }, + new + { + Input = ".ppsm", + Output = ".pptx" + }, + new + { + Input = ".ppsm", + Output = ".otp" + }, + new + { + Input = ".ppsm", + Output = ".potm" + }, + new + { + Input = ".ppsm", + Output = ".potx" + }, + new + { + Input = ".ppsm", + Output = ".pptm" + }, + new + { + Input = ".ppsx", + Output = ".odp" + }, + new + { + Input = ".ppsx", + Output = ".pdf" + }, + new + { + Input = ".ppsx", + Output = ".pptx" + }, + new + { + Input = ".ppsx", + Output = ".otp" + }, + new + { + Input = ".ppsx", + Output = ".potm" + }, + new + { + Input = ".ppsx", + Output = ".potx" + }, + new + { + Input = ".ppsx", + Output = ".pptm" + }, + new + { + Input = ".ppt", + Output = ".odp" + }, + new + { + Input = ".ppt", + Output = ".pdf" + }, + new + { + Input = ".ppt", + Output = ".pptx" + }, + new + { + Input = ".ppt", + Output = ".otp" + }, + new + { + Input = ".ppt", + Output = ".potm" + }, + new + { + Input = ".ppt", + Output = ".potx" + }, + new + { + Input = ".ppt", + Output = ".pptm" + }, + new + { + Input = ".pptm", + Output = ".odp" + }, + new + { + Input = ".pptm", + Output = ".pdf" + }, + new + { + Input = ".pptm", + Output = ".pptx" + }, + new + { + Input = ".pptm", + Output = ".otp" + }, + new + { + Input = ".pptm", + Output = ".potm" + }, + new + { + Input = ".pptm", + Output = ".potx" + }, + new + { + Input = ".pptt", + Output = ".pptx" + }, + new + { + Input = ".pptx", + Output = ".odp" + }, + new + { + Input = ".pptx", + Output = ".pdf" + }, + new + { + Input = ".pptx", + Output = ".otp" + }, + new + { + Input = ".pptx", + Output = ".potm" + }, + new + { + Input = ".pptx", + Output = ".potx" + }, + new + { + Input = ".pptx", + Output = ".pptm" + }, + new + { + Input = ".rtf", + Output = ".odt" + }, + new + { + Input = ".rtf", + Output = ".pdf" + }, + new + { + Input = ".rtf", + Output = ".docx" + }, + new + { + Input = ".rtf", + Output = ".txt" + }, + new + { + Input = ".rtf", + Output = ".docm" + }, + new + { + Input = ".rtf", + Output = ".dotm" + }, + new + { + Input = ".rtf", + Output = ".dotx" + }, + new + { + Input = ".rtf", + Output = ".epub" + }, + new + { + Input = ".rtf", + Output = ".fb2" + }, + new + { + Input = ".rtf", + Output = ".html" + }, + new + { + Input = ".rtf", + Output = ".ott" + }, + new + { + Input = ".txt", + Output = ".pdf" + }, + new + { + Input = ".txt", + Output = ".docx" + }, + new + { + Input = ".txt", + Output = ".odt" + }, + new + { + Input = ".txt", + Output = ".rtf" + }, + new + { + Input = ".txt", + Output = ".docm" + }, + new + { + Input = ".txt", + Output = ".dotm" + }, + new + { + Input = ".txt", + Output = ".dotx" + }, + new + { + Input = ".txt", + Output = ".epub" + }, + new + { + Input = ".txt", + Output = ".fb2" + }, + new + { + Input = ".txt", + Output = ".html" + }, + new + { + Input = ".txt", + Output = ".ott" + }, + new + { + Input = ".xls", + Output = ".csv" + }, + new + { + Input = ".xls", + Output = ".ods" + }, + new + { + Input = ".xls", + Output = ".pdf" + }, + new + { + Input = ".xls", + Output = ".xlsx" + }, + new + { + Input = ".xls", + Output = ".ots" + }, + new + { + Input = ".xls", + Output = ".xlsm" + }, + new + { + Input = ".xls", + Output = ".xltm" + }, + new + { + Input = ".xls", + Output = ".xltx" + }, + new + { + Input = ".xlsm", + Output = ".csv" + }, + new + { + Input = ".xlsm", + Output = ".xltm" + }, + new + { + Input = ".xlsm", + Output = ".xltx" + }, + new + { + Input = ".xlsm", + Output = ".ots" + }, + new + { + Input = ".xlsm", + Output = ".pdf" + }, + new + { + Input = ".xlsm", + Output = ".ods" + }, + new + { + Input = ".xlsm", + Output = ".xlsx" + }, + new + { + Input = ".xlsx", + Output = ".csv" + }, + new + { + Input = ".xlsx", + Output = ".ods" + }, + new + { + Input = ".xlsx", + Output = ".ots" + }, + new + { + Input = ".xlsx", + Output = ".pdf" + }, + new + { + Input = ".xlsx", + Output = ".xlsm" + }, + new + { + Input = ".xlsx", + Output = ".xltm" + }, + new + { + Input = ".xlsx", + Output = ".xltx" + }, + new + { + Input = ".xlst", + Output = ".xlsx" + }, + new + { + Input = ".xlt", + Output = ".csv" + }, + new + { + Input = ".xlt", + Output = ".ods" + }, + new + { + Input = ".xlt", + Output = ".pdf" + }, + new + { + Input = ".xlt", + Output = ".xlsx" + }, + new + { + Input = ".xlt", + Output = ".ots" + }, + new + { + Input = ".xlt", + Output = ".xlsm" + }, + new + { + Input = ".xlt", + Output = ".xltm" + }, + new + { + Input = ".xlt", + Output = ".xltx" + }, + new + { + Input = ".xltm", + Output = ".csv" + }, + new + { + Input = ".xltm", + Output = ".ods" + }, + new + { + Input = ".xltm", + Output = ".pdf" + }, + new + { + Input = ".xltm", + Output = ".ots" + }, + new + { + Input = ".xltm", + Output = ".xlsm" + }, + new + { + Input = ".xltm", + Output = ".xltx" + }, + new + { + Input = ".xltm", + Output = ".xlsx" + }, + new + { + Input = ".xltx", + Output = ".pdf" + }, + new + { + Input = ".xltx", + Output = ".csv" + }, + new + { + Input = ".xltx", + Output = ".ods" + }, + new + { + Input = ".xltx", + Output = ".ots" + }, + new + { + Input = ".xltx", + Output = ".xlsm" + }, + new + { + Input = ".xltx", + Output = ".xltm" + }, + new + { + Input = ".xltx", + Output = ".xlsx" + }, + new + { + Input = ".xps", + Output = ".pdf" + }, + new + { + Input = ".xml", + Output = ".docm" + }, + new + { + Input = ".xml", + Output = ".docx" + }, + new + { + Input = ".xml", + Output = ".dotm" + }, + new + { + Input = ".xml", + Output = ".dotx" + }, + new + { + Input = ".xml", + Output = ".epub" + }, + new + { + Input = ".xml", + Output = ".fb2" + }, + new + { + Input = ".xml", + Output = ".html" + }, + new + { + Input = ".xml", + Output = ".odt" + }, + new + { + Input = ".xml", + Output = ".ott" + }, + new + { + Input = ".xml", + Output = ".pdf" + }, + new + { + Input = ".xml", + Output = ".rtf" + }, + new + { + Input = ".xml", + Output = ".txt" + }); + }); + + modelBuilder.Entity("ASC.Files.Core.EF.DbFile", b => + { + b.Property("TenantId") + .HasColumnType("int") + .HasColumnName("tenant_id"); + + b.Property("Id") + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Version") + .HasColumnType("int") + .HasColumnName("version"); + + b.Property("Category") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("category") + .HasDefaultValueSql("'0'"); + + b.Property("Changes") + .HasColumnType("mediumtext") + .HasColumnName("changes") + .UseCollation("utf8_general_ci") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Comment") + .HasColumnType("varchar(255)") + .HasColumnName("comment") + .UseCollation("utf8_general_ci") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("ContentLength") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("content_length") + .HasDefaultValueSql("'0'"); + + b.Property("ConvertedType") + .HasColumnType("varchar(10)") + .HasColumnName("converted_type") + .UseCollation("utf8_general_ci") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("CreateBy") + .IsRequired() + .HasColumnType("char(38)") + .HasColumnName("create_by") + .UseCollation("utf8_general_ci") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("CreateOn") + .HasColumnType("datetime") + .HasColumnName("create_on"); + + b.Property("CurrentVersion") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasColumnName("current_version") + .HasDefaultValueSql("'0'"); + + b.Property("Encrypted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasColumnName("encrypted") + .HasDefaultValueSql("'0'"); + + b.Property("FileStatus") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("file_status") + .HasDefaultValueSql("'0'"); + + b.Property("Forcesave") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("forcesave") + .HasDefaultValueSql("'0'"); + + b.Property("ModifiedBy") + .IsRequired() + .HasColumnType("char(38)") + .HasColumnName("modified_by") + .UseCollation("utf8_general_ci") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("ModifiedOn") + .HasColumnType("datetime") + .HasColumnName("modified_on"); + + b.Property("ParentId") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("folder_id") + .HasDefaultValueSql("'0'"); + + b.Property("ThumbnailStatus") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("thumb") + .HasDefaultValueSql("'0'"); + + b.Property("Title") + .IsRequired() + .HasColumnType("varchar(400)") + .HasColumnName("title") + .UseCollation("utf8_general_ci") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("VersionGroup") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("version_group") + .HasDefaultValueSql("'1'"); + + b.HasKey("TenantId", "Id", "Version") + .HasName("PRIMARY"); + + b.HasIndex("Id") + .HasDatabaseName("id"); + + b.HasIndex("ModifiedOn") + .HasDatabaseName("modified_on"); + + b.HasIndex("ParentId") + .HasDatabaseName("folder_id"); + + b.ToTable("files_file", (string)null); + + b.HasAnnotation("MySql:CharSet", "utf8"); + }); + + modelBuilder.Entity("ASC.Files.Core.EF.DbFilesBunchObjects", b => + { + b.Property("TenantId") + .HasColumnType("int") + .HasColumnName("tenant_id"); + + b.Property("RightNode") + .HasColumnType("varchar(255)") + .HasColumnName("right_node") + .UseCollation("utf8_general_ci") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("LeftNode") + .IsRequired() + .HasColumnType("varchar(255)") + .HasColumnName("left_node") + .UseCollation("utf8_general_ci") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("TenantId", "RightNode") + .HasName("PRIMARY"); + + b.HasIndex("LeftNode") + .HasDatabaseName("left_node"); + + b.ToTable("files_bunch_objects", (string)null); + + b.HasAnnotation("MySql:CharSet", "utf8"); + }); + + modelBuilder.Entity("ASC.Files.Core.EF.DbFilesLink", b => + { + b.Property("TenantId") + .HasColumnType("int") + .HasColumnName("tenant_id"); + + b.Property("SourceId") + .HasColumnType("varchar(32)") + .HasColumnName("source_id") + .UseCollation("utf8_general_ci") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("LinkedId") + .HasColumnType("varchar(32)") + .HasColumnName("linked_id") + .UseCollation("utf8_general_ci") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("LinkedFor") + .IsRequired() + .HasColumnType("char(38)") + .HasColumnName("linked_for") + .UseCollation("utf8_general_ci") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("TenantId", "SourceId", "LinkedId") + .HasName("PRIMARY"); + + b.HasIndex("TenantId", "SourceId", "LinkedId", "LinkedFor") + .HasDatabaseName("linked_for"); + + b.ToTable("files_link", (string)null); + + b.HasAnnotation("MySql:CharSet", "utf8"); + }); + + modelBuilder.Entity("ASC.Files.Core.EF.DbFilesProperties", b => + { + b.Property("TenantId") + .HasColumnType("int") + .HasColumnName("tenant_id"); + + b.Property("EntryId") + .HasColumnType("varchar(32)") + .HasColumnName("entry_id") + .UseCollation("utf8_general_ci") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Data") + .HasColumnType("mediumtext") + .HasColumnName("data") + .UseCollation("utf8_general_ci") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("TenantId", "EntryId") + .HasName("PRIMARY"); + + b.ToTable("files_properties", (string)null); + }); + + modelBuilder.Entity("ASC.Files.Core.EF.DbFilesSecurity", b => + { + b.Property("TenantId") + .HasColumnType("int") + .HasColumnName("tenant_id"); + + b.Property("EntryId") + .HasColumnType("varchar(50)") + .HasColumnName("entry_id") + .UseCollation("utf8_general_ci") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("EntryType") + .HasColumnType("int") + .HasColumnName("entry_type"); + + b.Property("Subject") + .HasColumnType("char(38)") + .HasColumnName("subject") + .UseCollation("utf8_general_ci") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("FileShareOptions") + .HasColumnType("text") + .HasColumnName("options") + .UseCollation("utf8_general_ci") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Owner") + .IsRequired() + .HasColumnType("char(38)") + .HasColumnName("owner") + .UseCollation("utf8_general_ci") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Share") + .HasColumnType("int") + .HasColumnName("security"); + + b.Property("SubjectType") + .HasColumnType("int") + .HasColumnName("subject_type"); + + b.Property("TimeStamp") + .HasColumnType("timestamp") + .HasColumnName("timestamp"); + + b.HasKey("TenantId", "EntryId", "EntryType", "Subject") + .HasName("PRIMARY"); + + b.HasIndex("Owner") + .HasDatabaseName("owner"); + + b.HasIndex("TenantId", "EntryType", "EntryId", "Owner") + .HasDatabaseName("tenant_id"); + + b.ToTable("files_security", (string)null); + + b.HasAnnotation("MySql:CharSet", "utf8"); + }); + + modelBuilder.Entity("ASC.Files.Core.EF.DbFilesTag", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(255)") + .HasColumnName("name") + .UseCollation("utf8_general_ci") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Owner") + .IsRequired() + .HasColumnType("varchar(38)") + .HasColumnName("owner") + .UseCollation("utf8_general_ci") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("TenantId") + .HasColumnType("int") + .HasColumnName("tenant_id"); + + b.Property("Type") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("flag") + .HasDefaultValueSql("'0'"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Owner", "Name", "Type") + .HasDatabaseName("name"); + + b.ToTable("files_tag", (string)null); + + b.HasAnnotation("MySql:CharSet", "utf8"); + }); + + modelBuilder.Entity("ASC.Files.Core.EF.DbFilesTagLink", b => + { + b.Property("TenantId") + .HasColumnType("int") + .HasColumnName("tenant_id"); + + b.Property("TagId") + .HasColumnType("int") + .HasColumnName("tag_id"); + + b.Property("EntryId") + .HasColumnType("varchar(32)") + .HasColumnName("entry_id") + .UseCollation("utf8_general_ci") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("EntryType") + .HasColumnType("int") + .HasColumnName("entry_type"); + + b.Property("Count") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("tag_count") + .HasDefaultValueSql("'0'"); + + b.Property("CreateBy") + .HasColumnType("char(38)") + .HasColumnName("create_by") + .UseCollation("utf8_general_ci") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("CreateOn") + .HasColumnType("datetime") + .HasColumnName("create_on"); + + b.HasKey("TenantId", "TagId", "EntryId", "EntryType") + .HasName("PRIMARY"); + + b.HasIndex("CreateOn") + .HasDatabaseName("create_on"); + + b.HasIndex("TenantId", "EntryId", "EntryType") + .HasDatabaseName("entry_id"); + + b.ToTable("files_tag_link", (string)null); + + b.HasAnnotation("MySql:CharSet", "utf8"); + }); + + modelBuilder.Entity("ASC.Files.Core.EF.DbFilesThirdpartyAccount", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("CreateOn") + .HasColumnType("datetime") + .HasColumnName("create_on"); + + b.Property("FolderId") + .HasColumnType("text") + .HasColumnName("folder_id") + .UseCollation("utf8_general_ci") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("FolderType") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("folder_type") + .HasDefaultValueSql("'0'"); + + b.Property("HasLogo") + .HasColumnType("tinyint(1)") + .HasColumnName("has_logo"); + + b.Property("Password") + .IsRequired() + .HasColumnType("varchar(512)") + .HasColumnName("password") + .UseCollation("utf8_general_ci") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Private") + .HasColumnType("tinyint(1)") + .HasColumnName("private"); + + b.Property("Provider") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("varchar(50)") + .HasColumnName("provider") + .HasDefaultValueSql("'0'") + .UseCollation("utf8_general_ci") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("RoomType") + .HasColumnType("int") + .HasColumnName("room_type"); + + b.Property("TenantId") + .HasColumnType("int") + .HasColumnName("tenant_id"); + + b.Property("Title") + .IsRequired() + .HasColumnType("varchar(400)") + .HasColumnName("customer_title") + .UseCollation("utf8_general_ci") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Token") + .HasColumnType("text") + .HasColumnName("token") + .UseCollation("utf8_general_ci") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Url") + .HasColumnType("text") + .HasColumnName("url") + .UseCollation("utf8_general_ci") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("varchar(38)") + .HasColumnName("user_id") + .UseCollation("utf8_general_ci") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("UserName") + .IsRequired() + .HasColumnType("varchar(100)") + .HasColumnName("user_name") + .UseCollation("utf8_general_ci") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id"); + + b.HasIndex("TenantId") + .HasDatabaseName("tenant_id"); + + b.ToTable("files_thirdparty_account", (string)null); + + b.HasAnnotation("MySql:CharSet", "utf8"); + }); + + modelBuilder.Entity("ASC.Files.Core.EF.DbFilesThirdpartyApp", b => + { + b.Property("UserId") + .HasColumnType("varchar(38)") + .HasColumnName("user_id") + .UseCollation("utf8_general_ci") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("App") + .HasColumnType("varchar(50)") + .HasColumnName("app") + .UseCollation("utf8_general_ci") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("ModifiedOn") + .HasColumnType("timestamp") + .HasColumnName("modified_on"); + + b.Property("TenantId") + .HasColumnType("int") + .HasColumnName("tenant_id"); + + b.Property("Token") + .HasColumnType("text") + .HasColumnName("token") + .UseCollation("utf8_general_ci") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("UserId", "App") + .HasName("PRIMARY"); + + b.ToTable("files_thirdparty_app", (string)null); + + b.HasAnnotation("MySql:CharSet", "utf8"); + }); + + modelBuilder.Entity("ASC.Files.Core.EF.DbFilesThirdpartyIdMapping", b => + { + b.Property("HashId") + .HasColumnType("char(32)") + .HasColumnName("hash_id") + .UseCollation("utf8_general_ci") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Id") + .IsRequired() + .HasColumnType("text") + .HasColumnName("id") + .UseCollation("utf8_general_ci") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("TenantId") + .HasColumnType("int") + .HasColumnName("tenant_id"); + + b.HasKey("HashId") + .HasName("PRIMARY"); + + b.HasIndex("TenantId", "HashId") + .HasDatabaseName("index_1"); + + b.ToTable("files_thirdparty_id_mapping", (string)null); + + b.HasAnnotation("MySql:CharSet", "utf8"); + }); + + modelBuilder.Entity("ASC.Files.Core.EF.DbFolder", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("CreateBy") + .IsRequired() + .HasColumnType("char(38)") + .HasColumnName("create_by") + .UseCollation("utf8_general_ci") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("CreateOn") + .HasColumnType("datetime") + .HasColumnName("create_on"); + + b.Property("FilesCount") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("filesCount") + .HasDefaultValueSql("'0'"); + + b.Property("FolderType") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("folder_type") + .HasDefaultValueSql("'0'"); + + b.Property("FoldersCount") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("foldersCount") + .HasDefaultValueSql("'0'"); + + b.Property("HasLogo") + .HasColumnType("tinyint(1)") + .HasColumnName("has_logo"); + + b.Property("ModifiedBy") + .IsRequired() + .HasColumnType("char(38)") + .HasColumnName("modified_by") + .UseCollation("utf8_general_ci") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("ModifiedOn") + .HasColumnType("datetime") + .HasColumnName("modified_on"); + + b.Property("ParentId") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("parent_id") + .HasDefaultValueSql("'0'"); + + b.Property("Private") + .HasColumnType("tinyint(1)") + .HasColumnName("private"); + + b.Property("TenantId") + .HasColumnType("int") + .HasColumnName("tenant_id"); + + b.Property("Title") + .IsRequired() + .HasColumnType("varchar(400)") + .HasColumnName("title") + .UseCollation("utf8_general_ci") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id"); + + b.HasIndex("ModifiedOn") + .HasDatabaseName("modified_on"); + + b.HasIndex("TenantId", "ParentId") + .HasDatabaseName("parent_id"); + + b.ToTable("files_folder", (string)null); + + b.HasAnnotation("MySql:CharSet", "utf8"); + }); + + modelBuilder.Entity("ASC.Files.Core.EF.DbFolderTree", b => + { + b.Property("ParentId") + .HasColumnType("int") + .HasColumnName("parent_id"); + + b.Property("FolderId") + .HasColumnType("int") + .HasColumnName("folder_id"); + + b.Property("Level") + .HasColumnType("int") + .HasColumnName("level"); + + b.HasKey("ParentId", "FolderId") + .HasName("PRIMARY"); + + b.HasIndex("FolderId") + .HasDatabaseName("folder_id"); + + b.ToTable("files_folder_tree", (string)null); + + b.HasAnnotation("MySql:CharSet", "utf8"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/migrations/mysql/FilesDbContext/20221215125741_FilesDbContext_Upgrade1.cs b/migrations/mysql/FilesDbContext/20221215125741_FilesDbContext_Upgrade1.cs new file mode 100644 index 0000000000..313c2a5746 --- /dev/null +++ b/migrations/mysql/FilesDbContext/20221215125741_FilesDbContext_Upgrade1.cs @@ -0,0 +1,37 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace ASC.Migrations.MySql.Migrations.FilesDb +{ + public partial class FilesDbContext_Upgrade1 : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "has_logo", + table: "files_thirdparty_account", + type: "tinyint(1)", + nullable: false, + defaultValue: false); + + migrationBuilder.AddColumn( + name: "has_logo", + table: "files_folder", + type: "tinyint(1)", + nullable: false, + defaultValue: false); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "has_logo", + table: "files_thirdparty_account"); + + migrationBuilder.DropColumn( + name: "has_logo", + table: "files_folder"); + } + } +} diff --git a/migrations/mysql/FilesDbContext/FilesDbContextModelSnapshot.cs b/migrations/mysql/FilesDbContext/FilesDbContextModelSnapshot.cs index 2ccd508bf1..d082fb1ee4 100644 --- a/migrations/mysql/FilesDbContext/FilesDbContextModelSnapshot.cs +++ b/migrations/mysql/FilesDbContext/FilesDbContextModelSnapshot.cs @@ -2329,6 +2329,10 @@ namespace ASC.Migrations.MySql.Migrations .HasColumnName("folder_type") .HasDefaultValueSql("'0'"); + b.Property("HasLogo") + .HasColumnType("tinyint(1)") + .HasColumnName("has_logo"); + b.Property("Password") .IsRequired() .HasColumnType("varchar(512)") @@ -2502,6 +2506,10 @@ namespace ASC.Migrations.MySql.Migrations .HasColumnName("foldersCount") .HasDefaultValueSql("'0'"); + b.Property("HasLogo") + .HasColumnType("tinyint(1)") + .HasColumnName("has_logo"); + b.Property("ModifiedBy") .IsRequired() .HasColumnType("char(38)") diff --git a/migrations/postgre/FilesDbContext/20221215125741_FilesDbContext_Upgrade1.Designer.cs b/migrations/postgre/FilesDbContext/20221215125741_FilesDbContext_Upgrade1.Designer.cs new file mode 100644 index 0000000000..1eb77871d0 --- /dev/null +++ b/migrations/postgre/FilesDbContext/20221215125741_FilesDbContext_Upgrade1.Designer.cs @@ -0,0 +1,2507 @@ +// +using System; +using ASC.Files.Core.EF; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace ASC.Migrations.PostgreSql.Migrations.FilesDb +{ + [DbContext(typeof(FilesDbContext))] + [Migration("20221215125741_FilesDbContext_Upgrade1")] + partial class FilesDbContext_Upgrade1 + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn) + .HasAnnotation("ProductVersion", "6.0.7") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + modelBuilder.Entity("ASC.Core.Common.EF.Model.DbTenant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("Alias") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("alias"); + + b.Property("Calls") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasColumnName("calls") + .HasDefaultValueSql("true"); + + b.Property("CreationDateTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("creationdatetime"); + + b.Property("Industry") + .HasColumnType("integer") + .HasColumnName("industry"); + + b.Property("Language") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(10) + .HasColumnType("character(10)") + .HasColumnName("language") + .HasDefaultValueSql("'en-US'") + .IsFixedLength(); + + b.Property("LastModified") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("last_modified") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("MappedDomain") + .ValueGeneratedOnAdd() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("mappeddomain") + .HasDefaultValueSql("NULL"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("name"); + + b.Property("OwnerId") + .ValueGeneratedOnAdd() + .HasMaxLength(38) + .HasColumnType("uuid") + .HasColumnName("owner_id") + .HasDefaultValueSql("NULL"); + + b.Property("PaymentId") + .ValueGeneratedOnAdd() + .HasMaxLength(38) + .HasColumnType("character varying(38)") + .HasColumnName("payment_id") + .HasDefaultValueSql("NULL"); + + b.Property("Spam") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasColumnName("spam") + .HasDefaultValueSql("true"); + + b.Property("Status") + .HasColumnType("integer") + .HasColumnName("status"); + + b.Property("StatusChanged") + .HasColumnType("timestamp with time zone") + .HasColumnName("statuschanged"); + + b.Property("TimeZone") + .ValueGeneratedOnAdd() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("timezone") + .HasDefaultValueSql("NULL"); + + b.Property("TrustedDomainsEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("trusteddomainsenabled") + .HasDefaultValueSql("1"); + + b.Property("TrustedDomainsRaw") + .ValueGeneratedOnAdd() + .HasMaxLength(1024) + .HasColumnType("character varying(1024)") + .HasColumnName("trusteddomains") + .HasDefaultValueSql("NULL"); + + b.Property("Version") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("version") + .HasDefaultValueSql("2"); + + b.Property("Version_Changed") + .HasColumnType("timestamp with time zone") + .HasColumnName("version_changed"); + + b.HasKey("Id"); + + b.HasIndex("Alias") + .IsUnique() + .HasDatabaseName("alias"); + + b.HasIndex("LastModified") + .HasDatabaseName("last_modified_tenants_tenants"); + + b.HasIndex("MappedDomain") + .HasDatabaseName("mappeddomain"); + + b.HasIndex("Version") + .HasDatabaseName("version"); + + b.ToTable("tenants_tenants", "onlyoffice"); + + b.HasData( + new + { + Id = 1, + Alias = "localhost", + Calls = false, + CreationDateTime = new DateTime(2021, 3, 9, 17, 46, 59, 97, DateTimeKind.Utc).AddTicks(4317), + Industry = 0, + LastModified = new DateTime(2022, 7, 8, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "Web Office", + OwnerId = new Guid("66faa6e4-f133-11ea-b126-00ffeec8b4ef"), + Spam = false, + Status = 0, + TrustedDomainsEnabled = 0, + Version = 0 + }); + }); + + modelBuilder.Entity("ASC.Core.Common.EF.Model.FilesConverts", b => + { + b.Property("Input") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("input"); + + b.Property("Output") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("output"); + + b.HasKey("Input", "Output") + .HasName("files_converts_pkey"); + + b.ToTable("files_converts", "onlyoffice"); + + b.HasData( + new + { + Input = ".csv", + Output = ".ods" + }, + new + { + Input = ".csv", + Output = ".pdf" + }, + new + { + Input = ".csv", + Output = ".ots" + }, + new + { + Input = ".csv", + Output = ".xlsx" + }, + new + { + Input = ".csv", + Output = ".xlsm" + }, + new + { + Input = ".csv", + Output = ".xltm" + }, + new + { + Input = ".csv", + Output = ".xltx" + }, + new + { + Input = ".doc", + Output = ".docx" + }, + new + { + Input = ".doc", + Output = ".docm" + }, + new + { + Input = ".doc", + Output = ".dotm" + }, + new + { + Input = ".doc", + Output = ".dotx" + }, + new + { + Input = ".doc", + Output = ".epub" + }, + new + { + Input = ".doc", + Output = ".fb2" + }, + new + { + Input = ".doc", + Output = ".html" + }, + new + { + Input = ".doc", + Output = ".ott" + }, + new + { + Input = ".doc", + Output = ".odt" + }, + new + { + Input = ".doc", + Output = ".pdf" + }, + new + { + Input = ".doc", + Output = ".rtf" + }, + new + { + Input = ".doc", + Output = ".txt" + }, + new + { + Input = ".docm", + Output = ".docx" + }, + new + { + Input = ".docm", + Output = ".dotm" + }, + new + { + Input = ".docm", + Output = ".html" + }, + new + { + Input = ".docm", + Output = ".dotx" + }, + new + { + Input = ".docm", + Output = ".epub" + }, + new + { + Input = ".docm", + Output = ".fb2" + }, + new + { + Input = ".docm", + Output = ".ott" + }, + new + { + Input = ".docm", + Output = ".odt" + }, + new + { + Input = ".docm", + Output = ".pdf" + }, + new + { + Input = ".docm", + Output = ".rtf" + }, + new + { + Input = ".docm", + Output = ".txt" + }, + new + { + Input = ".doct", + Output = ".docx" + }, + new + { + Input = ".docx", + Output = ".odt" + }, + new + { + Input = ".docx", + Output = ".pdf" + }, + new + { + Input = ".docx", + Output = ".rtf" + }, + new + { + Input = ".docx", + Output = ".txt" + }, + new + { + Input = ".docx", + Output = ".html" + }, + new + { + Input = ".docx", + Output = ".dotm" + }, + new + { + Input = ".docx", + Output = ".dotx" + }, + new + { + Input = ".docx", + Output = ".epub" + }, + new + { + Input = ".docx", + Output = ".fb2" + }, + new + { + Input = ".docx", + Output = ".ott" + }, + new + { + Input = ".docx", + Output = ".docm" + }, + new + { + Input = ".docx", + Output = ".docxf" + }, + new + { + Input = ".docxf", + Output = ".docx" + }, + new + { + Input = ".docxf", + Output = ".odt" + }, + new + { + Input = ".docxf", + Output = ".oform" + }, + new + { + Input = ".docxf", + Output = ".pdf" + }, + new + { + Input = ".docxf", + Output = ".rtf" + }, + new + { + Input = ".docxf", + Output = ".txt" + }, + new + { + Input = ".docxf", + Output = ".dotx" + }, + new + { + Input = ".docxf", + Output = ".epub" + }, + new + { + Input = ".docxf", + Output = ".fb2" + }, + new + { + Input = ".docxf", + Output = ".html" + }, + new + { + Input = ".docxf", + Output = ".ott" + }, + new + { + Input = ".dot", + Output = ".docx" + }, + new + { + Input = ".dot", + Output = ".odt" + }, + new + { + Input = ".dot", + Output = ".pdf" + }, + new + { + Input = ".dot", + Output = ".rtf" + }, + new + { + Input = ".dot", + Output = ".txt" + }, + new + { + Input = ".dot", + Output = ".docm" + }, + new + { + Input = ".dot", + Output = ".dotm" + }, + new + { + Input = ".dot", + Output = ".dotx" + }, + new + { + Input = ".dot", + Output = ".epub" + }, + new + { + Input = ".dot", + Output = ".fb2" + }, + new + { + Input = ".dot", + Output = ".html" + }, + new + { + Input = ".dot", + Output = ".ott" + }, + new + { + Input = ".dotm", + Output = ".docx" + }, + new + { + Input = ".dotm", + Output = ".odt" + }, + new + { + Input = ".dotm", + Output = ".pdf" + }, + new + { + Input = ".dotm", + Output = ".rtf" + }, + new + { + Input = ".dotm", + Output = ".txt" + }, + new + { + Input = ".dotm", + Output = ".docm" + }, + new + { + Input = ".dotm", + Output = ".dotx" + }, + new + { + Input = ".dotm", + Output = ".epub" + }, + new + { + Input = ".dotm", + Output = ".fb2" + }, + new + { + Input = ".dotm", + Output = ".html" + }, + new + { + Input = ".dotm", + Output = ".ott" + }, + new + { + Input = ".dotx", + Output = ".docx" + }, + new + { + Input = ".dotx", + Output = ".odt" + }, + new + { + Input = ".dotx", + Output = ".pdf" + }, + new + { + Input = ".dotx", + Output = ".rtf" + }, + new + { + Input = ".dotx", + Output = ".txt" + }, + new + { + Input = ".dotx", + Output = ".docm" + }, + new + { + Input = ".dotx", + Output = ".dotm" + }, + new + { + Input = ".dotx", + Output = ".epub" + }, + new + { + Input = ".dotx", + Output = ".fb2" + }, + new + { + Input = ".dotx", + Output = ".html" + }, + new + { + Input = ".dotx", + Output = ".ott" + }, + new + { + Input = ".epub", + Output = ".docx" + }, + new + { + Input = ".epub", + Output = ".odt" + }, + new + { + Input = ".epub", + Output = ".pdf" + }, + new + { + Input = ".epub", + Output = ".rtf" + }, + new + { + Input = ".epub", + Output = ".txt" + }, + new + { + Input = ".epub", + Output = ".docm" + }, + new + { + Input = ".epub", + Output = ".dotm" + }, + new + { + Input = ".epub", + Output = ".dotx" + }, + new + { + Input = ".epub", + Output = ".fb2" + }, + new + { + Input = ".epub", + Output = ".html" + }, + new + { + Input = ".epub", + Output = ".ott" + }, + new + { + Input = ".fb2", + Output = ".docx" + }, + new + { + Input = ".fb2", + Output = ".odt" + }, + new + { + Input = ".fb2", + Output = ".pdf" + }, + new + { + Input = ".fb2", + Output = ".rtf" + }, + new + { + Input = ".fb2", + Output = ".txt" + }, + new + { + Input = ".fb2", + Output = ".docm" + }, + new + { + Input = ".fb2", + Output = ".dotm" + }, + new + { + Input = ".fb2", + Output = ".dotx" + }, + new + { + Input = ".fb2", + Output = ".epub" + }, + new + { + Input = ".fb2", + Output = ".html" + }, + new + { + Input = ".fb2", + Output = ".ott" + }, + new + { + Input = ".fodp", + Output = ".odp" + }, + new + { + Input = ".fodp", + Output = ".pdf" + }, + new + { + Input = ".fodp", + Output = ".pptx" + }, + new + { + Input = ".fodp", + Output = ".otp" + }, + new + { + Input = ".fodp", + Output = ".potm" + }, + new + { + Input = ".fodp", + Output = ".potx" + }, + new + { + Input = ".fodp", + Output = ".pptm" + }, + new + { + Input = ".fods", + Output = ".csv" + }, + new + { + Input = ".fods", + Output = ".ods" + }, + new + { + Input = ".fods", + Output = ".pdf" + }, + new + { + Input = ".fods", + Output = ".xlsx" + }, + new + { + Input = ".fods", + Output = ".xlsm" + }, + new + { + Input = ".fods", + Output = ".xltm" + }, + new + { + Input = ".fods", + Output = ".xltx" + }, + new + { + Input = ".fods", + Output = ".ots" + }, + new + { + Input = ".fodt", + Output = ".docx" + }, + new + { + Input = ".fodt", + Output = ".odt" + }, + new + { + Input = ".fodt", + Output = ".docm" + }, + new + { + Input = ".fodt", + Output = ".pdf" + }, + new + { + Input = ".fodt", + Output = ".rtf" + }, + new + { + Input = ".fodt", + Output = ".txt" + }, + new + { + Input = ".fodt", + Output = ".dotm" + }, + new + { + Input = ".fodt", + Output = ".dotx" + }, + new + { + Input = ".fodt", + Output = ".epub" + }, + new + { + Input = ".fodt", + Output = ".fb2" + }, + new + { + Input = ".fodt", + Output = ".html" + }, + new + { + Input = ".fodt", + Output = ".ott" + }, + new + { + Input = ".html", + Output = ".docx" + }, + new + { + Input = ".html", + Output = ".odt" + }, + new + { + Input = ".html", + Output = ".pdf" + }, + new + { + Input = ".html", + Output = ".rtf" + }, + new + { + Input = ".html", + Output = ".txt" + }, + new + { + Input = ".html", + Output = ".docm" + }, + new + { + Input = ".html", + Output = ".dotm" + }, + new + { + Input = ".html", + Output = ".dotx" + }, + new + { + Input = ".html", + Output = ".epub" + }, + new + { + Input = ".html", + Output = ".fb2" + }, + new + { + Input = ".html", + Output = ".ott" + }, + new + { + Input = ".mht", + Output = ".docx" + }, + new + { + Input = ".mht", + Output = ".odt" + }, + new + { + Input = ".mht", + Output = ".pdf" + }, + new + { + Input = ".mht", + Output = ".rtf" + }, + new + { + Input = ".mht", + Output = ".txt" + }, + new + { + Input = ".mht", + Output = ".docm" + }, + new + { + Input = ".mht", + Output = ".dotm" + }, + new + { + Input = ".mht", + Output = ".dotx" + }, + new + { + Input = ".mht", + Output = ".epub" + }, + new + { + Input = ".mht", + Output = ".fb2" + }, + new + { + Input = ".mht", + Output = ".ott" + }, + new + { + Input = ".odp", + Output = ".pdf" + }, + new + { + Input = ".odp", + Output = ".pptx" + }, + new + { + Input = ".odp", + Output = ".otp" + }, + new + { + Input = ".odp", + Output = ".potm" + }, + new + { + Input = ".odp", + Output = ".potx" + }, + new + { + Input = ".odp", + Output = ".pptm" + }, + new + { + Input = ".otp", + Output = ".odp" + }, + new + { + Input = ".otp", + Output = ".pdf" + }, + new + { + Input = ".otp", + Output = ".potm" + }, + new + { + Input = ".otp", + Output = ".potx" + }, + new + { + Input = ".otp", + Output = ".pptm" + }, + new + { + Input = ".otp", + Output = ".pptx" + }, + new + { + Input = ".ods", + Output = ".csv" + }, + new + { + Input = ".ods", + Output = ".pdf" + }, + new + { + Input = ".ods", + Output = ".xlsx" + }, + new + { + Input = ".ods", + Output = ".ots" + }, + new + { + Input = ".ods", + Output = ".xlsm" + }, + new + { + Input = ".ods", + Output = ".xltm" + }, + new + { + Input = ".ods", + Output = ".xltx" + }, + new + { + Input = ".ots", + Output = ".csv" + }, + new + { + Input = ".ots", + Output = ".ods" + }, + new + { + Input = ".ots", + Output = ".pdf" + }, + new + { + Input = ".ots", + Output = ".xlsm" + }, + new + { + Input = ".ots", + Output = ".xltm" + }, + new + { + Input = ".ots", + Output = ".xltx" + }, + new + { + Input = ".ots", + Output = ".xlsx" + }, + new + { + Input = ".oxps", + Output = ".pdf" + }, + new + { + Input = ".odt", + Output = ".docx" + }, + new + { + Input = ".odt", + Output = ".pdf" + }, + new + { + Input = ".odt", + Output = ".rtf" + }, + new + { + Input = ".odt", + Output = ".txt" + }, + new + { + Input = ".odt", + Output = ".docm" + }, + new + { + Input = ".odt", + Output = ".dotm" + }, + new + { + Input = ".odt", + Output = ".dotx" + }, + new + { + Input = ".odt", + Output = ".epub" + }, + new + { + Input = ".odt", + Output = ".fb2" + }, + new + { + Input = ".odt", + Output = ".html" + }, + new + { + Input = ".odt", + Output = ".ott" + }, + new + { + Input = ".ott", + Output = ".docx" + }, + new + { + Input = ".ott", + Output = ".odt" + }, + new + { + Input = ".ott", + Output = ".pdf" + }, + new + { + Input = ".ott", + Output = ".rtf" + }, + new + { + Input = ".ott", + Output = ".txt" + }, + new + { + Input = ".ott", + Output = ".docm" + }, + new + { + Input = ".ott", + Output = ".dotm" + }, + new + { + Input = ".ott", + Output = ".dotx" + }, + new + { + Input = ".ott", + Output = ".epub" + }, + new + { + Input = ".ott", + Output = ".fb2" + }, + new + { + Input = ".ott", + Output = ".html" + }, + new + { + Input = ".pot", + Output = ".odp" + }, + new + { + Input = ".pot", + Output = ".pdf" + }, + new + { + Input = ".pot", + Output = ".pptx" + }, + new + { + Input = ".pot", + Output = ".otp" + }, + new + { + Input = ".pot", + Output = ".potm" + }, + new + { + Input = ".pot", + Output = ".potx" + }, + new + { + Input = ".pot", + Output = ".pptm" + }, + new + { + Input = ".potm", + Output = ".odp" + }, + new + { + Input = ".potm", + Output = ".pdf" + }, + new + { + Input = ".potm", + Output = ".pptx" + }, + new + { + Input = ".potm", + Output = ".otp" + }, + new + { + Input = ".potm", + Output = ".potx" + }, + new + { + Input = ".potm", + Output = ".pptm" + }, + new + { + Input = ".potx", + Output = ".odp" + }, + new + { + Input = ".potx", + Output = ".pdf" + }, + new + { + Input = ".potx", + Output = ".pptx" + }, + new + { + Input = ".potx", + Output = ".otp" + }, + new + { + Input = ".potx", + Output = ".potm" + }, + new + { + Input = ".potx", + Output = ".pptm" + }, + new + { + Input = ".pps", + Output = ".odp" + }, + new + { + Input = ".pps", + Output = ".pdf" + }, + new + { + Input = ".pps", + Output = ".pptx" + }, + new + { + Input = ".pps", + Output = ".otp" + }, + new + { + Input = ".pps", + Output = ".potm" + }, + new + { + Input = ".pps", + Output = ".potx" + }, + new + { + Input = ".pps", + Output = ".pptm" + }, + new + { + Input = ".ppsm", + Output = ".odp" + }, + new + { + Input = ".ppsm", + Output = ".pdf" + }, + new + { + Input = ".ppsm", + Output = ".pptx" + }, + new + { + Input = ".ppsm", + Output = ".otp" + }, + new + { + Input = ".ppsm", + Output = ".potm" + }, + new + { + Input = ".ppsm", + Output = ".potx" + }, + new + { + Input = ".ppsm", + Output = ".pptm" + }, + new + { + Input = ".ppsx", + Output = ".odp" + }, + new + { + Input = ".ppsx", + Output = ".pdf" + }, + new + { + Input = ".ppsx", + Output = ".pptx" + }, + new + { + Input = ".ppsx", + Output = ".otp" + }, + new + { + Input = ".ppsx", + Output = ".potm" + }, + new + { + Input = ".ppsx", + Output = ".potx" + }, + new + { + Input = ".ppsx", + Output = ".pptm" + }, + new + { + Input = ".ppt", + Output = ".odp" + }, + new + { + Input = ".ppt", + Output = ".pdf" + }, + new + { + Input = ".ppt", + Output = ".pptx" + }, + new + { + Input = ".ppt", + Output = ".otp" + }, + new + { + Input = ".ppt", + Output = ".potm" + }, + new + { + Input = ".ppt", + Output = ".potx" + }, + new + { + Input = ".ppt", + Output = ".pptm" + }, + new + { + Input = ".pptm", + Output = ".odp" + }, + new + { + Input = ".pptm", + Output = ".pdf" + }, + new + { + Input = ".pptm", + Output = ".pptx" + }, + new + { + Input = ".pptm", + Output = ".otp" + }, + new + { + Input = ".pptm", + Output = ".potm" + }, + new + { + Input = ".pptm", + Output = ".potx" + }, + new + { + Input = ".pptt", + Output = ".pptx" + }, + new + { + Input = ".pptx", + Output = ".odp" + }, + new + { + Input = ".pptx", + Output = ".pdf" + }, + new + { + Input = ".pptx", + Output = ".otp" + }, + new + { + Input = ".pptx", + Output = ".potm" + }, + new + { + Input = ".pptx", + Output = ".potx" + }, + new + { + Input = ".pptx", + Output = ".pptm" + }, + new + { + Input = ".rtf", + Output = ".odt" + }, + new + { + Input = ".rtf", + Output = ".pdf" + }, + new + { + Input = ".rtf", + Output = ".docx" + }, + new + { + Input = ".rtf", + Output = ".txt" + }, + new + { + Input = ".rtf", + Output = ".docm" + }, + new + { + Input = ".rtf", + Output = ".dotm" + }, + new + { + Input = ".rtf", + Output = ".dotx" + }, + new + { + Input = ".rtf", + Output = ".epub" + }, + new + { + Input = ".rtf", + Output = ".fb2" + }, + new + { + Input = ".rtf", + Output = ".html" + }, + new + { + Input = ".rtf", + Output = ".ott" + }, + new + { + Input = ".txt", + Output = ".pdf" + }, + new + { + Input = ".txt", + Output = ".docx" + }, + new + { + Input = ".txt", + Output = ".odt" + }, + new + { + Input = ".txt", + Output = ".rtf" + }, + new + { + Input = ".txt", + Output = ".docm" + }, + new + { + Input = ".txt", + Output = ".dotm" + }, + new + { + Input = ".txt", + Output = ".dotx" + }, + new + { + Input = ".txt", + Output = ".epub" + }, + new + { + Input = ".txt", + Output = ".fb2" + }, + new + { + Input = ".txt", + Output = ".html" + }, + new + { + Input = ".txt", + Output = ".ott" + }, + new + { + Input = ".xls", + Output = ".csv" + }, + new + { + Input = ".xls", + Output = ".ods" + }, + new + { + Input = ".xls", + Output = ".pdf" + }, + new + { + Input = ".xls", + Output = ".xlsx" + }, + new + { + Input = ".xls", + Output = ".ots" + }, + new + { + Input = ".xls", + Output = ".xlsm" + }, + new + { + Input = ".xls", + Output = ".xltm" + }, + new + { + Input = ".xls", + Output = ".xltx" + }, + new + { + Input = ".xlsm", + Output = ".csv" + }, + new + { + Input = ".xlsm", + Output = ".xltm" + }, + new + { + Input = ".xlsm", + Output = ".xltx" + }, + new + { + Input = ".xlsm", + Output = ".ots" + }, + new + { + Input = ".xlsm", + Output = ".pdf" + }, + new + { + Input = ".xlsm", + Output = ".ods" + }, + new + { + Input = ".xlsm", + Output = ".xlsx" + }, + new + { + Input = ".xlsx", + Output = ".csv" + }, + new + { + Input = ".xlsx", + Output = ".ods" + }, + new + { + Input = ".xlsx", + Output = ".ots" + }, + new + { + Input = ".xlsx", + Output = ".pdf" + }, + new + { + Input = ".xlsx", + Output = ".xlsm" + }, + new + { + Input = ".xlsx", + Output = ".xltm" + }, + new + { + Input = ".xlsx", + Output = ".xltx" + }, + new + { + Input = ".xlst", + Output = ".xlsx" + }, + new + { + Input = ".xlt", + Output = ".csv" + }, + new + { + Input = ".xlt", + Output = ".ods" + }, + new + { + Input = ".xlt", + Output = ".pdf" + }, + new + { + Input = ".xlt", + Output = ".xlsx" + }, + new + { + Input = ".xlt", + Output = ".ots" + }, + new + { + Input = ".xlt", + Output = ".xlsm" + }, + new + { + Input = ".xlt", + Output = ".xltm" + }, + new + { + Input = ".xlt", + Output = ".xltx" + }, + new + { + Input = ".xltm", + Output = ".csv" + }, + new + { + Input = ".xltm", + Output = ".ods" + }, + new + { + Input = ".xltm", + Output = ".pdf" + }, + new + { + Input = ".xltm", + Output = ".ots" + }, + new + { + Input = ".xltm", + Output = ".xlsm" + }, + new + { + Input = ".xltm", + Output = ".xltx" + }, + new + { + Input = ".xltm", + Output = ".xlsx" + }, + new + { + Input = ".xltx", + Output = ".pdf" + }, + new + { + Input = ".xltx", + Output = ".csv" + }, + new + { + Input = ".xltx", + Output = ".ods" + }, + new + { + Input = ".xltx", + Output = ".ots" + }, + new + { + Input = ".xltx", + Output = ".xlsm" + }, + new + { + Input = ".xltx", + Output = ".xltm" + }, + new + { + Input = ".xltx", + Output = ".xlsx" + }, + new + { + Input = ".xps", + Output = ".pdf" + }, + new + { + Input = ".xml", + Output = ".docm" + }, + new + { + Input = ".xml", + Output = ".docx" + }, + new + { + Input = ".xml", + Output = ".dotm" + }, + new + { + Input = ".xml", + Output = ".dotx" + }, + new + { + Input = ".xml", + Output = ".epub" + }, + new + { + Input = ".xml", + Output = ".fb2" + }, + new + { + Input = ".xml", + Output = ".html" + }, + new + { + Input = ".xml", + Output = ".odt" + }, + new + { + Input = ".xml", + Output = ".ott" + }, + new + { + Input = ".xml", + Output = ".pdf" + }, + new + { + Input = ".xml", + Output = ".rtf" + }, + new + { + Input = ".xml", + Output = ".txt" + }); + }); + + modelBuilder.Entity("ASC.Files.Core.EF.DbFile", b => + { + b.Property("Id") + .HasColumnType("integer") + .HasColumnName("id"); + + b.Property("TenantId") + .HasColumnType("integer") + .HasColumnName("tenant_id"); + + b.Property("Version") + .HasColumnType("integer") + .HasColumnName("version"); + + b.Property("Category") + .HasColumnType("integer") + .HasColumnName("category"); + + b.Property("Changes") + .HasColumnType("text") + .HasColumnName("changes"); + + b.Property("Comment") + .ValueGeneratedOnAdd() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("comment") + .HasDefaultValueSql("NULL::character varying"); + + b.Property("ContentLength") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("content_length") + .HasDefaultValueSql("'0'::bigint"); + + b.Property("ConvertedType") + .ValueGeneratedOnAdd() + .HasMaxLength(10) + .HasColumnType("character varying(10)") + .HasColumnName("converted_type") + .HasDefaultValueSql("NULL::character varying"); + + b.Property("CreateBy") + .HasMaxLength(38) + .HasColumnType("uuid") + .HasColumnName("create_by") + .IsFixedLength(); + + b.Property("CreateOn") + .HasColumnType("timestamp with time zone") + .HasColumnName("create_on"); + + b.Property("CurrentVersion") + .HasColumnType("boolean") + .HasColumnName("current_version"); + + b.Property("Encrypted") + .HasColumnType("boolean") + .HasColumnName("encrypted"); + + b.Property("FileStatus") + .HasColumnType("integer") + .HasColumnName("file_status"); + + b.Property("Forcesave") + .HasColumnType("integer") + .HasColumnName("forcesave"); + + b.Property("ModifiedBy") + .HasMaxLength(38) + .HasColumnType("uuid") + .HasColumnName("modified_by") + .IsFixedLength(); + + b.Property("ModifiedOn") + .HasColumnType("timestamp with time zone") + .HasColumnName("modified_on"); + + b.Property("ParentId") + .HasColumnType("integer") + .HasColumnName("folder_id"); + + b.Property("ThumbnailStatus") + .HasColumnType("integer") + .HasColumnName("thumb"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(400) + .HasColumnType("character varying(400)") + .HasColumnName("title"); + + b.Property("VersionGroup") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("version_group") + .HasDefaultValueSql("1"); + + b.HasKey("Id", "TenantId", "Version") + .HasName("files_file_pkey"); + + b.HasIndex("Id") + .HasDatabaseName("id"); + + b.HasIndex("ModifiedOn") + .HasDatabaseName("modified_on_files_file"); + + b.HasIndex("ParentId") + .HasDatabaseName("folder_id"); + + b.ToTable("files_file", "onlyoffice"); + }); + + modelBuilder.Entity("ASC.Files.Core.EF.DbFilesBunchObjects", b => + { + b.Property("TenantId") + .HasColumnType("integer") + .HasColumnName("tenant_id"); + + b.Property("RightNode") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("right_node"); + + b.Property("LeftNode") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("left_node"); + + b.HasKey("TenantId", "RightNode") + .HasName("files_bunch_objects_pkey"); + + b.HasIndex("LeftNode") + .HasDatabaseName("left_node"); + + b.ToTable("files_bunch_objects", "onlyoffice"); + }); + + modelBuilder.Entity("ASC.Files.Core.EF.DbFilesLink", b => + { + b.Property("TenantId") + .HasColumnType("integer") + .HasColumnName("tenant_id"); + + b.Property("SourceId") + .HasMaxLength(32) + .HasColumnType("character varying(32)") + .HasColumnName("source_id"); + + b.Property("LinkedId") + .HasMaxLength(32) + .HasColumnType("character varying(32)") + .HasColumnName("linked_id"); + + b.Property("LinkedFor") + .ValueGeneratedOnAdd() + .HasMaxLength(38) + .HasColumnType("uuid") + .HasColumnName("linked_for") + .HasDefaultValueSql("NULL::bpchar") + .IsFixedLength(); + + b.HasKey("TenantId", "SourceId", "LinkedId") + .HasName("files_link_pkey"); + + b.HasIndex("TenantId", "SourceId", "LinkedId", "LinkedFor") + .HasDatabaseName("linked_for_files_link"); + + b.ToTable("files_link", "onlyoffice"); + }); + + modelBuilder.Entity("ASC.Files.Core.EF.DbFilesProperties", b => + { + b.Property("TenantId") + .HasColumnType("integer") + .HasColumnName("tenant_id"); + + b.Property("EntryId") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("entry_id"); + + b.Property("Data") + .IsRequired() + .HasColumnType("text") + .HasColumnName("data"); + + b.HasKey("TenantId", "EntryId") + .HasName("files_properties_pkey"); + + b.ToTable("files_properties", "onlyoffice"); + }); + + modelBuilder.Entity("ASC.Files.Core.EF.DbFilesSecurity", b => + { + b.Property("TenantId") + .HasColumnType("integer") + .HasColumnName("tenant_id"); + + b.Property("EntryId") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("entry_id"); + + b.Property("EntryType") + .HasColumnType("integer") + .HasColumnName("entry_type"); + + b.Property("Subject") + .HasMaxLength(38) + .HasColumnType("uuid") + .HasColumnName("subject") + .IsFixedLength(); + + b.Property("FileShareOptions") + .HasColumnType("text") + .HasColumnName("options"); + + b.Property("Owner") + .HasMaxLength(38) + .HasColumnType("uuid") + .HasColumnName("owner") + .IsFixedLength(); + + b.Property("Share") + .HasColumnType("integer") + .HasColumnName("security"); + + b.Property("SubjectType") + .HasColumnType("integer") + .HasColumnName("subject_type"); + + b.Property("TimeStamp") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("timestamp") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.HasKey("TenantId", "EntryId", "EntryType", "Subject") + .HasName("files_security_pkey"); + + b.HasIndex("Owner") + .HasDatabaseName("owner"); + + b.HasIndex("EntryId", "TenantId", "EntryType", "Owner") + .HasDatabaseName("tenant_id_files_security"); + + b.ToTable("files_security", "onlyoffice"); + }); + + modelBuilder.Entity("ASC.Files.Core.EF.DbFilesTag", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("name"); + + b.Property("Owner") + .HasMaxLength(38) + .HasColumnType("uuid") + .HasColumnName("owner"); + + b.Property("TenantId") + .HasColumnType("integer") + .HasColumnName("tenant_id"); + + b.Property("Type") + .HasColumnType("integer") + .HasColumnName("flag"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Owner", "Name", "Type") + .HasDatabaseName("name_files_tag"); + + b.ToTable("files_tag", "onlyoffice"); + }); + + modelBuilder.Entity("ASC.Files.Core.EF.DbFilesTagLink", b => + { + b.Property("TenantId") + .HasColumnType("integer") + .HasColumnName("tenant_id"); + + b.Property("TagId") + .HasColumnType("integer") + .HasColumnName("tag_id"); + + b.Property("EntryType") + .HasColumnType("integer") + .HasColumnName("entry_type"); + + b.Property("EntryId") + .HasMaxLength(32) + .HasColumnType("character varying(32)") + .HasColumnName("entry_id"); + + b.Property("Count") + .HasColumnType("integer") + .HasColumnName("tag_count"); + + b.Property("CreateBy") + .ValueGeneratedOnAdd() + .HasMaxLength(38) + .HasColumnType("uuid") + .HasColumnName("create_by") + .HasDefaultValueSql("NULL::bpchar") + .IsFixedLength(); + + b.Property("CreateOn") + .HasColumnType("timestamp with time zone") + .HasColumnName("create_on"); + + b.HasKey("TenantId", "TagId", "EntryType", "EntryId") + .HasName("files_tag_link_pkey"); + + b.HasIndex("CreateOn") + .HasDatabaseName("create_on_files_tag_link"); + + b.HasIndex("TenantId", "EntryType", "EntryId") + .HasDatabaseName("entry_id"); + + b.ToTable("files_tag_link", "onlyoffice"); + }); + + modelBuilder.Entity("ASC.Files.Core.EF.DbFilesThirdpartyAccount", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("CreateOn") + .HasColumnType("timestamp with time zone") + .HasColumnName("create_on"); + + b.Property("FolderId") + .HasColumnType("text") + .HasColumnName("folder_id"); + + b.Property("FolderType") + .HasColumnType("integer") + .HasColumnName("folder_type"); + + b.Property("HasLogo") + .HasColumnType("boolean") + .HasColumnName("has_logo"); + + b.Property("Password") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("password"); + + b.Property("Private") + .HasColumnType("boolean") + .HasColumnName("private"); + + b.Property("Provider") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("provider") + .HasDefaultValueSql("'0'::character varying"); + + b.Property("RoomType") + .HasColumnType("integer") + .HasColumnName("room_type"); + + b.Property("TenantId") + .HasColumnType("integer") + .HasColumnName("tenant_id"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(400) + .HasColumnType("character varying(400)") + .HasColumnName("customer_title"); + + b.Property("Token") + .HasColumnType("text") + .HasColumnName("token"); + + b.Property("Url") + .HasColumnType("text") + .HasColumnName("url"); + + b.Property("UserId") + .HasMaxLength(38) + .HasColumnType("uuid") + .HasColumnName("user_id"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("user_name"); + + b.HasKey("Id"); + + b.HasIndex("TenantId") + .HasDatabaseName("tenant_id"); + + b.ToTable("files_thirdparty_account", "onlyoffice"); + }); + + modelBuilder.Entity("ASC.Files.Core.EF.DbFilesThirdpartyApp", b => + { + b.Property("UserId") + .HasMaxLength(38) + .HasColumnType("uuid") + .HasColumnName("user_id"); + + b.Property("App") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("app"); + + b.Property("ModifiedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("modified_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("TenantId") + .HasColumnType("integer") + .HasColumnName("tenant_id"); + + b.Property("Token") + .HasColumnType("text") + .HasColumnName("token"); + + b.HasKey("UserId", "App") + .HasName("files_thirdparty_app_pkey"); + + b.ToTable("files_thirdparty_app", "onlyoffice"); + }); + + modelBuilder.Entity("ASC.Files.Core.EF.DbFilesThirdpartyIdMapping", b => + { + b.Property("HashId") + .HasMaxLength(32) + .HasColumnType("character(32)") + .HasColumnName("hash_id") + .IsFixedLength(); + + b.Property("Id") + .IsRequired() + .HasColumnType("text") + .HasColumnName("id"); + + b.Property("TenantId") + .HasColumnType("integer") + .HasColumnName("tenant_id"); + + b.HasKey("HashId") + .HasName("files_thirdparty_id_mapping_pkey"); + + b.HasIndex("TenantId", "HashId") + .HasDatabaseName("index_1"); + + b.ToTable("files_thirdparty_id_mapping", "onlyoffice"); + }); + + modelBuilder.Entity("ASC.Files.Core.EF.DbFolder", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("CreateBy") + .HasMaxLength(38) + .HasColumnType("uuid") + .HasColumnName("create_by") + .IsFixedLength(); + + b.Property("CreateOn") + .HasColumnType("timestamp with time zone") + .HasColumnName("create_on"); + + b.Property("FilesCount") + .HasColumnType("integer") + .HasColumnName("filesCount"); + + b.Property("FolderType") + .HasColumnType("integer") + .HasColumnName("folder_type"); + + b.Property("FoldersCount") + .HasColumnType("integer") + .HasColumnName("foldersCount"); + + b.Property("HasLogo") + .HasColumnType("boolean") + .HasColumnName("has_logo"); + + b.Property("ModifiedBy") + .HasMaxLength(38) + .HasColumnType("uuid") + .HasColumnName("modified_by") + .IsFixedLength(); + + b.Property("ModifiedOn") + .HasColumnType("timestamp with time zone") + .HasColumnName("modified_on"); + + b.Property("ParentId") + .HasColumnType("integer") + .HasColumnName("parent_id"); + + b.Property("Private") + .HasColumnType("boolean") + .HasColumnName("private"); + + b.Property("TenantId") + .HasColumnType("integer") + .HasColumnName("tenant_id"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(400) + .HasColumnType("character varying(400)") + .HasColumnName("title"); + + b.HasKey("Id"); + + b.HasIndex("ModifiedOn") + .HasDatabaseName("modified_on_files_folder"); + + b.HasIndex("TenantId", "ParentId") + .HasDatabaseName("parent_id"); + + b.ToTable("files_folder", "onlyoffice"); + }); + + modelBuilder.Entity("ASC.Files.Core.EF.DbFolderTree", b => + { + b.Property("ParentId") + .HasColumnType("integer") + .HasColumnName("parent_id"); + + b.Property("FolderId") + .HasColumnType("integer") + .HasColumnName("folder_id"); + + b.Property("Level") + .HasColumnType("integer") + .HasColumnName("level"); + + b.HasKey("ParentId", "FolderId") + .HasName("files_folder_tree_pkey"); + + b.HasIndex("FolderId") + .HasDatabaseName("folder_id_files_folder_tree"); + + b.ToTable("files_folder_tree", "onlyoffice"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/migrations/postgre/FilesDbContext/20221215125741_FilesDbContext_Upgrade1.cs b/migrations/postgre/FilesDbContext/20221215125741_FilesDbContext_Upgrade1.cs new file mode 100644 index 0000000000..53dc2a2652 --- /dev/null +++ b/migrations/postgre/FilesDbContext/20221215125741_FilesDbContext_Upgrade1.cs @@ -0,0 +1,41 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace ASC.Migrations.PostgreSql.Migrations.FilesDb +{ + public partial class FilesDbContext_Upgrade1 : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "has_logo", + schema: "onlyoffice", + table: "files_thirdparty_account", + type: "boolean", + nullable: false, + defaultValue: false); + + migrationBuilder.AddColumn( + name: "has_logo", + schema: "onlyoffice", + table: "files_folder", + type: "boolean", + nullable: false, + defaultValue: false); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "has_logo", + schema: "onlyoffice", + table: "files_thirdparty_account"); + + migrationBuilder.DropColumn( + name: "has_logo", + schema: "onlyoffice", + table: "files_folder"); + } + } +} diff --git a/migrations/postgre/FilesDbContext/FilesDbContextModelSnapshot.cs b/migrations/postgre/FilesDbContext/FilesDbContextModelSnapshot.cs index 7faa25dece..310d64372a 100644 --- a/migrations/postgre/FilesDbContext/FilesDbContextModelSnapshot.cs +++ b/migrations/postgre/FilesDbContext/FilesDbContextModelSnapshot.cs @@ -2283,6 +2283,10 @@ namespace ASC.Migrations.PostgreSql.Migrations .HasColumnType("integer") .HasColumnName("folder_type"); + b.Property("HasLogo") + .HasColumnType("boolean") + .HasColumnName("has_logo"); + b.Property("Password") .IsRequired() .HasMaxLength(100) @@ -2430,6 +2434,10 @@ namespace ASC.Migrations.PostgreSql.Migrations .HasColumnType("integer") .HasColumnName("foldersCount"); + b.Property("HasLogo") + .HasColumnType("boolean") + .HasColumnName("has_logo"); + b.Property("ModifiedBy") .HasMaxLength(38) .HasColumnType("uuid") diff --git a/packages/client/src/components/GlobalEvents/EditRoomEvent.js b/packages/client/src/components/GlobalEvents/EditRoomEvent.js index eb9a7831da..84eaf33153 100644 --- a/packages/client/src/components/GlobalEvents/EditRoomEvent.js +++ b/packages/client/src/components/GlobalEvents/EditRoomEvent.js @@ -32,7 +32,6 @@ const EditRoomEvent = ({ withPaging, reloadSelection, - getRoomLogo, }) => { const { t } = useTranslation(["CreateEditRoomDialog", "Common", "Files"]); @@ -107,12 +106,6 @@ const EditRoomEvent = ({ }); if (!withPaging) { - const newLogo = await getRoomLogo(room.logo); - - room.logoHandlers = room.logo; - room.logo = newLogo; - room.isLogoLoading = false; - setFolder(room); } @@ -125,12 +118,6 @@ const EditRoomEvent = ({ }); } else { if (!withPaging) { - const newLogo = await getRoomLogo(room.logo); - - room.logoHandlers = room.logo; - room.logo = newLogo; - room.isLogoLoading = false; - setFolder(room); } // to update state info panel @@ -149,9 +136,7 @@ const EditRoomEvent = ({ }; useEffect(async () => { - const logo = item?.logo?.original - ? item.logo.original - : await api.rooms.getLogoIcon(item?.logoHandlers?.original); + const logo = item?.logo?.original ? item.logo.original : ""; if (logo) { const imgExst = logo.slice(".")[1]; @@ -212,7 +197,6 @@ export default inject( setFolder, addLogoToRoom, removeLogoFromRoom, - getRoomLogo, } = filesStore; const { createTag, fetchTags } = tagsStore; @@ -226,7 +210,6 @@ export default inject( editRoom, addTagsToRoom, removeTagsFromRoom, - getRoomLogo, createTag, fetchTags, diff --git a/packages/client/src/pages/Home/InfoPanel/Body/sub-components/ItemTitle/FilesItemTitle.js b/packages/client/src/pages/Home/InfoPanel/Body/sub-components/ItemTitle/FilesItemTitle.js index cbbc66fecd..754850e703 100644 --- a/packages/client/src/pages/Home/InfoPanel/Body/sub-components/ItemTitle/FilesItemTitle.js +++ b/packages/client/src/pages/Home/InfoPanel/Body/sub-components/ItemTitle/FilesItemTitle.js @@ -30,10 +30,7 @@ const FilesItemTitle = ({ ); - const icon = - selection?.isRoom && selection?.logo?.medium - ? selection.logo.medium - : selection.icon; + const icon = selection.icon; return ( diff --git a/packages/client/src/pages/Home/InfoPanel/Body/views/Details/index.js b/packages/client/src/pages/Home/InfoPanel/Body/views/Details/index.js index 370e44218a..87044cda41 100644 --- a/packages/client/src/pages/Home/InfoPanel/Body/views/Details/index.js +++ b/packages/client/src/pages/Home/InfoPanel/Body/views/Details/index.js @@ -22,7 +22,6 @@ const Details = ({ isVisitor, }) => { const [itemProperties, setItemProperties] = useState([]); - const [largeLogoIcon, setLargeLogoIcon] = useState(""); const [isThumbnailError, setIsThumbmailError] = useState(false); const onThumbnailError = () => setIsThumbmailError(true); @@ -39,24 +38,9 @@ const Details = ({ culture, }); - const getLargeRoomLogo = React.useCallback( - async (url) => { - if (selection?.logo?.large) return setLargeLogoIcon(selection.logo.large); - - const icon = await api.rooms.getLogoIcon(url); - - setLargeLogoIcon(icon); - }, - [selection?.logo?.large] - ); - useEffect(async () => { setItemProperties(detailsHelper.getPropertyList()); - if ((selection?.isRoom || selection?.roomType) && !selection.isArchive) { - getLargeRoomLogo(selection?.logoHandlers?.large); - } - if ( !selection.isFolder && selection.thumbnailStatus === 0 && @@ -67,11 +51,13 @@ const Details = ({ ) { await createThumbnail(selection.id); } - }, [selection, getLargeRoomLogo]); + }, [selection]); - const currentIcon = largeLogoIcon - ? largeLogoIcon - : getInfoPanelItemIcon(selection, 96); + console.log(selection); + const currentIcon = + !selection.isArchive && selection?.logo?.large + ? selection?.logo?.large + : getInfoPanelItemIcon(selection, 96); return ( <> @@ -89,7 +75,10 @@ const Details = ({ thumbnail-icon-big { const element = ( diff --git a/packages/client/src/pages/Home/Section/Body/TableView/TableRow.js b/packages/client/src/pages/Home/Section/Body/TableView/TableRow.js index 5953c8b0e9..f1ebeb82a2 100644 --- a/packages/client/src/pages/Home/Section/Body/TableView/TableRow.js +++ b/packages/client/src/pages/Home/Section/Body/TableView/TableRow.js @@ -324,7 +324,7 @@ const FilesTableRow = (props) => { const element = ( diff --git a/packages/client/src/pages/Home/Section/Body/TilesView/FileTile.js b/packages/client/src/pages/Home/Section/Body/TilesView/FileTile.js index cc6473e3e3..0cf2148b11 100644 --- a/packages/client/src/pages/Home/Section/Body/TilesView/FileTile.js +++ b/packages/client/src/pages/Home/Section/Body/TilesView/FileTile.js @@ -68,7 +68,7 @@ const FileTile = (props) => { const element = ( diff --git a/packages/client/src/store/FilesStore.js b/packages/client/src/store/FilesStore.js index 512a2f5f41..7f1e3040d7 100644 --- a/packages/client/src/store/FilesStore.js +++ b/packages/client/src/store/FilesStore.js @@ -1067,8 +1067,6 @@ class FilesStore { this.setCreatedItem(null); } - this.updateRoomLoadingLogo(); - return Promise.resolve(selectedFolder); }) .catch((err) => { @@ -2047,48 +2045,6 @@ class FilesStore { return folderUrl; }; - getRoomLogo = async (logoHandlers) => { - const newLogos = {}; - - for (let key in logoHandlers) { - let icon = ""; - - if (key === "medium") { - icon = await api.rooms.getLogoIcon(logoHandlers[key]); - - // check for null - icon = icon ? icon : ""; - } - - newLogos[key] = icon; - } - - return newLogos; - }; - - updateRoomLoadingLogo = async () => { - const newRooms = await Promise.all( - this.folders.map(async (f) => { - const newRoom = JSON.parse(JSON.stringify(f)); - - if (!newRoom.isLogoLoading) return newRoom; - - newRoom.isLogoLoading = false; - newRoom.logo = await this.getRoomLogo(newRoom.logoHandlers); - - return newRoom; - }) - ); - - if ( - (this.treeFoldersStore.isRoomsFolder || - this.treeFoldersStore.isArchiveFolder) && - this.selectedFolderStore.navigationPath.length === 0 - ) { - this.setFolders(newRooms); - } - }; - get filesList() { const { getIcon } = this.filesSettingsStore; //return [...this.folders, ...this.files]; @@ -2119,8 +2075,6 @@ class FilesStore { foldersCount, id, logo, - logoHandlers, - isLogoLoading, locked, parentId, pureContentLength, @@ -2170,14 +2124,6 @@ class FilesStore { const isThirdPartyFolder = providerKey && id === rootFolderId; const iconSize = this.viewAs === "table" ? 24 : 32; - const icon = getIcon( - iconSize, - fileExst, - providerKey, - contentLength, - roomType, - isArchive - ); let isFolder = false; this.folders.map((x) => { @@ -2208,6 +2154,18 @@ class FilesStore { const isRoom = !!roomType; + const icon = + isRoom && !isArchive && logo?.medium + ? logo?.medium + : getIcon( + iconSize, + fileExst, + providerKey, + contentLength, + roomType, + isArchive + ); + return { access, //checked, @@ -2226,9 +2184,8 @@ class FilesStore { icon, id, isFolder, - isLogoLoading, logo, - logoHandlers, + locked, new: item.new, parentId, @@ -2866,8 +2823,6 @@ class FilesStore { this.setFolders([...this.folders, ...newFiles.folders]); this.setFilesIsLoading(false); }); - - if (isRooms) this.updateRoomLoadingLogo(); }; //Duplicate of countTilesInRow, used to update the number of tiles in a row after the window is resized. diff --git a/packages/client/src/store/SelectedFolderStore.js b/packages/client/src/store/SelectedFolderStore.js index 3c2c815f49..c99e1db7fd 100644 --- a/packages/client/src/store/SelectedFolderStore.js +++ b/packages/client/src/store/SelectedFolderStore.js @@ -24,8 +24,8 @@ class SelectedFolderStore { roomType = null; pinned = null; isRoom = null; + isArchive = null; logo = null; - logoHandlers = null; tags = null; rootFolderId = null; settingsStore = null; diff --git a/packages/common/api/files/index.js b/packages/common/api/files/index.js index 7967fdb3d9..8a2921034a 100644 --- a/packages/common/api/files/index.js +++ b/packages/common/api/files/index.js @@ -5,7 +5,7 @@ import { FolderType, RoomSearchArea } from "../../constants"; import find from "lodash/find"; import { getFolderOptions, decodeDisplayName } from "../../utils"; import { Encoder } from "../../utils/encoder"; -import { getLogoIcon, getRooms } from "../rooms"; +import { getRooms } from "../rooms"; import RoomsFilter from "../rooms/filter"; export function openEdit(fileId, version, doc, view) { @@ -39,45 +39,7 @@ export function getFolderInfo(folderId) { url: `/files/folder/${folderId}`, }; - return request(options).then((res) => { - if (res.roomType) { - return new Promise((resolve, reject) => { - if (res.rootFolderType === FolderType.Archive) { - res.isLogoLoading = false; - for (let key in room.logo) { - room.logo[key] = ""; - } - - return resolve(res); - } - - res.isLogoLoading = false; - res.logoHandlers = res.logo; - - const newLogos = {}; - - const actions = []; - - const getLogo = async (key) => { - const logo = await getLogoIcon(res.logo[key]); - - newLogos[key] = logo; - }; - - for (let key in res.logo) { - actions.push(getLogo(key)); - } - - return Promise.all(actions).then(() => { - res.logo = newLogos; - - resolve(res); - }); - }); - } - - return res; - }); + return request(options); } export function getFolderPath(folderId) { @@ -95,40 +57,9 @@ export function getFolder(folderId, filter) { res.files = decodeDisplayName(res.files); res.folders = decodeDisplayName(res.folders); - const { current } = res; - - if (current.roomType) { - res.current.isLogoLoading = false; - res.current.logoHandlers = current.logo; - - if (current.rootFolderType === FolderType.Rooms) { - return new Promise((resolve, reject) => { - const actions = []; - - const newLogos = {}; - - const getLogo = async (key) => { - const logo = await getLogoIcon(current.logo[key]); - - newLogos[key] = logo; - }; - - for (let key in current.logo) { - actions.push(getLogo(key)); - } - - return Promise.all(actions).then(() => { - res.current.logo = newLogos; - - resolve(res); - }); - }); - } else { - for (let key in res.current.logo) { - res.current.logo[key] = ""; - } - } - } + res.current.isArchive = + !!res.current.roomType && + res.current.rootFolderType === FolderType.Archive; return res; }); diff --git a/packages/common/api/rooms/index.js b/packages/common/api/rooms/index.js index d52af12832..9ae6b7674d 100644 --- a/packages/common/api/rooms/index.js +++ b/packages/common/api/rooms/index.js @@ -15,23 +15,6 @@ export function getRooms(filter) { if (res.current.rootFolderType === FolderType.Archive) { res.folders.forEach((room) => { room.isArchive = true; - room.isLogoLoading = false; - for (let key in room.logo) { - room.logo[key] = ""; - } - }); - } else { - res.folders.forEach((f, index) => { - res.folders[index].isLogoLoading = true; - res.folders[index].logoHandlers = f.logo; - - const newLogos = {}; - - for (let key in f.logo) { - newLogos[key] = ""; - } - - res.folders[index].logo = newLogos; }); } @@ -39,60 +22,16 @@ export function getRooms(filter) { }); } -export function getLogoIcon(url) { - if (!url) return ""; - - const options = { - // baseURL: combineUrl(AppServerConfig.proxyURL, config.homepage), - method: "get", - url: `/products/files/httphandlers${url}`, - responseType: "text", - }; - - return request(options); -} - export function getRoomInfo(id) { const options = { method: "get", url: `/files/rooms/${id}`, }; - return request(options).then(async (res) => { - return new Promise((resolve, reject) => { - if (res.rootFolderType === FolderType.Archive) { - res.isLogoLoading = false; - res.isArchive = true; - for (let key in res.logo) { - res.logo[key] = ""; - } + return request(options).then((res) => { + if (res.rootFolderType === FolderType.Archive) res.isArchive = true; - return resolve(res); - } - - res.isLogoLoading = false; - res.logoHandlers = res.logo; - - const newLogos = {}; - - const actions = []; - - const getLogo = async (key) => { - const logo = await getLogoIcon(res.logo[key]); - - newLogos[key] = logo; - }; - - for (let key in res.logo) { - actions.push(getLogo(key)); - } - - return Promise.all(actions).then(() => { - res.logo = newLogos; - - resolve(res); - }); - }); + return res; }); } diff --git a/products/ASC.Files/Core/ApiModels/ResponseDto/FolderDto.cs b/products/ASC.Files/Core/ApiModels/ResponseDto/FolderDto.cs index d760014748..2412b72180 100644 --- a/products/ASC.Files/Core/ApiModels/ResponseDto/FolderDto.cs +++ b/products/ASC.Files/Core/ApiModels/ResponseDto/FolderDto.cs @@ -110,7 +110,7 @@ public class FolderDtoHelper : FileEntryDtoHelper result.Tags = folder.Tags.Select(t => t.Name); } - result.Logo = _roomLogoManager.GetLogo(folder); + result.Logo = await _roomLogoManager.GetLogoAsync(folder); result.RoomType = folder.FolderType switch { FolderType.FillingFormsRoom => RoomType.FillingFormsRoom, diff --git a/products/ASC.Files/Core/Core/Dao/Interfaces/IProviderDao.cs b/products/ASC.Files/Core/Core/Dao/Interfaces/IProviderDao.cs index 0e955b2083..57ca6a72fd 100644 --- a/products/ASC.Files/Core/Core/Dao/Interfaces/IProviderDao.cs +++ b/products/ASC.Files/Core/Core/Dao/Interfaces/IProviderDao.cs @@ -35,6 +35,7 @@ public interface IProviderDao IAsyncEnumerable GetProvidersInfoAsync(Guid userId); Task SaveProviderInfoAsync(string providerKey, string customerTitle, AuthData authData, FolderType folderType); Task UpdateProviderInfoAsync(int linkId, FolderType rootFolderType); + Task UpdateProviderInfoAsync(int linkId, bool hasLogo); Task UpdateProviderInfoAsync(int linkId, string folderId, FolderType folderType, bool @private); Task UpdateProviderInfoAsync(int linkId, string customerTitle, AuthData authData, FolderType folderType, Guid? userId = null); Task UpdateBackupProviderInfoAsync(string providerKey, string customerTitle, AuthData authData); diff --git a/products/ASC.Files/Core/Core/Dao/TeamlabDao/FolderDao.cs b/products/ASC.Files/Core/Core/Dao/TeamlabDao/FolderDao.cs index faed44c7cc..cc3175aee4 100644 --- a/products/ASC.Files/Core/Core/Dao/TeamlabDao/FolderDao.cs +++ b/products/ASC.Files/Core/Core/Dao/TeamlabDao/FolderDao.cs @@ -446,6 +446,7 @@ internal class FolderDao : AbstractDao, IFolderDao toUpdate.CreateBy = folder.CreateBy; toUpdate.ModifiedOn = _tenantUtil.DateTimeToUtc(folder.ModifiedOn); toUpdate.ModifiedBy = folder.ModifiedBy; + toUpdate.HasLogo = folder.HasLogo; await filesDbContext.SaveChangesAsync(); diff --git a/products/ASC.Files/Core/Core/EF/DbFilesThirdpartyAccount.cs b/products/ASC.Files/Core/Core/EF/DbFilesThirdpartyAccount.cs index 5bd0c05df6..95cb49d49e 100644 --- a/products/ASC.Files/Core/Core/EF/DbFilesThirdpartyAccount.cs +++ b/products/ASC.Files/Core/Core/EF/DbFilesThirdpartyAccount.cs @@ -42,6 +42,7 @@ public class DbFilesThirdpartyAccount : BaseEntity, IDbFile, IDbSearch public int TenantId { get; set; } public string FolderId { get; set; } public bool Private { get; set; } + public bool HasLogo { get; set; } public override object[] GetKeys() { @@ -137,6 +138,8 @@ public static class DbFilesThirdpartyAccountExtension .UseCollation("utf8_general_ci"); entity.Property(e => e.Private).HasColumnName("private"); + + entity.Property(e => e.HasLogo).HasColumnName("has_logo"); }); } public static void PgSqlAddDbFilesThirdpartyAccount(this ModelBuilder modelBuilder) @@ -188,7 +191,9 @@ public static class DbFilesThirdpartyAccountExtension entity.Property(e => e.FolderId).HasColumnName("folder_id"); - entity.Property(e => e.Private).HasColumnName("private"); + entity.Property(e => e.Private).HasColumnName("private"); + + entity.Property(e => e.HasLogo).HasColumnName("has_logo"); }); } } diff --git a/products/ASC.Files/Core/Core/EF/DbFolder.cs b/products/ASC.Files/Core/Core/EF/DbFolder.cs index 3f80416765..6f39b908a4 100644 --- a/products/ASC.Files/Core/Core/EF/DbFolder.cs +++ b/products/ASC.Files/Core/Core/EF/DbFolder.cs @@ -44,6 +44,7 @@ public class DbFolder : IDbFile, IDbSearch, ISearchItem public int FoldersCount { get; set; } public int FilesCount { get; set; } public bool Private { get; set; } + public bool HasLogo { get; set; } [Ignore] public string IndexName => Tables.Folder; @@ -130,6 +131,8 @@ public static class DbFolderExtension .UseCollation("utf8_general_ci"); entity.Property(e => e.Private).HasColumnName("private"); + + entity.Property(e => e.HasLogo).HasColumnName("has_logo"); }); } public static void PgSqlAddDbFolder(this ModelBuilder modelBuilder) @@ -178,6 +181,8 @@ public static class DbFolderExtension .HasMaxLength(400); entity.Property(e => e.Private).HasColumnName("private"); + + entity.Property(e => e.HasLogo).HasColumnName("has_logo"); }); } } diff --git a/products/ASC.Files/Core/Core/Entries/Folder.cs b/products/ASC.Files/Core/Core/Entries/Folder.cs index 942f8ee7a4..0709cd7106 100644 --- a/products/ASC.Files/Core/Core/Entries/Folder.cs +++ b/products/ASC.Files/Core/Core/Entries/Folder.cs @@ -73,6 +73,7 @@ public class Folder : FileEntry, IFolder public string FolderUrl { get; set; } public bool Pinned { get; set; } public bool Private { get; set; } + public bool HasLogo { get; set; } public override bool IsNew { get => Convert.ToBoolean(NewForMe); diff --git a/products/ASC.Files/Core/Core/Thirdparty/Box/BoxDaoBase.cs b/products/ASC.Files/Core/Core/Thirdparty/Box/BoxDaoBase.cs index e78cb96e50..797b739128 100644 --- a/products/ASC.Files/Core/Core/Thirdparty/Box/BoxDaoBase.cs +++ b/products/ASC.Files/Core/Core/Thirdparty/Box/BoxDaoBase.cs @@ -124,6 +124,7 @@ internal abstract class BoxDaoBase : ThirdPartyProviderDao folder.FilesCount = boxFolder.ItemCollection != null ? boxFolder.ItemCollection.Entries.Count(item => item is BoxFile) : 0; folder.FoldersCount = boxFolder.ItemCollection != null ? boxFolder.ItemCollection.Entries.Count(item => item is BoxFolder) : 0; folder.Private = ProviderInfo.Private; + folder.HasLogo = ProviderInfo.HasLogo; SetFolderType(folder, isRoot); if (folder.CreateOn != DateTime.MinValue && folder.CreateOn.Kind == DateTimeKind.Utc) diff --git a/products/ASC.Files/Core/Core/Thirdparty/Box/BoxProviderInfo.cs b/products/ASC.Files/Core/Core/Thirdparty/Box/BoxProviderInfo.cs index 341db88f9b..8550b94092 100644 --- a/products/ASC.Files/Core/Core/Thirdparty/Box/BoxProviderInfo.cs +++ b/products/ASC.Files/Core/Core/Thirdparty/Box/BoxProviderInfo.cs @@ -57,6 +57,7 @@ internal class BoxProviderInfo : IProviderInfo public FolderType FolderType { get; set; } public string FolderId { get; set; } public bool Private { get; set; } + public bool HasLogo { get; set; } public string BoxRootId { diff --git a/products/ASC.Files/Core/Core/Thirdparty/Dropbox/DropboxDaoBase.cs b/products/ASC.Files/Core/Core/Thirdparty/Dropbox/DropboxDaoBase.cs index ed16855ba5..0fd8d34ceb 100644 --- a/products/ASC.Files/Core/Core/Thirdparty/Dropbox/DropboxDaoBase.cs +++ b/products/ASC.Files/Core/Core/Thirdparty/Dropbox/DropboxDaoBase.cs @@ -128,6 +128,7 @@ internal abstract class DropboxDaoBase : ThirdPartyProviderDao UpdateProviderInfoAsync(int linkId, bool hasLogo) + { + using var filesDbContext = _dbContextFactory.CreateDbContext(); + var forUpdate = await filesDbContext.ThirdpartyAccount + .Where(r => r.Id == linkId) + .Where(r => r.TenantId == TenantID) + .FirstOrDefaultAsync(); + + if (forUpdate == null) + { + return false; + } + + forUpdate.HasLogo = hasLogo; + + await filesDbContext.SaveChangesAsync(); + + return true; + } + public async Task UpdateProviderInfoAsync(int linkId, string folderId, FolderType roomType, bool @private) { using var filesDbContext = _dbContextFactory.CreateDbContext(); @@ -496,6 +516,7 @@ internal class ProviderAccountDao : IProviderDao var folderId = input.FolderId; var createOn = _tenantUtil.DateTimeFromUtc(input.CreateOn); var authData = new AuthData(input.Url, input.UserName, DecryptPassword(input.Password, id), token); + var hasLogo = input.HasLogo; if (key == ProviderTypes.Box) { @@ -515,6 +536,7 @@ internal class ProviderAccountDao : IProviderDao box.FolderType = folderType; box.FolderId = folderId; box.Private = privateRoom; + box.HasLogo = hasLogo; return box; } @@ -537,6 +559,7 @@ internal class ProviderAccountDao : IProviderDao drop.FolderType = folderType; drop.FolderId = folderId; drop.Private = privateRoom; + drop.HasLogo = hasLogo; return drop; } @@ -559,6 +582,7 @@ internal class ProviderAccountDao : IProviderDao sh.FolderType = folderType; sh.FolderId = folderId; sh.Private = privateRoom; + sh.HasLogo = hasLogo; return sh; } @@ -581,6 +605,7 @@ internal class ProviderAccountDao : IProviderDao gd.FolderType = folderType; gd.FolderId = folderId; gd.Private = privateRoom; + gd.HasLogo = hasLogo; return gd; } @@ -603,6 +628,7 @@ internal class ProviderAccountDao : IProviderDao od.FolderType = folderType; od.FolderId = folderId; od.Private = privateRoom; + od.HasLogo = hasLogo; return od; } @@ -633,6 +659,7 @@ internal class ProviderAccountDao : IProviderDao sharpBoxProviderInfo.FolderType = folderType; sharpBoxProviderInfo.FolderId = folderId; sharpBoxProviderInfo.Private = privateRoom; + sharpBoxProviderInfo.HasLogo = hasLogo; return sharpBoxProviderInfo; } diff --git a/products/ASC.Files/Core/Core/Thirdparty/SharePoint/SharePointProviderInfo.cs b/products/ASC.Files/Core/Core/Thirdparty/SharePoint/SharePointProviderInfo.cs index 0669ab60ca..1c8cd27b3c 100644 --- a/products/ASC.Files/Core/Core/Thirdparty/SharePoint/SharePointProviderInfo.cs +++ b/products/ASC.Files/Core/Core/Thirdparty/SharePoint/SharePointProviderInfo.cs @@ -45,6 +45,7 @@ public class SharePointProviderInfo : IProviderInfo public string SpRootFolderId { get; set; } = "/Shared Documents"; public string FolderId { get; set; } public bool Private { get; set; } + public bool HasLogo { get; set; } public SharePointProviderInfo( ILogger logger, @@ -576,6 +577,7 @@ public class SharePointProviderInfo : IProviderInfo result.FoldersCount = 0; result.Error = errorFolder.Error; result.Private = Private; + result.HasLogo = HasLogo; return result; } @@ -599,6 +601,7 @@ public class SharePointProviderInfo : IProviderInfo result.FilesCount = 0; result.FoldersCount = 0; result.Private = Private; + result.HasLogo = HasLogo; SetFolderType(result, isRoot); diff --git a/products/ASC.Files/Core/Core/Thirdparty/Sharpbox/SharpBoxDaoBase.cs b/products/ASC.Files/Core/Core/Thirdparty/Sharpbox/SharpBoxDaoBase.cs index d407a35410..e162634924 100644 --- a/products/ASC.Files/Core/Core/Thirdparty/Sharpbox/SharpBoxDaoBase.cs +++ b/products/ASC.Files/Core/Core/Thirdparty/Sharpbox/SharpBoxDaoBase.cs @@ -310,6 +310,7 @@ internal abstract class SharpBoxDaoBase : ThirdPartyProviderDao logger, - AscCache cache, FilesMessageService filesMessageService, - IHttpContextAccessor httpContextAccessor, - FilesLinkUtility filesLinkUtility) + IHttpContextAccessor httpContextAccessor) { _storageFactory = storageFactory; _tenantManager = tenantManager; _daoFactory = daoFactory; _fileSecurity = fileSecurity; _logger = logger; - _cache = cache; _filesMessageService = filesMessageService; _httpContextAccessor = httpContextAccessor; - _filesLinkUtility = filesLinkUtility; } public bool EnableAudit { get; set; } = true; @@ -108,8 +97,19 @@ public class RoomLogoManager id = GetId(room); - await DeleteLogo(id); await SaveWithProcessAsync(id, data, -1, new Point(x, y), new Size(width, height)); + await RemoveTempAsync(fileName); + + room.HasLogo = true; + + if (room.ProviderEntry) + { + await _daoFactory.ProviderDao.UpdateProviderInfoAsync(room.ProviderId, true); + } + else + { + await folderDao.SaveFolderAsync(room); + } if (EnableAudit) { @@ -133,14 +133,24 @@ public class RoomLogoManager try { - await DeleteLogo(id); + await DataStore.DeleteFilesAsync(string.Empty, $"{ProcessFolderId(id)}*.*", false); + room.HasLogo = false; + + if (room.ProviderEntry) + { + await _daoFactory.ProviderDao.UpdateProviderInfoAsync(room.ProviderId, false); + } + else + { + await folderDao.SaveFolderAsync(room); + } if (EnableAudit) { _filesMessageService.Send(room, Headers, MessageAction.RoomLogoDeleted); } } - catch (DirectoryNotFoundException e) + catch (Exception e) { _logger.ErrorRemoveRoomLogo(e); } @@ -148,24 +158,35 @@ public class RoomLogoManager return room; } - public Logo GetLogo(Folder room) + public async ValueTask GetLogoAsync(Folder room) { - var id = room.Id; - - return new Logo + if (!room.HasLogo) { - Original = GetOriginalLogoUrl(id), - Large = GetLargeLogoUrl(id), - Medium = GetMediumLogoUrl(id), - Small = GetSmallLogoUrl(id) + return new Logo + { + Original = string.Empty, + Large = string.Empty, + Medium = string.Empty, + Small = string.Empty, + }; + } + + var id = GetId(room); + + return new Logo() + { + Original = await GetLogoPathAsync(id, SizeName.Original), + Large = await GetLogoPathAsync(id, SizeName.Large), + Medium = await GetLogoPathAsync(id, SizeName.Medium), + Small = await GetLogoPathAsync(id, SizeName.Small), }; } public async Task SaveTempAsync(byte[] data, long maxFileSize) { - data = UserPhotoThumbnailManager.TryParseImage(data, maxFileSize, _originalLogoSize, out var imgFormat, out _, out _); + data = UserPhotoThumbnailManager.TryParseImage(data, maxFileSize, _originalLogoSize.Item2, out _, out _, out _); - var fileName = Guid.NewGuid() + "." + CommonPhotoManager.GetImgFormatName(imgFormat); + var fileName = $"{Guid.NewGuid()}.png"; using var stream = new MemoryStream(data); var path = await DataStore.SaveAsync(TempDomainPath, fileName, stream); @@ -177,89 +198,31 @@ public class RoomLogoManager if (pathAsString.IndexOf('?') > 0) { pathWithoutQuery = pathAsString.Substring(0, pathAsString.IndexOf('?')); - } + } return pathWithoutQuery; } - public string GetOriginalLogoUrl(T id) + public async Task RemoveTempAsync(string fileName) { - return GetLogoUrl(id, RoomLogoSize.Original); - } + var index = fileName.LastIndexOf('.'); + var fileNameWithoutExt = (index != -1) ? fileName.Substring(0, index) : fileName; - public string GetLargeLogoUrl(T id) - { - return GetLogoUrl(id, RoomLogoSize.Large); - } - - public string GetMediumLogoUrl(T id) - { - return GetLogoUrl(id, RoomLogoSize.Medium); - } - - public string GetSmallLogoUrl(T id) - { - return GetLogoUrl(id, RoomLogoSize.Small); - } - - public async ValueTask GetMediumLogoPathAsync(T id) - { - return await GetLogoPathAsync(id, _mediumLogoSize); - } - - public async ValueTask GetSmallLogoPathAsync(T id) - { - return await GetLogoPathAsync(id, _smallLogoSize); - } - - public async ValueTask GetLargeLogoPathAsync(T id) - { - return await GetLogoPathAsync(id, _largeLogoSize); - } - - public async ValueTask GetOriginalLogoPathAsync(T id) - { - return await GetLogoPathAsync(id, null, true); - } - - public async Task GetLogoPathAsync(T id, string size) - { - var room = await _daoFactory.GetFolderDao().GetFolderAsync(id); - - if (room == null) + try { - throw new ItemNotFoundException("Room not found"); + await DataStore.DeleteFilesAsync(TempDomainPath, "", fileNameWithoutExt + "*.*", false); } - - if (!await _fileSecurity.CanReadAsync(room)) + catch(Exception e) { - throw new SecurityException("You don't have permission to read the room"); + _logger.ErrorRemoveTempPhoto(e); } - - if (!RoomLogoSizeExtensions.TryParse(size, true, out var result)) - { - throw new ArgumentException("Size not valid", nameof(size)); - } - - id = GetId(room); - - return result switch - { - RoomLogoSize.Original => await GetOriginalLogoPathAsync(id), - RoomLogoSize.Large => await GetLargeLogoPathAsync(id), - RoomLogoSize.Medium => await GetMediumLogoPathAsync(id), - RoomLogoSize.Small => await GetSmallLogoPathAsync(id), - _ => throw new NotImplementedException() - }; } private async Task SaveWithProcessAsync(T id, byte[] imageData, long maxFileSize, Point position, Size cropSize) { - imageData = UserPhotoThumbnailManager.TryParseImage(imageData, maxFileSize, _originalLogoSize, out var imageFormat, out var width, out var height); + imageData = UserPhotoThumbnailManager.TryParseImage(imageData, maxFileSize, _originalLogoSize.Item2, out var _, out var _, out var _); - var imageExtension = CommonPhotoManager.GetImgFormatName(imageFormat); - - var fileName = $"{ProcessFolderId(id)}_orig_{width}-{height}.{imageExtension}"; + var fileName = string.Format(LogosPath, ProcessFolderId(id), SizeName.Original.ToStringLowerFast()); if (imageData == null || imageData.Length == 0) { @@ -276,7 +239,7 @@ public class RoomLogoManager return path.ToString(); } - private async Task ResizeAndSaveAsync(T id, byte[] data, long maxFileSize, Size size, Point position, Size cropSize) + private async Task ResizeAndSaveAsync(T id, byte[] data, long maxFileSize, (SizeName, Size) size, Point position, Size cropSize) { if (data == null || data.Length <= 0) { @@ -293,9 +256,9 @@ public class RoomLogoManager using var img = Image.Load(stream, out var format); var imgFormat = format; - if (size != img.Size()) + if (size.Item2 != img.Size()) { - using var img2 = UserPhotoThumbnailManager.GetImage(img, size, new UserPhotoThumbnailSettings(position, cropSize)); + using var img2 = UserPhotoThumbnailManager.GetImage(img, size.Item2, new UserPhotoThumbnailSettings(position, cropSize)); data = CommonPhotoManager.SaveToBytes(img2); } else @@ -304,7 +267,7 @@ public class RoomLogoManager } var extension = CommonPhotoManager.GetImgFormatName(imgFormat); - var fileName = string.Format(LogosPath, ProcessFolderId(id), size.Width, size.Height, extension); + var fileName = string.Format(LogosPath, ProcessFolderId(id), size.Item1.ToStringLowerFast()); using var stream2 = new MemoryStream(data); await DataStore.SaveAsync(fileName, stream2); @@ -315,33 +278,12 @@ public class RoomLogoManager } } - private string GetLogoUrl(T id, RoomLogoSize size) + private async ValueTask GetLogoPathAsync(T id, SizeName size) { - return $"{_filesLinkUtility.FileHandlerPath}?{FilesLinkUtility.Action}={ActionName}" + - $"&{FilesLinkUtility.FolderId}={Uri.EscapeDataString(id.ToString())}" + - $"&{FilesLinkUtility.Size}={size.ToStringLowerFast()}"; - } + var fileName = string.Format(LogosPath, ProcessFolderId(id), size.ToStringLowerFast()); + var uri = await DataStore.GetUriAsync(fileName); - private async ValueTask GetLogoPathAsync(T id, Size? size, bool original = false) - { - var key = original ? GetKey(id) : GetKey(id, size.Value); - - var path = _cache.Get(key); - if (path == Default) - { - return string.Empty; - } - - if (!string.IsNullOrEmpty(path)) - { - return await ValueTask.FromResult(path); - } - - await LoadPathToCacheAsync(id); - - path = _cache.Get(key); - - return path == null || path == Default ? string.Empty : path; + return uri.ToString(); } private async Task GetTempAsync(string fileName) @@ -364,37 +306,6 @@ public class RoomLogoManager return data.ToArray(); } - private async Task LoadPathToCacheAsync(T id) - { - var logoPath = await DataStore.ListFilesAsync(string.Empty, $"{ProcessFolderId(id)}*", false) - .Select(u => u.ToString()).ToListAsync(); - - if (logoPath.Count == 0) - { - SetDefaultCache(id); - return; - } - - var original = logoPath.Where(u => u.Contains("orig")).FirstOrDefault(); - - _cache.Insert(GetKey(id), original, _cacheLifeTime); - - logoPath.Remove(original); - - foreach (var (k, v) in logoPath.ToDictionary(p => _pattern.Match(p).Value.Split('-'))) - { - _cache.Insert(GetKey(id, new Size(int.Parse(k[0]), int.Parse(k[1]))), v, _cacheLifeTime); - } - } - - private async Task DeleteLogo(T id) - { - await DataStore.DeleteFilesAsync(string.Empty, $"{ProcessFolderId(id)}*.*", false); - - _cache.Remove(_cachePattern); - _cache.Remove(GetKey(id)); - } - private string ProcessFolderId(T id) { ArgumentNullException.ThrowIfNull(id, nameof(id)); @@ -404,24 +315,6 @@ public class RoomLogoManager : id.ToString()?.Replace("-", "").Replace("|", ""); } - private string GetKey(T id, Size size) - { - return $"{TenantId}/{id}/{size.Width}/{size.Height}"; - } - - private string GetKey(T id) - { - return $"{TenantId}/{id}/orig"; - } - - private void SetDefaultCache(T id) - { - _cache.Insert(GetKey(id), Default, _cacheLifeTime); - _cache.Insert(GetKey(id, _largeLogoSize), Default, _cacheLifeTime); - _cache.Insert(GetKey(id, _mediumLogoSize), Default, _cacheLifeTime); - _cache.Insert(GetKey(id, _smallLogoSize), Default, _cacheLifeTime); - } - private T GetId(Folder room) { return room.ProviderEntry && (room.RootId.ToString().Contains("sbox") @@ -430,7 +323,7 @@ public class RoomLogoManager } [EnumExtensions] -public enum RoomLogoSize +public enum SizeName { Original = 0, Large = 1, diff --git a/products/ASC.Files/Core/HttpHandlers/FileHandler.ashx.cs b/products/ASC.Files/Core/HttpHandlers/FileHandler.ashx.cs index 658850615c..616434512e 100644 --- a/products/ASC.Files/Core/HttpHandlers/FileHandler.ashx.cs +++ b/products/ASC.Files/Core/HttpHandlers/FileHandler.ashx.cs @@ -196,9 +196,6 @@ public class FileHandlerService case "track": await TrackFile(context); break; - case "logo": - await GetRoomLogoPathAsync(context); - break; default: throw new HttpException((int)HttpStatusCode.BadRequest, FilesCommonResource.ErrorMassage_BadRequest); } @@ -1569,60 +1566,6 @@ public class FileHandlerService await context.Response.WriteAsync(TrackResponse.Serialize(result)); } - - private async Task GetRoomLogoPathAsync(HttpContext context) - { - if (!_securityContext.IsAuthenticated) - { - context.Response.StatusCode = (int)HttpStatusCode.Forbidden; - return; - } - - var folderId = context.Request.Query[FilesLinkUtility.FolderId].FirstOrDefault(); - var size = context.Request.Query[FilesLinkUtility.Size].FirstOrDefault(); - - string result; - - try - { - if (int.TryParse(folderId, out var id)) - { - result = await _roomLogoManager.GetLogoPathAsync(id, size); - } - else - { - result = await _roomLogoManager.GetLogoPathAsync(folderId, size); - } - } - catch(ItemNotFoundException) - { - context.Response.StatusCode = (int)HttpStatusCode.NotFound; - return; - } - catch (SecurityException) - { - context.Response.StatusCode = (int)HttpStatusCode.Forbidden; - return; - } - catch - { - context.Response.StatusCode = (int)HttpStatusCode.BadRequest; - return; - } - - context.Response.Clear(); - await context.Response.WriteAsync(result); - - try - { - await context.Response.Body.FlushAsync(); - await context.Response.CompleteAsync(); - } - catch (HttpException ex) - { - _logger.Error(ex.Message); - } - } } public static class FileHandlerExtensions diff --git a/products/ASC.Files/Core/Log/RoomLogoManagerLogger.cs b/products/ASC.Files/Core/Log/RoomLogoManagerLogger.cs index f85243365b..3f78b339c5 100644 --- a/products/ASC.Files/Core/Log/RoomLogoManagerLogger.cs +++ b/products/ASC.Files/Core/Log/RoomLogoManagerLogger.cs @@ -30,4 +30,7 @@ public static partial class RoomLogoManagerLogger { [LoggerMessage(Level = LogLevel.Error, Message = "RemoveRoomLogo")] public static partial void ErrorRemoveRoomLogo(this ILogger logger, Exception exception); + + [LoggerMessage(Level = LogLevel.Error, Message = "RemoveTempPhoto")] + public static partial void ErrorRemoveTempPhoto(this ILogger logger, Exception exception); }