Skip to content

Commit

Permalink
fix: remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
BerendWouters committed Feb 9, 2024
1 parent ab554ff commit eca12b8
Show file tree
Hide file tree
Showing 21 changed files with 21 additions and 606 deletions.
4 changes: 2 additions & 2 deletions Singer.API/ClientApp/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Singer.API/ClientApp/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Singer",
"version": "0.1.0-issue-msal.1595",
"version": "0.1.0-issue-msal.1596",
"scripts": {
"ng": "ng",
"start": "ng serve",
Expand Down
3 changes: 2 additions & 1 deletion Singer.API/ClientApp/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Routes, RouterModule } from '@angular/router';
import { NgModule } from '@angular/core';
import { MainComponent } from './main.component';
import { BrowserUtils } from '@azure/msal-browser';
import { MsalRedirectComponent } from '@azure/msal-angular';
import { MsalGuard, MsalRedirectComponent } from '@azure/msal-angular';

const routes: Routes = [
{ path: 'login', loadChildren: () => import('./modules/login/login.module').then((m) => m.LoginModule) },
Expand All @@ -19,6 +19,7 @@ const routes: Routes = [
{
path: 'voogden',
loadChildren: () => import('./modules/legalguardians/legalguardians.module').then((m) => m.LegalguardiansModule),
canActivate: [MsalGuard],
component: MainComponent,
},
{ path: '', redirectTo: '/dashboard', pathMatch: 'full' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@

<!-- UserName Column -->
<ng-container matColumnDef="userName">
<th mat-header-cell *matHeaderCellDef mat-sort-header>
Gebruikersnaam
</th>
<th mat-header-cell *matHeaderCellDef mat-sort-header>Gebruikersnaam</th>
<td mat-cell *matCellDef="let row">{{ row.userName }}</td>
</ng-container>
<ng-container matColumnDef="actions">
Expand All @@ -38,9 +36,6 @@
<button mat-stroked-button matTooltip="Bewerk beheerder" (click)="editAdmin(row)">
<mat-icon>edit</mat-icon>
</button>
<button mat-stroked-button matTooltip="Wijzig wachtwoord" (click)="changePassword(row)">
<mat-icon>lock</mat-icon>
</button>
</div>
</td>
</ng-container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,25 +148,6 @@ export class AdminOverviewComponent implements OnInit, AfterViewInit {
});
}

changePassword(row: AdminUser) {
const dialogRef = this.dialog.open(ConfirmComponent, {
data: <ConfirmRequest>{
confirmMessage: `Wilt u het wachtwoord van ${row.firstName} ${row.lastName} wijzigen?`,
},
});
dialogRef.afterClosed().subscribe((isConfirmed: boolean) => {
if (isConfirmed) {
this._snackBar.open(
`Nieuw wachtwoord voor gebruiker ${row.firstName} ${row.lastName} werd aangevraagd.`,
'OK',
{
duration: 2000,
}
);
}
});
}

handleApiError(err: any) {
if (typeof err === 'string') {
this._snackBar.open(`⚠ ${err}`, 'OK');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,7 @@
<ng-container matColumnDef="actions">
<th mat-header-cell *matHeaderCellDef>Acties</th>
<td mat-cell *matCellDef="let row">
<div class="action-list">
<button mat-stroked-button matTooltip="Wijzig wachtwoord" (click)="changePassword($event, row)">
<mat-icon>lock</mat-icon>
</button>
</div>
<div class="action-list"></div>
</td>
</ng-container>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { AboutComponent } from '../core/components/about/about.component';
import { AccountInfoCareusersListComponent } from '../shared/components/account-info/account-info-careusers-list/account-info-careusers-list.component';
import { AccountInfoSummaryComponent } from '../shared/components/account-info/account-info-summary/account-info-summary.component';
import { RegistrationOverviewComponent } from './components/registration-overview/registration-overview.component';
import { MsalGuard } from '@azure/msal-angular';

const routes: Routes = [
{
Expand All @@ -15,22 +16,22 @@ const routes: Routes = [
{
path: 'about',
component: AboutComponent,
canActivate: [],
canActivate: [MsalGuard],
},
{
path: 'account/account-info',
component: AccountInfoSummaryComponent,
canActivate: [],
canActivate: [MsalGuard],
},
{
path: 'account/zorggebruikers',
component: AccountInfoCareusersListComponent,
canActivate: [],
canActivate: [MsalGuard],
},
{
path: 'registratie-overzicht',
component: RegistrationOverviewComponent,
canActivate: [],
canActivate: [MsalGuard],
},
];
@NgModule({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { Routes, RouterModule } from '@angular/router';
import { NgModule } from '@angular/core';
import { RegisterCareWizardComponent } from './components/register-care-wizard/register-care-wizard.component';
import { MsalGuard } from '@azure/msal-angular';

const routes: Routes = [
{
path: 'opvang',
component: RegisterCareWizardComponent,
canActivate: [],
canActivate: [MsalGuard],
},
];
@NgModule({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,6 @@ <h3 class="header">Account gegevens:</h3>
<p class="label">Wachtwoord:</p>
<p>*****</p>
</div>
<div class="button flex--row justify--end">
<button type="button" mat-stroked-button (click)="changePassword()">
Wachtwoord wijzigen
</button>
</div>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,4 @@ export class AccountInfoSummaryComponent {
this.user = res;
});
}

changePassword() {
const dialogRef = this.dialog.open(ConfirmComponent, {
data: <ConfirmRequest>{
confirmMessage: `Wilt u uw wachtwoord wijzigen?`,
},
});
dialogRef.afterClosed().subscribe((isConfirmed: boolean) => {
if (isConfirmed) {
// this.authService.requestPasswordReset(this.user.id);
this._snackBar.open(
`Er is een e-mail naar ${this.user.email} verstuurd met verdere instructies om uw wachtwoord kunt wijzigen.`,
'OK',
{
duration: 10000,
}
);
}
});
}
}
9 changes: 0 additions & 9 deletions Singer.API/Controllers/CareUserController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,4 @@ public override async Task<IActionResult> Update(Guid id, [FromBody] UpdateCareU
return Ok(result);
}

//[HttpGet("self")]
//public async Task<IActionResult> GetOwnCareUsers(string search)
//{
// var userId = Guid.Parse(User.GetSubjectId());

// var relatedCareUsers = await _careUserService.GetRelatedCareUserAsync(userId, search);
// return Ok(relatedCareUsers);

//}
}
2 changes: 1 addition & 1 deletion Singer.API/Controllers/DataControllerBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ protected DataControllerBase(IDatabaseService<TEntity, TDTO, TCreateDTO, TUpdate
[HttpPost]
[ProducesResponseType(StatusCodes.Status201Created)]
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
[RequiredScope("https://vzwstijn.onmicrosoft.com/4ea3a07f-5db9-4290-b930-88806df40e9d/Events.Read")]
[RequiredScope("Events.Read")]
public virtual async Task<IActionResult> Create([FromBody] TCreateDTO dto)
{
var model = ModelState;
Expand Down
10 changes: 5 additions & 5 deletions Singer.API/Data/ApplicationDbContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ protected override void OnModelCreating(ModelBuilder builder)
.WithOne(x => x.CareUser)
.OnDelete(DeleteBehavior.Restrict);

//builder.Entity<EventRegistrationLog>()
// .ToTable("EventRegistrationLogs")
// .HasDiscriminator(x => x.EventRegistrationChanges)
// .HasValue<EventRegistrationLocationChange>(EventRegistrationChanges.LocationChange)
// .HasValue<EventRegistrationStatusChange>(EventRegistrationChanges.RegistrationStatusChange);
builder.Entity<EventRegistrationLog>()
.ToTable("EventRegistrationLogs")
.HasDiscriminator(x => x.EventRegistrationChanges)
.HasValue<EventRegistrationLocationChange>(EventRegistrationChanges.LocationChange)
.HasValue<EventRegistrationStatusChange>(EventRegistrationChanges.RegistrationStatusChange);

builder.Entity<EventRegistrationLog>()
.HasOne(x => x.EventRegistration);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,6 @@ public static async Task<WebApplication> MigrateContexts(this WebApplication app
var applicationDbContext = serviceScope.ServiceProvider.GetRequiredService<ApplicationDbContext>();
await applicationDbContext.Database.MigrateAsync();

// TODO Reintroduce
//await Seed.SeedRolesAsync(serviceScope);
//await Seed.SeedUsersAsync(serviceScope, applicationDbContext, initialAdminPassword);
//await Seed.CheckRolesAsync(serviceScope, applicationDbContext);
//Seed.CreateAPIAndClient(configrationDbContext);
//Seed.SeedIdentityResources(configrationDbContext);
Seed.SeedSingerLocations(applicationDbContext);

await applicationDbContext.SaveChangesAsync();
Expand Down
3 changes: 0 additions & 3 deletions Singer.API/Helpers/Extensions/ServiceExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,7 @@ public static WebApplicationBuilder AddSingerServices(this WebApplicationBuilder

// Adds AutoMapper. Maps are defined as profiles in ./Profiles/*Profile.cs
builder.Services.AddAutoMapper(typeof(EventProfile));
builder.Services.AddScoped<ICareUserService, CareUserService>();
builder.Services.AddScoped<ILegalGuardianUserService, LegalGuardianUserService>();
builder.Services.AddScoped<ISingerLocationService, SingerLocationService>();
builder.Services.AddScoped<IAdminUserService, AdminUserService>();
builder.Services.AddScoped<IEventService, EventService>();
builder.Services.AddScoped<IEventRegistrationService, EventRegistrationService>()
.AddScoped<IDateValidator, DateValidator>();
Expand Down
1 change: 0 additions & 1 deletion Singer.API/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
app.UseSpaStaticFiles();

app.UseExceptionMiddleware();
//app.UseIdentityServer();

// Register the Swagger generator and the Swagger UI middlewares
// Navigate to:
Expand Down
66 changes: 0 additions & 66 deletions Singer.API/Services/AdminUserService.cs

This file was deleted.

Loading

0 comments on commit eca12b8

Please sign in to comment.