bbovenzi commented on code in PR #44869: URL: https://github.com/apache/airflow/pull/44869#discussion_r1882488658
########## airflow/ui/src/components/ui/clipboard.tsx: ########## Review Comment: `Clipboard.tsx` Let's make sure this is capitalized and exported from the `index.ts` file We can leave the warning for now. I am happy to fix that later. I might just port all of the chakra generated snippets to a separate directory so we don't have to do all of this manual formatting every single time. ########## airflow/ui/src/pages/TaskInstance/XCom/XCom.tsx: ########## @@ -0,0 +1,93 @@ +/*! + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import { Box } from "@chakra-ui/react"; +import type { ColumnDef } from "@tanstack/react-table"; +import { useParams, useSearchParams } from "react-router-dom"; + +import { useXcomServiceGetXcomEntries } from "openapi/queries"; +import type { XComResponse } from "openapi/requests/types.gen"; +import { DataTable } from "src/components/DataTable"; +import { useTableURLState } from "src/components/DataTable/useTableUrlState"; +import { ErrorAlert } from "src/components/ErrorAlert"; + +import { XComEntry } from "./XComEntry"; + +const XComColumn = (): Array<ColumnDef<XComResponse>> => [ Review Comment: ```suggestion const columns = Array<ColumnDef<XComResponse>> = [ ``` 1. start the variable names lowercase 2. We're not passing any arguments, its better as just an array ########## airflow/ui/src/pages/TaskInstance/XCom/XCom.tsx: ########## @@ -0,0 +1,93 @@ +/*! + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import { Box } from "@chakra-ui/react"; +import type { ColumnDef } from "@tanstack/react-table"; +import { useParams, useSearchParams } from "react-router-dom"; + +import { useXcomServiceGetXcomEntries } from "openapi/queries"; +import type { XComResponse } from "openapi/requests/types.gen"; +import { DataTable } from "src/components/DataTable"; +import { useTableURLState } from "src/components/DataTable/useTableUrlState"; +import { ErrorAlert } from "src/components/ErrorAlert"; + +import { XComEntry } from "./XComEntry"; + +const XComColumn = (): Array<ColumnDef<XComResponse>> => [ + { + accessorKey: "key", + enableSorting: false, + header: "Key", + meta: { + skeletonWidth: 10, + }, + }, + { + cell: ({ row: { original } }) => ( + <XComEntry + dagId={original.dag_id} + mapIndex={original.map_index} + runId={original.run_id} + taskId={original.task_id} + xcomKey={original.key} + /> + ), + enableSorting: false, + header: "Value", + meta: { + skeletonWidth: 10, Review Comment: Maybe we should make the skeleton the same size of the XComEntry skeleton? ########## airflow/ui/src/router.tsx: ########## @@ -51,6 +52,10 @@ export const router = createBrowserRouter( element: <Events />, path: "events", }, + { + element: <XCom />, + path: "xcoms", Review Comment: ```suggestion path: "xcom", ``` -- 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]
