Skip to content

Commit

Permalink
profile module
Browse files Browse the repository at this point in the history
  • Loading branch information
newmanw committed Aug 22, 2024
1 parent 1abf4bb commit a760c11
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 7 deletions.
10 changes: 4 additions & 6 deletions web-app/src/app/home/home.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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: '',
Expand Down Expand Up @@ -211,11 +210,9 @@ const routes: Routes = [{
AttachmentComponent,
FilenamePipe,
AttachUploadComponent,
UserAvatarComponent,
UserViewComponent,
UserListItemComponent,
UserListComponent,
ProfileComponent,
ObservationPopupComponent,
UserPopupComponent,
DatetimePickerComponent,
Expand All @@ -231,6 +228,9 @@ const routes: Routes = [{
ContactDialogComponent
],
imports: [
UserAvatarModule,
FeedItemSummaryModule,
StaticIconModule,
CommonModule,
FormsModule,
ReactiveFormsModule,
Expand Down Expand Up @@ -281,8 +281,6 @@ const routes: Routes = [{
MatSnackBarModule,
MatDatepickerModule,
NgxMatSelectSearchModule,
FeedItemSummaryModule,
StaticIconModule,
MatSlideToggleModule,
MatStepperModule,
InputMaskModule.forRoot(),
Expand Down
3 changes: 3 additions & 0 deletions web-app/src/app/routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion web-app/src/app/user/profile/profile.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export class ProfileComponent implements OnInit {
}

onBack(): void {
this.router.navigate(['map'])
this.router.navigate(['home'])
}

private setInfo(user: any) {
Expand Down
52 changes: 52 additions & 0 deletions web-app/src/app/user/profile/profile.module.ts
Original file line number Diff line number Diff line change
@@ -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 { }
14 changes: 14 additions & 0 deletions web-app/src/app/user/user-avatar/user-avatar.module.ts
Original file line number Diff line number Diff line change
@@ -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 { }

0 comments on commit a760c11

Please sign in to comment.