Skip to content

Commit 9fa05a4

Browse files
author
Stephen Poserina
committed
Merge branch 'master' into 403-db-matching
2 parents 4486efe + 81db321 commit 9fa05a4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1870
-517
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ start_env.sh
1818

1919
/src/server/venv/
2020
/src/local_files/
21-
/src/server/secrets.py
21+
/src/server/secrets_dict.py
2222
/src/server/local_files/
2323
.mypy_cache/
24+
*secrets*
25+
*kustomization*

src/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ _Docker Compose instructions_
1717
- Install Docker Compose - `https://docs.docker.com/compose/install/`
1818
- Most package managers have it as `docker-compose` and it's largely just a shell script.
1919
- `docker-compose up -d` to bring up the application.
20+
- Scheduler docker will not start. To run the scheduler, use profile flag `production-only` as explained in the Production Environment section.
2021

2122
#### Finally - Run The UI on http://localhost:3000
2223

2324
---------------------------------------
24-
Deploy
25+
Production Environment
2526
---------------------------------------
2627
- `docker-compose` should use the profile flag `production-only`. i.e: `docker-compose --profile production-only up
2728
` and `docker-compose --profile production-only build`

src/client/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ RUN npm install --silent
1616
COPY public ./public
1717
COPY src ./src
1818

19+
RUN npx browserslist@latest --update-db
1920
RUN npm run build
2021

2122
# add app

src/client/package-lock.json

Lines changed: 64 additions & 45 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/client/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"@material-ui/core": "^4.9.14",
77
"@material-ui/icons": "^4.9.1",
88
"@material-ui/lab": "^4.0.0-alpha.53",
9+
"@material-ui/styles": "^4.11.4",
910
"@testing-library/jest-dom": "^4.2.4",
1011
"@testing-library/react": "^9.5.0",
1112
"@testing-library/user-event": "^7.2.1",

src/client/src/App.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import Login from './pages/Login/Login';
88
import Logout from './pages/Login/Logout';
99
import HomePage from './pages/Home';
1010
import Admin from './pages/Admin';
11-
import Search360 from './pages/DataView360/Search/Search';
11+
import {Search360} from './pages/DataView360/Search/Search';
1212
import View360 from './pages/DataView360/View/View360';
1313
import About from './pages/About';
1414
import RefreshDlg from './components/RefreshDlg';
@@ -17,16 +17,17 @@ import Refresh from './components/Refresh';
1717

1818
import useToken from './pages/Login/useToken';
1919
import Box from "@material-ui/core/Box";
20+
import {RFM} from "./pages/RFM/RFM";
2021

2122
let jwt = require('jsonwebtoken');
2223

2324
const REFRESH_POPUP_TIME = 300 // seconds
2425

2526
// Triggers token expiration check
2627
const sleep = time => new Promise(resolve => setTimeout(resolve, time))
27-
const expTimer = () => sleep(500).then(() => ({}))
28+
let expTimer = () => sleep(500).then(() => ({}));
2829

29-
const AuthContext = React.createContext()
30+
const AuthContext = React.createContext();
3031

3132
function AuthProvider({children}) {
3233
const [state, setState] = React.useState({
@@ -39,6 +40,7 @@ function AuthProvider({children}) {
3940
expTimer().then(
4041
user => setState({status: 'success', error: null, user})
4142
)
43+
expTimer = () => sleep(100000).then(() => ({}));
4244
},)
4345

4446
return (
@@ -76,7 +78,6 @@ function useAuthState() {
7678

7779

7880
function AuthenticatedApp() {
79-
8081
const {access_token, setToken} = useToken();
8182

8283
let decoded = jwt.decode(access_token, {complete: true});
@@ -140,6 +141,10 @@ function AuthenticatedApp() {
140141
<View360 access_token={access_token}/>
141142
</Route>
142143

144+
<Route path="/rfm">
145+
<RFM access_token={access_token}/>
146+
</Route>
147+
143148
<Route path="/check">
144149
<Check access_token={access_token}/>
145150
</Route>
@@ -168,7 +173,6 @@ function Home() {
168173
}
169174

170175
function App() {
171-
172176
return (
173177
<AuthProvider>
174178
<Home/>

src/client/src/components/Header.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ class Header extends Component {
2929
{this.props.headerType !== 'Login' && <Button size="large" component={RouterLink} to="/360view/search">360
3030
DataView</Button>
3131
}
32+
{this.props.headerType !== 'Login' && <Button size="large" component={RouterLink} to="/rfm">RFM
33+
</Button>
34+
}
3235
<Button size="large" component={RouterLink} to="/about">About us</Button>
3336
{this.props.headerType !== 'Login' &&
3437
<Button size="large" component={RouterLink} to="/logout">Log Out</Button>}

src/client/src/pages/About.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ const getList = (listName) => {
6161
};
6262

6363

64-
export default function About(props) {
64+
export default function About() {
6565
return (
6666
<Container maxWidth={"md"} style={{"padding": "1em"}}>
6767
<Grid container direction="column" spacing={1}>

src/client/src/pages/Admin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ class Admin extends Component {
172172
const fileName = file.split("-")[0];
173173
let fileDate = file.split("-").slice(1).join().split(".")[0];
174174
let fileDateOnlyNumbers = fileDate.replaceAll(",", "");
175-
let fileDateFormatted = moment.utc(fileDateOnlyNumbers, "YYYYMMDDhmmss").local().format("MMMM Do YYYY, h:mm:ss a");
175+
let fileDateFormatted = moment(fileDateOnlyNumbers, "YYYYMMDDhmmss").local().format("MMMM Do YYYY, h:mm:ss a");
176176

177177
return (
178178
<TableRow key={index}>

0 commit comments

Comments
 (0)