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

Commit 4ac7213

Browse files
authored
Merge pull request #131 from FileFighter/feature/profile
Feature/profile
2 parents 06590e7 + 2a0499a commit 4ac7213

34 files changed

+5400
-39688
lines changed

.github/workflows/latestRelease.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ jobs:
5151
-
5252
name: Trigger update on server
5353
run: |
54-
curl -u ${{ secrets.LOG_CREDS }} https://logs.filefighter.de/filefighter-update.log
54+
curl -f -u ${{ secrets.LOG_CREDS }} https://logs.filefighter.de/filefighter-update-script.log

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ local.properties
8383
*/.idea/**/contentModel.xml
8484

8585
*/.idea/
86-
8786
/.idea
87+
.idea/
8888

8989
WebApp.iml
9090

cypress/integration/filesystem.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ describe("The filesystem page", () => {
77
});
88

99
it("changes the url when you click on a file", () => {
10-
cy.get("div").contains("dummyFile.txt").click();
11-
cy.url().should("include", "#dummyFile.txt");
10+
cy.get("div").contains("user1").click();
11+
cy.url().should("include", "/user1");
1212
});
1313
});

cypress/integration/login_spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ describe('The Home Page', () => {
66

77
it('sets auth cookie when logging in via form submission', function () {
88
// destructuring assignment of the this.currentUser object
9-
const username = 'admin';
10-
const password = 'admin';
9+
const username = 'user1';
10+
const password = '12345';
1111

1212
//cy.visit('/login')
1313

cypress/support/commands.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//
1212
// -- This is a parent command --
1313
Cypress.Commands.add('loginWithUrl', (path) => {
14-
const user = {username:"admin",password:"admin"}
14+
const user = {username:"user",password:"1234"}
1515

1616
cy.visit(path)
1717
cy.get('input[id=formBasicUsername]')

package-lock.json

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

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
"bootstrap": "4.6.0",
1919
"eslint-plugin-react-hooks": "4.2.0",
2020
"node-sass": "4.14.1",
21-
"react": "17.0.1",
21+
"react": "^16.14.0",
2222
"react-bootstrap": "1.5.2",
23-
"react-dom": "17.0.1",
23+
"react-dom": "^16.14.0",
2424
"react-redux": "7.2.2",
2525
"react-router-dom": "5.2.0",
2626
"react-scripts": "4.0.3",
@@ -54,7 +54,7 @@
5454
]
5555
},
5656
"devDependencies": {
57-
"@babel/core": "7.12.3",
57+
"@babel/core": "^7.13.14",
5858
"@storybook/addon-actions": "6.1.21",
5959
"@storybook/addon-essentials": "6.1.21",
6060
"@storybook/addon-links": "6.1.21",

src/__tests__/__snapshots__/storybook.test.ts.snap

Lines changed: 52 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,21 +1026,66 @@ exports[`Storyshots Login onlyInput 1`] = `
10261026
</div>
10271027
`;
10281028

1029+
exports[`Storyshots Profile default 1`] = `
1030+
<div
1031+
className="page-content container"
1032+
>
1033+
<div
1034+
className="px-1 w-100 mt-1 mb-3 "
1035+
>
1036+
<div
1037+
className="w-100 title-action"
1038+
>
1039+
<h1
1040+
className="mr-1 h4"
1041+
>
1042+
My Profile
1043+
</h1>
1044+
<button
1045+
className="btn btn-primary"
1046+
disabled={false}
1047+
onClick={[Function]}
1048+
type="button"
1049+
>
1050+
<img
1051+
alt="edit icon"
1052+
className="pr-2"
1053+
src="edit_white_24dp.svg"
1054+
/>
1055+
Edit
1056+
</button>
1057+
</div>
1058+
</div>
1059+
<div
1060+
className="profile-information-display p-0 w-100"
1061+
>
1062+
<h2
1063+
className="h3 pb-3"
1064+
/>
1065+
<dl>
1066+
<dt>
1067+
Username
1068+
</dt>
1069+
<dd />
1070+
<dt>
1071+
Groups
1072+
</dt>
1073+
<dd />
1074+
</dl>
1075+
</div>
1076+
</div>
1077+
`;
1078+
10291079
exports[`Storyshots Registration default 1`] = `
10301080
<div
1031-
className="h-100 container"
1081+
className="container"
10321082
id="registrationContainer"
1033-
style={
1034-
Object {
1035-
"position": "relative",
1036-
}
1037-
}
10381083
>
10391084
<div
10401085
className="row"
10411086
>
10421087
<div
1043-
className="col-md-6 offset-md-3"
1088+
className="px-3 w-100"
10441089
>
10451090
<h1>
10461091
Create new account
Lines changed: 1 addition & 0 deletions
Loading

src/background/api/auth.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import {
1010
checkedCookies,
1111
removeTokens
1212
} from "../redux/actions/tokens";
13-
import { addUser } from "../redux/actions/user";
1413
import { AccessToken, CookieStatus } from "../redux/actions/tokenTypes";
1514
import { deleteCookie, getCookie, setCookie } from "../methods/cookies";
15+
import {updateUser} from "../redux/actions/user";
1616

1717
// reference: https://daveceddia.com/access-redux-store-outside-react/
1818

@@ -57,7 +57,7 @@ export const loginWithUsernameAndPassword = (
5757
.then((data: AxiosResponse<BackendLoginData>) => {
5858
console.log(data.data);
5959
store.dispatch(addRefreshToken(data.data.tokenValue));
60-
store.dispatch(addUser(data.data.user as UserState));
60+
store.dispatch(updateUser(data.data.user as UserState));
6161

6262
if (stayLoggedIn) {
6363
setCookie(cookieName, data.data.tokenValue, 60);
@@ -109,7 +109,7 @@ export const getAccessTokenWithRefreshToken = () => {
109109
const getOwnUserData = (userId: number) => {
110110
Axios.get<UserState>(`${hostname}${userPath}/${userId}/info`)
111111
.then((response: AxiosResponse<UserState>) => {
112-
store.dispatch(addUser(response.data));
112+
store.dispatch(updateUser(response.data));
113113
})
114114
.catch((error) => {
115115
console.log(error);

0 commit comments

Comments
 (0)