diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 5276c0ebe5..703ca5d732 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,35 +1,21 @@ import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; -import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -<<<<<<< HEAD import { AppRoutingModule } from './app-routing.module'; -======= +import { AppComponent } from './app.component'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { HeaderComponent } from './header/header.component'; import { ShellModule } from './shell/shell.module'; ->>>>>>> origin/develop import { FlexLayoutModule } from '@angular/flex-layout'; - - import { AppState } from './shared/store/app.state'; import { NgxsModule } from '@ngxs/store'; import { NgxsReduxDevtoolsPluginModule } from '@ngxs/devtools-plugin'; import { NgxsLoggerPluginModule } from '@ngxs/logger-plugin'; import { environment } from 'src/environments/environment'; -import { AppComponent } from './app.component'; -import { HeaderComponent } from './header/header.component'; -import { ShellModule } from './shell/shell.module'; -import { ShellComponent } from './shell/shell.component'; - @NgModule({ declarations: [ AppComponent, -<<<<<<< HEAD - HeaderComponent, - ShellComponent, -======= HeaderComponent ->>>>>>> origin/develop ], imports: [ BrowserModule, diff --git a/src/app/shared/result.actions.ts b/src/app/shared/result.actions.ts new file mode 100644 index 0000000000..2b7ad15dc9 --- /dev/null +++ b/src/app/shared/result.actions.ts @@ -0,0 +1,4 @@ +export class UpdateCurrentView { + static readonly type = '[Result] EditView'; + constructor(public payload: string) {} +} diff --git a/src/app/shell/main/main.component.html b/src/app/shell/main/main.component.html index 2b3e4bdb13..7840cf3914 100644 --- a/src/app/shell/main/main.component.html +++ b/src/app/shell/main/main.component.html @@ -1 +1,2 @@ + diff --git a/src/app/shell/main/result/hobby-groups-list/hobby-groups-list.component.html b/src/app/shell/main/result/hobby-groups-list/hobby-groups-list.component.html new file mode 100644 index 0000000000..034be4b737 --- /dev/null +++ b/src/app/shell/main/result/hobby-groups-list/hobby-groups-list.component.html @@ -0,0 +1 @@ +

hobby-groups-list works!

diff --git a/src/app/shell/main/result/hobby-groups-list/hobby-groups-list.component.scss b/src/app/shell/main/result/hobby-groups-list/hobby-groups-list.component.scss new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/app/shell/main/result/hobby-groups-list/hobby-groups-list.component.spec.ts b/src/app/shell/main/result/hobby-groups-list/hobby-groups-list.component.spec.ts new file mode 100644 index 0000000000..634aa8c746 --- /dev/null +++ b/src/app/shell/main/result/hobby-groups-list/hobby-groups-list.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { HobbyGroupsListComponent } from './hobby-groups-list.component'; + +describe('HobbyGroupsListComponent', () => { + let component: HobbyGroupsListComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ HobbyGroupsListComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(HobbyGroupsListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/shell/main/result/hobby-groups-list/hobby-groups-list.component.ts b/src/app/shell/main/result/hobby-groups-list/hobby-groups-list.component.ts new file mode 100644 index 0000000000..0bb2318bf0 --- /dev/null +++ b/src/app/shell/main/result/hobby-groups-list/hobby-groups-list.component.ts @@ -0,0 +1,23 @@ +import { Component, OnInit } from '@angular/core'; +import { Observable } from 'rxjs'; +import { Store } from '@ngxs/store'; + +@Component({ + selector: 'app-hobby-groups-list', + templateUrl: './hobby-groups-list.component.html', + styleUrls: ['./hobby-groups-list.component.scss'] +}) +export class HobbyGroupsListComponent implements OnInit { + stateCards: Observable; + public cards: Array = []; + + constructor(private store: Store) { + this.stateCards = this.store.select(state => state.ShowData); + // To do: change "state.ShowData" when state will be configured + } + + ngOnInit(): void { + this.stateCards.subscribe((data) => this.cards = data); + } + +} diff --git a/src/app/shell/main/result/map/map.component.html b/src/app/shell/main/result/map/map.component.html new file mode 100644 index 0000000000..088f942e33 --- /dev/null +++ b/src/app/shell/main/result/map/map.component.html @@ -0,0 +1 @@ +

map works!

diff --git a/src/app/shell/main/result/map/map.component.scss b/src/app/shell/main/result/map/map.component.scss new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/app/shell/main/result/map/map.component.spec.ts b/src/app/shell/main/result/map/map.component.spec.ts new file mode 100644 index 0000000000..f163147974 --- /dev/null +++ b/src/app/shell/main/result/map/map.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { MapComponent } from './map.component'; + +describe('MapComponent', () => { + let component: MapComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ MapComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(MapComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/shell/main/result/map/map.component.ts b/src/app/shell/main/result/map/map.component.ts new file mode 100644 index 0000000000..4dc118f02b --- /dev/null +++ b/src/app/shell/main/result/map/map.component.ts @@ -0,0 +1,23 @@ +import { Component, OnInit } from '@angular/core'; +import { Observable } from 'rxjs'; +import { Store } from '@ngxs/store'; + +@Component({ + selector: 'app-map', + templateUrl: './map.component.html', + styleUrls: ['./map.component.scss'] +}) +export class MapComponent implements OnInit { + stateMarkers: Observable; + public markers: Array = []; + + constructor(private store: Store) { + this.stateMarkers = this.store.select(state => state.ShowData); + // To do: change "state.ShowData" when state will be configured + } + + ngOnInit(): void { + this.stateMarkers.subscribe((data) => this.markers = data); + } + +} diff --git a/src/app/shell/main/result/result.component.html b/src/app/shell/main/result/result.component.html new file mode 100644 index 0000000000..25b4e7db1b --- /dev/null +++ b/src/app/shell/main/result/result.component.html @@ -0,0 +1,14 @@ + + + Список + + + Карта + + +
+ +
+ + + diff --git a/src/app/shell/main/result/result.component.scss b/src/app/shell/main/result/result.component.scss new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/app/shell/main/result/result.component.spec.ts b/src/app/shell/main/result/result.component.spec.ts new file mode 100644 index 0000000000..53c0eedd9a --- /dev/null +++ b/src/app/shell/main/result/result.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ResultComponent } from './result.component'; + +describe('ResultComponent', () => { + let component: ResultComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ ResultComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(ResultComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/shell/main/result/result.component.ts b/src/app/shell/main/result/result.component.ts new file mode 100644 index 0000000000..846d37c54f --- /dev/null +++ b/src/app/shell/main/result/result.component.ts @@ -0,0 +1,25 @@ +import { Component, OnInit } from '@angular/core'; +import { UpdateCurrentView } from '../../../shared/result.actions'; +import { Store } from '@ngxs/store'; + +@Component({ + selector: 'app-result', + templateUrl: './result.component.html', + styleUrls: ['./result.component.scss'] +}) +export class ResultComponent implements OnInit { + public currentView: string; + + constructor(private store: Store) {} + + ngOnInit(): void { + this.currentView ='show-data'; + } + + public SetCurrentView(view: string) { + this.currentView = view; + this.store.dispatch(new UpdateCurrentView(view)); + // To do: finish action when state will be configured + } + +} diff --git a/src/app/shell/shell-routing.module.ts b/src/app/shell/shell-routing.module.ts index b7df122db4..8030ba830f 100644 --- a/src/app/shell/shell-routing.module.ts +++ b/src/app/shell/shell-routing.module.ts @@ -1,9 +1,11 @@ import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; import { MainComponent } from './main/main.component'; +import { ResultComponent } from './main/result/result.component'; const routes: Routes = [ - { path: '', component: MainComponent } + { path: '', component: MainComponent }, + { path: 'result', component: ResultComponent } ]; @NgModule({ diff --git a/src/app/shell/shell.component.html b/src/app/shell/shell.component.html index 90c6b64632..0680b43f9c 100644 --- a/src/app/shell/shell.component.html +++ b/src/app/shell/shell.component.html @@ -1 +1 @@ - \ No newline at end of file + diff --git a/src/app/shell/shell.module.ts b/src/app/shell/shell.module.ts index c8c12176d9..47be6236fd 100644 --- a/src/app/shell/shell.module.ts +++ b/src/app/shell/shell.module.ts @@ -6,6 +6,10 @@ import { FlexLayoutModule } from '@angular/flex-layout'; import { ShellRoutingModule } from './shell-routing.module'; import { ShellComponent } from './shell.component'; +import { ResultComponent } from './main/result/result.component'; +import { HobbyGroupsListComponent } from './main/result/hobby-groups-list/hobby-groups-list.component'; +import { MapComponent } from './main/result/map/map.component'; +import {MatButtonToggleModule} from '@angular/material/button-toggle'; import { MainComponent } from './main/main.component'; import { FiltersListComponent } from './main/filters-list/filters-list.component'; @@ -18,29 +22,25 @@ import { CategoriesFilterComponent } from './main/filters-list/categories-filter @NgModule({ declarations: [ MainComponent, -<<<<<<< HEAD + ShellComponent, + ResultComponent, + HobbyGroupsListComponent, + MapComponent, FiltersListComponent, AgeFilterComponent, SearchbarComponent, OwnershipTypeFilterComponent, CategoriesFilterComponent -======= - ShellComponent ->>>>>>> origin/develop ], imports: [ CommonModule, RouterModule, -<<<<<<< HEAD ShellRoutingModule, MatButtonModule, FlexLayoutModule -======= - ShellRoutingModule ], exports: [ ShellComponent ->>>>>>> origin/develop ] }) export class ShellModule { }