Skip to content

Commit

Permalink
feat(datasets): download csv button (#3312)
Browse files Browse the repository at this point in the history
* feat(datasets): download csv button

* cleanup
  • Loading branch information
mikeldking committed Jun 29, 2024
1 parent f0f7392 commit 823abcd
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
34 changes: 32 additions & 2 deletions app/src/pages/dataset/DatasetPage.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
import React, { Suspense } from "react";
import { useLoaderData } from "react-router";

import { Flex, Text, View } from "@arizeai/components";
import {
ActionMenu,
Flex,
Icon,
Icons,
Item,
Text,
View,
} from "@arizeai/components";

import { Loading } from "@phoenix/components";

Expand Down Expand Up @@ -29,13 +37,35 @@ function DatasetPageContent({
borderBottomWidth="thin"
borderBottomColor="dark"
>
<Flex direction="row" justifyContent="space-between">
<Flex
direction="row"
justifyContent="space-between"
alignItems="center"
>
<Flex direction="column" justifyContent="space-between">
<Text elementType="h1" textSize="xlarge" weight="heavy">
{dataset.name}
</Text>
<Text color="text-700">{dataset.description || "--"}</Text>
</Flex>
<Flex direction="row" gap="size-100">
<ActionMenu
icon={<Icon svg={<Icons.DownloadOutline />} />}
onAction={(action) => {
switch (action) {
case "csv":
// TODO(datasets): change this URL to be more RESTful
window.open(
`/v1/datasets/download/csv/${dataset.id}`,
"_blank"
);
break;
}
}}
>
<Item key="csv">Download CSV</Item>
</ActionMenu>
</Flex>
</Flex>
</View>
<DatasetExamplesTable dataset={dataset} />
Expand Down
1 change: 0 additions & 1 deletion app/src/pages/datasets/DatasetsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ function CreateDatasetButton({ onDatasetCreated }: CreateDatasetButtonProps) {
};
return (
<>
{/* Disabled until the mutation is created */}
<Button variant="default" onClick={onCreateDataset}>
Create Dataset
</Button>
Expand Down

0 comments on commit 823abcd

Please sign in to comment.