Skip to content

Commit

Permalink
env to cypress
Browse files Browse the repository at this point in the history
  • Loading branch information
mluena committed Feb 23, 2024
1 parent 0d9d5aa commit ca2d15b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/testing-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,7 @@ jobs:
command: "yarn cypress:open"
working-directory: client
install: false
env:
NEXT_PUBLIC_MAPBOX_API_TOKEN: ${{ secrets.NEXT_PUBLIC_MAPBOX_API_TOKEN }}
NEXT_PUBLIC_API_URL: ${{ secrets.NEXT_PUBLIC_MAPBOX_API_TOKEN }}

2 changes: 1 addition & 1 deletion client/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ yarn-debug.log*
yarn-error.log*

# local env files
.env
.env.local

# vercel
.vercel
Expand Down
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"lucide-react": "^0.252.0",
"mapbox-gl": "2.15.0",
"next": "14.1.0",
"nuqs": "1.17.0",
"postcss": "8.4.24",
"react": "18.2.0",
"react-dom": "18.2.0",
Expand All @@ -71,7 +72,6 @@
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-import": "2.27.5",
"eslint-plugin-prettier": "^4.2.1",
"nuqs": "1.17.0",
"prettier": "^2.8.8",
"prettier-plugin-tailwindcss": "^0.3.0"
}
Expand Down
16 changes: 14 additions & 2 deletions client/src/containers/filters/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,20 @@ export default function Filters() {
const filtersSettingsParsed = flatten(
Object.entries(filtersSettings as FilterSettings).map((filter) => {
if (!Array.isArray(filter[1])) return [];
if (filter[0] === 'intervention' && filter[1].length === INTERVENTION_TYPES.length) return [];
if (filter[0] !== 'intervention' && filter[1].length === AREAS.length) return [];
if (filter[0] === 'intervention' && filter[1].length === INTERVENTION_TYPES.length) {
setFiltersToURL({
...filtersSettings,
intervention: [],
});
return [];
}
if (filter[0] !== 'intervention' && filter[1].length === AREAS.length) {
setFiltersToURL({
...filtersSettings,
[filter[0]]: [],
});
return [];
}
return filter[1].map((f) => ({ [filter[0]]: f }));
})
);
Expand Down

0 comments on commit ca2d15b

Please sign in to comment.