Skip to content

Commit f59bde7

Browse files
committed
Merge branch 'main' of github.com:TeamIO-NZ/note-ui into main
2 parents 22fdd48 + 2b9f4b1 commit f59bde7

Some content is hidden

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

60 files changed

+685
-413
lines changed

README.md

+13-6
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,16 @@ Front end settings
1010
|Register Page for making new users|[x]|Done, fuck you react|
1111
|Home Page that shows all notes a user has access to|[x]|Pretty sure this is done|
1212
|Note access page/component for displaying note information|[x]|It looks pretty cool tbh|
13-
|Note edit button that allows changes with a submit button|[]|
14-
|Note access change button that opens access screen|[]|
15-
|Access screen has a list of users that can read and edit this note|[]|
16-
|Access screen has a dropdown of all the users and a radio button for no access, viewer, editor|[]|
17-
|Search bar for filtering and counting|[]|
18-
|User List Page|[x]||
13+
|Note edit button that allows changes with a submit button|[x]|
14+
|Note access change button that opens access screen|[x]|
15+
|Access screen has a list of users that can read and edit this note|[x]|I think this works. maybe?
16+
|Access screen has a dropdown of all the users and a radio button for no access, viewer, editor|[x]|
17+
|Search bar for filtering and counting|[x]|
18+
|User List Page|[x]||
19+
|ability to filter notes you can access|[x]|
20+
|Users can count occurrence of the following among notes they have access to|[x]|
21+
|A sentence with a given prefix or suffix|[x]|
22+
|A phone number with a give area code and/or consecutive number pattern|[x]|
23+
|An email address on a domain that is only partially provided|[x]|
24+
|Text that contains at least three of the following case sensitive words. [meeting, minutes, agenda, action, attendees, apologies]|[x]|
25+
|A 3+ letter word thats all caps|[x]|

debug.log

-3
This file was deleted.

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,6 @@
5252
"last 1 firefox version",
5353
"last 1 safari version"
5454
]
55-
}
55+
},
56+
"homepage": "/web/"
5657
}

public/android-icon-144x144.png

9.47 KB
Loading

public/android-icon-192x192.png

14.2 KB
Loading

public/android-icon-36x36.png

2.14 KB
Loading

public/android-icon-48x48.png

2.55 KB
Loading

public/android-icon-72x72.png

3.77 KB
Loading

public/android-icon-96x96.png

5.73 KB
Loading

public/apple-icon-114x114.png

7.66 KB
Loading

public/apple-icon-120x120.png

7.62 KB
Loading

public/apple-icon-144x144.png

9.47 KB
Loading

public/apple-icon-152x152.png

11.6 KB
Loading

public/apple-icon-180x180.png

14.2 KB
Loading

public/apple-icon-57x57.png

3.24 KB
Loading

public/apple-icon-60x60.png

3.41 KB
Loading

public/apple-icon-72x72.png

3.77 KB
Loading

public/apple-icon-76x76.png

4.42 KB
Loading

public/apple-icon-precomposed.png

14.7 KB
Loading

public/apple-icon.png

14.7 KB
Loading

public/browserconfig.xml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<browserconfig><msapplication><tile><square70x70logo src="/ms-icon-70x70.png"/><square150x150logo src="/ms-icon-150x150.png"/><square310x310logo src="/ms-icon-310x310.png"/><TileColor>#ffffff</TileColor></tile></msapplication></browserconfig>

public/favicon-16x16.png

1.32 KB
Loading

public/favicon-32x32.png

1.9 KB
Loading

public/favicon-96x96.png

5.73 KB
Loading

public/favicon.ico

-2.66 KB
Binary file not shown.

public/index.html

