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-295 Fix dashboard and filter #122

Merged
merged 1 commit into from
Mar 22, 2024
Merged

HOSTSD-295 Fix dashboard and filter #122

merged 1 commit into from
Mar 22, 2024

Conversation

Fosol
Copy link
Contributor

@Fosol Fosol commented Mar 22, 2024

If a user belongs to a tenant that owns more than one organization, the All Storage chart should display all organizations they have access to.

If the user only has access to a single tenant or a single organization hide those dropdown filter options.

Dashboard

image

@Fosol Fosol added the bug Something isn't working label Mar 22, 2024
@Fosol Fosol self-assigned this Mar 22, 2024
@@ -137,6 +137,42 @@ export const Dashboard = () => {
values.tenant,
]);

const handleExport = React.useCallback(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cleans things up and makes it easier to maintain.

@@ -46,7 +46,7 @@ export const FilteredOrganizations = ({}: IFilteredOrganizationsProps) => {
setValues((values) => ({ ...values, organization: organizations[0] }));
}, [setFilteredOrganizations, organizations, setValues, filteredOrganizations.length]);

return (
return filteredOrganizationOptions.length > 1 ? (
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Don't show dropdown unless there is more than one option

@@ -59,7 +59,7 @@ export const FilteredTenants = ({}: IFilteredTenantsProps) => {
if (tenants.length === 1) setValues((values) => ({ ...values, tenant: tenants[0] }));
}, [filteredTenants.length, setFilteredTenants, setValues, tenants]);

return filteredTenantOptions.length > 0 ? (
return filteredTenantOptions.length > 1 ? (
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Don't show dropdown unless there is more than one option

@Fosol Fosol merged commit e3b4181 into bcgov:main Mar 22, 2024
1 check passed
@Fosol Fosol deleted the 295 branch March 22, 2024 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant