diff --git a/src/components/JobsHistory/__tests__/JobsHistoryTable.unit.test.tsx b/src/components/JobsHistory/__tests__/JobsHistoryTable.unit.test.tsx
deleted file mode 100644
index 832f16187..000000000
--- a/src/components/JobsHistory/__tests__/JobsHistoryTable.unit.test.tsx
+++ /dev/null
@@ -1,94 +0,0 @@
-import { render, screen } from "@testing-library/react";
-import { MemoryRouter } from "react-router";
-import JobsHistoryTable, { JobHistory } from "./../JobsHistoryTable";
-
-global.ResizeObserver = jest.fn().mockImplementation(() => ({
- observe: jest.fn(),
- unobserve: jest.fn(),
- disconnect: jest.fn()
-}));
-
-describe("JobsHistoryTable", () => {
- const data: JobHistory[] = [
- {
- id: "1",
- name: "JobName1",
- status: "SUCCESS",
- duration_millis: 123456,
- created_at: "2022-01-01T00:00:00Z",
- success_count: 250,
- error_count: 0,
- hostname: "localhost",
- resource_id: "resource_id",
- resource_type: "topology",
- time_start: "2022-01-01T00:00:00Z",
- time_end: "2022-01-01T00:02:03Z",
- resource_name: "resource_name_1"
- },
- {
- id: "2",
- name: "JobName2",
- status: "FAILED",
- duration_millis: 654321,
- created_at: "2022-01-02T00:00:00Z",
- success_count: 300,
- error_count: 0,
- hostname: "localhost",
- resource_id: "resource_id_2",
- resource_type: "canary",
- time_start: "2022-01-01T00:00:00Z",
- time_end: "2022-01-01T00:02:03Z",
- resource_name: "resource_name_2"
- }
- ];
-
- it("renders the table with the correct column headers", () => {
- render(
-
-
-
- );
- expect(
- screen.getByRole("columnheader", { name: "Resource" })
- ).toBeInTheDocument();
-
- expect(
- screen.getByRole("columnheader", { name: "Timestamp" })
- ).toBeInTheDocument();
- expect(
- screen.getByRole("columnheader", { name: "Job Name" })
- ).toBeInTheDocument();
- expect(
- screen.getByRole("columnheader", { name: "Status" })
- ).toBeInTheDocument();
- expect(
- screen.getByRole("columnheader", { name: "Duration" })
- ).toBeInTheDocument();
- });
-
- it("renders the table with the correct data cells", () => {
- render(
-
-
-
- );
-
- expect(
- screen.getByRole("cell", {
- name: /Job Name 1/i
- })
- ).toBeInTheDocument();
- expect(screen.getByRole("cell", { name: "2m3s" })).toBeInTheDocument();
- expect(
- screen.getByRole("cell", { name: /resource_name_1/i })
- ).toBeInTheDocument();
-
- expect(
- screen.getByRole("cell", { name: /Job Name 2/i })
- ).toBeInTheDocument();
- expect(screen.getByRole("cell", { name: "10m54s" })).toBeInTheDocument();
- expect(
- screen.getByRole("cell", { name: /resource_name_2/i })
- ).toBeInTheDocument();
- });
-});
diff --git a/src/components/ReactSelectDropdown/index.tsx b/src/components/ReactSelectDropdown/index.tsx
index 1693ed4bd..54d538b2d 100644
--- a/src/components/ReactSelectDropdown/index.tsx
+++ b/src/components/ReactSelectDropdown/index.tsx
@@ -10,14 +10,13 @@ import {
useState
} from "react";
import { Controller } from "react-hook-form";
-
+import CreatableSelect from "react-select/creatable";
import Select, {
SingleValue,
StylesConfig,
components,
defaultTheme
-} from "react-select";
-import CreatableSelect from "react-select/creatable";
+} from "react-windowed-select";
import { Avatar } from "../../ui/Avatar";
const { colors } = defaultTheme;
@@ -232,6 +231,7 @@ export const ReactSelectDropdown = ({
}}
options={options}
placeholder={placeholder}
+ // @ts-expect-error
styles={selectStyles}
tabSelectsValue={false}
value={valueControlled}
@@ -279,9 +279,11 @@ export const ReactSelectDropdown = ({
hideSelectedOptions={false}
isClearable={false}
menuIsOpen
+ // @ts-expect-error
onChange={onSelectChange}
options={options}
placeholder={placeholder}
+ // @ts-expect-error
styles={selectStyles}
tabSelectsValue={false}
value={value}
diff --git a/src/ui/Dropdowns/MultiSelectDropdown.tsx b/src/ui/Dropdowns/MultiSelectDropdown.tsx
index 15354fd8f..51c2ca630 100644
--- a/src/ui/Dropdowns/MultiSelectDropdown.tsx
+++ b/src/ui/Dropdowns/MultiSelectDropdown.tsx
@@ -1,11 +1,11 @@
import { autoUpdate, useFloating } from "@floating-ui/react";
-import { Popover } from "@headlessui/react";
+import { Popover, PopoverButton, PopoverPanel } from "@headlessui/react";
import { ChevronDownIcon, ChevronUpIcon } from "@heroicons/react/solid";
import clsx from "clsx";
import { isArray } from "lodash";
import React, { ComponentProps } from "react";
import { createPortal } from "react-dom";
-import Select, { components } from "react-select";
+import Select, { components } from "react-windowed-select";
export type GroupByOptions = {
isTag?: boolean;
@@ -16,12 +16,13 @@ export type GroupByOptions = {
type ConfigGroupByDropdownProps = Omit<
ComponentProps
,
- "components" | "defaultValue"
+ "components" | "defaultValue" | "windowThreshold"
> & {
label?: string;
containerClassName?: string;
dropDownClassNames?: string;
defaultValue?: string;
+ closeMenuOnSelect?: boolean;
};
export function MultiSelectDropdown({
@@ -34,6 +35,8 @@ export function MultiSelectDropdown({
dropDownClassNames = "w-auto max-w-[300px]",
value,
defaultValue,
+ closeMenuOnSelect = false,
+ onChange = () => {},
...props
}: ConfigGroupByDropdownProps) {
const { refs, floatingStyles } = useFloating({
@@ -43,9 +46,9 @@ export function MultiSelectDropdown({
return (
- {({ open }) => (
+ {({ open, close }) => (
<>
-
+
{(value as GroupByOptions).icon}
)}
- {!(value as GroupByOptions) && (
+ {(value as GroupByOptions) && (
{(value as GroupByOptions).label?.toString()}
@@ -102,10 +105,10 @@ export function MultiSelectDropdown({