diff --git a/AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.Client/src/api-authorization/api-authorization.module.spec.ts b/AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.Client/src/api-authorization/api-authorization.module.spec.ts
deleted file mode 100644
index f6a4b29..0000000
--- a/AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.Client/src/api-authorization/api-authorization.module.spec.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { ApiAuthorizationModule } from './api-authorization.module';
-
-describe('ApiAuthorizationModule', () => {
- let apiAuthorizationModule: ApiAuthorizationModule;
-
- beforeEach(() => {
- apiAuthorizationModule = new ApiAuthorizationModule();
- });
-
- it('should create an instance', () => {
- expect(apiAuthorizationModule).toBeTruthy();
- });
-});
diff --git a/AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.Client/src/api-authorization/api-authorization.module.ts b/AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.Client/src/api-authorization/api-authorization.module.ts
deleted file mode 100644
index 36770eb..0000000
--- a/AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.Client/src/api-authorization/api-authorization.module.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import { NgModule } from '@angular/core';
-import { CommonModule } from '@angular/common';
-import { LoginMenuComponent } from './login-menu/login-menu.component';
-import { LoginComponent } from './login/login.component';
-import { LogoutComponent } from './logout/logout.component';
-import { RouterModule } from '@angular/router';
-import { ApplicationPaths } from './api-authorization.constants';
-import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
-
-@NgModule({ declarations: [LoginMenuComponent, LoginComponent, LogoutComponent],
- exports: [LoginMenuComponent, LoginComponent, LogoutComponent], imports: [CommonModule,
- RouterModule.forChild([
- { path: ApplicationPaths.Register, component: LoginComponent },
- { path: ApplicationPaths.Profile, component: LoginComponent },
- { path: ApplicationPaths.Login, component: LoginComponent },
- { path: ApplicationPaths.LoginFailed, component: LoginComponent },
- { path: ApplicationPaths.LoginCallback, component: LoginComponent },
- { path: ApplicationPaths.LogOut, component: LogoutComponent },
- { path: ApplicationPaths.LoggedOut, component: LogoutComponent },
- { path: ApplicationPaths.LogOutCallback, component: LogoutComponent }
- ])], providers: [provideHttpClient(withInterceptorsFromDi())] })
-export class ApiAuthorizationModule { }
diff --git a/AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.Client/src/api-authorization/login-menu/login-menu.component.html b/AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.Client/src/api-authorization/login-menu/login-menu.component.html
index 30fa656..792315d 100644
--- a/AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.Client/src/api-authorization/login-menu/login-menu.component.html
+++ b/AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.Client/src/api-authorization/login-menu/login-menu.component.html
@@ -1,16 +1,21 @@
-
-
+@if (isAuthenticated | async; as authenticated) {
+ @if (authenticated) {
+
+ } @else if (!authenticated) {
+
+ }
+}
diff --git a/AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.Client/src/api-authorization/login-menu/login-menu.component.ts b/AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.Client/src/api-authorization/login-menu/login-menu.component.ts
index 9f526c3..918f2bc 100644
--- a/AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.Client/src/api-authorization/login-menu/login-menu.component.ts
+++ b/AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.Client/src/api-authorization/login-menu/login-menu.component.ts
@@ -1,13 +1,15 @@
import { Component, OnInit } from '@angular/core';
import { AuthorizeService } from '../authorize.service';
import { Observable } from 'rxjs';
-import { map, tap } from 'rxjs/operators';
+import { map } from 'rxjs/operators';
+import { RouterLink } from '@angular/router';
+import { AsyncPipe } from '@angular/common';
@Component({
selector: 'app-login-menu',
templateUrl: './login-menu.component.html',
styleUrls: ['./login-menu.component.css'],
- standalone: false
+ imports: [RouterLink, AsyncPipe]
})
export class LoginMenuComponent implements OnInit {
public isAuthenticated!: Observable;
diff --git a/AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.Client/src/api-authorization/login/login.component.ts b/AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.Client/src/api-authorization/login/login.component.ts
index b7ee0d2..1b19941 100644
--- a/AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.Client/src/api-authorization/login/login.component.ts
+++ b/AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.Client/src/api-authorization/login/login.component.ts
@@ -4,6 +4,7 @@ import { ActivatedRoute, Router } from '@angular/router';
import { BehaviorSubject } from 'rxjs';
import { LoginActions, QueryParameterNames, ApplicationPaths, ReturnUrlType } from '../api-authorization.constants';
import { environment } from '../../environments/environment';
+import { AsyncPipe } from '@angular/common';
// The main responsibility of this component is to handle the user's login process.
// This is the starting point for the login process. Any component that needs to authenticate
@@ -13,7 +14,7 @@ import { environment } from '../../environments/environment';
selector: 'app-login',
templateUrl: './login.component.html',
styleUrls: ['./login.component.css'],
- standalone: false
+ imports: [AsyncPipe]
})
export class LoginComponent implements OnInit {
public message = new BehaviorSubject(null);
diff --git a/AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.Client/src/api-authorization/logout/logout.component.ts b/AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.Client/src/api-authorization/logout/logout.component.ts
index 06d72f1..89522a9 100644
--- a/AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.Client/src/api-authorization/logout/logout.component.ts
+++ b/AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.Client/src/api-authorization/logout/logout.component.ts
@@ -4,6 +4,7 @@ import { BehaviorSubject } from 'rxjs';
import { ActivatedRoute, Router } from '@angular/router';
import { take } from 'rxjs/operators';
import { LogoutActions, ApplicationPaths, ReturnUrlType } from '../api-authorization.constants';
+import { AsyncPipe } from '@angular/common';
// The main responsibility of this component is to handle the user's logout process.
// This is the starting point for the logout process, which is usually initiated when a
@@ -12,7 +13,7 @@ import { LogoutActions, ApplicationPaths, ReturnUrlType } from '../api-authoriza
selector: 'app-logout',
templateUrl: './logout.component.html',
styleUrls: ['./logout.component.css'],
- standalone: false
+ imports: [AsyncPipe]
})
export class LogoutComponent implements OnInit {
public message = new BehaviorSubject(null);
diff --git a/AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.Client/src/app/app.component.ts b/AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.Client/src/app/app.component.ts
index 10d11ef..286bfde 100644
--- a/AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.Client/src/app/app.component.ts
+++ b/AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.Client/src/app/app.component.ts
@@ -1,9 +1,11 @@
import { Component } from '@angular/core';
+import { RouterOutlet } from '@angular/router';
+import { NavMenuComponent } from './nav-menu/nav-menu.component';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
- standalone: false
+ imports: [NavMenuComponent, RouterOutlet]
})
export class AppComponent {
title = 'app';
diff --git a/AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.Client/src/app/app.module.ts b/AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.Client/src/app/app.module.ts
deleted file mode 100644
index 911873e..0000000
--- a/AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.Client/src/app/app.module.ts
+++ /dev/null
@@ -1,41 +0,0 @@
-import { BrowserModule } from '@angular/platform-browser';
-import { NgModule } from '@angular/core';
-import { FormsModule } from '@angular/forms';
-import { HTTP_INTERCEPTORS, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
-import { RouterModule } from '@angular/router';
-
-import { AppComponent } from './app.component';
-import { NavMenuComponent } from './nav-menu/nav-menu.component';
-import { DxReportViewerModule, DxReportDesignerModule } from 'devexpress-reporting-angular';
-import { HomeComponent } from './home/home.component';
-import { ReportListComponent } from './report-list/report.list.component';
-
-import { ReportDesignerComponent } from './reportdesigner/report-designer';
-import { ReportViewerComponent } from './reportviewer/report-viewer';
-import { ApiAuthorizationModule } from '../api-authorization/api-authorization.module';
-import { AuthorizeGuard } from '../api-authorization/authorize.guard';
-import { AuthorizeInterceptor } from '../api-authorization/authorize.interceptor';
-
-@NgModule({ declarations: [
- AppComponent,
- NavMenuComponent,
- HomeComponent,
- ReportViewerComponent,
- ReportDesignerComponent,
- ReportListComponent
- ],
- bootstrap: [AppComponent], imports: [BrowserModule,
- FormsModule,
- DxReportViewerModule,
- DxReportDesignerModule,
- ApiAuthorizationModule,
- RouterModule.forRoot([
- { path: '', component: HomeComponent, pathMatch: 'full' },
- { path: 'designer', component: ReportDesignerComponent, canActivate: [AuthorizeGuard] },
- { path: 'viewer', component: ReportViewerComponent, canActivate: [AuthorizeGuard] },
- { path: 'report-list', component: ReportListComponent, canActivate: [AuthorizeGuard] },
- ])], providers: [
- { provide: HTTP_INTERCEPTORS, useClass: AuthorizeInterceptor, multi: true },
- provideHttpClient(withInterceptorsFromDi())
- ] })
-export class AppModule { }
diff --git a/AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.Client/src/app/app.server.module.ts b/AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.Client/src/app/app.server.module.ts
deleted file mode 100644
index 316380b..0000000
--- a/AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.Client/src/app/app.server.module.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-import { NgModule } from '@angular/core';
-import { ServerModule } from '@angular/platform-server';
-import { AppComponent } from './app.component';
-import { AppModule } from './app.module';
-
-@NgModule({
- imports: [AppModule, ServerModule],
- bootstrap: [AppComponent]
-})
-export class AppServerModule { }
diff --git a/AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.Client/src/app/home/home.component.ts b/AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.Client/src/app/home/home.component.ts
index 948fb73..2c0d67b 100644
--- a/AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.Client/src/app/home/home.component.ts
+++ b/AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.Client/src/app/home/home.component.ts
@@ -2,8 +2,7 @@ import { Component } from '@angular/core';
@Component({
selector: 'app-home',
- templateUrl: './home.component.html',
- standalone: false
+ templateUrl: './home.component.html'
})
export class HomeComponent {
}
diff --git a/AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.Client/src/app/nav-menu/nav-menu.component.html b/AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.Client/src/app/nav-menu/nav-menu.component.html
index 5b859e3..5c6b638 100644
--- a/AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.Client/src/app/nav-menu/nav-menu.component.html
+++ b/AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.Client/src/app/nav-menu/nav-menu.component.html
@@ -10,14 +10,13 @@
data-toggle="collapse"
data-target=".navbar-collapse"
aria-label="Toggle navigation"
- [attr.aria-expanded]="isExpanded"
- (click)="toggle()"
+ [attr.aria-expanded]="isExpanded()"
+ (click)="toggle()" >
>
diff --git a/AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.Client/src/app/nav-menu/nav-menu.component.ts b/AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.Client/src/app/nav-menu/nav-menu.component.ts
index 0ce4aba..dd5f12e 100644
--- a/AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.Client/src/app/nav-menu/nav-menu.component.ts
+++ b/AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.Client/src/app/nav-menu/nav-menu.component.ts
@@ -1,19 +1,21 @@
-import { Component } from '@angular/core';
+import { Component, signal } from '@angular/core';
+import { LoginMenuComponent } from '../../api-authorization/login-menu/login-menu.component';
+import { RouterLink, RouterLinkActive } from '@angular/router';
@Component({
selector: 'app-nav-menu',
templateUrl: './nav-menu.component.html',
styleUrls: ['./nav-menu.component.css'],
- standalone: false
+ imports: [RouterLink, LoginMenuComponent, RouterLinkActive]
})
export class NavMenuComponent {
- isExpanded = false;
+ protected readonly isExpanded = signal(false);
collapse() {
- this.isExpanded = false;
+ this.isExpanded.set(false);
}
toggle() {
- this.isExpanded = !this.isExpanded;
+ this.isExpanded.update(value => !value);
}
}
diff --git a/AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.Client/src/app/report-list/report.list.component.html b/AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.Client/src/app/report-list/report.list.component.html
index 6feb998..72e889a 100644
--- a/AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.Client/src/app/report-list/report.list.component.html
+++ b/AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.Client/src/app/report-list/report.list.component.html
@@ -1,12 +1,14 @@
Reports
- -
- {{reportItem.title}}
-