Skip to content

Commit

Permalink
Merge pull request #403 from HSLdevcom/DT-5837
Browse files Browse the repository at this point in the history
DT-5837: Verify data
  • Loading branch information
sharhio authored Aug 28, 2023
2 parents 5d998a3 + 8893291 commit 7f72927
Show file tree
Hide file tree
Showing 12 changed files with 111 additions and 39 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ README.md
docker-compose.yml
node_modules
server/node_modules
**/.env
**/.env.example
6 changes: 3 additions & 3 deletions .github/workflows/next_virtualmonitor-app(dev).yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
if: "!startsWith(github.event.head_commit.message, '[DEPLOY]')"

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
token: ${{ secrets.GIT_SECRET }}
- run: git config --global user.name 'Digitransit'
Expand All @@ -35,8 +35,8 @@ jobs:
if: "startsWith(github.event.head_commit.message, '[DEPLOY]')"
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: azure/docker-login@v1
uses: actions/checkout@v3
- uses: azure/docker-login@v2
with:
login-server: https://index.docker.io/v1/
username: ${{ secrets.AzureAppService_ContainerUsername_43e4c8bef39f4f7d9da4f67dc0bafa48 }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/next_virtualmonitor-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:
runs-on: 'ubuntu-latest'

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: azure/docker-login@v1
- uses: azure/docker-login@v2
with:
login-server: https://index.docker.io/v1/
username: ${{ secrets.AzureAppService_ContainerUsername_43e4c8bef39f4f7d9da4f67dc0bafa48 }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ yarn-debug.log*
yarn-error.log*
yarn.lock
dump.rdb
**/.env
64 changes: 32 additions & 32 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"private": true,
"dependencies": {
"@apollo/client": "^3.3.19",
"@digitransit-component/digitransit-component-autosuggest": "1.9.4",
"@digitransit-component/digitransit-component-autosuggest": "1.9.10",
"@habx/apollo-multi-endpoint-link": "^2.5.0",
"@hsl-fi/modal": "^0.3.1",
"@hsl-fi/site-header": "4.2.2",
Expand Down
15 changes: 15 additions & 0 deletions server/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
MANAGEMENT_API_ID=<>
MANAGEMENT_API_SECRET=<>
REDIS_KEY=<>
REDIS_PORT=<>
APPSETTING_DB_ENDPOINT=<>
APPSETTING_DB_ID=<>
APPSETTING_DB_CONTAINER=<>
OIDC_CLIENT_ID=<>
OIDC_CLIENT_SECRET=<>
OIDCHOST=<>
API_SUBSCRIPTION_QUERY_PARAMETER_NAME=<>
API_SUBSCRIPTION_TOKEN=<>
DEBUGLOGGING=false
MAP_URL=<>

19 changes: 19 additions & 0 deletions server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"description": "Backend for Azure Cosmos DB's SQL API",
"scripts": {
"start": "cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 node server.js",
"start-local": "cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 node -r dotenv/config server.js",
"lint": "eslint *.js --fix --quiet"
},
"dependencies": {
Expand All @@ -30,6 +31,7 @@
"prettier": "^2.8.0",
"eslint": "^8.20.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1"
"eslint-plugin-prettier": "^4.2.1",
"dotenv": "^16.3.1"
}
}
15 changes: 15 additions & 0 deletions src/defaultConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,21 @@ export default {
'lautta',
'OULU',
'digitraffic',
'Rauma',
'Hameenlinna',
'Kotka',
'Kouvola',
'Lappeenranta',
'Mikkeli',
'Vaasa',
'Joensuu',
'FOLI',
'Lahti',
'Kuopio',
'Rovaniemi',
'Kajaani',
'Salo',
'Pori',
],
fonts: {
weights: {
Expand Down
10 changes: 10 additions & 0 deletions src/monitorConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,16 @@ export default {
map: {
inUse: false,
},
stopSearchFilter: stop => {
const props = stop.properties;
if (
props?.id?.includes('GTFS:HSL') &&
props?.addendum?.GTFS?.modes?.includes('RAIL')
) {
return false;
}
return true;
},
},
tampere: {
colors: {
Expand Down
8 changes: 8 additions & 0 deletions src/ui/StopCardRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,14 @@ const StopCardRow: FC<IProps> = ({
const possibleToMove = cards.length > 1;
const possibleToDelete = hasMap ? cards.length > 2 : cards.length > 1;
const filterSearchResults = (results, x) => {
if (config.stopSearchFilter) {
return results
.filter(result => {
const gtfsId = getGTFSId(result.properties.id);
return !columns.left.stops.some(s => s.gtfsId === gtfsId);
})
.filter(config.stopSearchFilter);
}
return results.filter(result => {
const gtfsId = getGTFSId(result.properties.id);
return !columns.left.stops.some(s => s.gtfsId === gtfsId);
Expand Down

0 comments on commit 7f72927

Please sign in to comment.