diff --git a/frontend/src/app/app-routing.module.ts b/frontend/src/app/app-routing.module.ts index 2873eba..b89eadd 100644 --- a/frontend/src/app/app-routing.module.ts +++ b/frontend/src/app/app-routing.module.ts @@ -1,12 +1,10 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; -import { HomeComponent } from './features/pages/home/home.component'; -import { SearchComponent } from './features/pages/search/search.component'; -import { TrendingComponent } from './features/pages/trending/trending.component'; -import { PopularComponent } from './features/pages/popular/popular.component'; -import { LibraryComponent } from './features/pages/library/library.component'; -import { ListsComponent } from './features/pages/lists/lists.component'; -import { ListInfoComponent } from './features/list-info/list-info.component'; +import { HomeComponent } from './features/home/home.component'; +import { SearchComponent } from './features/discover/search/search.component'; +import { TrendingComponent } from './features/discover/trending/trending.component'; +import { PopularComponent } from './features/discover/popular/popular.component'; +import { LibraryComponent } from './features/library/library.component'; const routes: Routes = [ { path: '', redirectTo: '/home', pathMatch: 'full' }, @@ -16,8 +14,10 @@ const routes: Routes = [ { path: 'trending', component: TrendingComponent }, { path: 'library', component: LibraryComponent }, - { path: 'lists', component: ListsComponent }, - { path: 'lists/:id', component: ListInfoComponent }, + { + path: 'user-collections', + loadChildren: () => import('./features/collections/user-collections.module').then(m => m.UserCollectionsModule) + }, ]; @NgModule({ diff --git a/frontend/src/app/app.module.ts b/frontend/src/app/app.module.ts index a176f06..aba5f23 100644 --- a/frontend/src/app/app.module.ts +++ b/frontend/src/app/app.module.ts @@ -5,18 +5,9 @@ import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; import { HttpClientModule } from '@angular/common/http'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { EntryListComponent } from './features/lists/entry-list/entry-list.component'; -import { HomeComponent } from './features/pages/home/home.component'; -import { SidebarComponent } from './core/components/sidebar/sidebar.component'; -import { NavbarComponent } from './core/components/navbar/navbar.component'; -import { PopularComponent } from './features/pages/popular/popular.component'; -import { TrendingComponent } from './features/pages/trending/trending.component'; -import { SearchComponent } from './features/pages/search/search.component'; -import { MainCardComponent } from './features/cards/main-card/main-card.component'; -import { DynamicEntryListComponent } from './features/lists/dynamic-entry-list/dynamic-entry-list.component'; -import { LibraryComponent } from './features/pages/library/library.component'; + import { CoreModule } from './core/core.module'; -import { ListSelectionModalComponent } from './features/modals/list-selection-modal/list-selection-modal.component'; +import { SharedModule } from './shared/shared.module'; import { MatDialogModule } from '@angular/material/dialog'; import { MatInputModule } from '@angular/material/input'; @@ -25,42 +16,36 @@ import { MatCheckboxModule } from '@angular/material/checkbox'; import { MatListModule } from '@angular/material/list'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { ListsComponent } from './features/pages/lists/lists.component'; -import { UserListItemComponent } from './features/cards/user-list-item/user-list-item.component'; -import { UserListItemCardComponent } from './features/cards/user-list-item-card/user-list-item-card.component'; -import { DateFormatPipe } from './core/pipes/date-format/date-format.pipe'; -import { SharedModule } from './shared/shared.module'; -import { ListInfoComponent } from './features/list-info/list-info.component'; -import { ListEntryCardComponent } from './features/cards/list-entry-card/list-entry-card.component'; -import { UserCollectionEntryGridComponent } from './features/lists/collection-entry-list/user-collection-entry-grid.component'; import { DatePipe } from '@angular/common'; import { DragDropModule } from '@angular/cdk/drag-drop'; +import { HomeComponent } from './features/home/home.component'; +import { PopularComponent } from './features/discover/popular/popular.component'; +import { TrendingComponent } from './features/discover/trending/trending.component'; +import { SearchComponent } from './features/discover/search/search.component'; +import { LibraryComponent } from './features/library/library.component'; +import { DynamicEntryListComponent } from './shared/components/lists/dynamic-entry-list/dynamic-entry-list.component'; +import { NotificationPopupComponent } from './shared/components/notification-popup/notification-popup.component'; +import { MainCardComponent } from './shared/components/cards/main-card/main-card.component'; +import { ListSelectionModalComponent } from './shared/components/modals/list-selection-modal/list-selection-modal.component'; @NgModule({ declarations: [ AppComponent, - EntryListComponent, HomeComponent, - SidebarComponent, - NavbarComponent, PopularComponent, TrendingComponent, SearchComponent, + LibraryComponent, + + // ? components + NotificationPopupComponent, MainCardComponent, DynamicEntryListComponent, - LibraryComponent, + NotificationPopupComponent, ListSelectionModalComponent, - ListsComponent, - UserListItemComponent, - UserListItemCardComponent, - DateFormatPipe, - ListInfoComponent, - ListEntryCardComponent, - UserCollectionEntryGridComponent, ], imports: [ CoreModule, - SharedModule, BrowserModule, AppRoutingModule, @@ -68,11 +53,11 @@ import { DragDropModule } from '@angular/cdk/drag-drop'; ReactiveFormsModule, FormsModule, - MatDialogModule, - MatInputModule, - MatButtonModule, - MatCheckboxModule, - MatListModule, + // MatDialogModule, + // MatInputModule, + // MatButtonModule, + // MatCheckboxModule, + // MatListModule, BrowserAnimationsModule, DragDropModule, diff --git a/frontend/src/app/core/core.module.ts b/frontend/src/app/core/core.module.ts index e70fff4..418bce7 100644 --- a/frontend/src/app/core/core.module.ts +++ b/frontend/src/app/core/core.module.ts @@ -6,9 +6,11 @@ import { LibraryService } from './services/library.service'; import { EntryService } from './services/entry.service'; import { ListService } from './services/list.service'; import { ToggleService } from './services/toggle.service'; +import { SidebarComponent } from './components/sidebar/sidebar.component'; +import { NavbarComponent } from './components/navbar/navbar.component'; @NgModule({ - declarations: [], + declarations: [SidebarComponent, NavbarComponent], imports: [CommonModule], providers: [ TmdbService, @@ -17,6 +19,7 @@ import { ToggleService } from './services/toggle.service'; ListService, ToggleService, ], + exports: [SidebarComponent, NavbarComponent], }) export class CoreModule { constructor(@Optional() @SkipSelf() parentModule?: CoreModule) { diff --git a/frontend/src/app/core/services/list.service.ts b/frontend/src/app/core/services/list.service.ts index 334283b..bc1d4a2 100644 --- a/frontend/src/app/core/services/list.service.ts +++ b/frontend/src/app/core/services/list.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { Observable } from 'rxjs'; -import { List } from '../../shared/models/list.model'; +import { UserCollection } from '../../shared/models/userCollection.model'; import { ListEntry } from '../../shared/models/listEntry.model'; import { Entry } from '../../shared/models/entry.model'; @@ -13,18 +13,18 @@ export class ListService { constructor(private http: HttpClient) {} // get all lists - getLists(): Observable { - return this.http.get(`${this.backend_apiUrl}/lists`); + getLists(): Observable { + return this.http.get(`${this.backend_apiUrl}/lists`); } // get a list by id getList(id: string) { - return this.http.get(`${this.backend_apiUrl}/lists/${id}`); + return this.http.get(`${this.backend_apiUrl}/lists/${id}`); } // Create a new list - createList(list: List): Observable { - return this.http.post(`${this.backend_apiUrl}/lists`, list); + createList(list: UserCollection): Observable { + return this.http.post(`${this.backend_apiUrl}/lists`, list); } // Delete a list by ID diff --git a/frontend/src/app/features/cards/list-entry-card/list-entry-card.component.spec.ts b/frontend/src/app/features/cards/list-entry-card/list-entry-card.component.spec.ts deleted file mode 100644 index 3895cf6..0000000 --- a/frontend/src/app/features/cards/list-entry-card/list-entry-card.component.spec.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { ListEntryCardComponent } from './list-entry-card.component'; - -describe('ListEntryCardComponent', () => { - let component: ListEntryCardComponent; - let fixture: ComponentFixture; - - beforeEach(() => { - TestBed.configureTestingModule({ - declarations: [ListEntryCardComponent] - }); - fixture = TestBed.createComponent(ListEntryCardComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/frontend/src/app/features/cards/user-list-item-card/user-list-item-card.component.html b/frontend/src/app/features/cards/user-list-item-card/user-list-item-card.component.html deleted file mode 100644 index 35cdeba..0000000 --- a/frontend/src/app/features/cards/user-list-item-card/user-list-item-card.component.html +++ /dev/null @@ -1 +0,0 @@ -

user-list-item-card works!

diff --git a/frontend/src/app/features/cards/user-list-item-card/user-list-item-card.component.spec.ts b/frontend/src/app/features/cards/user-list-item-card/user-list-item-card.component.spec.ts deleted file mode 100644 index 4f2c77f..0000000 --- a/frontend/src/app/features/cards/user-list-item-card/user-list-item-card.component.spec.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { UserListItemCardComponent } from './user-list-item-card.component'; - -describe('UserListItemCardComponent', () => { - let component: UserListItemCardComponent; - let fixture: ComponentFixture; - - beforeEach(() => { - TestBed.configureTestingModule({ - declarations: [UserListItemCardComponent] - }); - fixture = TestBed.createComponent(UserListItemCardComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/frontend/src/app/features/cards/user-list-item-card/user-list-item-card.component.ts b/frontend/src/app/features/cards/user-list-item-card/user-list-item-card.component.ts deleted file mode 100644 index c341738..0000000 --- a/frontend/src/app/features/cards/user-list-item-card/user-list-item-card.component.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Component } from '@angular/core'; - -@Component({ - selector: 'app-user-list-item-card', - templateUrl: './user-list-item-card.component.html', - styleUrls: ['./user-list-item-card.component.css'] -}) -export class UserListItemCardComponent { - -} diff --git a/frontend/src/app/features/cards/user-list-item/user-list-item.component.spec.ts b/frontend/src/app/features/cards/user-list-item/user-list-item.component.spec.ts deleted file mode 100644 index 481c8f5..0000000 --- a/frontend/src/app/features/cards/user-list-item/user-list-item.component.spec.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { UserListItemComponent } from './user-list-item.component'; - -describe('UserListItemComponent', () => { - let component: UserListItemComponent; - let fixture: ComponentFixture; - - beforeEach(() => { - TestBed.configureTestingModule({ - declarations: [UserListItemComponent] - }); - fixture = TestBed.createComponent(UserListItemComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/frontend/src/app/features/collections/collections-routing.module.ts b/frontend/src/app/features/collections/collections-routing.module.ts new file mode 100644 index 0000000..a4656b4 --- /dev/null +++ b/frontend/src/app/features/collections/collections-routing.module.ts @@ -0,0 +1,21 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; +import { UserCollectionsPageComponent } from './user-collections/userCollections-page/userCollections-page.component'; +import { UserCollectionInfoPageComponent } from './user-collection-info/userCollection-info-page/userCollection-info-page.component'; + +const routes: Routes = [ + { + path: '', + component: UserCollectionsPageComponent + }, + { + path: ':id', + component: UserCollectionInfoPageComponent + } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class CollectionsRoutingModule { } \ No newline at end of file diff --git a/frontend/src/app/features/lists/collection-entry-list/user-collection-entry-grid.component.css b/frontend/src/app/features/collections/user-collection-info/userCollection-entry-grid/userCollection-entry-grid.component.css similarity index 100% rename from frontend/src/app/features/lists/collection-entry-list/user-collection-entry-grid.component.css rename to frontend/src/app/features/collections/user-collection-info/userCollection-entry-grid/userCollection-entry-grid.component.css diff --git a/frontend/src/app/features/lists/collection-entry-list/user-collection-entry-grid.component.html b/frontend/src/app/features/collections/user-collection-info/userCollection-entry-grid/userCollection-entry-grid.component.html similarity index 54% rename from frontend/src/app/features/lists/collection-entry-list/user-collection-entry-grid.component.html rename to frontend/src/app/features/collections/user-collection-info/userCollection-entry-grid/userCollection-entry-grid.component.html index 720cb3f..35aa0e9 100644 --- a/frontend/src/app/features/lists/collection-entry-list/user-collection-entry-grid.component.html +++ b/frontend/src/app/features/collections/user-collection-info/userCollection-entry-grid/userCollection-entry-grid.component.html @@ -1,5 +1,5 @@
- - +
\ No newline at end of file diff --git a/frontend/src/app/features/lists/collection-entry-list/user-collection-entry-grid.component.spec.ts b/frontend/src/app/features/collections/user-collection-info/userCollection-entry-grid/userCollection-entry-grid.component.spec.ts similarity index 86% rename from frontend/src/app/features/lists/collection-entry-list/user-collection-entry-grid.component.spec.ts rename to frontend/src/app/features/collections/user-collection-info/userCollection-entry-grid/userCollection-entry-grid.component.spec.ts index b54c34f..abb5421 100644 --- a/frontend/src/app/features/lists/collection-entry-list/user-collection-entry-grid.component.spec.ts +++ b/frontend/src/app/features/collections/user-collection-info/userCollection-entry-grid/userCollection-entry-grid.component.spec.ts @@ -1,6 +1,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { UserCollectionEntryGridComponent } from './user-collection-entry-grid.component'; +import { UserCollectionEntryGridComponent } from './userCollection-entry-grid.component'; describe('UserCollectionEntryGridComponent', () => { let component: UserCollectionEntryGridComponent; diff --git a/frontend/src/app/features/lists/collection-entry-list/user-collection-entry-grid.component.ts b/frontend/src/app/features/collections/user-collection-info/userCollection-entry-grid/userCollection-entry-grid.component.ts similarity index 76% rename from frontend/src/app/features/lists/collection-entry-list/user-collection-entry-grid.component.ts rename to frontend/src/app/features/collections/user-collection-info/userCollection-entry-grid/userCollection-entry-grid.component.ts index 2ebbc76..aa2daee 100644 --- a/frontend/src/app/features/lists/collection-entry-list/user-collection-entry-grid.component.ts +++ b/frontend/src/app/features/collections/user-collection-info/userCollection-entry-grid/userCollection-entry-grid.component.ts @@ -1,5 +1,5 @@ import { Component, Input } from '@angular/core'; -import { Entry } from '../../../shared/models/entry.model'; +import { Entry } from '../../../../shared/models/entry.model'; import { CdkDragDrop, CdkDragEnd, @@ -8,9 +8,9 @@ import { } from '@angular/cdk/drag-drop'; @Component({ - selector: 'app-user-collection-entry-grid', - templateUrl: './user-collection-entry-grid.component.html', - styleUrls: ['./user-collection-entry-grid.component.css'], + selector: 'app-userCollection-entry-grid', + templateUrl: './userCollection-entry-grid.component.html', + styleUrls: ['./userCollection-entry-grid.component.css'], }) export class UserCollectionEntryGridComponent { @Input() entries: Entry[] = []; diff --git a/frontend/src/app/features/cards/list-entry-card/list-entry-card.component.css b/frontend/src/app/features/collections/user-collection-info/userCollection-grid-card/userCollection-grid-card.component.css similarity index 100% rename from frontend/src/app/features/cards/list-entry-card/list-entry-card.component.css rename to frontend/src/app/features/collections/user-collection-info/userCollection-grid-card/userCollection-grid-card.component.css diff --git a/frontend/src/app/features/cards/list-entry-card/list-entry-card.component.html b/frontend/src/app/features/collections/user-collection-info/userCollection-grid-card/userCollection-grid-card.component.html similarity index 100% rename from frontend/src/app/features/cards/list-entry-card/list-entry-card.component.html rename to frontend/src/app/features/collections/user-collection-info/userCollection-grid-card/userCollection-grid-card.component.html diff --git a/frontend/src/app/features/collections/user-collection-info/userCollection-grid-card/userCollection-grid-card.component.spec.ts b/frontend/src/app/features/collections/user-collection-info/userCollection-grid-card/userCollection-grid-card.component.spec.ts new file mode 100644 index 0000000..e99beec --- /dev/null +++ b/frontend/src/app/features/collections/user-collection-info/userCollection-grid-card/userCollection-grid-card.component.spec.ts @@ -0,0 +1,21 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { UserCollectionGridCardComponent } from './userCollection-grid-card.component'; + +describe('UserCollectionGridCardComponent', () => { + let component: UserCollectionGridCardComponent; + let fixture: ComponentFixture; + + beforeEach(() => { + TestBed.configureTestingModule({ + declarations: [UserCollectionGridCardComponent] + }); + fixture = TestBed.createComponent(UserCollectionGridCardComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/src/app/features/cards/list-entry-card/list-entry-card.component.ts b/frontend/src/app/features/collections/user-collection-info/userCollection-grid-card/userCollection-grid-card.component.ts similarity index 85% rename from frontend/src/app/features/cards/list-entry-card/list-entry-card.component.ts rename to frontend/src/app/features/collections/user-collection-info/userCollection-grid-card/userCollection-grid-card.component.ts index b86f92d..fa0db67 100644 --- a/frontend/src/app/features/cards/list-entry-card/list-entry-card.component.ts +++ b/frontend/src/app/features/collections/user-collection-info/userCollection-grid-card/userCollection-grid-card.component.ts @@ -1,14 +1,14 @@ import { Component, EventEmitter, Input, Output } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; -import { LibraryService } from '../../../core/services/library.service'; -import { Entry } from '../../../shared/models/entry.model'; +import { LibraryService } from '../../../../core/services/library.service'; +import { Entry } from '../../../../shared/models/entry.model'; import { trigger, transition, style, animate } from '@angular/animations'; -import { ListService } from '../../../core/services/list.service'; +import { ListService } from '../../../../core/services/list.service'; @Component({ - selector: 'app-list-entry-card', - templateUrl: './list-entry-card.component.html', - styleUrls: ['./list-entry-card.component.css'], + selector: 'app-userCollection-grid-card', + templateUrl: './userCollection-grid-card.component.html', + styleUrls: ['./userCollection-grid-card.component.css'], animations: [ trigger('fadeInOut', [ transition(':enter', [ @@ -19,7 +19,7 @@ import { ListService } from '../../../core/services/list.service'; ]), ], }) -export class ListEntryCardComponent { +export class UserCollectionGridCardComponent { @Input() entry!: Entry; @Input() listId: string = ''; @Output() refrechEvent = new EventEmitter(); diff --git a/frontend/src/app/features/cards/user-list-item-card/user-list-item-card.component.css b/frontend/src/app/features/collections/user-collection-info/userCollection-info-page/userCollection-info-page.component.css similarity index 100% rename from frontend/src/app/features/cards/user-list-item-card/user-list-item-card.component.css rename to frontend/src/app/features/collections/user-collection-info/userCollection-info-page/userCollection-info-page.component.css diff --git a/frontend/src/app/features/list-info/list-info.component.html b/frontend/src/app/features/collections/user-collection-info/userCollection-info-page/userCollection-info-page.component.html similarity index 89% rename from frontend/src/app/features/list-info/list-info.component.html rename to frontend/src/app/features/collections/user-collection-info/userCollection-info-page/userCollection-info-page.component.html index 3c8dcfd..bf54c91 100644 --- a/frontend/src/app/features/list-info/list-info.component.html +++ b/frontend/src/app/features/collections/user-collection-info/userCollection-info-page/userCollection-info-page.component.html @@ -28,7 +28,7 @@
{{list.description}}

- +
\ No newline at end of file diff --git a/frontend/src/app/features/collections/user-collection-info/userCollection-info-page/userCollection-info-page.component.spec.ts b/frontend/src/app/features/collections/user-collection-info/userCollection-info-page/userCollection-info-page.component.spec.ts new file mode 100644 index 0000000..7486711 --- /dev/null +++ b/frontend/src/app/features/collections/user-collection-info/userCollection-info-page/userCollection-info-page.component.spec.ts @@ -0,0 +1,21 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { UserCollectionInfoPageComponent } from './userCollection-info-page.component'; + +describe('UserCollectionInfoPageComponent', () => { + let component: UserCollectionInfoPageComponent; + let fixture: ComponentFixture; + + beforeEach(() => { + TestBed.configureTestingModule({ + declarations: [UserCollectionInfoPageComponent], + }); + fixture = TestBed.createComponent(UserCollectionInfoPageComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/src/app/features/list-info/list-info.component.ts b/frontend/src/app/features/collections/user-collection-info/userCollection-info-page/userCollection-info-page.component.ts similarity index 82% rename from frontend/src/app/features/list-info/list-info.component.ts rename to frontend/src/app/features/collections/user-collection-info/userCollection-info-page/userCollection-info-page.component.ts index 50b5900..8e3b9ec 100644 --- a/frontend/src/app/features/list-info/list-info.component.ts +++ b/frontend/src/app/features/collections/user-collection-info/userCollection-info-page/userCollection-info-page.component.ts @@ -1,18 +1,18 @@ import { Component } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; -import { ListService } from '../../core/services/list.service'; -import { List } from '../../shared/models/list.model'; -import { Entry } from '../../shared/models/entry.model'; +import { ListService } from '../../../../core/services/list.service'; +import { UserCollection } from '../../../../shared/models/userCollection.model'; +import { Entry } from '../../../../shared/models/entry.model'; import { DatePipe } from '@angular/common'; @Component({ - selector: 'app-list-info', - templateUrl: './list-info.component.html', - styleUrls: ['./list-info.component.css'], + selector: 'app-userCollection-info-page', + templateUrl: './userCollection-info-page.component.html', + styleUrls: ['./userCollection-info-page.component.css'], providers: [DatePipe], }) -export class ListInfoComponent { - list: List = {} as List; +export class UserCollectionInfoPageComponent { + list: UserCollection = {} as UserCollection; createdAt: string = ''; updatedAt: string = ''; @@ -29,7 +29,7 @@ export class ListInfoComponent { this.listService.getList(id.toString()).subscribe( (data) => { // Handle the successful reception of data. - this.list = data as unknown as List; + this.list = data as unknown as UserCollection; this.list.entries = this.list.entries as Entry[]; this.createdAt = this.getCreatedDate()?.toString() || ''; diff --git a/frontend/src/app/features/collections/user-collections.module.ts b/frontend/src/app/features/collections/user-collections.module.ts new file mode 100644 index 0000000..57f0b64 --- /dev/null +++ b/frontend/src/app/features/collections/user-collections.module.ts @@ -0,0 +1,33 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { AppRoutingModule } from '../../app-routing.module'; +import { CollectionsRoutingModule } from './collections-routing.module'; +import { SharedModule } from '../../shared/shared.module'; +import { UserCollectionsPageComponent } from './user-collections/userCollections-page/userCollections-page.component'; +import { UserCollectionsListItemComponent } from './user-collections/userCollection-list-item/userCollections-list-item.component'; +import { UserCollectionEntryGridComponent } from './user-collection-info/userCollection-entry-grid/userCollection-entry-grid.component'; +import { UserCollectionGridCardComponent } from './user-collection-info/userCollection-grid-card/userCollection-grid-card.component'; +import { UserCollectionInfoPageComponent } from './user-collection-info/userCollection-info-page/userCollection-info-page.component'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { DragDropModule } from '@angular/cdk/drag-drop'; + +@NgModule({ + declarations: [ + UserCollectionEntryGridComponent, + UserCollectionGridCardComponent, + UserCollectionInfoPageComponent, + + UserCollectionsPageComponent, + UserCollectionsListItemComponent, + ], + imports: [ + CommonModule, + SharedModule, + CollectionsRoutingModule, + FormsModule, + ReactiveFormsModule, + DragDropModule, + ], + exports: [], +}) +export class UserCollectionsModule {} diff --git a/frontend/src/app/features/cards/user-list-item/user-list-item.component.css b/frontend/src/app/features/collections/user-collections/userCollection-list-item/userCollections-list-item.component.css similarity index 100% rename from frontend/src/app/features/cards/user-list-item/user-list-item.component.css rename to frontend/src/app/features/collections/user-collections/userCollection-list-item/userCollections-list-item.component.css diff --git a/frontend/src/app/features/cards/user-list-item/user-list-item.component.html b/frontend/src/app/features/collections/user-collections/userCollection-list-item/userCollections-list-item.component.html similarity index 100% rename from frontend/src/app/features/cards/user-list-item/user-list-item.component.html rename to frontend/src/app/features/collections/user-collections/userCollection-list-item/userCollections-list-item.component.html diff --git a/frontend/src/app/features/collections/user-collections/userCollection-list-item/userCollections-list-item.component.spec.ts b/frontend/src/app/features/collections/user-collections/userCollection-list-item/userCollections-list-item.component.spec.ts new file mode 100644 index 0000000..15c1142 --- /dev/null +++ b/frontend/src/app/features/collections/user-collections/userCollection-list-item/userCollections-list-item.component.spec.ts @@ -0,0 +1,21 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { UserCollectionsListItemComponent } from './userCollections-list-item.component'; + +describe('UserCollectionsListItemComponent', () => { + let component: UserCollectionsListItemComponent; + let fixture: ComponentFixture; + + beforeEach(() => { + TestBed.configureTestingModule({ + declarations: [UserCollectionsListItemComponent] + }); + fixture = TestBed.createComponent(UserCollectionsListItemComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/src/app/features/cards/user-list-item/user-list-item.component.ts b/frontend/src/app/features/collections/user-collections/userCollection-list-item/userCollections-list-item.component.ts similarity index 72% rename from frontend/src/app/features/cards/user-list-item/user-list-item.component.ts rename to frontend/src/app/features/collections/user-collections/userCollection-list-item/userCollections-list-item.component.ts index c9c13e2..d52ca68 100644 --- a/frontend/src/app/features/cards/user-list-item/user-list-item.component.ts +++ b/frontend/src/app/features/collections/user-collections/userCollection-list-item/userCollections-list-item.component.ts @@ -1,13 +1,13 @@ import { Component, Input} from '@angular/core'; -import { List } from '../../../shared/models/list.model'; -import { ListService } from '../../../core/services/list.service'; +import { UserCollection } from '../../../../shared/models/userCollection.model'; +import { ListService } from '../../../../core/services/list.service'; import { Router } from '@angular/router'; import { trigger, transition, style, animate } from '@angular/animations'; @Component({ - selector: 'app-user-list-item', - templateUrl: './user-list-item.component.html', - styleUrls: ['./user-list-item.component.css'], + selector: 'app-userCollections-list-item', + templateUrl: './userCollections-list-item.component.html', + styleUrls: ['./userCollections-list-item.component.css'], animations: [ trigger('fadeInOut', [ transition(':enter', [ @@ -22,8 +22,8 @@ import { trigger, transition, style, animate } from '@angular/animations'; ]), ], }) -export class UserListItemComponent { - @Input() list!: List; +export class UserCollectionsListItemComponent { + @Input() list!: UserCollection; constructor(private listService: ListService, private router: Router) {} diff --git a/frontend/src/app/features/list-info/list-info.component.css b/frontend/src/app/features/collections/user-collections/userCollections-page/userCollections-page.component.css similarity index 100% rename from frontend/src/app/features/list-info/list-info.component.css rename to frontend/src/app/features/collections/user-collections/userCollections-page/userCollections-page.component.css diff --git a/frontend/src/app/features/pages/lists/lists.component.html b/frontend/src/app/features/collections/user-collections/userCollections-page/userCollections-page.component.html similarity index 91% rename from frontend/src/app/features/pages/lists/lists.component.html rename to frontend/src/app/features/collections/user-collections/userCollections-page/userCollections-page.component.html index 04b2b5c..4cce251 100644 --- a/frontend/src/app/features/pages/lists/lists.component.html +++ b/frontend/src/app/features/collections/user-collections/userCollections-page/userCollections-page.component.html @@ -30,7 +30,7 @@
- +
diff --git a/frontend/src/app/features/collections/user-collections/userCollections-page/userCollections-page.component.spec.ts b/frontend/src/app/features/collections/user-collections/userCollections-page/userCollections-page.component.spec.ts new file mode 100644 index 0000000..ee8ea44 --- /dev/null +++ b/frontend/src/app/features/collections/user-collections/userCollections-page/userCollections-page.component.spec.ts @@ -0,0 +1,21 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { UserCollectionsPageComponent } from './userCollections-page.component'; + +describe('UserCollectionsPageComponent', () => { + let component: UserCollectionsPageComponent; + let fixture: ComponentFixture; + + beforeEach(() => { + TestBed.configureTestingModule({ + declarations: [UserCollectionsPageComponent], + }); + fixture = TestBed.createComponent(UserCollectionsPageComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/src/app/features/pages/lists/lists.component.ts b/frontend/src/app/features/collections/user-collections/userCollections-page/userCollections-page.component.ts similarity index 76% rename from frontend/src/app/features/pages/lists/lists.component.ts rename to frontend/src/app/features/collections/user-collections/userCollections-page/userCollections-page.component.ts index 6eb0e8f..3edafdc 100644 --- a/frontend/src/app/features/pages/lists/lists.component.ts +++ b/frontend/src/app/features/collections/user-collections/userCollections-page/userCollections-page.component.ts @@ -1,20 +1,20 @@ import { Component, OnInit } from '@angular/core'; import { FormControl } from '@angular/forms'; -import { List } from '../../../shared/models/list.model'; -import { ListService } from '../../../core/services/list.service'; +import { UserCollection } from '../../../../shared/models/userCollection.model'; +import { ListService } from '../../../../core/services/list.service'; @Component({ - selector: 'app-lists', - templateUrl: './lists.component.html', - styleUrls: ['./lists.component.css'], + selector: 'app-userCollections-page', + templateUrl: './userCollections-page.component.html', + styleUrls: ['./userCollections-page.component.css'], }) -export class ListsComponent implements OnInit { +export class UserCollectionsPageComponent implements OnInit { searchControl = new FormControl(''); showAddButton: boolean = false; listsCount: number = 0; - lists: List[] = []; - listsToShow: List[] = []; + lists: UserCollection[] = []; + listsToShow: UserCollection[] = []; constructor(private listService: ListService) {} diff --git a/frontend/src/app/features/pages/popular/popular.component.css b/frontend/src/app/features/discover/popular/popular.component.css similarity index 100% rename from frontend/src/app/features/pages/popular/popular.component.css rename to frontend/src/app/features/discover/popular/popular.component.css diff --git a/frontend/src/app/features/pages/popular/popular.component.html b/frontend/src/app/features/discover/popular/popular.component.html similarity index 100% rename from frontend/src/app/features/pages/popular/popular.component.html rename to frontend/src/app/features/discover/popular/popular.component.html diff --git a/frontend/src/app/features/pages/popular/popular.component.spec.ts b/frontend/src/app/features/discover/popular/popular.component.spec.ts similarity index 100% rename from frontend/src/app/features/pages/popular/popular.component.spec.ts rename to frontend/src/app/features/discover/popular/popular.component.spec.ts diff --git a/frontend/src/app/features/pages/popular/popular.component.ts b/frontend/src/app/features/discover/popular/popular.component.ts similarity index 100% rename from frontend/src/app/features/pages/popular/popular.component.ts rename to frontend/src/app/features/discover/popular/popular.component.ts index 328779e..3cdbbf5 100644 --- a/frontend/src/app/features/pages/popular/popular.component.ts +++ b/frontend/src/app/features/discover/popular/popular.component.ts @@ -1,6 +1,6 @@ import { Component } from '@angular/core'; -import { Entry } from '../../../shared/models/entry.model'; import { TmdbService } from '../../../core/services/tmdb.service'; +import { Entry } from '../../../shared/models/entry.model'; @Component({ selector: 'app-popular', diff --git a/frontend/src/app/features/pages/search/search.component.css b/frontend/src/app/features/discover/search/search.component.css similarity index 100% rename from frontend/src/app/features/pages/search/search.component.css rename to frontend/src/app/features/discover/search/search.component.css diff --git a/frontend/src/app/features/pages/search/search.component.html b/frontend/src/app/features/discover/search/search.component.html similarity index 100% rename from frontend/src/app/features/pages/search/search.component.html rename to frontend/src/app/features/discover/search/search.component.html diff --git a/frontend/src/app/features/pages/search/search.component.spec.ts b/frontend/src/app/features/discover/search/search.component.spec.ts similarity index 100% rename from frontend/src/app/features/pages/search/search.component.spec.ts rename to frontend/src/app/features/discover/search/search.component.spec.ts diff --git a/frontend/src/app/features/pages/search/search.component.ts b/frontend/src/app/features/discover/search/search.component.ts similarity index 100% rename from frontend/src/app/features/pages/search/search.component.ts rename to frontend/src/app/features/discover/search/search.component.ts index 4f71763..0985336 100644 --- a/frontend/src/app/features/pages/search/search.component.ts +++ b/frontend/src/app/features/discover/search/search.component.ts @@ -1,6 +1,6 @@ import { Component } from '@angular/core'; -import { TmdbService } from '../../../core/services/tmdb.service'; import { Entry } from '../../../shared/models/entry.model'; +import { TmdbService } from '../../../core/services/tmdb.service'; @Component({ selector: 'app-search', diff --git a/frontend/src/app/features/pages/trending/trending.component.css b/frontend/src/app/features/discover/trending/trending.component.css similarity index 100% rename from frontend/src/app/features/pages/trending/trending.component.css rename to frontend/src/app/features/discover/trending/trending.component.css diff --git a/frontend/src/app/features/pages/trending/trending.component.html b/frontend/src/app/features/discover/trending/trending.component.html similarity index 100% rename from frontend/src/app/features/pages/trending/trending.component.html rename to frontend/src/app/features/discover/trending/trending.component.html diff --git a/frontend/src/app/features/pages/trending/trending.component.spec.ts b/frontend/src/app/features/discover/trending/trending.component.spec.ts similarity index 100% rename from frontend/src/app/features/pages/trending/trending.component.spec.ts rename to frontend/src/app/features/discover/trending/trending.component.spec.ts diff --git a/frontend/src/app/features/pages/trending/trending.component.ts b/frontend/src/app/features/discover/trending/trending.component.ts similarity index 100% rename from frontend/src/app/features/pages/trending/trending.component.ts rename to frontend/src/app/features/discover/trending/trending.component.ts diff --git a/frontend/src/app/features/pages/home/home.component.css b/frontend/src/app/features/home/home.component.css similarity index 100% rename from frontend/src/app/features/pages/home/home.component.css rename to frontend/src/app/features/home/home.component.css diff --git a/frontend/src/app/features/pages/home/home.component.html b/frontend/src/app/features/home/home.component.html similarity index 100% rename from frontend/src/app/features/pages/home/home.component.html rename to frontend/src/app/features/home/home.component.html diff --git a/frontend/src/app/features/pages/home/home.component.spec.ts b/frontend/src/app/features/home/home.component.spec.ts similarity index 100% rename from frontend/src/app/features/pages/home/home.component.spec.ts rename to frontend/src/app/features/home/home.component.spec.ts diff --git a/frontend/src/app/features/pages/home/home.component.ts b/frontend/src/app/features/home/home.component.ts similarity index 100% rename from frontend/src/app/features/pages/home/home.component.ts rename to frontend/src/app/features/home/home.component.ts diff --git a/frontend/src/app/features/pages/library/library.component.css b/frontend/src/app/features/library/library.component.css similarity index 100% rename from frontend/src/app/features/pages/library/library.component.css rename to frontend/src/app/features/library/library.component.css diff --git a/frontend/src/app/features/pages/library/library.component.html b/frontend/src/app/features/library/library.component.html similarity index 100% rename from frontend/src/app/features/pages/library/library.component.html rename to frontend/src/app/features/library/library.component.html diff --git a/frontend/src/app/features/pages/library/library.component.spec.ts b/frontend/src/app/features/library/library.component.spec.ts similarity index 100% rename from frontend/src/app/features/pages/library/library.component.spec.ts rename to frontend/src/app/features/library/library.component.spec.ts diff --git a/frontend/src/app/features/pages/library/library.component.ts b/frontend/src/app/features/library/library.component.ts similarity index 95% rename from frontend/src/app/features/pages/library/library.component.ts rename to frontend/src/app/features/library/library.component.ts index fa6806f..5308083 100644 --- a/frontend/src/app/features/pages/library/library.component.ts +++ b/frontend/src/app/features/library/library.component.ts @@ -1,6 +1,6 @@ import { Component } from '@angular/core'; -import { Entry } from '../../../shared/models/entry.model'; -import { LibraryService } from '../../../core/services/library.service'; +import { Entry } from '../../shared/models/entry.model'; +import { LibraryService } from '../../core/services/library.service'; @Component({ selector: 'app-library', diff --git a/frontend/src/app/features/list-info/list-info.component.spec.ts b/frontend/src/app/features/list-info/list-info.component.spec.ts deleted file mode 100644 index 1e4c24c..0000000 --- a/frontend/src/app/features/list-info/list-info.component.spec.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { ListInfoComponent } from './list-info.component'; - -describe('ListInfoComponent', () => { - let component: ListInfoComponent; - let fixture: ComponentFixture; - - beforeEach(() => { - TestBed.configureTestingModule({ - declarations: [ListInfoComponent] - }); - fixture = TestBed.createComponent(ListInfoComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/frontend/src/app/features/pages/lists/lists.component.css b/frontend/src/app/features/pages/lists/lists.component.css deleted file mode 100644 index e69de29..0000000 diff --git a/frontend/src/app/features/pages/lists/lists.component.spec.ts b/frontend/src/app/features/pages/lists/lists.component.spec.ts deleted file mode 100644 index b4172ba..0000000 --- a/frontend/src/app/features/pages/lists/lists.component.spec.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { ListsComponent } from './lists.component'; - -describe('ListsComponent', () => { - let component: ListsComponent; - let fixture: ComponentFixture; - - beforeEach(() => { - TestBed.configureTestingModule({ - declarations: [ListsComponent] - }); - fixture = TestBed.createComponent(ListsComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/frontend/src/app/features/cards/main-card/main-card.component.css b/frontend/src/app/shared/components/cards/main-card/main-card.component.css similarity index 100% rename from frontend/src/app/features/cards/main-card/main-card.component.css rename to frontend/src/app/shared/components/cards/main-card/main-card.component.css diff --git a/frontend/src/app/features/cards/main-card/main-card.component.html b/frontend/src/app/shared/components/cards/main-card/main-card.component.html similarity index 100% rename from frontend/src/app/features/cards/main-card/main-card.component.html rename to frontend/src/app/shared/components/cards/main-card/main-card.component.html diff --git a/frontend/src/app/features/cards/main-card/main-card.component.spec.ts b/frontend/src/app/shared/components/cards/main-card/main-card.component.spec.ts similarity index 100% rename from frontend/src/app/features/cards/main-card/main-card.component.spec.ts rename to frontend/src/app/shared/components/cards/main-card/main-card.component.spec.ts diff --git a/frontend/src/app/features/cards/main-card/main-card.component.ts b/frontend/src/app/shared/components/cards/main-card/main-card.component.ts similarity index 95% rename from frontend/src/app/features/cards/main-card/main-card.component.ts rename to frontend/src/app/shared/components/cards/main-card/main-card.component.ts index 500b5f6..9f11e20 100644 --- a/frontend/src/app/features/cards/main-card/main-card.component.ts +++ b/frontend/src/app/shared/components/cards/main-card/main-card.component.ts @@ -1,9 +1,9 @@ import { Component, Input, OnInit } from '@angular/core'; -import { Entry } from '../../../shared/models/entry.model'; -import { LibraryService } from '../../../core/services/library.service'; import { ListSelectionModalComponent } from '../../modals/list-selection-modal/list-selection-modal.component'; import { MatDialog } from '@angular/material/dialog'; import { trigger, transition, style, animate } from '@angular/animations'; +import { Entry } from '../../../models/entry.model'; +import { LibraryService } from '../../../../core/services/library.service'; @Component({ selector: 'app-main-card', diff --git a/frontend/src/app/features/lists/dynamic-entry-list/dynamic-entry-list.component.css b/frontend/src/app/shared/components/lists/dynamic-entry-list/dynamic-entry-list.component.css similarity index 100% rename from frontend/src/app/features/lists/dynamic-entry-list/dynamic-entry-list.component.css rename to frontend/src/app/shared/components/lists/dynamic-entry-list/dynamic-entry-list.component.css diff --git a/frontend/src/app/features/lists/dynamic-entry-list/dynamic-entry-list.component.html b/frontend/src/app/shared/components/lists/dynamic-entry-list/dynamic-entry-list.component.html similarity index 100% rename from frontend/src/app/features/lists/dynamic-entry-list/dynamic-entry-list.component.html rename to frontend/src/app/shared/components/lists/dynamic-entry-list/dynamic-entry-list.component.html diff --git a/frontend/src/app/features/lists/dynamic-entry-list/dynamic-entry-list.component.spec.ts b/frontend/src/app/shared/components/lists/dynamic-entry-list/dynamic-entry-list.component.spec.ts similarity index 100% rename from frontend/src/app/features/lists/dynamic-entry-list/dynamic-entry-list.component.spec.ts rename to frontend/src/app/shared/components/lists/dynamic-entry-list/dynamic-entry-list.component.spec.ts diff --git a/frontend/src/app/features/lists/dynamic-entry-list/dynamic-entry-list.component.ts b/frontend/src/app/shared/components/lists/dynamic-entry-list/dynamic-entry-list.component.ts similarity index 82% rename from frontend/src/app/features/lists/dynamic-entry-list/dynamic-entry-list.component.ts rename to frontend/src/app/shared/components/lists/dynamic-entry-list/dynamic-entry-list.component.ts index 861d80b..193685b 100644 --- a/frontend/src/app/features/lists/dynamic-entry-list/dynamic-entry-list.component.ts +++ b/frontend/src/app/shared/components/lists/dynamic-entry-list/dynamic-entry-list.component.ts @@ -1,5 +1,5 @@ import { Component, Input } from '@angular/core'; -import { Entry } from '../../../shared/models/entry.model'; +import { Entry } from '../../../../shared/models/entry.model'; @Component({ selector: 'app-dynamic-entry-list', diff --git a/frontend/src/app/features/lists/entry-list/entry-list.component.css b/frontend/src/app/shared/components/lists/entry-list/entry-list.component.css similarity index 100% rename from frontend/src/app/features/lists/entry-list/entry-list.component.css rename to frontend/src/app/shared/components/lists/entry-list/entry-list.component.css diff --git a/frontend/src/app/features/lists/entry-list/entry-list.component.html b/frontend/src/app/shared/components/lists/entry-list/entry-list.component.html similarity index 100% rename from frontend/src/app/features/lists/entry-list/entry-list.component.html rename to frontend/src/app/shared/components/lists/entry-list/entry-list.component.html diff --git a/frontend/src/app/features/lists/entry-list/entry-list.component.spec.ts b/frontend/src/app/shared/components/lists/entry-list/entry-list.component.spec.ts similarity index 100% rename from frontend/src/app/features/lists/entry-list/entry-list.component.spec.ts rename to frontend/src/app/shared/components/lists/entry-list/entry-list.component.spec.ts diff --git a/frontend/src/app/features/lists/entry-list/entry-list.component.ts b/frontend/src/app/shared/components/lists/entry-list/entry-list.component.ts similarity index 100% rename from frontend/src/app/features/lists/entry-list/entry-list.component.ts rename to frontend/src/app/shared/components/lists/entry-list/entry-list.component.ts diff --git a/frontend/src/app/features/modals/list-selection-modal/list-selection-modal.component.css b/frontend/src/app/shared/components/modals/list-selection-modal/list-selection-modal.component.css similarity index 100% rename from frontend/src/app/features/modals/list-selection-modal/list-selection-modal.component.css rename to frontend/src/app/shared/components/modals/list-selection-modal/list-selection-modal.component.css diff --git a/frontend/src/app/features/modals/list-selection-modal/list-selection-modal.component.html b/frontend/src/app/shared/components/modals/list-selection-modal/list-selection-modal.component.html similarity index 100% rename from frontend/src/app/features/modals/list-selection-modal/list-selection-modal.component.html rename to frontend/src/app/shared/components/modals/list-selection-modal/list-selection-modal.component.html diff --git a/frontend/src/app/features/modals/list-selection-modal/list-selection-modal.component.spec.ts b/frontend/src/app/shared/components/modals/list-selection-modal/list-selection-modal.component.spec.ts similarity index 100% rename from frontend/src/app/features/modals/list-selection-modal/list-selection-modal.component.spec.ts rename to frontend/src/app/shared/components/modals/list-selection-modal/list-selection-modal.component.spec.ts diff --git a/frontend/src/app/features/modals/list-selection-modal/list-selection-modal.component.ts b/frontend/src/app/shared/components/modals/list-selection-modal/list-selection-modal.component.ts similarity index 80% rename from frontend/src/app/features/modals/list-selection-modal/list-selection-modal.component.ts rename to frontend/src/app/shared/components/modals/list-selection-modal/list-selection-modal.component.ts index 854b5bf..36ae081 100644 --- a/frontend/src/app/features/modals/list-selection-modal/list-selection-modal.component.ts +++ b/frontend/src/app/shared/components/modals/list-selection-modal/list-selection-modal.component.ts @@ -1,10 +1,11 @@ import { Component, Inject, Input, OnInit, ViewChild } from '@angular/core'; import { FormControl } from '@angular/forms'; import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; -import { ListService } from '../../../core/services/list.service'; -import { List } from '../../../shared/models/list.model'; -import { NotificationPopupComponent } from '../../../shared/notification-popup/notification-popup.component'; -import { NotificationService } from '../../../shared/services/notification.service'; +import { ListService } from '../../../../core/services/list.service'; +import { NotificationPopupComponent } from '../../notification-popup/notification-popup.component'; +import { NotificationService } from '../../../services/notification.service'; +import { UserCollection } from '../../../../shared/models/userCollection.model'; + import { trigger, state, @@ -42,8 +43,8 @@ export class ListSelectionModalComponent implements OnInit { searchControl = new FormControl(''); showAddButton: boolean = false; - lists: List[] = []; - listsToShow: List[] = []; + lists: UserCollection[] = []; + listsToShow: UserCollection[] = []; constructor( public dialogRef: MatDialogRef, @@ -101,7 +102,7 @@ export class ListSelectionModalComponent implements OnInit { createList() { const listName = this.searchControl.value; // string - let myNewList = { name: listName } as List; + let myNewList = { name: listName } as UserCollection; this.listService.createList(myNewList).subscribe(async (list) => { await this.getLists(); @@ -112,7 +113,7 @@ export class ListSelectionModalComponent implements OnInit { return this.showAddButton; } - onSelectionChange(list: List, event: Event): void { + onSelectionChange(list: UserCollection, event: Event): void { const inputElement = event.target as HTMLInputElement; const isChecked = inputElement.checked; @@ -137,19 +138,21 @@ export class ListSelectionModalComponent implements OnInit { }); } else { console.log(`Removing Entry ${this.entryId} from list: ${list.name}`); - this.listService.removeEntryFromList(list.id.toString(), this.entryId).subscribe({ - next: (_) => { - this.showNotification( - 'Entry Removed', - 'Entry removed successfully', - 'success' - ); - }, - error: (error) => { - console.error('Error removing entry:', error); - this.showNotification('Error', 'Failed to remove entry', 'error'); - }, - }); + this.listService + .removeEntryFromList(list.id.toString(), this.entryId) + .subscribe({ + next: (_) => { + this.showNotification( + 'Entry Removed', + 'Entry removed successfully', + 'success' + ); + }, + error: (error) => { + console.error('Error removing entry:', error); + this.showNotification('Error', 'Failed to remove entry', 'error'); + }, + }); } } diff --git a/frontend/src/app/shared/notification-popup/notification-popup.component.css b/frontend/src/app/shared/components/notification-popup/notification-popup.component.css similarity index 100% rename from frontend/src/app/shared/notification-popup/notification-popup.component.css rename to frontend/src/app/shared/components/notification-popup/notification-popup.component.css diff --git a/frontend/src/app/shared/notification-popup/notification-popup.component.html b/frontend/src/app/shared/components/notification-popup/notification-popup.component.html similarity index 100% rename from frontend/src/app/shared/notification-popup/notification-popup.component.html rename to frontend/src/app/shared/components/notification-popup/notification-popup.component.html diff --git a/frontend/src/app/shared/notification-popup/notification-popup.component.spec.ts b/frontend/src/app/shared/components/notification-popup/notification-popup.component.spec.ts similarity index 100% rename from frontend/src/app/shared/notification-popup/notification-popup.component.spec.ts rename to frontend/src/app/shared/components/notification-popup/notification-popup.component.spec.ts diff --git a/frontend/src/app/shared/notification-popup/notification-popup.component.ts b/frontend/src/app/shared/components/notification-popup/notification-popup.component.ts similarity index 100% rename from frontend/src/app/shared/notification-popup/notification-popup.component.ts rename to frontend/src/app/shared/components/notification-popup/notification-popup.component.ts diff --git a/frontend/src/app/shared/models/list.model.ts b/frontend/src/app/shared/models/userCollection.model.ts similarity index 90% rename from frontend/src/app/shared/models/list.model.ts rename to frontend/src/app/shared/models/userCollection.model.ts index 14ce319..034dae6 100644 --- a/frontend/src/app/shared/models/list.model.ts +++ b/frontend/src/app/shared/models/userCollection.model.ts @@ -1,7 +1,7 @@ import { Entry } from './entry.model'; import { ListEntry } from './listEntry.model'; -export interface List { +export interface UserCollection { id: number; name: string; diff --git a/frontend/src/app/core/pipes/date-format/date-format.pipe.spec.ts b/frontend/src/app/shared/pipes/date-format/date-format.pipe.spec.ts similarity index 100% rename from frontend/src/app/core/pipes/date-format/date-format.pipe.spec.ts rename to frontend/src/app/shared/pipes/date-format/date-format.pipe.spec.ts diff --git a/frontend/src/app/core/pipes/date-format/date-format.pipe.ts b/frontend/src/app/shared/pipes/date-format/date-format.pipe.ts similarity index 100% rename from frontend/src/app/core/pipes/date-format/date-format.pipe.ts rename to frontend/src/app/shared/pipes/date-format/date-format.pipe.ts diff --git a/frontend/src/app/shared/services/notification.service.ts b/frontend/src/app/shared/services/notification.service.ts index a053342..1d189a1 100644 --- a/frontend/src/app/shared/services/notification.service.ts +++ b/frontend/src/app/shared/services/notification.service.ts @@ -6,7 +6,7 @@ import { EmbeddedViewRef, ComponentRef, } from '@angular/core'; -import { NotificationPopupComponent } from '../notification-popup/notification-popup.component'; +import { NotificationPopupComponent } from '../components/notification-popup/notification-popup.component'; @Injectable({ providedIn: 'root', diff --git a/frontend/src/app/shared/shared.module.ts b/frontend/src/app/shared/shared.module.ts index cfeba23..2d6d918 100644 --- a/frontend/src/app/shared/shared.module.ts +++ b/frontend/src/app/shared/shared.module.ts @@ -1,10 +1,29 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; -import { NotificationPopupComponent } from './notification-popup/notification-popup.component'; +import { NotificationPopupComponent } from './components/notification-popup/notification-popup.component'; +import { DateFormatPipe } from './pipes/date-format/date-format.pipe'; +import { MainCardComponent } from './components/cards/main-card/main-card.component'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { ListSelectionModalComponent } from './components/modals/list-selection-modal/list-selection-modal.component'; @NgModule({ - declarations: [NotificationPopupComponent], - imports: [CommonModule], - exports: [NotificationPopupComponent], + declarations: [ + // ? pipes + DateFormatPipe, + + // ? components + // NotificationPopupComponent, + // MainCardComponent, + // DynamicEntryListComponent, + // NotificationPopupComponent, + // ListSelectionModalComponent, + + // ? modules + ], + imports: [CommonModule, FormsModule, ReactiveFormsModule], + exports: [ + //NotificationPopupComponent, + DateFormatPipe, + ], }) export class SharedModule {} diff --git a/frontend/src/assets/images/logo3.png b/frontend/src/assets/images/logo3.png new file mode 100644 index 0000000..8ae2e69 Binary files /dev/null and b/frontend/src/assets/images/logo3.png differ