pierrejeambrun commented on code in PR #45205: URL: https://github.com/apache/airflow/pull/45205#discussion_r1897889694
########## airflow/ui/src/pages/Variables/VariableAction.tsx: ########## @@ -0,0 +1,66 @@ +/*! + * 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. + */ +// TODO: Disable lint will be removed once the implementation completed + +/* eslint-disable no-alert */ +import { IconButton } from "@chakra-ui/react"; +import { FiEdit, FiEye, FiMoreVertical, FiTrash } from "react-icons/fi"; + +import { Menu } from "../../components/ui/Menu"; + +type VariableActionsProps = { + readonly variableKey: string; +}; + +export const VariableActions = ({ variableKey }: VariableActionsProps) => ( + <Menu.Root> + <Menu.Trigger asChild> + <IconButton aria-label="Action menu" variant="ghost"> + <FiMoreVertical /> + </IconButton> + </Menu.Trigger> + + <Menu.Content> + <Menu.Item + onClick={() => + alert(`To be implemented: Selected key is ${variableKey}`) Review Comment: Yes I also think that displaying everything in the table (very long description or key) will be a problem and make the table look bad. I would be in favour of truncating / ellipsis too long string in the table display. And either show the full text in a “tooltip” or add a “detail” view onClick that will get to a dedicated page with full text displayed for those values. Though I don’t think we need an “action” “view”. A simple link on the key as we do for tasks or dagrun is enough. -- 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]
