Skip to content

Commit 5bf15b9

Browse files
committed
WIP for #536
1 parent 3ceb633 commit 5bf15b9

File tree

5 files changed

+25
-32
lines changed

5 files changed

+25
-32
lines changed

client/src/components/UserFeedbackWidget.jsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,16 @@ export const UserFeedbackWidget = () => {
2727
};
2828

2929
const captureScreenshot = useCallback(async () => {
30+
window.scrollTo({top: 0, behavior: "instant"});
3031
document.body.classList.add("feedback-capture");
3132
const canvas = await html2canvas(document.body, {
3233
backgroundColor: null,
3334
useCORS: true,
3435
scale: 1,
35-
windowWidth: document.documentElement.clientWidth,
36-
windowHeight: document.documentElement.clientHeight
36+
windowWidth: document.body.clientWidth,
37+
windowHeight: document.body.scrollHeight
3738
});
38-
setTimeout(() => document.body.classList.remove("feedback-capture"), 625);
39+
setTimeout(() => document.body.classList.remove("feedback-capture"), 825);
3940
return canvas.toDataURL("image/png");
4041
}, []);
4142

client/src/hooks/UseLogout.jsx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,16 @@ export const useLogout = () => {
1111

1212
const logoutUser = useCallback((e, setIsAuthenticated) => {
1313
stopEvent(e);
14+
navigate("/authentication-switch");
1415
logout().then(() => {
15-
useAppStore.setState(() => ({
16-
currentOrganization: { name: "" },
17-
breadcrumbPaths: [],
18-
user: { name: "" }
19-
}));
20-
2116
sessionStorage.removeItem(SESSION_STORAGE_LOCATION);
22-
navigate("/authentication-switch");
23-
17+
setIsAuthenticated(false);
2418
setTimeout(() => {
25-
setIsAuthenticated(false);
19+
useAppStore.setState(() => ({
20+
currentOrganization: { name: "" },
21+
breadcrumbPaths: [],
22+
user: { name: "" }
23+
}));
2624
navigate("/home");
2725
}, 375);
2826
});

client/src/locale/en.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -951,17 +951,16 @@ const en = {
951951
},
952952
feedback: {
953953
title: "Provide Feedback",
954-
info: "Like what you see? Have a suggestion? Let us know what you think here",
954+
info: "Like what you see? Have a suggestion? Let us know what you think here.",
955955
disclaimer: "We will use this information to fix problems, improve our products and help you. " +
956956
"We may follow up with you regarding your feedback. " +
957-
"Please make sure the feedback does not contain any confidential, sensitive, or personal information. " +
958957
"For more information, please review our <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://edu.nl/fcgbd\">Privacy Notice</a>.",
959958
help: "Need help?",
960959
helpInfo: "For questions or issues, please reach out to us at <a href='mailto:support@surf.nl'>support@surf.nl</a>",
961960
send: "Provide feedback",
962961
flash: "Your feedback has been sent. Thanks!",
963962
widgetLabel: "Feedback",
964-
includeScreenshot: "Include screenshot",
963+
includeScreenshot: "I agree to have a screenshot of the current page automatically included in the feedback message",
965964
tooLarge: "The screenshot is too large (max 5MB). It was not attached."
966965
},
967966
myOrganization: {

client/src/pages/UserHome.jsx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import "./UserHome.scss";
2-
import React from "react";
2+
import React, {useEffect} from "react";
33
import {useAppStore} from "../stores/AppStore";
44
import {Button, ButtonType} from "@surfnet/sds";
55
import I18n from "../locale/I18n";
@@ -22,16 +22,20 @@ const UserHome = () => {
2222
} else if (!isEmpty(user.joinRequests) && isEmpty(currentOrganization?.id)) {
2323
newLocation = "/relax"
2424
}
25+
26+
useEffect(() => {
27+
if (newLocation === null) {
28+
useAppStore.setState({
29+
breadcrumbPaths: [
30+
{path: "/home", value: I18n.t("breadCrumb.home"), menuItemName: mainMenuItems.home}
31+
]
32+
});
33+
}
34+
}, []);
35+
2536
if (newLocation !== null) {
2637
return <Navigate to={newLocation} replace/>;
27-
} else {
28-
useAppStore.setState({
29-
breadcrumbPaths: [
30-
{path: "/home", value: I18n.t("breadCrumb.home"), menuItemName: mainMenuItems.home}
31-
]
32-
});
3338
}
34-
3539
const navigateInner = (menuItem, path) => {
3640
navigate(path);
3741
useAppStore.setState(() => ({
Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
package access.model;
22

3-
import lombok.AllArgsConstructor;
4-
import lombok.Getter;
5-
import lombok.NoArgsConstructor;
6-
import lombok.Setter;
7-
8-
import java.io.Serializable;
9-
10-
@AllArgsConstructor
11-
@NoArgsConstructor
123
public class DisconnectionRequest extends ConnectionRequest {
134

145
}

0 commit comments

Comments
 (0)