loucyx commented on code in PR #42184:
URL: https://github.com/apache/airflow/pull/42184#discussion_r1755787417
##########
airflow/ui/src/dagsList.tsx:
##########
@@ -17,91 +17,55 @@
* under the License.
*/
-import { ColumnDef } from "@tanstack/react-table";
-import { useSearchParams } from "react-router-dom";
import {
Badge,
- Button,
- ButtonProps,
Checkbox,
Heading,
HStack,
- Input,
- InputGroup,
- InputGroupProps,
- InputLeftElement,
- InputProps,
- InputRightElement,
Select,
Spinner,
VStack,
} from "@chakra-ui/react";
+import type { ColumnDef } from "@tanstack/react-table";
import { Select as ReactSelect } from "chakra-react-select";
-import { FiSearch } from "react-icons/fi";
+import { useSearchParams } from "react-router-dom";
-import { DAG } from "openapi/requests/types.gen";
import { useDagServiceGetDags } from "openapi/queries";
+import type { DAG } from "openapi/requests/types.gen";
+import { useCallback, type ChangeEventHandler } from "react";
import { DataTable } from "./components/DataTable";
-import { pluralize } from "./utils/pluralize";
import { useTableURLState } from "./components/DataTable/useTableUrlState";
+import { QuickFilterButton } from "./components/QuickFilterButton";
+import { SearchBar } from "./components/SearchBar";
+import { pluralize } from "./utils/pluralize";
-const SearchBar = ({
- groupProps,
- inputProps,
- buttonProps,
-}: {
- groupProps?: InputGroupProps;
- inputProps?: InputProps;
- buttonProps?: ButtonProps;
-}) => (
- <InputGroup {...groupProps}>
- <InputLeftElement pointerEvents="none">
- <FiSearch />
- </InputLeftElement>
- <Input placeholder="Search DAGs" pr={150} {...inputProps} />
- <InputRightElement width={150}>
- <Button
- variant="ghost"
- colorScheme="blue"
- width={140}
- height="1.75rem"
- fontWeight="normal"
- {...buttonProps}
- >
- Advanced Search
- </Button>
- </InputRightElement>
- </InputGroup>
-);
-
-const columns: ColumnDef<DAG>[] = [
+const columns: Array<ColumnDef<DAG>> = [
{
accessorKey: "dag_id",
- header: "DAG",
cell: ({ row }) => row.original.dag_display_name,
+ header: "DAG",
},
{
accessorKey: "is_paused",
- header: () => "Is Paused",
enableSorting: false,
+ header: () => "Is Paused",
},
{
accessorKey: "timetable_description",
- header: () => "Schedule",
cell: (info) =>
- info.getValue() !== "Never, external triggers only"
- ? info.getValue()
- : undefined,
+ info.getValue() === "Never, external triggers only"
Review Comment:
Conditions with the shape: `something !== value ? a : b` are changed to
`something === value ? b : a`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]