Skip to content

Commit f52a68a

Browse files
authored
Merge pull request #142 from overture-stack/rc/4.1.0
🔖 Rc/4.1.0
2 parents 589c097 + c036b84 commit f52a68a

File tree

11 files changed

+159
-115
lines changed

11 files changed

+159
-115
lines changed

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
22
"editor.formatOnSave": true,
3-
"editor.tabSize": 2
3+
"editor.tabSize": 2,
4+
"files.insertFinalNewline": true
45
}

Dockerfile

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,10 @@
1-
#######################
2-
# Builder
3-
#######################
4-
FROM node:11.15.0 as builder
1+
FROM node:14.16.0-alpine
52

63
WORKDIR /usr/src/app
74

85
COPY . .
96

10-
ENV REACT_APP_API=REACT_APP_API_PLACEHOLDER
11-
ENV REACT_APP_EGO_CLIENT_ID=REACT_APP_EGO_CLIENT_ID_PLACEHOLDER
12-
13-
RUN yarn install && yarn build
14-
15-
#######################
16-
# Server
17-
#######################
18-
FROM nginx:1.17.8-alpine
19-
20-
COPY --from=builder /usr/src/app/build /usr/share/nginx/html
21-
COPY nginx/default.conf.template /etc/nginx/conf.d/default.conf.template
22-
COPY nginx/nginx.conf /etc/nginx/nginx.conf
7+
RUN yarn install
238

249
ENV EGO_UI_USER=egoui
2510
ENV EGO_UI_UID=9999
@@ -30,14 +15,16 @@ ENV PORT=8080
3015

3116
RUN addgroup -S -g $EGO_UI_GID $EGO_UI_USER \
3217
&& adduser -S -u $EGO_UI_UID -G $EGO_UI_USER $EGO_UI_USER \
33-
&& chown -R $EGO_UI_UID:$EGO_UI_GID /etc/nginx/conf.d \
34-
&& chown -R $EGO_UI_UID:$EGO_UI_GID /var/cache \
35-
&& chown -R $EGO_UI_UID:$EGO_UI_GID /var/log/nginx \
36-
&& chown -R $EGO_UI_UID:$EGO_UI_GID /run
18+
&& chown -R $EGO_UI_UID:$EGO_UI_GID /usr/src/app
3719

38-
# default client_id is set to ego
20+
# defaults
3921
ENV REACT_APP_EGO_CLIENT_ID=ego
22+
ENV REACT_APP_API=http://localhost:8081/
23+
# public_url for compiling assets
24+
ENV PUBLIC_URL="/"
25+
# for the Router component basename
26+
ENV REACT_APP_PUBLIC_PATH="/"
4027

4128
USER $EGO_UI_UID
4229

43-
CMD uri=\$uri envsubst < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf && exec nginx -g 'daemon off;'
30+
CMD ["yarn", "run", "serve", "-l", "8080"]

nginx/default.conf.template

Lines changed: 0 additions & 22 deletions
This file was deleted.

nginx/nginx.conf

Lines changed: 0 additions & 32 deletions
This file was deleted.

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "auth-ui",
3-
"version": "4.0.0",
3+
"version": "4.1.0",
44
"private": true,
55
"dependencies": {
66
"axios": "^0.21.1",
@@ -28,11 +28,16 @@
2828
"recompose": "^0.26.0",
2929
"semantic-ui-css": "2.2.12",
3030
"semantic-ui-react": "^0.81.1",
31+
"serve": "^11.3.2",
3132
"url-join": "^2.0.2",
3233
"vanilla-ripplejs": "^1.0.3"
3334
},
35+
"bin": {
36+
"serve": "./node_modules/.bin/serve"
37+
},
3438
"scripts": {
3539
"start": "react-scripts-ts start",
40+
"serve": "npm run build && NODE_ENV=production serve -s build",
3641
"build": "react-scripts-ts build",
3742
"test": "react-scripts-ts test --env=jsdom",
3843
"eject": "react-scripts-ts eject",

public/index.html

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
<!doctype html>
1+
<!DOCTYPE html>
22
<html lang="en">
3-
4-
<head>
5-
<meta charset="utf-8">
6-
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
7-
<meta name="theme-color" content="#000000">
8-
<!--
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
6+
<meta name="theme-color" content="#000000" />
7+
<!--
98
manifest.json provides metadata used when your web app is added to the
109
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
1110
-->
12-
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
13-
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
14-
<!--
11+
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
12+
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
13+
<!--
1514
Notice the use of %PUBLIC_URL% in the tags above.
1615
It will be replaced with the URL of the `public` folder during the build.
1716
Only files inside the `public` folder can be referenced from the HTML.
@@ -20,16 +19,21 @@
2019
work correctly both with client-side routing and a non-root public URL.
2120
Learn how to configure a non-root public URL by running `npm run build`.
2221
-->
23-
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.0/css/all.css" integrity="sha384-lZN37f5QGtY3VHgisS14W3ExzMWZxybE1SJSEsQp9S+oqd12jhcu+A56Ebc1zFSJ" crossorigin="anonymous">
24-
<title>Admin Portal</title>
25-
</head>
22+
<link
23+
rel="stylesheet"
24+
href="https://use.fontawesome.com/releases/v5.7.0/css/all.css"
25+
integrity="sha384-lZN37f5QGtY3VHgisS14W3ExzMWZxybE1SJSEsQp9S+oqd12jhcu+A56Ebc1zFSJ"
26+
crossorigin="anonymous"
27+
/>
28+
<title>Admin Portal</title>
29+
</head>
2630

27-
<body>
28-
<noscript>
29-
You need to enable JavaScript to run this app.
30-
</noscript>
31-
<div id="root"></div>
32-
<!--
31+
<body>
32+
<noscript>
33+
You need to enable JavaScript to run this app.
34+
</noscript>
35+
<div id="root"></div>
36+
<!--
3337
This HTML file is a template.
3438
If you open it directly in the browser, you will see an empty page.
3539
@@ -39,6 +43,5 @@
3943
To begin the development, run `npm start` or `yarn start`.
4044
To create a production bundle, use `npm run build` or `yarn build`.
4145
-->
42-
</body>
43-
46+
</body>
4447
</html>

src/App.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import ResourceRoute from 'components/ResourceRoute';
1212
import RESOURCE_MAP from 'common/RESOURCE_MAP';
1313
import Nav from 'components/Nav';
1414
import NoAccess from 'components/NoAccess';
15+
import { PUBLIC_PATH } from 'common/injectGlobals';
1516

1617
const enhance = compose(provideLoggedInUser);
1718

@@ -22,7 +23,7 @@ const ProtectedRoute = injectState(({ component, state, ...rest }) => (
2223
class App extends React.Component<any, any> {
2324
render() {
2425
return (
25-
<Router>
26+
<Router basename={PUBLIC_PATH}>
2627
<div style={{ height: '100%', display: 'flex' }}>
2728
<Switch>
2829
<Route path="/" exact component={Login} />

src/common/injectGlobals.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ export const API_ROOT = process.env.REACT_APP_API;
1111
export const EGO_CLIENT_ID = process.env.REACT_APP_EGO_CLIENT_ID;
1212
export const USE_DUMMY_DATA = process.env.REACT_APP_DUMMY;
1313

14+
export const PUBLIC_PATH = process.env.REACT_APP_PUBLIC_PATH;
15+
1416
export const STATUSES = ['DISABLED', 'APPROVED', 'PENDING', 'REJECTED'];
1517
export const DATE_KEYS = ['createdAt', 'lastLogin'];
1618
export const DATE_FORMAT = 'YYYY-MM-DD hh:mm A';

src/common/typedefs/User.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
enum EgoProviderType {
22
GOOGLE = 'GOOGLE',
3-
FACEBOOK = 'FACEBOOK',
3+
// FACEBOOK = 'FACEBOOK',
44
GITHUB = 'GITHUB',
55
LINKEDIN = 'LINKEDIN',
66
ORCID = 'ORCID',

src/components/Login.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ const enhance = compose(injectState);
5252

5353
enum LoginProvider {
5454
Google = 'Google',
55-
Facebook = 'Facebook',
55+
// Facebook = 'Facebook',
5656
Github = 'GitHub',
5757
Linkedin = 'LinkedIn',
5858
Orcid = 'ORCiD',
5959
}
6060

6161
enum ProviderLoginPaths {
6262
google = 'google',
63-
facebook = 'facebook',
63+
// facebook = 'facebook',
6464
github = 'github',
6565
linkedin = 'linkedin',
6666
orcid = 'orcid',
@@ -78,7 +78,7 @@ const providers: ProviderType[] = [
7878
{ name: LoginProvider.Google, path: ProviderLoginPaths.google, Icon: Google },
7979
{ name: LoginProvider.Orcid, path: ProviderLoginPaths.orcid, Icon: Orcid },
8080
{ name: LoginProvider.Github, path: ProviderLoginPaths.github, Icon: GitHub },
81-
{ name: LoginProvider.Facebook, path: ProviderLoginPaths.facebook, Icon: Facebook },
81+
// { name: LoginProvider.Facebook, path: ProviderLoginPaths.facebook, Icon: Facebook },
8282
{ name: LoginProvider.Linkedin, path: ProviderLoginPaths.linkedin, Icon: LinkedIn },
8383
];
8484

0 commit comments

Comments
 (0)