-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#19 create results layout #22
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a12ac48
created result component
fd49d92
recreated result component, created list & map components with routes
1d70b01
added routes for map and show-data components, saved current view
0ab8445
added app-result tag
87ae558
fixed pull request
d9c39ce
Merge branch 'develop' into #19_create_results_layout
NabokinAlexandr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aria-label must be meaningful