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-227 HSB user pages #53

Merged
merged 1 commit into from
Jan 17, 2024
Merged

HOSTSD-227 HSB user pages #53

merged 1 commit into from
Jan 17, 2024

Conversation

Fosol
Copy link
Contributor

@Fosol Fosol commented Jan 17, 2024

All pages for HSB users have been wired up with basic functionality. There are some UI issues, but all these can be addressed later.

  • Added the All Servers page
  • Added new Drive Space chart for a single server
  • Updated most charts to require passing data to them. This allows the parent to control what data is displayed instead of a hard link to one store.

Drive Space Chart

image

Multi Organization

image

Single Organization

image

Single OS

image

Single Server

image

All Servers

image

@Fosol Fosol added the enhancement New feature or request label Jan 17, 2024
@Fosol Fosol self-assigned this Jan 17, 2024
Copy link
Contributor Author

Choose a reason for hiding this comment

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

not needed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not needed

export default function Page() {
useSecureRoute((state) => state.isOrganizationAdmin, '/');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Simple way to force redirect. What I don't like about it is that the whole page needs to be use client for it to work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not needed

);
useSecureRoute((state) => state.isClient, '/');

return <Dashboard />;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved all this common logic to a single component that both HSB and Client users can share.

return (
<Col>
<h1></h1>All Servers
<AllocationByStorageVolume organizations={organizations} serverItems={serverItems} />
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The all servers page chart doesn't expand correctly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not needed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not needed

import { useAllocationByOS } from './hooks';
import { getColumns, getLabel } from './utils';

export interface IAllocationTableProps {
/** Filter servers by their OS */
operatingSystem: OperatingSystems;
operatingSystem?: string;
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've moved the data out so that it can be passed in by the parent.


/**
* Provides a function to filter server items.
* @param operatingSystem Operating system filter.
* @returns Function to filter server items by operating system and predicate.
*/
export const useAllocationByOS = (operatingSystem: OperatingSystems) => {
export const useAllocationByOS = (operatingSystem?: string) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Improved implementation to not require an enum

@Fosol Fosol merged commit 9b3193f into bcgov:main Jan 17, 2024
1 check passed
@Fosol Fosol deleted the 227 branch January 17, 2024 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant