-
-
Notifications
You must be signed in to change notification settings - Fork 1
Feature/topology #474
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
Merged
Merged
Feature/topology #474
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
3e78260
fix env var binding in ci
NielsPilgaard eac453e
add NetTopologySuite
NielsPilgaard ca06980
don't redirect to profile anymore, we have a dashboard now \o/
NielsPilgaard b2c27d9
Update SqlServerContainer.cs
NielsPilgaard 3ade775
add migration
NielsPilgaard 40ef1f7
add location to models
NielsPilgaard 0b25dff
Update QueryableUserProfileExtensions.cs
NielsPilgaard d898a61
search looks good
NielsPilgaard 0de4ec5
move delete account, improve myprofile further
NielsPilgaard bed2483
Update UserSearchServiceTests.cs
NielsPilgaard 911bb18
add temp migration service
NielsPilgaard 0b28935
Update LocationMigrationService.cs
NielsPilgaard 04d67a3
Delete 02-nettopologysuite-migration.md
NielsPilgaard 2aa92cd
Update LocationMigrationService.cs
NielsPilgaard File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 12 additions & 76 deletions
88
src/web/Jordnaer/Components/Account/Pages/Manage/DeletePersonalData.razor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,84 +1,20 @@ | ||
| @page "/Account/Manage/DeletePersonalData" | ||
|
|
||
| @inject UserManager<ApplicationUser> UserManager | ||
| @inject SignInManager<ApplicationUser> SignInManager | ||
| @inject IdentityUserAccessor UserAccessor | ||
| @inject IdentityRedirectManager RedirectManager | ||
| @inject ILogger<DeletePersonalData> Logger | ||
|
|
||
| @attribute [Sitemap] | ||
|
|
||
| <MetadataComponent Title="Slet personlige data"/> | ||
|
|
||
| <h2 class="manage-page-title">Slet personlige data</h2> | ||
|
|
||
| <StatusMessage Message="@_message" /> | ||
|
|
||
| <div class="alert alert-warning" role="alert"> | ||
| <p> | ||
| <strong>Når du sletter disse data, vil din konto blive permanent fjernet, og dette kan ikke fortrydes.</strong> | ||
| </p> | ||
| </div> | ||
|
|
||
| <EditForm Model="Input" FormName="delete-user" OnValidSubmit="OnValidSubmitAsync" method="post" class="account-form" style="max-width: 600px;"> | ||
| <DataAnnotationsValidator /> | ||
| <ValidationSummary class="validation-message" role="alert" /> | ||
|
|
||
| @if (_requirePassword) | ||
| { | ||
| <div class="form-floating"> | ||
| <InputText type="password" @bind-Value="Input.Password" class="form-control" autocomplete="current-password" aria-required="true" placeholder="Indtast venligst din adgangskode." autofocus /> | ||
| <label for="password" class="form-label">Adgangskode</label> | ||
| <ValidationMessage For="() => Input.Password" class="validation-message" /> | ||
| </div> | ||
| } | ||
|
|
||
| <button class="account-button-primary" type="submit" style="background-color: var(--danger-color);">Slet data og luk min konto</button> | ||
| </EditForm> | ||
|
|
||
|
|
||
| @code { | ||
| private AlertMessage? _message; | ||
| private ApplicationUser _user = default!; | ||
| private bool _requirePassword; | ||
|
|
||
| [CascadingParameter] | ||
| private HttpContext HttpContext { get; set; } = default!; | ||
|
|
||
| [SupplyParameterFromForm] | ||
| private InputModel Input { get; set; } = new(); | ||
|
|
||
| protected override async Task OnInitializedAsync() | ||
| { | ||
| _user = await UserAccessor.GetRequiredUserAsync(HttpContext); | ||
| _requirePassword = await UserManager.HasPasswordAsync(_user); | ||
| } | ||
|
|
||
| private async Task OnValidSubmitAsync() | ||
| { | ||
| if (_requirePassword && !await UserManager.CheckPasswordAsync(_user, Input.Password)) | ||
| { | ||
| _message = new AlertMessage("Forkert adgangskode.", true); | ||
| return; | ||
| } | ||
|
|
||
| var result = await UserManager.DeleteAsync(_user); | ||
| if (!result.Succeeded) | ||
| { | ||
| throw new InvalidOperationException("Unexpected error occurred deleting user."); | ||
| } | ||
| <MetadataComponent Title="Slet bruger" /> | ||
|
|
||
| await SignInManager.SignOutAsync(); | ||
| <h2 class="manage-page-title">Slet bruger</h2> | ||
|
|
||
| var userId = await UserManager.GetUserIdAsync(_user); | ||
| Logger.LogInformation("User with ID '{UserId}' deleted themselves.", userId); | ||
| <StatusMessage /> | ||
|
|
||
| RedirectManager.RedirectToCurrentPage(); | ||
| } | ||
| <div style="max-width: 600px;"> | ||
| <MudText Typo="Typo.body1" Class="mb-4"> | ||
| <strong>Når du sletter din bruger, vil din konto blive permanent fjernet, og dette kan ikke fortrydes.</strong> | ||
| </MudText> | ||
|
|
||
| private sealed class InputModel | ||
| { | ||
| [DataType(DataType.Password)] | ||
| public string Password { get; set; } = ""; | ||
| } | ||
| } | ||
| <MudButton StartIcon="@Icons.Material.Filled.Warning" Size="Size.Large" Href="/InitializeDeleteUser" | ||
| Color="Color.Error" Variant="Variant.Outlined"> | ||
| Slet Bruger | ||
| </MudButton> | ||
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.