bbovenzi commented on code in PR #55604:
URL: https://github.com/apache/airflow/pull/55604#discussion_r2349294440
##########
airflow-core/src/airflow/ui/src/components/LimitedItemsList.tsx:
##########
@@ -16,67 +16,178 @@
* specific language governing permissions and limitations
* under the License.
*/
-import { Box, Text, HStack, StackSeparator } from "@chakra-ui/react";
+import { Box, Text, HStack, useDisclosure, Heading, Stack } from
"@chakra-ui/react";
import React, { type ReactNode } from "react";
import { useTranslation } from "react-i18next";
-import { Tooltip } from "./ui";
+import { Tooltip, Dialog, Button } from "./ui";
type ListProps = {
readonly icon?: ReactNode;
readonly interactive?: boolean;
readonly items: Array<ReactNode | string>;
readonly maxItems?: number;
+ readonly modalTitle?: string;
readonly separator?: string;
+ readonly showModal?: boolean;
};
export const LimitedItemsList = ({
icon,
interactive = false,
items,
maxItems,
+ modalTitle = "All Items",
separator = ", ",
+ showModal = false,
}: ListProps) => {
const { t: translate } = useTranslation("components");
+ const { onClose, onOpen, open } = useDisclosure();
const shouldTruncate = maxItems !== undefined && items.length > maxItems;
const displayItems = shouldTruncate ? items.slice(0, maxItems) : items;
const remainingItems = shouldTruncate ? items.slice(maxItems) : [];
const remainingItemsList = interactive ? (
- <HStack separator={<StackSeparator />}>{remainingItems}</HStack>
+ <Box maxH="200px" overflowY="auto" p={2}>
+ <Text fontSize="sm" fontWeight="bold" mb={2}>
+ {translate("limitedList.allItems", { count: items.length })}
+ </Text>
+ <Stack gap={1}>
+ {items.map((item, index) => (
+ // eslint-disable-next-line react/no-array-index-key
+ <Box fontSize="sm" key={index}>
Review Comment:
If item is text and unique, then that should be the key, no?
--
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]