Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dmin/release settings #1046

Merged
merged 4 commits into from
Apr 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using IdentityServer4.Models;
using System.Security.Claims;
using IdentityServer4.Models;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Localization;
using Microsoft.Extensions.Logging;
Expand All @@ -10,7 +11,9 @@
using Microsoft.AspNetCore.Identity;
using OutOfSchool.Services.Models;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Options;
using OutOfSchool.Common;
using OutOfSchool.IdentityServer.Config;
using OutOfSchool.RazorTemplatesData.Services;

Expand Down Expand Up @@ -54,6 +57,16 @@ public void Setup()
fakeLocalizer.Object,
fakeIdentityServerConfig.Object
);

var user = new ClaimsPrincipal(new ClaimsIdentity(new[]
{
new Claim(IdentityResourceClaimsTypes.Sub, "example"),
}, "mock"));

accountController.ControllerContext = new ControllerContext()
{
HttpContext = new DefaultHttpContext { User = user }
};
}

[Test]
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,24 @@

#nullable disable

namespace OutOfSchool.IdentityServer.Data.Migrations.OutOfSchoolMigrations
namespace OutOfSchool.IdentityServer.Data.Migrations.OutOfSchoolMigrations;

public partial class AddIsBlockedColumnToWorkshop : Migration
{
public partial class AddIsBlockedColumnToWorkshop : Migration
protected override void Up(MigrationBuilder migrationBuilder)
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "IsBlocked",
table: "Workshops",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
}
migrationBuilder.AddColumn<bool>(
name: "IsBlocked",
table: "Workshops",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
}

protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "IsBlocked",
table: "Workshops");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "IsBlocked",
table: "Workshops");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,51 @@

#nullable disable

namespace OutOfSchool.IdentityServer.Data.Migrations.OutOfSchoolMigrations
namespace OutOfSchool.IdentityServer.Data.Migrations.OutOfSchoolMigrations;

public partial class AddIndexesToRatingAndNotification : Migration
{
public partial class AddIndexesToRatingAndNotification : Migration
protected override void Up(MigrationBuilder migrationBuilder)
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
migrationBuilder.AlterColumn<string>(
name: "UserId",
table: "Notifications",
type: "varchar(255)",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");

migrationBuilder.CreateIndex(
name: "IX_Ratings_EntityId",
table: "Ratings",
column: "EntityId");
migrationBuilder.CreateIndex(
name: "IX_Ratings_EntityId",
table: "Ratings",
column: "EntityId");

migrationBuilder.CreateIndex(
name: "IX_Notifications_UserId",
table: "Notifications",
column: "UserId");
}
migrationBuilder.CreateIndex(
name: "IX_Notifications_UserId",
table: "Notifications",
column: "UserId");
}

protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_Ratings_EntityId",
table: "Ratings");
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_Ratings_EntityId",
table: "Ratings");

migrationBuilder.DropIndex(
name: "IX_Notifications_UserId",
table: "Notifications");
migrationBuilder.DropIndex(
name: "IX_Notifications_UserId",
table: "Notifications");

migrationBuilder.AlterColumn<string>(
migrationBuilder.AlterColumn<string>(
name: "UserId",
table: "Notifications",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(255)")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
}
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,42 @@

#nullable disable

namespace OutOfSchool.IdentityServer.Data.Migrations.OutOfSchoolMigrations
namespace OutOfSchool.IdentityServer.Data.Migrations.OutOfSchoolMigrations;

public partial class AddIsGovernmentToInstitution : Migration
{
public partial class AddIsGovernmentToInstitution : Migration
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "IsGovernment",
table: "Institutions",
type: "tinyint(1)",
nullable: false,
defaultValue: false);

migrationBuilder.CreateIndex(
name: "IX_QuartzJobs_IsDeleted",
table: "QuartzJobs",
column: "IsDeleted");

migrationBuilder.CreateIndex(
name: "IX_AverageRatings_IsDeleted",
table: "AverageRatings",
column: "IsDeleted");
}

protected override void Down(MigrationBuilder migrationBuilder)
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "IsGovernment",
table: "Institutions",
type: "tinyint(1)",
nullable: false,
defaultValue: false);

migrationBuilder.CreateIndex(
name: "IX_QuartzJobs_IsDeleted",
table: "QuartzJobs",
column: "IsDeleted");

migrationBuilder.CreateIndex(
name: "IX_AverageRatings_IsDeleted",
table: "AverageRatings",
column: "IsDeleted");
}

protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_QuartzJobs_IsDeleted",
table: "QuartzJobs");

migrationBuilder.DropIndex(
name: "IX_AverageRatings_IsDeleted",
table: "AverageRatings");

migrationBuilder.DropColumn(
name: "IsGovernment",
table: "Institutions");
}
migrationBuilder.DropIndex(
name: "IX_QuartzJobs_IsDeleted",
table: "QuartzJobs");

migrationBuilder.DropIndex(
name: "IX_AverageRatings_IsDeleted",
table: "AverageRatings");

migrationBuilder.DropColumn(
name: "IsGovernment",
table: "Institutions");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@

#nullable disable

namespace OutOfSchool.IdentityServer.Data.Migrations.OutOfSchoolMigrations
namespace OutOfSchool.IdentityServer.Data.Migrations.OutOfSchoolMigrations;

public partial class AddOperationsWithObjects : Migration
{
public partial class AddOperationsWithObjects : Migration
protected override void Up(MigrationBuilder migrationBuilder)
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
migrationBuilder.CreateTable(
name: "OperationsWithObjects",
columns: table => new
{
Expand All @@ -27,33 +27,32 @@ protected override void Up(MigrationBuilder migrationBuilder)
{
table.PrimaryKey("PK_OperationsWithObjects", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");

migrationBuilder.CreateIndex(
name: "IX_OperationsWithObjects_EntityId",
table: "OperationsWithObjects",
column: "EntityId");

migrationBuilder.CreateIndex(
name: "IX_OperationsWithObjects_EntityType",
table: "OperationsWithObjects",
column: "EntityType");

migrationBuilder.CreateIndex(
name: "IX_OperationsWithObjects_OperationType",
table: "OperationsWithObjects",
column: "OperationType");

migrationBuilder.CreateIndex(
name: "IX_OperationsWithObjects_RowSeparator",
table: "OperationsWithObjects",
column: "RowSeparator");
}

protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "OperationsWithObjects");
}
.Annotation("MySql:CharSet", "utf8mb4");

migrationBuilder.CreateIndex(
name: "IX_OperationsWithObjects_EntityId",
table: "OperationsWithObjects",
column: "EntityId");

migrationBuilder.CreateIndex(
name: "IX_OperationsWithObjects_EntityType",
table: "OperationsWithObjects",
column: "EntityType");

migrationBuilder.CreateIndex(
name: "IX_OperationsWithObjects_OperationType",
table: "OperationsWithObjects",
column: "OperationType");

migrationBuilder.CreateIndex(
name: "IX_OperationsWithObjects_RowSeparator",
table: "OperationsWithObjects",
column: "RowSeparator");
}

protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "OperationsWithObjects");
}
}
}
47 changes: 0 additions & 47 deletions OutOfSchool/OutOfSchool.IdentityServer/appsettings.Compose.json

This file was deleted.

Loading