-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* created result component * recreated result component, created list & map components with routes * added routes for map and show-data components, saved current view * added app-result tag * fixed pull request
- Loading branch information
1 parent
4896862
commit 06b227f
Showing
18 changed files
with
181 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export class UpdateCurrentView { | ||
static readonly type = '[Result] EditView'; | ||
constructor(public payload: string) {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
<app-filters-list></app-filters-list> | ||
<app-result></app-result> |
1 change: 1 addition & 0 deletions
1
src/app/shell/main/result/hobby-groups-list/hobby-groups-list.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<p>hobby-groups-list works!</p> |
Empty file.
25 changes: 25 additions & 0 deletions
25
src/app/shell/main/result/hobby-groups-list/hobby-groups-list.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<HobbyGroupsListComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [ HobbyGroupsListComponent ] | ||
}) | ||
.compileComponents(); | ||
}); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(HobbyGroupsListComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
23 changes: 23 additions & 0 deletions
23
src/app/shell/main/result/hobby-groups-list/hobby-groups-list.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<Object[]>; | ||
public cards: Array<Object> = []; | ||
|
||
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); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<p>map works!</p> |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { MapComponent } from './map.component'; | ||
|
||
describe('MapComponent', () => { | ||
let component: MapComponent; | ||
let fixture: ComponentFixture<MapComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [ MapComponent ] | ||
}) | ||
.compileComponents(); | ||
}); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(MapComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<Object[]>; | ||
public markers: Array<Object> = []; | ||
|
||
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); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<mat-button-toggle-group #group="matButtonToggleGroup" [value]="currentView" (change)="SetCurrentView(group.value)"> | ||
<mat-button-toggle value="show-data" aria-label="show-data"> | ||
Список | ||
</mat-button-toggle> | ||
<mat-button-toggle value="map" aria-label="map"> | ||
Карта | ||
</mat-button-toggle> | ||
</mat-button-toggle-group> | ||
<div *ngIf="group.value==='map'; else ShowData"> | ||
<app-map></app-map> | ||
</div> | ||
<ng-template #ShowData> | ||
<app-hobby-groups-list></app-hobby-groups-list> | ||
</ng-template> |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { ResultComponent } from './result.component'; | ||
|
||
describe('ResultComponent', () => { | ||
let component: ResultComponent; | ||
let fixture: ComponentFixture<ResultComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [ ResultComponent ] | ||
}) | ||
.compileComponents(); | ||
}); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(ResultComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<router-outlet></router-outlet> | ||
<router-outlet></router-outlet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters