diff --git a/web-app/src/app/home/home.module.ts b/web-app/src/app/home/home.module.ts index d35247f88..610b40fa7 100644 --- a/web-app/src/app/home/home.module.ts +++ b/web-app/src/app/home/home.module.ts @@ -70,7 +70,6 @@ import { AttachUploadComponent } from '../observation/attachment/attachment-uplo import { ObservationViewFormComponent } from '../observation/observation-view/observation-view-form.component'; import { ObservationViewComponent } from '../observation/observation-view/observation-view.component'; import { ObservationFavoritesComponent } from '../observation/observation-favorites/observation-favorites.component'; -import { UserAvatarComponent } from '../user/user-avatar/user-avatar.component'; import { ObservationListComponent } from '../observation/observation-list/observation-list.component'; import { UserViewComponent } from '../user/user-view/user-view.component'; import { UserListItemComponent } from '../user/user-list/user-list-item.component'; @@ -134,11 +133,11 @@ import { PollingIntervalComponent } from '../preferences/polling-interval/pollin import { TimeFormatComponent } from '../preferences/time-format/time-format.component'; import { TimeZoneComponent } from '../preferences/time-zone/time-zone.component'; import { CoordinateSystemComponent } from '../preferences/coordinate-system/coordinate-system.component'; -import { ProfileComponent } from '../user/profile/profile.component'; import { PasswordResetSuccessDialog } from '../user/password/password-reset-success-dialog'; import { HomeComponent } from '..//home/home.component'; import { RouterModule, Routes } from '@angular/router'; import { UserResolver } from '../ingress/user.resolver'; +import { UserAvatarModule } from '../user/user-avatar/user-avatar.module'; const routes: Routes = [{ path: '', @@ -211,11 +210,9 @@ const routes: Routes = [{ AttachmentComponent, FilenamePipe, AttachUploadComponent, - UserAvatarComponent, UserViewComponent, UserListItemComponent, UserListComponent, - ProfileComponent, ObservationPopupComponent, UserPopupComponent, DatetimePickerComponent, @@ -231,6 +228,9 @@ const routes: Routes = [{ ContactDialogComponent ], imports: [ + UserAvatarModule, + FeedItemSummaryModule, + StaticIconModule, CommonModule, FormsModule, ReactiveFormsModule, @@ -281,8 +281,6 @@ const routes: Routes = [{ MatSnackBarModule, MatDatepickerModule, NgxMatSelectSearchModule, - FeedItemSummaryModule, - StaticIconModule, MatSlideToggleModule, MatStepperModule, InputMaskModule.forRoot(), diff --git a/web-app/src/app/routing.module.ts b/web-app/src/app/routing.module.ts index 186251ab3..ae6908c07 100644 --- a/web-app/src/app/routing.module.ts +++ b/web-app/src/app/routing.module.ts @@ -10,6 +10,9 @@ const appRoutes: Routes =[{ },{ path: 'about', loadChildren: () => import('./about/about.module').then(m => m.AboutModule) + },{ + path: 'profile', + loadChildren: () => import('./user/profile/profile.module').then(m => m.ProfileModule) },{ path: '', redirectTo: 'landing', diff --git a/web-app/src/app/user/profile/profile.component.ts b/web-app/src/app/user/profile/profile.component.ts index 46c8d5683..43fe3ff0b 100644 --- a/web-app/src/app/user/profile/profile.component.ts +++ b/web-app/src/app/user/profile/profile.component.ts @@ -137,7 +137,7 @@ export class ProfileComponent implements OnInit { } onBack(): void { - this.router.navigate(['map']) + this.router.navigate(['home']) } private setInfo(user: any) { diff --git a/web-app/src/app/user/profile/profile.module.ts b/web-app/src/app/user/profile/profile.module.ts new file mode 100644 index 000000000..a496910bb --- /dev/null +++ b/web-app/src/app/user/profile/profile.module.ts @@ -0,0 +1,52 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { ProfileComponent } from './profile.component'; +import { UserAvatarModule } from '../user-avatar/user-avatar.module'; +import { UserResolver } from '../../ingress/user.resolver'; +import { RouterModule, Routes } from '@angular/router'; +import { MatToolbarModule } from '@angular/material/toolbar'; +import { MatIconModule } from '@angular/material/icon'; +import { MatCardModule } from '@angular/material/card'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { ReactiveFormsModule } from '@angular/forms'; +import { MatProgressBarModule } from '@angular/material/progress-bar'; +import { MatInputModule } from '@angular/material/input'; +import { MatButtonModule } from '@angular/material/button'; + +const routes: Routes = [{ + path: '', + component: ProfileComponent, + resolve: { + user: UserResolver + } +}]; + +@NgModule({ + declarations: [], + imports: [], + exports: [ + CommonModule, + MatButtonModule, + MatCardModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatProgressBarModule, + MatToolbarModule, + ReactiveFormsModule + ] +}) +class AngularModule { } + +@NgModule({ + declarations: [ + ProfileComponent + ], + imports: [ + AngularModule, + UserAvatarModule, + RouterModule.forChild(routes) + ], + exports: [ RouterModule ] +}) +export class ProfileModule { } \ No newline at end of file diff --git a/web-app/src/app/user/user-avatar/user-avatar.module.ts b/web-app/src/app/user/user-avatar/user-avatar.module.ts new file mode 100644 index 000000000..5ddbc94d2 --- /dev/null +++ b/web-app/src/app/user/user-avatar/user-avatar.module.ts @@ -0,0 +1,14 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { UserAvatarComponent } from './user-avatar.component'; + +@NgModule({ + declarations: [ + UserAvatarComponent + ], + imports: [ + CommonModule + ], + exports: [ UserAvatarComponent ] +}) +export class UserAvatarModule { } \ No newline at end of file