-
Notifications
You must be signed in to change notification settings - Fork 2
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
Conversation
@@ -137,6 +137,42 @@ export const Dashboard = () => { | |||
values.tenant, | |||
]); | |||
|
|||
const handleExport = React.useCallback( |
There was a problem hiding this comment.
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 ? ( |
There was a problem hiding this comment.
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 ? ( |
There was a problem hiding this comment.
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
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