Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.

Commit 1fc8c87

Browse files
authored
Merge pull request #24 from FileFighter/review
Review in master
2 parents b46fa54 + c17cd1b commit 1fc8c87

39 files changed

+2200
-205
lines changed

webapp_frontend/package-lock.json

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

webapp_frontend/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"@types/react-router-dom": "^5.1.6",
1717
"axios": "^0.20.0",
1818
"bootstrap": "^4.5.3",
19+
"eslint-plugin-react-hooks": "^4.2.0",
1920
"node-sass": "^4.14.1",
2021
"react": "^16.13.1",
2122
"react-bootstrap": "^1.4.0",
@@ -26,6 +27,7 @@
2627
"react-toastify": "^6.1.0",
2728
"redux": "^4.0.5",
2829
"redux-types": "^2.0.3",
30+
"super-tiny-icons": "^0.4.0",
2931
"typescript": "^3.8.3"
3032
},
3133
"scripts": {
@@ -35,7 +37,7 @@
3537
"eject": "react-scripts eject",
3638
"storybook": "start-storybook -p 6006 -s public --no-dll",
3739
"build-storybook": "build-storybook -s public --no-dll",
38-
"sonar": "SONAR_LOGIN=$SONAR_LOGIN SONAR_PASSWORD=$SONAR_PASSWORD node src/sonar-scanner.js"
40+
"sonar": "SONAR_LOGIN=$SONAR_LOGIN SONAR_PASSWORD=$SONAR_PASSWORD node src/sonar-scanner.js"
3941
},
4042
"eslintConfig": {
4143
"extends": "react-app"

webapp_frontend/public/favicon.ico

-984 Bytes
Binary file not shown.

webapp_frontend/public/index.html

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE html>
2-
<html lang="en">
2+
<html lang="en" class="h-100">
33
<head>
44
<meta charset="utf-8" />
55
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
@@ -24,20 +24,25 @@
2424
work correctly both with client-side routing and a non-root public URL.
2525
Learn how to configure a non-root public URL by running `npm run build`.
2626
-->
27-
<title>React App</title>
27+
<title>FileFighter</title>
2828
</head>
29-
<body>
29+
<body class="h-100">
3030
<noscript>You need to enable JavaScript to run this app.</noscript>
31-
<div id="root"></div>
32-
<!--
33-
This HTML file is a template.
34-
If you open it directly in the browser, you will see an empty page.
35-
36-
You can add webfonts, meta tags, or analytics to this file.
37-
The build step will place the bundled scripts into the <body> tag.
38-
39-
To begin the development, run `npm start` or `yarn start`.
40-
To create a production bundle, use `npm run build` or `yarn build`.
41-
-->
31+
<div id="root" class="d-flex flex-column h-100"></div>
32+
<!--Black Lives Matter!-->
33+
<!--Queer Lives Matter!-->
34+
<!-- ################### -->
35+
<!-- ._____..._..._.........._____..._..........._......._................. -->
36+
<!-- |..___|.(_).|.|...___..|..___|.(_)...____..|.|__...|.|_....___...____. -->
37+
<!-- |.|_....|.|.|.|../._.\.|.|_....|.|../._\`|.|.'_.\..|.__|../._.\.|.'__| -->
38+
<!-- |.._|...|.|.|.|.|..__/.|.._|...|.|.|.(_|.|.|.|.|.|.|.|_..|..__/.|.|... -->
39+
<!-- |_|.....|_|.|_|..\___|.|_|.....|_|..\__,.|.|_|.|_|..\__|..\___|.|_|... -->
40+
<!-- ------------------------------------|___/----------------------------- -->
41+
<!-- FileFighter's documentation & code: https://filefighter.github.io/-->
42+
<!-- ################### -->
43+
<!-- Made with <3 by: -->
44+
<!-- https://github.com/Gimleux -->
45+
<!-- https://github.com/open-schnick -->
46+
<!-- https://github.com/qvalentin -->
4247
</body>
4348
</html>

webapp_frontend/public/logo192.png

-2.47 KB
Loading

webapp_frontend/public/logo512.png

-4.83 KB
Loading
22 KB
Loading
1.56 KB
Loading

webapp_frontend/src/background/api/api.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ export const hostname:string =constants.url.API_URL+'/api';
55

66
export const userPath:string='/v1/users';
77

8+
export const filesytemPath:string='/v1/filesystem';
9+
10+
11+
812

913
interface BackendHealthData {
1014
uptimeInSeconds: number;

webapp_frontend/src/background/api/auth.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export const checkForCookie=()=>{
2828
if (refreshTokenCookieValue){
2929
store.dispatch(addRefreshToken(refreshTokenCookieValue))
3030
getAccessTokenWithRefreshToken();
31+
3132
}
3233
store.dispatch(checkedCookies(true))
3334

@@ -78,22 +79,31 @@ export const getAccessTokenWithRefreshToken = () => {
7879
},
7980
};
8081

82+
83+
8184
Axios.get(hostname + userPath + '/auth', config)
8285
.then((data) => {
8386
setAuthHeaderToAxios(data.data.tokenValue)
8487

8588
store.dispatch(addAccessToken({token: data.data.tokenValue, timestamp: data.data.validUntil}as AccessToken));
8689

90+
//TODO: also get User data here
91+
92+
8793
})
8894
.catch(((error) => {
8995
store.dispatch(removeTokens()as RemoveTokens);
9096

9197
console.log(error)
9298
//you probably want to notify the user, maybe with a toast or similar
99+
93100
}));
94101

95102
}
96103

104+
105+
106+
97107
export const logout=()=>{
98108
store.dispatch(removeTokens());
99109
deleteCookie(cookieName);
@@ -102,4 +112,4 @@ export const logout=()=>{
102112
function setAuthHeaderToAxios(accessToken: string) {
103113
Axios.defaults.headers.common['Authorization'] =
104114
`Bearer ${accessToken}`;
105-
}
115+
}

0 commit comments

Comments
 (0)