Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 02902f5

Browse files
removed unused imports and improved text color in nested subroute
1 parent 97f467b commit 02902f5

File tree

9 files changed

+16
-29
lines changed

9 files changed

+16
-29
lines changed

‎README.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Install Docker Desktop
77

88
**_Make sure backend\entrypoint.sh has LF format and not CRLF format_**
99

10-
You shouldn't have to make any other changes to get this up and running, but here's some things to note:
10+
You shouldn't have to make any other changes to get the app up and running, but here's some things to note:
1111

1212
- The default login credentials are admin and admin_password. These can be changed in backend/.env.
1313

@@ -25,7 +25,7 @@ For development mode without NGINX server (recommended for development), run the
2525
```sh
2626
docker-compose -f "docker-compose.dev.yml" up -d --build
2727
```
28-
The react frontend should be available at `http://localhost:3000/` and django backend at `http://localhost:8000/` (django admin at `http://localhost:8000/admin/`). This mode supports both react hot reloading and django auto-refresh with changes.
28+
The react frontend should be available at `http://localhost:3000/` and django backend at `http://localhost:8000/` (django admin at `http://localhost:8000/admin/`).
2929

3030
## Features
3131
### Forgot Password:
@@ -34,7 +34,7 @@ The react frontend should be available at `http://localhost:3000/` and django ba
3434
$id = $(docker ps -aqf "name=backend")
3535
docker logs --tail 1000 -f $id
3636
```
37-
- Upon submitting a valid email (default is ), you should get a path like `http://localhost:3000/password_reset?token=abcdefgxyz123`; paste this in your browser to access the password reset form. The password reset form first validates the token; if the token is valid, it presents the password reset interface and allows the user to provide a new password. If the token is invalid, it will redirect the user to the login page.
37+
- Upon submitting a valid email (default is admin@example.com), you should get a path like `http://localhost:3000/password_reset?token=abcdefgxyz123`; paste this in your browser to access the password reset form. The password reset form first validates the token; if the token is valid, it presents the password reset interface and allows the user to provide a new password. If the token is invalid, it will redirect the user to the login page.
3838

3939
Check out the Django docs starting [here](https://docs.djangoproject.com/en/3.1/topics/email/#smtp-backend) in order to update the Email Backend from a console output to an actual SMTP backend.
4040

‎frontend/src/App.tsx‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useContext, useEffect, useMemo,useState } from "react";
1+
import React, { useContext, useEffect, useMemo } from "react";
22
import {
33
BrowserRouter as Router,
44
Switch,
@@ -7,7 +7,14 @@ import {
77
Redirect,
88
useHistory,
99
} from "react-router-dom";
10-
import { ThemeProvider, CssBaseline, Snackbar, Dialog, DialogTitle, DialogContent, DialogActions } from "@material-ui/core";
10+
import {
11+
ThemeProvider,
12+
CssBaseline,
13+
Snackbar,
14+
Dialog,
15+
DialogTitle,
16+
DialogContent,
17+
DialogActions } from "@material-ui/core";
1118

1219
import { useAppSelector } from './redux/hooks';
1320
import { Login } from './components/Login/Login';

‎frontend/src/components/Home.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function Home(props: RouteComponentProps) {
4646
axios.post('/api/helloyou/', data)
4747
.then(response => {
4848
setHelloName(response.data["response"])
49-
TriggerAlert("Success!", "success")
49+
TriggerAlert("Successful API Request!", "success")
5050
})
5151
.catch(
5252
(error: any) => { TriggerAlert(error.message, "error") })

‎frontend/src/components/Layout/TopBar.tsx‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React,{useContext} from 'react';
1+
import React from 'react';
22
import { makeStyles } from '@material-ui/core/styles';
33
import { AppBar, IconButton, Toolbar, Tooltip, Typography } from '@material-ui/core';
44
import { APP_NAME } from '../../settings'
@@ -51,7 +51,6 @@ export default function TopBar(props: any) {
5151
</DropdownMenu>
5252
)
5353
}
54-
5554
</Toolbar>
5655
</AppBar>
5756
);

