Skip to content
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

Feature/valhalla #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ jobs:
restore-keys: |
${{runner.os}}-yarn-

- name: Add secret to '.npmrc' file
run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.COMPLEX_CELERY_CI }}" > ~/.npmrc

- name: Install
run: yarn install --frozen-lockfile

Expand Down Expand Up @@ -68,9 +71,9 @@ jobs:
- name: Add to codecov
uses: codecov/codecov-action@v2

- name: Deploy to Heroku
uses: akhileshns/[email protected]
with:
heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
heroku_app_name: 'complex-celery-github'
heroku_email: '[email protected]'
# - name: Deploy to Heroku
# uses: akhileshns/[email protected]
# with:
# heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
# heroku_app_name: 'complex-celery-github'
# heroku_email: '[email protected]'
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@michael2gray:registry=https://npm.pkg.github.com/
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"**/*": "prettier --write --ignore-unknown"
},
"dependencies": {
"@michael2gray/valhalla": "1.11.0",
"axios": "^0.24.0",
"clsx": "^1.1.1",
"date-fns": "^2.28.0",
Expand Down
21 changes: 10 additions & 11 deletions src/app/modules/city/routes/city.route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,16 @@ export const CityRoute = () => {
return (
<CountriesProvider city={city}>
<CountriesConsumer>
{(state) => {
const isoCode = state?.isoCode ?? DEFAULT_ISO_CODE;

return (
<CityProvider city={city} location={`${city.name},${isoCode}`}>
<Page>
<City />
</Page>
</CityProvider>
);
}}
{(state) => (
<CityProvider
city={city}
location={`${city.name},${state?.isoCode ?? DEFAULT_ISO_CODE}`}
>
<Page>
<City />
</Page>
</CityProvider>
)}
</CountriesConsumer>
</CountriesProvider>
);
Expand Down
10 changes: 5 additions & 5 deletions src/app/modules/country/utils/country.util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ export const getKnownNullCountry = (city: string): string => {
export const getCountriesFromCities = (
cities: City[]
): Omit<Country, 'weather'>[] => {
const citiesByCountry = _groupBy(cities, 'country');
const CITIES_BY_COUNTRY = _groupBy(cities, 'country');

const countries: Omit<Country, 'weather'>[] = [];
const COUNTRIES: Omit<Country, 'weather'>[] = [];

for (const [key, value] of Object.entries(citiesByCountry)) {
countries.push({
for (const [key, value] of Object.entries(CITIES_BY_COUNTRY)) {
COUNTRIES.push({
name: key,
cities: value,
coords: COUNTRY_LAT_LNGS[key],
});
}

return _orderBy(countries, 'name');
return _orderBy(COUNTRIES, 'name');
};
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1592,6 +1592,11 @@
resolved "https://registry.yarnpkg.com/@mdx-js/util/-/util-1.6.22.tgz#219dfd89ae5b97a8801f015323ffa4b62f45718b"
integrity sha512-H1rQc1ZOHANWBvPcW+JpGwr+juXSxM8Q8YCkm3GhZd8REu1fHR3z99CErO1p9pkcfcxZnMdIZdIsXkOHY0NilA==

"@michael2gray/[email protected]":
version "1.11.0"
resolved "https://npm.pkg.github.com/download/@michael2gray/valhalla/1.11.0/47c1c8f3a92756a10e59c1c0487d04402efc7f7b183c70998f9a83beaf4145f6#ff2152539e9adb2ff23e24fdf340850f638e28b2"
integrity sha512-gbYGfke/C4mNdam7a75/E92G+P8yxU60tvV4I+lTl4FQdElWpi2xBXKt5qQSQqSjKJxk2SEzkLsIcq+ZF3TIpQ==

"@mrmlnc/readdir-enhanced@^2.2.1":
version "2.2.1"
resolved "https://registry.yarnpkg.com/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz#524af240d1a360527b730475ecfa1344aa540dde"
Expand Down