Skip to content

Commit 1c504b2

Browse files
committed
wip
1 parent 3972714 commit 1c504b2

File tree

40 files changed

+21531
-206
lines changed

40 files changed

+21531
-206
lines changed

TeachingRecordSystem/src/TeachingRecordSystem.Core/DataStore/Postgres/Mappings/UserMapping.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ public void Configure(EntityTypeBuilder<ApplicationUser> builder)
4646
builder.HasIndex(e => e.OneLoginAuthenticationSchemeName).IsUnique().HasDatabaseName(ApplicationUser.OneLoginAuthenticationSchemeNameUniqueIndexName)
4747
.HasFilter("one_login_authentication_scheme_name is not null");
4848
builder.HasIndex(e => e.ClientId).IsUnique().HasDatabaseName(ApplicationUser.ClientIdUniqueIndexName).HasFilter("client_id is not null");
49-
builder.Property(e => e.ShortName).HasMaxLength(ApplicationUser.ShortNameMaxLength);
5049

5150
builder.HasData(new ApplicationUser { UserId = ApplicationUser.NpqApplicationUserGuid, Name = "NPQ", Active = true });
5251
}

TeachingRecordSystem/src/TeachingRecordSystem.Core/DataStore/Postgres/Migrations/20251127113103_RemoveApplicationUserShortName.Designer.cs

Lines changed: 21360 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
using System;
2+
using Microsoft.EntityFrameworkCore.Migrations;
3+
4+
#nullable disable
5+
6+
namespace TeachingRecordSystem.Core.DataStore.Postgres.Migrations
7+
{
8+
/// <inheritdoc />
9+
public partial class RemoveApplicationUserShortName : Migration
10+
{
11+
/// <inheritdoc />
12+
protected override void Up(MigrationBuilder migrationBuilder)
13+
{
14+
migrationBuilder.DropColumn(
15+
name: "short_name",
16+
table: "users");
17+
}
18+
19+
/// <inheritdoc />
20+
protected override void Down(MigrationBuilder migrationBuilder)
21+
{
22+
migrationBuilder.AddColumn<string>(
23+
name: "short_name",
24+
table: "users",
25+
type: "character varying(25)",
26+
maxLength: 25,
27+
nullable: true);
28+
29+
migrationBuilder.UpdateData(
30+
table: "users",
31+
keyColumn: "user_id",
32+
keyValue: new Guid("0f18f1ec-a102-4023-843f-1cadef3e6e14"),
33+
column: "short_name",
34+
value: null);
35+
}
36+
}
37+
}

TeachingRecordSystem/src/TeachingRecordSystem.Core/DataStore/Postgres/Migrations/TrsDbContextModelSnapshot.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20764,11 +20764,6 @@ protected override void BuildModel(ModelBuilder modelBuilder)
2076420764
.HasColumnType("varchar[]")
2076520765
.HasColumnName("redirect_uris");
2076620766

20767-
b.Property<string>("ShortName")
20768-
.HasMaxLength(25)
20769-
.HasColumnType("character varying(25)")
20770-
.HasColumnName("short_name");
20771-
2077220767
b.HasIndex("ClientId")
2077320768
.IsUnique()
2077420769
.HasDatabaseName("ix_users_client_id")

TeachingRecordSystem/src/TeachingRecordSystem.Core/DataStore/Postgres/Models/User.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ public class ApplicationUser : UserBase
3535
public const int ClientSecretMaxLength = 200;
3636
public const int ClientSecretMinLength = 16;
3737
public const int OneLoginClientIdMaxLength = 50;
38-
public const int ShortNameMaxLength = 25;
3938
public const string NameUniqueIndexName = "ix_users_application_user_name";
4039
public const string ClientIdUniqueIndexName = "ix_users_client_id";
4140
public const string OneLoginAuthenticationSchemeNameUniqueIndexName = "ix_users_one_login_authentication_scheme_name";
@@ -55,7 +54,6 @@ public class ApplicationUser : UserBase
5554
public string? OneLoginAuthenticationSchemeName { get; set; }
5655
public string? OneLoginRedirectUriPath { get; set; }
5756
public string? OneLoginPostLogoutRedirectUriPath { get; set; }
58-
public string? ShortName { get; set; }
5957

