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

HOSTSD-209 Fix all servers and auth bugs #55

Merged
merged 1 commit into from
Jan 19, 2024
Merged

HOSTSD-209 Fix all servers and auth bugs #55

merged 1 commit into from
Jan 19, 2024

Conversation

Fosol
Copy link
Contributor

@Fosol Fosol commented Jan 19, 2024

I've rewritten the page authorization so that we can now refresh the page and it won't redirect until it's completed loading the token.

Drive space will now load correct when a server is selected on the dashboard.

All servers will load correctly when you view that page before going to the dashboard.

@Fosol Fosol added bug Something isn't working enhancement New feature or request labels Jan 19, 2024
@Fosol Fosol self-assigned this Jan 19, 2024
const state = useAuth();

// Only allow Organization Admin role to view this page.
if (state.status === 'loading') return <div>Loading...</div>;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was hoping to extract this logic and put it into a shared function, but I can't seem to figure out the best way to do this because it's a conditional render.

available: fsi.availableSpace,
data: fsi,
}))
.sort((a, b) =>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cleaned up sorting

if (selectedServerItem) setDashboardServerItems([selectedServerItem]);
else setDashboardServerItems(filteredServerItems);

setDashboardDateRange(filteredDateRange);

if (filteredServerItem)
if (selectedServerItem)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correctly loads the currently selected server now.

@Fosol Fosol merged commit 8f71466 into bcgov:main Jan 19, 2024
1 check passed
@Fosol Fosol deleted the 209 branch January 19, 2024 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant