Skip to content

Commit 1b4c9a5

Browse files
committed
Add favicon.png, fix routing, and fix workflows.
1 parent d85c4fb commit 1b4c9a5

File tree

9 files changed

+33
-15
lines changed

9 files changed

+33
-15
lines changed

.github/workflows/dev-pipeline.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
node-version: [16.x]
14+
node-version: [20.x]
1515
steps:
1616
- name: Checkout
1717
uses: actions/checkout@v3
@@ -53,3 +53,5 @@ jobs:
5353
env:
5454
DOCKER_USER: ${{ secrets.DOCKER_USER }}
5555
DOCKER_AUTH: ${{ secrets.DOCKER_AUTH }}
56+
REACT_APP_API_SUBSCRIPTION_KEY: ${{ secrets.REACT_APP_API_SUBSCRIPTION_KEY }}
57+
REACT_APP_DEV_API_SUBSCRIPTION_KEY: ${{ secrets.REACT_APP_DEV_API_SUBSCRIPTION_KEY }}

.github/workflows/prod-pipeline.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@ jobs:
2323
env:
2424
DOCKER_USER: ${{ secrets.DOCKER_USER }}
2525
DOCKER_AUTH: ${{ secrets.DOCKER_AUTH }}
26+
REACT_APP_API_SUBSCRIPTION_KEY: ${{ secrets.REACT_APP_API_SUBSCRIPTION_KEY }}
27+
REACT_APP_DEV_API_SUBSCRIPTION_KEY: ${{ secrets.REACT_APP_DEV_API_SUBSCRIPTION_KEY }}

public/favicon.png

2.77 KB
Loading

public/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />
5-
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
5+
<link rel="icon" href="%PUBLIC_URL%/favicon.png" />
66
<meta name="viewport" content="width=device-width, initial-scale=1" />
77
<!--
88
manifest.json provides metadata used when your web app is installed on a
@@ -14,7 +14,7 @@
1414
It will be replaced with the URL of the `public` folder during the build.
1515
Only files inside the `public` folder can be referenced from the HTML.
1616
17-
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
17+
Unlike "/favicon.png" or "favicon.png", "%PUBLIC_URL%/favicon.png" will
1818
work correctly both with client-side routing and a non-root public URL.
1919
Learn how to configure a non-root public URL by running `npm run build`.
2020
-->

public/manifest.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
"name": "GraphiQL deployment",
44
"icons": [
55
{
6-
"src": "favicon.ico",
7-
"sizes": "64x64 32x32 24x24 16x16",
8-
"type": "image/x-icon"
6+
"src": "favicon.png",
7+
"sizes": " 96x96 64x64 32x32 24x24 16x16",
8+
"type": "image/png"
99
}
1010
],
1111
"start_url": ".",

src/graphiql/DefaultApiRoute.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
import React from 'react';
2-
import { useParams } from 'react-router-dom';
3-
import { API_VERSION_2, DIALECT_VERSION_1, CONFIG_LIST } from '../config';
2+
import { useParams, Navigate } from 'react-router-dom';
3+
import {
4+
API_VERSION_2,
5+
DIALECT_VERSION_1,
6+
CONFIG_LIST,
7+
DEFAULT_PATH,
8+
} from '../config';
49
import { getApiConfig } from './utils';
510
import CustomGraphiQL from './CustomGraphiQL';
611

@@ -13,5 +18,8 @@ export default () => {
1318
'gtfs',
1419
DIALECT_VERSION_1,
1520
);
21+
if (!config) {
22+
return <Navigate to={DEFAULT_PATH} />;
23+
}
1624
return <CustomGraphiQL config={config} configList={CONFIG_LIST} />;
1725
};

src/graphiql/Version1ApiRoute.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
import React from 'react';
2-
import { useParams } from 'react-router-dom';
3-
import { API_VERSION_1, CONFIG_LIST } from '../config';
2+
import { useParams, Navigate } from 'react-router-dom';
3+
import { API_VERSION_1, CONFIG_LIST, DEFAULT_PATH } from '../config';
44
import { getApiConfig } from './utils';
55
import CustomGraphiQL from './CustomGraphiQL';
66

77
export default () => {
88
const { router } = useParams();
99
const config = getApiConfig(CONFIG_LIST, router, API_VERSION_1);
10+
if (!config) {
11+
return <Navigate to={DEFAULT_PATH} />;
12+
}
1013
return <CustomGraphiQL config={config} configList={CONFIG_LIST} />;
1114
};

src/graphiql/Version2ApiRoute.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
2-
import { useParams } from 'react-router-dom';
3-
import { API_VERSION_2, CONFIG_LIST } from '../config';
2+
import { useParams, Navigate } from 'react-router-dom';
3+
import { API_VERSION_2, CONFIG_LIST, DEFAULT_PATH } from '../config';
44
import { getApiConfig } from './utils';
55
import CustomGraphiQL from './CustomGraphiQL';
66

@@ -13,5 +13,8 @@ export default () => {
1313
dialect,
1414
dialectVersion,
1515
);
16+
if (!config) {
17+
return <Navigate to={DEFAULT_PATH} />;
18+
}
1619
return <CustomGraphiQL config={config} configList={CONFIG_LIST} />;
1720
};

src/graphiql/utils.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ export function getPath(
5656
dialectVersion,
5757
) {
5858
if (isDefault) {
59-
return `/${router}`;
59+
return `/graphiql/${router}`;
6060
}
6161

6262
return apiVersion === API_VERSION_2
63-
? `/${router}/${apiVersion}/${dialect}/${dialectVersion}`
64-
: `/${router}/${apiVersion}`;
63+
? `/graphiql/${router}/${apiVersion}/${dialect}/${dialectVersion}`
64+
: `/graphiql/${router}/${apiVersion}`;
6565
}
6666

6767
export function getQueryString(query, variables, operationName) {

0 commit comments

Comments
 (0)