From 7e8c37760f4e02b35884d3ac68c97ccbca52097c Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sat, 23 Jan 2021 15:31:36 +0200 Subject: Renamed error component to not-found component (to better match it's purpose) --- src/DevHive.Angular/src/app/app-routing.module.ts | 6 +++--- src/DevHive.Angular/src/app/app.module.ts | 4 ++-- .../src/app/components/error/error.component.css | 23 --------------------- .../src/app/components/error/error.component.html | 10 --------- .../src/app/components/error/error.component.ts | 24 ---------------------- .../components/not-found/not-found.component.css | 23 +++++++++++++++++++++ .../components/not-found/not-found.component.html | 10 +++++++++ .../components/not-found/not-found.component.ts | 24 ++++++++++++++++++++++ .../profile-settings/profile-settings.component.ts | 2 +- .../app/components/profile/profile.component.ts | 2 +- 10 files changed, 64 insertions(+), 64 deletions(-) delete mode 100644 src/DevHive.Angular/src/app/components/error/error.component.css delete mode 100644 src/DevHive.Angular/src/app/components/error/error.component.html delete mode 100644 src/DevHive.Angular/src/app/components/error/error.component.ts create mode 100644 src/DevHive.Angular/src/app/components/not-found/not-found.component.css create mode 100644 src/DevHive.Angular/src/app/components/not-found/not-found.component.html create mode 100644 src/DevHive.Angular/src/app/components/not-found/not-found.component.ts (limited to 'src/DevHive.Angular') diff --git a/src/DevHive.Angular/src/app/app-routing.module.ts b/src/DevHive.Angular/src/app/app-routing.module.ts index d67ad8f..c9a8c61 100644 --- a/src/DevHive.Angular/src/app/app-routing.module.ts +++ b/src/DevHive.Angular/src/app/app-routing.module.ts @@ -5,7 +5,7 @@ import { LoginComponent } from './components/login/login.component'; import { RegisterComponent } from './components/register/register.component'; import { ProfileComponent } from './components/profile/profile.component'; import {ProfileSettingsComponent} from './components/profile-settings/profile-settings.component'; -import {ErrorComponent} from './components/error/error.component'; +import {NotFoundComponent} from './components/not-found/not-found.component'; const routes: Routes = [ { path: '', component: FeedComponent }, @@ -13,8 +13,8 @@ const routes: Routes = [ { path: 'register', component: RegisterComponent }, { path: 'profile/:username', component: ProfileComponent }, { path: 'profile/:username/settings', component: ProfileSettingsComponent }, - { path: 'error', component: ErrorComponent }, - { path: '**', component: ErrorComponent } + { path: 'not-found', component: NotFoundComponent }, + { path: '**', component: NotFoundComponent } ]; @NgModule({ diff --git a/src/DevHive.Angular/src/app/app.module.ts b/src/DevHive.Angular/src/app/app.module.ts index e404c30..586064e 100644 --- a/src/DevHive.Angular/src/app/app.module.ts +++ b/src/DevHive.Angular/src/app/app.module.ts @@ -15,7 +15,7 @@ import { FeedComponent } from './components/feed/feed.component'; import { PostComponent } from './components/post/post.component'; import { ProfileComponent } from './components/profile/profile.component'; import { ProfileSettingsComponent } from './components/profile-settings/profile-settings.component'; -import { ErrorComponent } from './components/error/error.component'; +import { NotFoundComponent } from './components/not-found/not-found.component'; import { LoadingComponent } from './components/loading/loading.component'; import { ErrorBarComponent } from './components/error-bar/error-bar.component'; import { SuccessBarComponent } from './components/success-bar/success-bar.component'; @@ -29,7 +29,7 @@ import { SuccessBarComponent } from './components/success-bar/success-bar.compon PostComponent, ProfileComponent, ProfileSettingsComponent, - ErrorComponent, + NotFoundComponent, LoadingComponent, ErrorBarComponent, SuccessBarComponent diff --git a/src/DevHive.Angular/src/app/components/error/error.component.css b/src/DevHive.Angular/src/app/components/error/error.component.css deleted file mode 100644 index ef6231d..0000000 --- a/src/DevHive.Angular/src/app/components/error/error.component.css +++ /dev/null @@ -1,23 +0,0 @@ -#content { - font-size: 1.3em; -} - -#content hr { - width: 100%; - border: 1px solid black; - box-sizing: border-box; -} - -#back-btns { - width: 100%; - display: flex; -} - -#back-btns > * { - flex: 1; - margin-right: .2em; -} - -#back-btns > *:nth-last-child(1) { - margin-right: 0; -} diff --git a/src/DevHive.Angular/src/app/components/error/error.component.html b/src/DevHive.Angular/src/app/components/error/error.component.html deleted file mode 100644 index 8394810..0000000 --- a/src/DevHive.Angular/src/app/components/error/error.component.html +++ /dev/null @@ -1,10 +0,0 @@ -
-
- Page not found! -
-
-
- - -
-
diff --git a/src/DevHive.Angular/src/app/components/error/error.component.ts b/src/DevHive.Angular/src/app/components/error/error.component.ts deleted file mode 100644 index 7069dc0..0000000 --- a/src/DevHive.Angular/src/app/components/error/error.component.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import {Router} from '@angular/router'; - -@Component({ - selector: 'app-error', - templateUrl: './error.component.html', - styleUrls: ['./error.component.css'] -}) -export class ErrorComponent implements OnInit { - - constructor(private _router: Router) - { } - - ngOnInit(): void { - } - - backToFeed(): void { - this._router.navigate(['/']); - } - - backToLogin(): void { - this._router.navigate(['/login']); - } -} diff --git a/src/DevHive.Angular/src/app/components/not-found/not-found.component.css b/src/DevHive.Angular/src/app/components/not-found/not-found.component.css new file mode 100644 index 0000000..ef6231d --- /dev/null +++ b/src/DevHive.Angular/src/app/components/not-found/not-found.component.css @@ -0,0 +1,23 @@ +#content { + font-size: 1.3em; +} + +#content hr { + width: 100%; + border: 1px solid black; + box-sizing: border-box; +} + +#back-btns { + width: 100%; + display: flex; +} + +#back-btns > * { + flex: 1; + margin-right: .2em; +} + +#back-btns > *:nth-last-child(1) { + margin-right: 0; +} diff --git a/src/DevHive.Angular/src/app/components/not-found/not-found.component.html b/src/DevHive.Angular/src/app/components/not-found/not-found.component.html new file mode 100644 index 0000000..8394810 --- /dev/null +++ b/src/DevHive.Angular/src/app/components/not-found/not-found.component.html @@ -0,0 +1,10 @@ +
+
+ Page not found! +
+
+
+ + +
+
diff --git a/src/DevHive.Angular/src/app/components/not-found/not-found.component.ts b/src/DevHive.Angular/src/app/components/not-found/not-found.component.ts new file mode 100644 index 0000000..157fb97 --- /dev/null +++ b/src/DevHive.Angular/src/app/components/not-found/not-found.component.ts @@ -0,0 +1,24 @@ +import { Component, OnInit } from '@angular/core'; +import {Router} from '@angular/router'; + +@Component({ + selector: 'app-not-found', + templateUrl: './not-found.component.html', + styleUrls: ['./not-found.component.css'] +}) +export class NotFoundComponent implements OnInit { + + constructor(private _router: Router) + { } + + ngOnInit(): void { + } + + backToFeed(): void { + this._router.navigate(['/']); + } + + backToLogin(): void { + this._router.navigate(['/login']); + } +} diff --git a/src/DevHive.Angular/src/app/components/profile-settings/profile-settings.component.ts b/src/DevHive.Angular/src/app/components/profile-settings/profile-settings.component.ts index f69c579..4954eb7 100644 --- a/src/DevHive.Angular/src/app/components/profile-settings/profile-settings.component.ts +++ b/src/DevHive.Angular/src/app/components/profile-settings/profile-settings.component.ts @@ -32,7 +32,7 @@ export class ProfileSettingsComponent implements OnInit { this._userService.getUserByUsernameRequest(this._urlUsername).subscribe( (res: object) => this.finishUserLoading(res), - (err: HttpErrorResponse) => { this._router.navigate(['/error']); } + (err: HttpErrorResponse) => { this._router.navigate(['/not-found']); } ); } diff --git a/src/DevHive.Angular/src/app/components/profile/profile.component.ts b/src/DevHive.Angular/src/app/components/profile/profile.component.ts index b4c42a0..42addfb 100644 --- a/src/DevHive.Angular/src/app/components/profile/profile.component.ts +++ b/src/DevHive.Angular/src/app/components/profile/profile.component.ts @@ -30,7 +30,7 @@ export class ProfileComponent implements OnInit { this._userService.getUserByUsernameRequest(this._urlUsername).subscribe( (res: object) => this.finishUserLoading(res), - (err: HttpErrorResponse) => { this._router.navigate(['/error']); } + (err: HttpErrorResponse) => { this._router.navigate(['/not-found']); } ); } -- cgit v1.2.3