+38-36
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,40 @@
11
<!DOCTYPE html>
22
<html lang="en">
3-
<head>
4-
<meta charset="utf-8" />
5-
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
6-
<meta name="viewport" content="width=device-width, initial-scale=1" />
7-
<meta name="theme-color" content="#000000" />
8-
<meta
9-
name="description"
10-
content="Web site created using create-react-app"
11-
/>
12-
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
13-
<!--
14-
manifest.json provides metadata used when your web app is installed on a
15-
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
16-
-->
17-
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
18-
<!--
19-
Notice the use of %PUBLIC_URL% in the tags above.
20-
It will be replaced with the URL of the `public` folder during the build.
21-
Only files inside the `public` folder can be referenced from the HTML.
22-
23-
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
24-
work correctly both with client-side routing and a non-root public URL.
25-
Learn how to configure a non-root public URL by running `npm run build`.
26-
-->
27-
<!-- Material UI Start -->
28-
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" />
29-
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />
30-
<!-- Material UI End -->
31-
<title>React App</title>
32-
</head>
33-
<body>
34-
<noscript>You need to enable JavaScript to run this app.</noscript>
35-
<div id="root"></div>
36-
<!--
3+
4+
<head>
5+
<meta charset="utf-8" />
6+
<meta name="viewport" content="minimum-scale=1, initial-scale=1, width=device-width" />
7+
8+
<link rel="apple-touch-icon" sizes="57x57" href="%PUBLIC_URL%/apple-icon-57x57.png">
9+
<link rel="apple-touch-icon" sizes="60x60" href="%PUBLIC_URL%/apple-icon-60x60.png">
10+
<link rel="apple-touch-icon" sizes="72x72" href="%PUBLIC_URL%/apple-icon-72x72.png">
11+
<link rel="apple-touch-icon" sizes="76x76" href="%PUBLIC_URL%/apple-icon-76x76.png">
12+
<link rel="apple-touch-icon" sizes="114x114" href="%PUBLIC_URL%/apple-icon-114x114.png">
13+
<link rel="apple-touch-icon" sizes="120x120" href="%PUBLIC_URL%/apple-icon-120x120.png">
14+
<link rel="apple-touch-icon" sizes="144x144" href="%PUBLIC_URL%/apple-icon-144x144.png">
15+
<link rel="apple-touch-icon" sizes="152x152" href="%PUBLIC_URL%/apple-icon-152x152.png">
16+
<link rel="apple-touch-icon" sizes="180x180" href="%PUBLIC_URL%/apple-icon-180x180.png">
17+
<link rel="icon" type="image/png" sizes="192x192" href="%PUBLIC_URL%/android-icon-192x192.png">
18+
<link rel="icon" type="image/png" sizes="32x32" href="%PUBLIC_URL%/favicon-32x32.png">
19+
<link rel="icon" type="image/png" sizes="96x96" href="%PUBLIC_URL%/favicon-96x96.png">
20+
<link rel="icon" type="image/png" sizes="16x16" href="%PUBLIC_URL%/favicon-16x16.png">
21+
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
22+
<meta name="msapplication-TileColor" content="#ffffff">
23+
<meta name="msapplication-TileImage" content="%PUBLIC_URL%/ms-icon-144x144.png">
24+
<meta name="theme-color" content="#ffffff">
25+
26+
<!-- Material UI Start -->
27+
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" />
28+
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />
29+
<!-- Material UI End -->
30+
31+
<title>Enterprise Note</title>
32+
</head>
33+
34+
<body>
35+
<noscript>You need to enable JavaScript to run this app.</noscript>
36+
<div id="root"></div>
37+
<!--
3738
This HTML file is a template.
3839
If you open it directly in the browser, you will see an empty page.
3940
@@ -43,5 +44,6 @@
4344
To begin the development, run `npm start` or `yarn start`.
4445
To create a production bundle, use `npm run build` or `yarn build`.
4546
-->
46-
</body>
47-
</html>
47+
</body>
48+
49+
</html>

public/logo192.png

-5.22 KB
Binary file not shown.

public/logo512.png

-9.44 KB
Binary file not shown.

public/manifest.json

+40-24
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,41 @@
11
{
2-
"short_name": "React App",
3-
"name": "Create React App Sample",
4-
"icons": [
5-
{
6-
"src": "favicon.ico",
7-
"sizes": "64x64 32x32 24x24 16x16",
8-
"type": "image/x-icon"
9-
},
10-
{
11-
"src": "logo192.png",
12-
"type": "image/png",
13-
"sizes": "192x192"
14-
},
15-
{
16-
"src": "logo512.png",
17-
"type": "image/png",
18-
"sizes": "512x512"
19-
}
20-
],
21-
"start_url": ".",
22-
"display": "standalone",
23-
"theme_color": "#000000",
24-
"background_color": "#ffffff"
25-
}
2+
"name": "App",
3+
"icons": [
4+
{
5+
"src": "\/android-icon-36x36.png",
6+
"sizes": "36x36",
7+
"type": "image\/png",
8+
"density": "0.75"
9+
},
10+
{
11+
"src": "\/android-icon-48x48.png",
12+
"sizes": "48x48",
13+
"type": "image\/png",
14+
"density": "1.0"
15+
},
16+
{
17+
"src": "\/android-icon-72x72.png",
18+
"sizes": "72x72",
19+
"type": "image\/png",
20+
"density": "1.5"
21+
},
22+
{
23+
"src": "\/android-icon-96x96.png",
24+
"sizes": "96x96",
25+
"type": "image\/png",
26+
"density": "2.0"
27+
},
28+
{
29+
"src": "\/android-icon-144x144.png",
30+
"sizes": "144x144",
31+
"type": "image\/png",
32+
"density": "3.0"
33+
},
34+
{
35+
"src": "\/android-icon-192x192.png",
36+
"sizes": "192x192",
37+
"type": "image\/png",
38+
"density": "4.0"
39+
}
40+
]
41+
}

public/ms-icon-144x144.png

9.47 KB
Loading

public/ms-icon-150x150.png

11.2 KB
Loading

public/ms-icon-310x310.png

31.5 KB
Loading

public/ms-icon-70x70.png

4.03 KB
Loading

src/App.css

-38
This file was deleted.

src/App.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import UserList from './pages/UserList';
1111
import ConnectionWarning from './elements/ConnectionWarning';
1212

