From 9a44c141079347b1f74a80e22a25c73aa77260f1 Mon Sep 17 00:00:00 2001 From: doug0102 Date: Thu, 17 Aug 2023 16:04:50 -0400 Subject: [PATCH 1/2] event page init --- src/app/app-routing.module.ts | 25 ++++++++----------- .../components/group/group.component.html | 1 + .../components/group/group.component.scss | 0 .../components/group/group.component.spec.ts | 21 ++++++++++++++++ .../components/group/group.component.ts | 11 ++++++++ .../features/groups/groups-routing.module.ts | 13 ++++++++++ src/app/features/groups/groups.module.ts | 5 ++-- src/assets/i18n/translations.en.ts | 1 + src/assets/i18n/translations.fr.ts | 1 + 9 files changed, 61 insertions(+), 17 deletions(-) create mode 100644 src/app/features/groups/components/group/group.component.html create mode 100644 src/app/features/groups/components/group/group.component.scss create mode 100644 src/app/features/groups/components/group/group.component.spec.ts create mode 100644 src/app/features/groups/components/group/group.component.ts diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 21e3b509..1cb2d164 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -110,7 +110,6 @@ const routes: Routes = [ path: CoreRoutes.Blog, title: translations.titles.blog, loadChildren: () => import('./features/blog/blog.module').then(m => m.BlogModule), - canActivate: [AuthGuard], data: { title: translations.titles.blog, breadcrumb: translations.titles.blog @@ -120,7 +119,7 @@ const routes: Routes = [ path: CoreRoutes.Bookmarks, title: translations.titles.bookmarks, loadChildren: () => import('./features/bookmarks/bookmarks.module').then(m => m.BookmarksModule), - canActivate: [AuthGuard], + canActivate: [AuthGuard, InterceptorGuard], data: { title: translations.titles.bookmarks, breadcrumb: translations.titles.bookmarks @@ -130,7 +129,7 @@ const routes: Routes = [ path: CoreRoutes.Dashboard, title: translations.titles.dashboards, loadChildren: () => import('./features/dashboard/dashboard.module').then(m => m.DashboardModule), - canActivate: [AuthGuard], + canActivate: [AuthGuard, InterceptorGuard], data: { title: translations.titles.dashboards, breadcrumb: translations.titles.dashboards @@ -145,7 +144,6 @@ const routes: Routes = [ path: CoreRoutes.Events, title: translations.titles.events, loadChildren: () => import('./features/events/events.module').then(m => m.EventsModule), - canActivate: [AuthGuard], data: { title: translations.titles.events, breadcrumb: translations.titles.events @@ -155,7 +153,7 @@ const routes: Routes = [ path: CoreRoutes.Friends, title: translations.titles.friends, loadChildren: () => import('./features/friends/friends.module').then(m => m.FriendsModule), - canActivate: [AuthGuard], + canActivate: [AuthGuard, InterceptorGuard], data: { title: translations.titles.friends, breadcrumb: translations.titles.friends @@ -165,7 +163,7 @@ const routes: Routes = [ path: CoreRoutes.Groups, title: translations.titles.groups, loadChildren: () => import('./features/groups/groups.module').then(m => m.GroupsModule), - canActivate: [AuthGuard], + canActivate: [AuthGuard, InterceptorGuard], data: { title: translations.titles.groups, breadcrumb: translations.titles.groups @@ -175,7 +173,7 @@ const routes: Routes = [ path: CoreRoutes.Invite, title: translations.titles.invite, loadChildren: () => import('./features/invite/invite.module').then(m => m.InviteModule), - canActivate: [AuthGuard], + canActivate: [AuthGuard, InterceptorGuard], data: { title: translations.titles.invite, breadcrumb: translations.titles.invite @@ -185,7 +183,7 @@ const routes: Routes = [ path: CoreRoutes.Members, title: translations.titles.members, loadChildren: () => import('./features/members/members.module').then(m => m.MembersModule), - canActivate: [AuthGuard], + canActivate: [AuthGuard, InterceptorGuard], data: { title: translations.titles.members, breadcrumb: translations.titles.members @@ -195,7 +193,7 @@ const routes: Routes = [ path: CoreRoutes.Messages, title: translations.titles.messages, loadChildren: () => import('./features/messages/messages.module').then(m => m.MessagesModule), - canActivate: [AuthGuard], + canActivate: [AuthGuard, InterceptorGuard], data: { title: translations.titles.messages, breadcrumb: translations.titles.messages @@ -205,7 +203,6 @@ const routes: Routes = [ path: CoreRoutes.Missions, title: translations.titles.missions, loadChildren: () => import('./features/missions/missions.module').then(m => m.MissionsModule), - canActivate: [AuthGuard], data: { title: translations.titles.missions, breadcrumb: translations.titles.missions @@ -215,7 +212,7 @@ const routes: Routes = [ path: CoreRoutes.NewsFeed, title: translations.titles.newsfeed, loadChildren: () => import('./features/news-feed/news-feed.module').then(m => m.NewsFeedModule), - canActivate: [AuthGuard], + canActivate: [AuthGuard, InterceptorGuard], data: { title: translations.titles.newsfeed, breadcrumb: translations.titles.newsfeed @@ -225,7 +222,7 @@ const routes: Routes = [ path: CoreRoutes.Profile, title: translations.titles.profile, loadChildren: () => import('./features/profile/profile.module').then(m => m.ProfileModule), - canActivate: [AuthGuard], + canActivate: [AuthGuard, InterceptorGuard], data: { title: translations.titles.profile, breadcrumb: translations.titles.profile @@ -235,7 +232,6 @@ const routes: Routes = [ path: CoreRoutes.Search, title: translations.titles.search, loadChildren: () => import('./features/search/search.module').then(m => m.SearchModule), - canActivate: [AuthGuard], data: { title: translations.titles.search, breadcrumb: translations.titles.search @@ -245,7 +241,7 @@ const routes: Routes = [ path: CoreRoutes.Settings, title: translations.titles.settings, loadChildren: () => import('./features/settings/settings.module').then(m => m.SettingsModule), - canActivate: [AuthGuard], + canActivate: [AuthGuard, InterceptorGuard], data: { title: translations.titles.settings, breadcrumb: translations.titles.settings @@ -255,7 +251,6 @@ const routes: Routes = [ path: CoreRoutes.TheWire, title: translations.titles.thewire, loadChildren: () => import('./features/the-wire/the-wire.module').then(m => m.TheWireModule), - canActivate: [AuthGuard], data: { title: translations.titles.thewire, breadcrumb: translations.titles.thewire diff --git a/src/app/features/groups/components/group/group.component.html b/src/app/features/groups/components/group/group.component.html new file mode 100644 index 00000000..f16d7f7f --- /dev/null +++ b/src/app/features/groups/components/group/group.component.html @@ -0,0 +1 @@ +

group works!

diff --git a/src/app/features/groups/components/group/group.component.scss b/src/app/features/groups/components/group/group.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/src/app/features/groups/components/group/group.component.spec.ts b/src/app/features/groups/components/group/group.component.spec.ts new file mode 100644 index 00000000..463a0617 --- /dev/null +++ b/src/app/features/groups/components/group/group.component.spec.ts @@ -0,0 +1,21 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { GroupComponent } from './group.component'; + +describe('GroupComponent', () => { + let component: GroupComponent; + let fixture: ComponentFixture; + + beforeEach(() => { + TestBed.configureTestingModule({ + declarations: [GroupComponent] + }); + fixture = TestBed.createComponent(GroupComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/features/groups/components/group/group.component.ts b/src/app/features/groups/components/group/group.component.ts new file mode 100644 index 00000000..e124d443 --- /dev/null +++ b/src/app/features/groups/components/group/group.component.ts @@ -0,0 +1,11 @@ +import { ChangeDetectionStrategy, Component } from '@angular/core'; + +@Component({ + selector: 'app-group', + templateUrl: './group.component.html', + styleUrls: ['./group.component.scss'], + changeDetection: ChangeDetectionStrategy.OnPush +}) +export class GroupComponent { + +} diff --git a/src/app/features/groups/groups-routing.module.ts b/src/app/features/groups/groups-routing.module.ts index 07147842..9664cdea 100644 --- a/src/app/features/groups/groups-routing.module.ts +++ b/src/app/features/groups/groups-routing.module.ts @@ -1,6 +1,10 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; import { GroupsComponent } from './groups.component'; +import { GroupComponent } from './components/group/group.component'; + +import { Translations } from 'src/app/core/services/translations.service'; +let translations = Translations.getInstance(); const routes: Routes = [ { @@ -8,6 +12,15 @@ const routes: Routes = [ pathMatch: 'full', component: GroupsComponent }, + { + path: ':groupId', + title: translations.titles.group, + component: GroupComponent, + data: { + title: translations.titles.group, + breadcrumb: translations.titles.group + } + }, { path: '**', redirectTo: '' diff --git a/src/app/features/groups/groups.module.ts b/src/app/features/groups/groups.module.ts index f1085cb0..0d4879d0 100644 --- a/src/app/features/groups/groups.module.ts +++ b/src/app/features/groups/groups.module.ts @@ -6,12 +6,14 @@ import { SharedModule } from 'src/app/shared/shared.module'; import { GroupCardComponent } from './components/group-card/group-card.component'; import { MatCardModule } from '@angular/material/card'; import { GroupListComponent } from './components/group-list/group-list.component'; +import { GroupComponent } from './components/group/group.component'; @NgModule({ declarations: [ GroupCardComponent, - GroupListComponent + GroupListComponent, + GroupComponent ], imports: [ CommonModule, @@ -20,7 +22,6 @@ import { GroupListComponent } from './components/group-list/group-list.component MatCardModule ], exports: [ - GroupCardComponent, GroupListComponent ] }) diff --git a/src/assets/i18n/translations.en.ts b/src/assets/i18n/translations.en.ts index 6ca33e0b..7aaf9e9b 100644 --- a/src/assets/i18n/translations.en.ts +++ b/src/assets/i18n/translations.en.ts @@ -47,6 +47,7 @@ export default { "events": "Events", "friends": "Friends", "groups": "Groups", + "group": "Group", "invite": "Invite", "members": "Members", "messages": "Messages", diff --git a/src/assets/i18n/translations.fr.ts b/src/assets/i18n/translations.fr.ts index a7ea9088..23f312a4 100644 --- a/src/assets/i18n/translations.fr.ts +++ b/src/assets/i18n/translations.fr.ts @@ -47,6 +47,7 @@ const fr: typeof import('./translations.en').default = { "events": "Événements", "friends": "Amis", "groups": "Groupes", + "group": "Groupe", "invite": "Inviter", "members": "Membres", "messages": "Messages", From 6974c4f9973df4a77264fc1c85600582ad075042 Mon Sep 17 00:00:00 2001 From: doug0102 Date: Thu, 17 Aug 2023 16:12:40 -0400 Subject: [PATCH 2/2] event page init --- .../components/event/event.component.html | 1 + .../components/event/event.component.scss | 0 .../components/event/event.component.spec.ts | 21 +++++++++++++++++++ .../components/event/event.component.ts | 11 ++++++++++ .../features/events/events-routing.module.ts | 13 ++++++++++++ src/app/features/events/events.module.ts | 5 +++-- src/assets/i18n/translations.en.ts | 1 + src/assets/i18n/translations.fr.ts | 1 + 8 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 src/app/features/events/components/event/event.component.html create mode 100644 src/app/features/events/components/event/event.component.scss create mode 100644 src/app/features/events/components/event/event.component.spec.ts create mode 100644 src/app/features/events/components/event/event.component.ts diff --git a/src/app/features/events/components/event/event.component.html b/src/app/features/events/components/event/event.component.html new file mode 100644 index 00000000..8a7c90c2 --- /dev/null +++ b/src/app/features/events/components/event/event.component.html @@ -0,0 +1 @@ +

event works!

diff --git a/src/app/features/events/components/event/event.component.scss b/src/app/features/events/components/event/event.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/src/app/features/events/components/event/event.component.spec.ts b/src/app/features/events/components/event/event.component.spec.ts new file mode 100644 index 00000000..60d8a37b --- /dev/null +++ b/src/app/features/events/components/event/event.component.spec.ts @@ -0,0 +1,21 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { EventComponent } from './event.component'; + +describe('EventComponent', () => { + let component: EventComponent; + let fixture: ComponentFixture; + + beforeEach(() => { + TestBed.configureTestingModule({ + declarations: [EventComponent] + }); + fixture = TestBed.createComponent(EventComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/features/events/components/event/event.component.ts b/src/app/features/events/components/event/event.component.ts new file mode 100644 index 00000000..8583814b --- /dev/null +++ b/src/app/features/events/components/event/event.component.ts @@ -0,0 +1,11 @@ +import { ChangeDetectionStrategy, Component } from '@angular/core'; + +@Component({ + selector: 'app-event', + templateUrl: './event.component.html', + styleUrls: ['./event.component.scss'], + changeDetection: ChangeDetectionStrategy.OnPush +}) +export class EventComponent { + +} diff --git a/src/app/features/events/events-routing.module.ts b/src/app/features/events/events-routing.module.ts index 3d42dcbc..e5640ac4 100644 --- a/src/app/features/events/events-routing.module.ts +++ b/src/app/features/events/events-routing.module.ts @@ -2,12 +2,25 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; import { EventsComponent } from './events.component'; +import { Translations } from 'src/app/core/services/translations.service'; +import { EventComponent } from './components/event/event.component'; +let translations = Translations.getInstance(); + const routes: Routes = [ { path: '', pathMatch: 'full', component: EventsComponent }, + { + path: ':eventId', + title: translations.titles.event, + component: EventComponent, + data: { + title: translations.titles.event, + breadcrumb: translations.titles.event + } + }, { path: '**', redirectTo: '' diff --git a/src/app/features/events/events.module.ts b/src/app/features/events/events.module.ts index f1d42796..90c04564 100644 --- a/src/app/features/events/events.module.ts +++ b/src/app/features/events/events.module.ts @@ -6,11 +6,13 @@ import { SharedModule } from 'src/app/shared/shared.module'; import { EventCardComponent } from './components/event-card/event-card.component'; import { MatCardModule } from '@angular/material/card'; import { EventListComponent } from './components/event-list/event-list.component'; +import { EventComponent } from './components/event/event.component'; @NgModule({ declarations: [ EventCardComponent, - EventListComponent + EventListComponent, + EventComponent ], imports: [ CommonModule, @@ -19,7 +21,6 @@ import { EventListComponent } from './components/event-list/event-list.component MatCardModule ], exports: [ - EventCardComponent, EventListComponent ] }) diff --git a/src/assets/i18n/translations.en.ts b/src/assets/i18n/translations.en.ts index 7aaf9e9b..379b6aa1 100644 --- a/src/assets/i18n/translations.en.ts +++ b/src/assets/i18n/translations.en.ts @@ -45,6 +45,7 @@ export default { "bookmarks": "Bookmarks", "dashboards": "Dashboards", "events": "Events", + "event": "Event", "friends": "Friends", "groups": "Groups", "group": "Group", diff --git a/src/assets/i18n/translations.fr.ts b/src/assets/i18n/translations.fr.ts index 23f312a4..1072b07d 100644 --- a/src/assets/i18n/translations.fr.ts +++ b/src/assets/i18n/translations.fr.ts @@ -45,6 +45,7 @@ const fr: typeof import('./translations.en').default = { "bookmarks": "Signets", "dashboards": "Tableaux de bord", "events": "Événements", + "event": "Événement", "friends": "Amis", "groups": "Groupes", "group": "Groupe",