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-300 Update filter select #123

Merged
merged 1 commit into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading