Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add link to data browser + prefix in dataset overview page #617

Merged
merged 8 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions app/scripts/components/common/notebook-connect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import { Button, ButtonProps } from '@devseed-ui/button';
import {
CollecticonBook,
CollecticonCode,
CollecticonCog
CollecticonCog,
CollecticonDownload2
} from '@devseed-ui/collecticons';
import { Modal } from '@devseed-ui/modal';
import { DatasetData, datasets } from 'veda';
Expand Down Expand Up @@ -78,11 +79,12 @@ const DatasetUsageLabel = styled.div`
}
`;

type DatasetUsageType = 'jupyter' | 'github' | 'unknown';
type DatasetUsageType = 'jupyter' | 'github' | 'download' | 'unknown';

const IconByType: Record<DatasetUsageType, any> = {
jupyter: <CollecticonCog />,
github: <CollecticonBook />,
download: <CollecticonDownload2 />,
unknown: <CollecticonCog />
};

Expand All @@ -100,6 +102,8 @@ export function NotebookConnectModal(props: {
let type = 'unknown';
if (d.url.match('nasa-veda.2i2c.cloud')) type = 'jupyter';
else if (d.url.match('github.com/NASA-IMPACT/veda-docs')) type = 'github';
// TO DO: browser UI url pattern check
else if (d.url.match('browseui')) type = 'download';
hanbyul-here marked this conversation as resolved.
Show resolved Hide resolved
return {
...d,
type
Expand Down Expand Up @@ -186,7 +190,7 @@ function NotebookConnectButtonSelf(props: NotebookConnectButtonProps) {
size={size}
>
<CollecticonCode meaningful={compact} title='Open data usage options' />
{compact ? '' : 'Analyze data (Python)'}
{compact ? '' : 'Access Data'}
</Button>
<NotebookConnectModal
dataset={dataset}
Expand Down
3 changes: 3 additions & 0 deletions mock/datasets/no2.data.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ usage:
- url: 'https://github.com/NASA-IMPACT/veda-docs'
label: All the docs for the site
title: 'Documentaion repo'
- url: https://d36s2ep3ahcq5b.cloudfront.net/browseui/index.html#ch4_inverse_flux
label: Data Browser
title: Download data
media:
src: ::file ./no2--dataset-cover.jpg
alt: Power plant shooting steam at the sky.
Expand Down
Loading