Skip to content

Commit

Permalink
HOSTSD-300 Update filter select (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fosol authored Mar 22, 2024
1 parent e3b4181 commit 938a188
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 15 deletions.
6 changes: 3 additions & 3 deletions src/dashboard/src/app/style-guide/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { Button } from '@/components/buttons';
import { Checkbox } from '@/components/forms/checkbox';
import { Select, FilterDropdown } from '@/components/forms/select';
import { FilterDropdown, Select } from '@/components/forms/select';
import { Text } from '@/components/forms/text';
import { Toggle } from '@/components/forms/toggle';
import styles from './StyleGuide.module.scss';
Expand Down Expand Up @@ -83,15 +83,15 @@ export default function Page() {
<Select
variant="filter"
title="filter dropdown example using select"
options={[]}
options={mockOptions}
label="Filter dropdown"
placeholder="Default option"
></Select>
<br />
<Select
variant="primary"
title="simple dropdown example"
options={[]}
options={mockOptions}
label="Simple dropdown"
placeholder="Default option"
></Select>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import { Select } from '@/components';
import { FilterDropdown } from '@/components';
import { IServerItemListModel } from '@/hooks';
import { useFilteredOperatingSystemItems, useFilteredServerItems } from '@/hooks/filter';
import { useOperatingSystemItems, useServerItems } from '@/hooks/lists';
Expand Down Expand Up @@ -41,9 +41,8 @@ export const FilteredOperatingSystemItems = ({}: IFilteredOperatingSystemItemsPr
]);

return (
<Select
<FilterDropdown
label="Operating system"
variant="filter"
options={filteredOperatingSystemItemOptions}
placeholder="Select OS"
value={values.operatingSystemItem?.id ?? ''}
Expand Down
5 changes: 2 additions & 3 deletions src/dashboard/src/components/filter/FilteredOrganizations.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import { Select } from '@/components';
import { FilterDropdown } from '@/components';
import { IOperatingSystemItemListModel, IServerItemListModel, useAuth } from '@/hooks';
import {
useFilteredOperatingSystemItems,
Expand Down Expand Up @@ -47,9 +47,8 @@ export const FilteredOrganizations = ({}: IFilteredOrganizationsProps) => {
}, [setFilteredOrganizations, organizations, setValues, filteredOrganizations.length]);

return filteredOrganizationOptions.length > 1 ? (
<Select
<FilterDropdown
label="Organization"
variant="filter"
options={filteredOrganizationOptions}
placeholder="Select organization"
value={values.organization?.id ?? ''}
Expand Down
5 changes: 2 additions & 3 deletions src/dashboard/src/components/filter/FilteredServerItems.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import { Select } from '@/components';
import { FilterDropdown } from '@/components';
import { useFilteredServerItems } from '@/hooks/filter';
import { useServerItems } from '@/hooks/lists';
import { useFilteredStore } from '@/store';
Expand All @@ -26,9 +26,8 @@ export const FilteredServerItems = () => {
}, [setFilteredServerItems, serverItems, setValues, filteredServerItems.length]);

return (
<Select
<FilterDropdown
label="Server"
variant="filter"
options={filteredServerItemOptions}
placeholder="Select server"
value={values.serverItem?.serviceNowKey ?? ''}
Expand Down
5 changes: 2 additions & 3 deletions src/dashboard/src/components/filter/FilteredTenants.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import { Select } from '@/components';
import { FilterDropdown } from '@/components';
import {
IOperatingSystemItemListModel,
IOrganizationListModel,
Expand Down Expand Up @@ -60,9 +60,8 @@ export const FilteredTenants = ({}: IFilteredTenantsProps) => {
}, [filteredTenants.length, setFilteredTenants, setValues, tenants]);

return filteredTenantOptions.length > 1 ? (
<Select
<FilterDropdown
label="Tenant"
variant="filter"
options={filteredTenantOptions}
placeholder="Select tenant"
value={values.tenant?.id ?? ''}
Expand Down

0 comments on commit 938a188

Please sign in to comment.