‎frontend/src/components/Login/ForgotPassword.tsx‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React, { useRef, useState } from 'react'
22
import { FormHelperText, Button, TextField } from '@material-ui/core';
33
import axios from 'axios';
44
import { useStyles } from './styles'
5-
import * as settings from '../../settings';
65

76
export const ForgotPassword = () => {
87
const emailInput = useRef<HTMLInputElement>(null);

‎frontend/src/components/Login/Login.tsx‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import { Grid, LinearProgress, Link } from '@material-ui/core';
1313
import { useAppSelector, useAppDispatch } from '../../redux/hooks'
1414
import { login } from '../../redux/auth/authThunks'
1515
import { ForgotPassword } from './ForgotPassword'
16-
import axios from 'axios';
1716
import { motion, useAnimation } from "framer-motion";
1817
import { useStyles } from './styles'
1918
import { APP_NAME } from '../../settings';
@@ -109,7 +108,6 @@ export function Login(props: RouteComponentProps<{}, any, { from: string }>) {
109108
autoComplete="username"
110109
autoFocus
111110
onChange={handleFormFieldChange}
112-
// inputProps={{ style: { WebkitBoxShadow: "0 0 0 1000px #FFFFFF inset" }}}
113111
/>
114112
<TextField
115113
variant="outlined"
@@ -122,7 +120,6 @@ export function Login(props: RouteComponentProps<{}, any, { from: string }>) {
122120
id="password"
123121
autoComplete="current-password"
124122
onChange={handleFormFieldChange}
125-
// inputProps={{ style: { WebkitBoxShadow: "0 0 0 1000px #FFFFFF inset" }}}
126123
/>
127124
<ValidationMessages validationErrors={validationErrors} />
128125
{isLoading && <LinearProgress color="secondary" />}
@@ -134,9 +131,8 @@ export function Login(props: RouteComponentProps<{}, any, { from: string }>) {
134131
className={classes.submit}
135132
>
136133
<Typography variant='subtitle2'>
137-
Sign In
134+
Sign In
138135
</Typography>
139-
140136
</Button>
141137
</form>
142138
}

‎frontend/src/components/Login/PasswordUpdate.tsx‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,5 +153,4 @@ function PasswordUpdate() {
153153
);
154154
}
155155

156-
157156
export default PasswordUpdate;

‎frontend/src/routes/Placeholder.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ interface MatchRouteProps extends RouteComponentProps<MatchParams> {
1212
const Placeholder = (props: MatchRouteProps) => {
1313
return (
1414
<div style={{ textAlign: "center" }}>
15-
<Typography variant="h5" style={{ margin: 20 }}>The user input detected by the route is: {props.match.params.userinput}</Typography>
15+
<Typography variant="h5" style={{ margin: 20 }}color="textSecondary">The user input detected by the route is: {props.match.params.userinput}</Typography>
1616
<Button variant="contained" color="primary" onClick={() => props.history.push('/home')}>Back Home</Button>
1717
</div>
1818
)

‎frontend/src/settings.tsx‎

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,5 @@
11
let API_SERVER_VAL = 'http://localhost:8000';
22

3-
// switch (process.env.NODE_ENV) {
4-
// case 'development':
5-
// API_SERVER_VAL = 'http://localhost:8000';
6-
// break;
7-
// case 'production':
8-
// if (process.env.REACT_APP_API_SERVER)
9-
// API_SERVER_VAL = process.env.REACT_APP_API_SERVER;
10-
// break;
11-
// default:
12-
// API_SERVER_VAL = 'http://localhost:8000';
13-
// break;
14-
// }
15-
163
export const API_SERVER = API_SERVER_VAL;
174

185
export const SESSION_DURATION = 5*3600*1000;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /