-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Import new UI into Balrog repo (#947)
- Loading branch information
Showing
85 changed files
with
16,105 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const neutrino = require('neutrino'); | ||
|
||
module.exports = neutrino().eslintrc(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
build | ||
node_modules | ||
*.swp | ||
.idea/ | ||
*.log | ||
.Rhistory | ||
.env | ||
.coverage | ||
.DS_Store | ||
.eslintcache | ||
.netlify/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
const DEFAULT_HOST = 'localhost'; | ||
const DEFAULT_PORT = 9000; | ||
const port = process.env.PORT || DEFAULT_PORT; | ||
|
||
module.exports = { | ||
options: { | ||
root: __dirname, | ||
}, | ||
use: [ | ||
'@mozilla-frontend-infra/react-lint', | ||
[ | ||
'@neutrinojs/react', | ||
{ | ||
devServer: { | ||
host: process.env.HOST || DEFAULT_HOST, | ||
port, | ||
historyApiFallback: { | ||
disableDotRule: true, | ||
}, | ||
}, | ||
html: { | ||
title: 'Balrog Admin', | ||
favicon: `${__dirname}/src/images/favicon.png`, | ||
template: 'src/index.html', | ||
}, | ||
env: { | ||
HOST: DEFAULT_HOST, | ||
PORT: DEFAULT_PORT, | ||
BALROG_ROOT_URL: 'https://localhost:8010', | ||
AUTH0_CLIENT_ID: 'GlZhJQfx52b7MLQ19AjuTJHieiB4oh1j', | ||
AUTH0_DOMAIN: 'balrog-localdev.auth0.com', | ||
AUTH0_AUDIENCE: 'balrog-localdev', | ||
AUTH0_RESPONSE_TYPE: 'token id_token', | ||
AUTH0_SCOPE: 'full-user-credentials openid profile email', | ||
AUTH0_REDIRECT_URI: `http://localhost:${port}/login`, | ||
}, | ||
} | ||
], | ||
(neutrino) => { | ||
neutrino.config.resolve.alias | ||
.set('react-dom', '@hot-loader/react-dom'); | ||
}, | ||
'@neutrinojs/jest' | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM node:current | ||
|
||
COPY .neutrinorc.js package.json webpack.config.js yarn.lock /app/ | ||
COPY src/ /app/src/ | ||
|
||
WORKDIR /app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const neutrino = require('neutrino'); | ||
|
||
process.env.NODE_ENV = process.env.NODE_ENV || 'test'; | ||
|
||
module.exports = neutrino().jest(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{ | ||
"name": "balrog-ui", | ||
"version": "1.0.0", | ||
"main": "index.js", | ||
"license": "MIT", | ||
"scripts": { | ||
"build": "dotenv webpack -- --mode production", | ||
"start": "dotenv webpack-dev-server -- --mode development", | ||
"test": "jest", | ||
"lint": "eslint --cache --format codeframe --ext mjs,jsx,js src test" | ||
}, | ||
"dependencies": { | ||
"@date-io/date-fns": "^1.3.7", | ||
"@hot-loader/react-dom": "^16.8.6", | ||
"@material-ui/core": "^4.1.3", | ||
"@material-ui/icons": "^4.2.1", | ||
"@material-ui/lab": "^4.0.0-alpha.11", | ||
"@material-ui/pickers": "^3.1.2", | ||
"@material-ui/styles": "^4.1.2", | ||
"@mozilla-frontend-infra/components": "^2.4.1", | ||
"axios": "^0.18.1", | ||
"change-case": "^3.1.0", | ||
"classnames": "^2.2.6", | ||
"clipboard-copy": "^3.0.0", | ||
"date-fns": "2.0.0-alpha.37", | ||
"downshift": "^3.2.10", | ||
"is-absolute-url": "^2.1.0", | ||
"mdi-react": "^5.3.0", | ||
"prop-types": "^15", | ||
"qs": "^6.7.0", | ||
"ramda": "^0.26.1", | ||
"react": "^16.8.6", | ||
"react-auth0-components": "^1.0.0", | ||
"react-diff-view": "^2.1.3", | ||
"react-dom": "^16.8.6", | ||
"react-hot-loader": "^4", | ||
"react-number-format": "^4.0.8", | ||
"react-router-dom": "^5.0.0", | ||
"react-virtualized": "^9.21.1", | ||
"unidiff": "^1.0.2" | ||
}, | ||
"devDependencies": { | ||
"@mozilla-frontend-infra/react-lint": "^1.2.2", | ||
"@neutrinojs/jest": "9.0.0-rc.0", | ||
"@neutrinojs/react": "9.0.0-rc.0", | ||
"dotenv": "^8.0.0", | ||
"dotenv-cli": "^2.0.0", | ||
"eslint": "^5", | ||
"jest": "^23", | ||
"neutrino": "9.0.0-rc.0", | ||
"webpack": "^4", | ||
"webpack-cli": "^3", | ||
"webpack-dev-server": "^3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Page Not Found</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<style> | ||
|
||
* { | ||
line-height: 1.2; | ||
margin: 0; | ||
} | ||
|
||
html { | ||
color: #888; | ||
display: table; | ||
font-family: sans-serif; | ||
height: 100%; | ||
text-align: center; | ||
width: 100%; | ||
} | ||
|
||
body { | ||
display: table-cell; | ||
vertical-align: middle; | ||
margin: 2em auto; | ||
} | ||
|
||
h1 { | ||
color: #555; | ||
font-size: 2em; | ||
font-weight: 400; | ||
} | ||
|
||
p { | ||
margin: 0 auto; | ||
width: 280px; | ||
} | ||
|
||
@media only screen and (max-width: 280px) { | ||
|
||
body, p { | ||
width: 95%; | ||
} | ||
|
||
h1 { | ||
font-size: 1.5em; | ||
margin: 0 0 0.3em; | ||
} | ||
|
||
} | ||
|
||
</style> | ||
</head> | ||
<body> | ||
<h1>Page Not Found</h1> | ||
<p>Sorry, but the page you were trying to view does not exist.</p> | ||
</body> | ||
</html> | ||
<!-- IE needs 512+ bytes: https://blogs.msdn.microsoft.com/ieinternals/2010/08/18/friendly-http-error-pages/ --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -o errexit -o pipefail | ||
|
||
export AWS_ACCESS_KEY_ID=$(curl ${AWS_CREDENTIALS_SECRET} | python3 -c 'import json, sys; a = json.load(sys.stdin); print(a["aws_access_key"])') | ||
export AWS_SECRET_ACCESS_KEY=$(curl ${AWS_CREDENTIALS_SECRET} | python3 -c 'import json, sys; a = json.load(sys.stdin); print(a["aws_secret_key"])') | ||
|
||
# Grab app config and convert it to shell format | ||
curl "${APP_CONFIG_SECRET}" | python3 -c 'import json, sys; a = json.load(sys.stdin); [print(f"{k}={v}") for k,v in a.items()]' > .env | ||
|
||
yarn build | ||
|
||
cp scripts/404.html public/404.html | ||
|
||
aws s3 sync \ | ||
--metadata "{ | ||
\"Strict-Transport-Security\": \"max-age=31536000\", | ||
\"Access-Control-Allow-Origin\": \"*\", | ||
\"x-content-type-options\": \"nosniff\", | ||
\"x-frame-options\": \"SAMEORIGIN\", | ||
\"x-xss-protection\": \"1; mode=block\" | ||
}" \ | ||
--metadata-directive "REPLACE" \ | ||
--cache-control "max-age=300" \ | ||
--delete \ | ||
./build/ "s3://${WEBSITE_BUCKET}/" |
Oops, something went wrong.