1313
function App() {
14-
const [user, setUser] = React.useState<User>(new User("", "", false, "", "", "", -1));
14+
const [user, setUser] = React.useState<User>(new User("", "", false, "", "", "", -1, -1));
1515
console.log("App Level User:");
1616
console.log(user);
1717
return (

src/elements/ConnectionWarning.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export default function ConnectionWarning() {
3939
return (
4040
<div className={classes.root}>
4141
<Collapse in={show}>
42-
<Alert severity="error">Connection to backend lost, attempting to reconnect.</Alert>
42+
<Alert severity="error">Connection to backend lost, attempting to reconnect.</Alert>
4343
</Collapse>
4444
</div>
4545
)

src/elements/Copyright.tsx

+10-10
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ import React from "react";
33
import { Link } from "react-router-dom";
44

55
export default function Copyright() {
6-
return (
7-
<Typography variant="body2" color="textSecondary" align="center">
8-
{'Copyright © '}
9-
<Link color="inherit" to="https://github.com/TeamIO-NZ/EnterpriseNote">
10-
Enterprise Note
6+
return (
7+
<Typography variant="body2" color="textSecondary" align="center">
8+
{'Copyright © '}
9+
<Link color="inherit" to="https://github.com/TeamIO-NZ/EnterpriseNote">
10+
Enterprise Note
1111
</Link>{' '}
12-
{new Date().getFullYear()}
13-
{'.'}
14-
</Typography>
15-
);
16-
}
12+
{new Date().getFullYear()}
13+
{'.'}
14+
</Typography>
15+
);
16+
}

src/elements/EditDialog.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ export default function EditDialog({ open, setOpen, note, setShouldRefresh }: {
124124
note.content = content;
125125

126126
if (typeof (note.id) === 'number' && note.id > 0) {
127-
NoteDataService.update(note.id, note, user.id);
127+
NoteDataService.update(note.id, note, user.id).then(() => { setShouldRefresh(String(Date.now())); });
128128
} else {
129-
NoteDataService.create(note).then((res) => { console.log(`create: ${res}`) });
129+
NoteDataService.create(note).then((res) => { console.log(`create: ${res}`) }).then(() => { setShouldRefresh(String(Date.now())); });
130130
}
131131
};
132132

src/elements/MenuAppBar.tsx

+15-9
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { useHistory, useLocation } from "react-router-dom";
1212
import { Avatar } from '@material-ui/core';
1313
import { useUser } from '../services/Context';
1414
import User from '../models/User';
15+
import { blue } from '@material-ui/core/colors';
1516

1617
const useStyles = makeStyles((theme: Theme) =>
1718
createStyles({
@@ -24,6 +25,10 @@ const useStyles = makeStyles((theme: Theme) =>
2425
title: {
2526
flexGrow: 1,
2627
},
28+
avatar: {
29+
backgroundColor: blue[100],
30+
color: blue[600],
31+
},
2732
}),
2833
);
2934

@@ -44,14 +49,14 @@ export default function MenuAppBar() {
4449
const handleLogin = () => {
4550
history.push("/login");
4651
}
47-
const handleUserListPush = () =>{
52+
const handleUserListPush = () => {
4853
history.push("/users");
4954
}
50-
const handleMyNotesPush = () =>{
55+
const handleMyNotesPush = () => {
5156
history.push("/");
5257
}
5358
const handleLogout = () => {
54-
setUser(new User("", "", false, "","","",-1));
59+
setUser(new User("", "", false, "", "", "", -1, -1));
5560
history.push("/login");
5661
}
5762

@@ -71,9 +76,10 @@ export default function MenuAppBar() {
7176
{user.token !== "" && (
7277
<div>
7378
<Avatar
74-
aria-label={`account of ${user.name}`}
75-
aria-controls="menu-appbar"
76-
onClick={handleMenu}
79+
aria-label={`account of ${user.name}`}
80+
aria-controls="menu-appbar"
81+
onClick={handleMenu}
82+
className={classes.avatar}
7783
>
7884
{user.name.charAt(0).toUpperCase()}
7985
</Avatar>
@@ -92,9 +98,9 @@ export default function MenuAppBar() {
9298
open={open}
9399
onClose={handleClose}
94100
>
95-
<MenuItem onClick={() => {handleMyNotesPush(); handleClose()}}>My Notes</MenuItem>
96-
<MenuItem onClick={() => {handleUserListPush();handleClose()}}>UserList</MenuItem>
97-
<MenuItem onClick={() => {handleLogout();handleClose();}}>Logout</MenuItem>
101+
<MenuItem onClick={() => { handleMyNotesPush(); handleClose() }}>My Notes</MenuItem>
102+
<MenuItem onClick={() => { handleUserListPush(); handleClose() }}>UserList</MenuItem>
103+
<MenuItem onClick={() => { handleLogout(); handleClose(); }}>Logout</MenuItem>
98104
</Menu>
99105
</div>
100106
)}

0 commit comments

Comments
 (0)