6058
[MemberNotNull(
6159
nameof(OneLoginClientId),

TeachingRecordSystem/src/TeachingRecordSystem.Core/Events/Legacy/ApplicationUserUpdatedEvent.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,5 @@ public enum ApplicationUserUpdatedEventChanges
2323
ClientId = 1 << 8,
2424
ClientSecret = 1 << 9,
2525
RedirectUris = 1 << 10,
26-
PostLogoutRedirectUris = 1 << 11,
27-
ShortName = 1 << 12
26+
PostLogoutRedirectUris = 1 << 11
2827
}

TeachingRecordSystem/src/TeachingRecordSystem.Core/Events/Models/ApplicationUser.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ public record ApplicationUser
1515
public string? OneLoginAuthenticationSchemeName { get; init; }
1616
public string? OneLoginRedirectUriPath { get; init; }
1717
public string? OneLoginPostLogoutRedirectUriPath { get; init; }
18-
public string? ShortName { get; init; }
1918

2019
public static ApplicationUser FromModel(DataStore.Postgres.Models.ApplicationUser user) => new()
2120
{
@@ -32,6 +31,5 @@ public record ApplicationUser
3231
OneLoginAuthenticationSchemeName = user.OneLoginAuthenticationSchemeName,
3332
OneLoginRedirectUriPath = user.OneLoginRedirectUriPath,
3433
OneLoginPostLogoutRedirectUriPath = user.OneLoginPostLogoutRedirectUriPath,
35-
ShortName = user.ShortName
3634
};
3735
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
alter table trs_users drop column short_name
2+

TeachingRecordSystem/src/TeachingRecordSystem.Core/TeachingRecordSystem.Core.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@
117117
<None Remove="Services\DqtReporting\Migrations\0093_RemoveITRPersonForeignKey.sql" />
118118
<None Remove="Services\DqtReporting\Migrations\0098_RemoveITRForeignKey.sql" />
119119
<None Remove="Services\DqtReporting\Migrations\0099_Users.sql" />
120+
<None Remove="Services\DqtReporting\Migrations\0100_RemoveUserShortName.sql" />
120121
</ItemGroup>
121122

122123
<ItemGroup>
@@ -256,6 +257,7 @@
256257
<EmbeddedResource Include="Services\DqtReporting\Migrations\0091_InsertRouteToProfessionalTypeData.sql" />
257258
<EmbeddedResource Include="Services\DqtReporting\Migrations\0092_Processes.sql" />
258259
<EmbeddedResource Include="Services\DqtReporting\Migrations\0093_RemoveITRPersonForeignKey.sql" />
260+
<EmbeddedResource Include="Services\DqtReporting\Migrations\0100_RemoveUserShortName.sql" />
259261
<EmbeddedResource Include="Services\DqtReporting\Migrations\0094_SupportTasksDeletedOn.sql" />
260262
<EmbeddedResource Include="Services\DqtReporting\Migrations\0095_IntegrationTransactionWarningCount.sql" />
261263
<EmbeddedResource Include="Services\DqtReporting\Migrations\0096_TrnRequestMetadata.sql" />

TeachingRecordSystem/src/TeachingRecordSystem.SupportUi/Pages/ApplicationUsers/AddApplicationUser/Index.cshtml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@
1717
<govuk-input-label class="govuk-label--m">Name</govuk-input-label>
1818
</govuk-input>
1919

20-
<govuk-input for="ShortName" input-class="govuk-input--width-10">
21-
<govuk-input-label class="govuk-label--m">Short name</govuk-input-label>
22-
</govuk-input>
23-
2420
<govuk-button type="submit">Save</govuk-button>
2521
</form>
2622
</div>

0 commit comments

Comments
 (0)