-
Notifications
You must be signed in to change notification settings - Fork 0
feat(formatting): add prettier and format src file #6
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
Open
JohnStamatelos
wants to merge
1
commit into
development
Choose a base branch
from
feature/format-code
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
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 hidden or 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,6 @@ | ||
| { | ||
| "trailingComma": "es5", | ||
| "tabWidth": 2, | ||
| "useEditorConfig": false, | ||
| "singleQuote": true | ||
| } | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -22,6 +22,7 @@ | |
| "@angular/platform-browser": "~13.0.3", | ||
| "@angular/platform-browser-dynamic": "~13.0.3", | ||
| "@angular/router": "~13.0.3", | ||
| "prettier": "^2.5.1", | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add prettier package to start standardising code format to help make code easier to read and also eliminate formatting conflicts |
||
| "rxjs": "~6.6.0", | ||
| "tslib": "^2.3.0", | ||
| "zone.js": "~0.11.4" | ||
|
|
||
This file contains hidden or 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,3 +1,5 @@ | ||
| # October 24 2021 Restructure App | ||
|
|
||
| ## Relocation of Services | ||
|
|
||
| ## Make Services more loosely coupled |
This file contains hidden or 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,12 +1,12 @@ | ||
| import { NgModule } from '@angular/core'; | ||
| import { RouterModule, Routes } from '@angular/router'; | ||
| import { BrowserModule } from '@angular/platform-browser'; | ||
| import {HttpClientModule} from '@angular/common/http'; | ||
| import { HttpClientModule } from '@angular/common/http'; | ||
|
|
||
| const routes: Routes = []; | ||
|
|
||
| @NgModule({ | ||
| imports: [RouterModule.forRoot(routes), BrowserModule, HttpClientModule], | ||
| exports: [RouterModule] | ||
| imports: [RouterModule.forRoot(routes), BrowserModule, HttpClientModule], | ||
| exports: [RouterModule], | ||
| }) | ||
| export class AppRoutingModule { } | ||
| export class AppRoutingModule {} |
This file contains hidden or 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 hidden or 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 hidden or 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,56 +1,117 @@ | ||
| import {Component} from '@angular/core'; | ||
| import {from, Observable, of, OperatorFunction} from 'rxjs'; | ||
| import {debounceTime, distinctUntilChanged, map, tap} from 'rxjs/operators'; | ||
| import { Component } from '@angular/core'; | ||
| import { from, Observable, of, OperatorFunction } from 'rxjs'; | ||
| import { debounceTime, distinctUntilChanged, map, tap } from 'rxjs/operators'; | ||
| import { HttpService } from '../services/http/http.service'; | ||
| import { WeatherInfo , CityLocation} from '../response-interfaces/response-interfaces'; | ||
| import { | ||
| WeatherInfo, | ||
| CityLocation, | ||
| } from '../response-interfaces/response-interfaces'; | ||
|
|
||
|
|
||
| const states = ['Alabama', 'Alaska', 'American Samoa', 'Arizona', 'Arkansas', 'California', 'Colorado', | ||
| 'Connecticut', 'Delaware', 'District Of Columbia', 'Federated States Of Micronesia', 'Florida', 'Georgia', | ||
| 'Guam', 'Hawaii', 'Idaho', 'Illinois', 'Indiana', 'Iowa', 'Kansas', 'Kentucky', 'Louisiana', 'Maine', | ||
| 'Marshall Islands', 'Maryland', 'Massachusetts', 'Michigan', 'Minnesota', 'Mississippi', 'Missouri', 'Montana', | ||
| 'Nebraska', 'Nevada', 'New Hampshire', 'New Jersey', 'New Mexico', 'New York', 'North Carolina', 'North Dakota', | ||
| 'Northern Mariana Islands', 'Ohio', 'Oklahoma', 'Oregon', 'Palau', 'Pennsylvania', 'Puerto Rico', 'Rhode Island', | ||
| 'South Carolina', 'South Dakota', 'Tennessee', 'Texas', 'Utah', 'Vermont', 'Virgin Islands', 'Virginia', | ||
| 'Washington', 'West Virginia', 'Wisconsin', 'Wyoming']; | ||
| const states = [ | ||
| 'Alabama', | ||
| 'Alaska', | ||
| 'American Samoa', | ||
| 'Arizona', | ||
| 'Arkansas', | ||
| 'California', | ||
| 'Colorado', | ||
| 'Connecticut', | ||
| 'Delaware', | ||
| 'District Of Columbia', | ||
| 'Federated States Of Micronesia', | ||
| 'Florida', | ||
| 'Georgia', | ||
| 'Guam', | ||
| 'Hawaii', | ||
| 'Idaho', | ||
| 'Illinois', | ||
| 'Indiana', | ||
| 'Iowa', | ||
| 'Kansas', | ||
| 'Kentucky', | ||
| 'Louisiana', | ||
| 'Maine', | ||
| 'Marshall Islands', | ||
| 'Maryland', | ||
| 'Massachusetts', | ||
| 'Michigan', | ||
| 'Minnesota', | ||
| 'Mississippi', | ||
| 'Missouri', | ||
| 'Montana', | ||
| 'Nebraska', | ||
| 'Nevada', | ||
| 'New Hampshire', | ||
| 'New Jersey', | ||
| 'New Mexico', | ||
| 'New York', | ||
| 'North Carolina', | ||
| 'North Dakota', | ||
| 'Northern Mariana Islands', | ||
| 'Ohio', | ||
| 'Oklahoma', | ||
| 'Oregon', | ||
| 'Palau', | ||
| 'Pennsylvania', | ||
| 'Puerto Rico', | ||
| 'Rhode Island', | ||
| 'South Carolina', | ||
| 'South Dakota', | ||
| 'Tennessee', | ||
| 'Texas', | ||
| 'Utah', | ||
| 'Vermont', | ||
| 'Virgin Islands', | ||
| 'Virginia', | ||
| 'Washington', | ||
| 'West Virginia', | ||
| 'Wisconsin', | ||
| 'Wyoming', | ||
| ]; | ||
|
|
||
| @Component({ | ||
| selector: 'app-city-search', | ||
| templateUrl: './city-search.component.html', | ||
| styles: [`.form-control { width: 300px; }`] | ||
| styles: [ | ||
| ` | ||
| .form-control { | ||
| width: 300px; | ||
| } | ||
| `, | ||
| ], | ||
| }) | ||
| export class CitySearchComponent { | ||
| public model: any; | ||
| public location!: CityLocation[]; | ||
|
|
||
| constructor(private httpService: HttpService) { | ||
|
|
||
| } | ||
| constructor(private httpService: HttpService) {} | ||
|
|
||
| search: OperatorFunction<string, readonly string[]> = (text$: Observable<string>) => | ||
| search: OperatorFunction<string, readonly string[]> = ( | ||
| text$: Observable<string> | ||
| ) => | ||
| text$.pipe( | ||
| debounceTime(300), | ||
| distinctUntilChanged(), | ||
| tap(r=> this.getCity()), | ||
| map(term => term.length < 2 ? [] | ||
| : this.handleArryOfLocationData(term) ) // TODO: investigate slice amount // | ||
| ) | ||
|
|
||
| handleArryOfLocationData(term : string):string[]{ | ||
| let cities = [this.location[0].name]; | ||
| return cities.filter(v => v.toLowerCase().indexOf(term.toLowerCase()) > -1).slice(0, 10) | ||
| // return [""]; | ||
| } | ||
| tap((r) => this.getCity()), | ||
| map((term) => | ||
| term.length < 2 ? [] : this.handleArryOfLocationData(term) | ||
| ) // TODO: investigate slice amount // | ||
| ); | ||
|
|
||
| getCity() { | ||
| // TODO have to change httpservice to take url | ||
| // const weatherInfo$ = this.httpService.getWeather('c19fda244ae14731aa532946210710') ; // TODo hide westher key | ||
| // weatherInfo$.subscribe( w => { | ||
| // console.log(w.location); | ||
| // this.location = [w.location] ; | ||
| // }); | ||
|
|
||
|
|
||
| } | ||
| handleArryOfLocationData(term: string): string[] { | ||
| let cities = [this.location[0].name]; | ||
| return cities | ||
| .filter((v) => v.toLowerCase().indexOf(term.toLowerCase()) > -1) | ||
| .slice(0, 10); | ||
| // return [""]; | ||
| } | ||
|
|
||
| getCity() { | ||
| // TODO have to change httpservice to take url | ||
| // const weatherInfo$ = this.httpService.getWeather('c19fda244ae14731aa532946210710') ; // TODo hide westher key | ||
| // weatherInfo$.subscribe( w => { | ||
| // console.log(w.location); | ||
| // this.location = [w.location] ; | ||
| // }); | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
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.
Added some 'suggested' standards here, happy to update or change as needed