Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue/162 - Prevent access to calendar and settings page and redirect when not logged in closes #162 #237

Merged
merged 1 commit into from
Apr 12, 2020

Conversation

AlexanderTheGrape
Copy link
Contributor

@AlexanderTheGrape AlexanderTheGrape commented Apr 8, 2020

issue/162 - Prevent access to calendar and settings page and redirect when not logged in

  • The pull request is complete according to the following criteria:
    • Acceptance criteria have been met
    • The documentation is kept up-to-date
    • Comprehensive tests (if applicable) have been generated and all pass.
    • The pull request describes the changes that have been made, and enough information is present in the description for any developer to understand what has changed
    • Commits have been squashed (or will be on merge).
    • The branch name is descriptive and follows the pull request title format : {issue/bug...}/(Issue Number) - Name of issue. E.g bug/30-Fix-Project
    • The pull request title is of the following format : {issue/bug...}/(Issue Number) - Name of issue. E.g bug/30-Fix-Project
    • The description uses github syntax to link to the issue. E,g Resolves se701g2/Doto#{Number}
    • At least two reviewers assigned. One of which must be the assigner of the issue.
    • If there are merge conflicts, run git rebase as opposed to git merge with master.

@AlexanderTheGrape
Copy link
Contributor Author

There's just one remaining linting issue I haven't been able to change so far. It says "React Hook useEffect has a missing dependency: 'setTheme'.", but when I import setTheme, the import doesn't get used.
If any reviewers have a suggestion, please let me know!

@Matteas-Eden Matteas-Eden self-requested a review April 8, 2020 06:19
@Matteas-Eden Matteas-Eden added bug Something isn't working frontend labels Apr 8, 2020
@Matteas-Eden
Copy link
Contributor

There's just one remaining linting issue I haven't been able to change so far. It says "React Hook useEffect has a missing dependency: 'setTheme'.", but when I import setTheme, the import doesn't get used.
If any reviewers have a suggestion, please let me know!

So I looked into it, and it appears that the code causing the build to fail is:

useEffect(() => {
	const fetchTasks = async () => {
		const tasks = await DotoService.getTasks();
		setTasks(tasks);
	};
	const fetchUserInfo = async () => {
		const userInfo = await DotoService.getUserInfo();
		setTheme(userInfo.themePreference);
	};
	fetchUserInfo();
	fetchTasks();
}, []);

This little code snippet is from doto-frontend/src/components/pages/Calendar/Calendar.js. The reason that the build is failing is because of the empty array after the anonymous function. As in;
useEffect(()=>{...}, [])
That second argument is causing the build to fail. So, try removing it. It's a little strange because this file wasn't actually changed by your PR, but maybe if this works then your PR can fix it.

@AlexanderTheGrape
Copy link
Contributor Author

Cheers Matt, I've made that change and works as expected.

Copy link
Contributor

@jordansimsmith jordansimsmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work guys. Well done making the PrivateRoute reusable component. Some suggestions but non blocking.

Copy link
Contributor

@jordansimsmith jordansimsmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks for addressing the comments @AlexanderTheGrape

Copy link
Contributor

@Matteas-Eden Matteas-Eden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, nice work @AlexanderTheGrape!

@Matteas-Eden Matteas-Eden merged commit 97c640c into se701g2:master Apr 12, 2020
utri092 pushed a commit to KimberleyEvans-Parker/Doto that referenced this pull request Apr 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working frontend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Redirect user to login page from calendar if they are not logged in
3 participants