-
Notifications
You must be signed in to change notification settings - Fork 24
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
Remove wkw datasource suggestions #7697
Changes from all commits
2849111
c9f752a
de8017a
c1b52f4
b264843
1673c15
c1c4630
97a9d6d
1d5437b
b0be7cd
5dd5e4d
cb4d67f
ef4188b
db9ba6d
f755c22
724445d
5f7c546
b5fb853
67e3295
dd1f4e1
c1cee08
dab6a0c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ import { | |
EllipsisOutlined, | ||
EyeOutlined, | ||
LoadingOutlined, | ||
PlusCircleOutlined, | ||
PlusOutlined, | ||
ReloadOutlined, | ||
SettingOutlined, | ||
|
@@ -18,9 +17,9 @@ import Toast from "libs/toast"; | |
import messages from "messages"; | ||
import CreateExplorativeModal from "dashboard/advanced_dataset/create_explorative_modal"; | ||
import { MenuProps, Modal, Typography } from "antd"; | ||
import { useState } from "react"; | ||
import { confirmAsync } from "dashboard/dataset/helper_components"; | ||
import { useQueryClient } from "@tanstack/react-query"; | ||
import { useState } from "react"; | ||
|
||
const disabledStyle: React.CSSProperties = { | ||
pointerEvents: "none", | ||
|
@@ -193,18 +192,31 @@ function DatasetActionView(props: Props) { | |
style={disabledWhenReloadingStyle} | ||
type="link" | ||
> | ||
{isReloading ? <LoadingOutlined /> : <ReloadOutlined className="icon-margin-right" />} | ||
{isReloading ? ( | ||
<LoadingOutlined className="icon-margin-right" /> | ||
) : ( | ||
<ReloadOutlined className="icon-margin-right" /> | ||
)} | ||
Reload | ||
</a> | ||
); | ||
const importLink = ( | ||
<div className="dataset-table-actions"> | ||
<Link | ||
to={`/datasets/${dataset.owningOrganization}/${dataset.name}/import`} | ||
className="import-dataset" | ||
const datasetSettingsLink = ( | ||
<> | ||
<LinkWithDisabled | ||
to={`/datasets/${dataset.owningOrganization}/${dataset.name}/edit`} | ||
title="Open Dataset Settings" | ||
disabled={isReloading} | ||
> | ||
<PlusCircleOutlined className="icon-margin-right" /> | ||
Import | ||
<SettingOutlined className="icon-margin-right" /> | ||
Settings | ||
</LinkWithDisabled> | ||
</> | ||
); | ||
const brokenDatasetActions = ( | ||
<div className="dataset-table-actions"> | ||
<Link to={`/datasets/${dataset.owningOrganization}/${dataset.name}/edit`}> | ||
<SettingOutlined className="icon-margin-right" /> | ||
Settings | ||
</Link> | ||
{reloadLink} | ||
<a | ||
|
@@ -236,41 +248,35 @@ function DatasetActionView(props: Props) { | |
) : null} | ||
</div> | ||
); | ||
|
||
const activeDatasetActions = ( | ||
<> | ||
{" "} | ||
<NewAnnotationLink | ||
dataset={dataset} | ||
isReloading={isReloading} | ||
isCreateExplorativeModalVisible={isCreateExplorativeModalVisible} | ||
onShowCreateExplorativeModal={() => setIsCreateExplorativeModalVisible(true)} | ||
onCloseCreateExplorativeModal={() => setIsCreateExplorativeModalVisible(false)} | ||
/> | ||
<LinkWithDisabled | ||
to={`/datasets/${dataset.owningOrganization}/${dataset.name}/view`} | ||
title="View Dataset" | ||
disabled={isReloading} | ||
> | ||
<EyeOutlined className="icon-margin-right" /> | ||
View | ||
</LinkWithDisabled> | ||
{dataset.isEditable ? datasetSettingsLink : null} | ||
{reloadLink} | ||
</> | ||
); | ||
return ( | ||
<div> | ||
{dataset.isEditable && !dataset.isActive ? importLink : null} | ||
{dataset.isActive ? ( | ||
<div className="dataset-table-actions nowrap"> | ||
<NewAnnotationLink | ||
dataset={dataset} | ||
isReloading={isReloading} | ||
isCreateExplorativeModalVisible={isCreateExplorativeModalVisible} | ||
onShowCreateExplorativeModal={() => setIsCreateExplorativeModalVisible(true)} | ||
onCloseCreateExplorativeModal={() => setIsCreateExplorativeModalVisible(false)} | ||
/> | ||
<LinkWithDisabled | ||
to={`/datasets/${dataset.owningOrganization}/${dataset.name}/view`} | ||
title="View Dataset" | ||
disabled={isReloading} | ||
> | ||
<EyeOutlined className="icon-margin-right" /> | ||
View | ||
</LinkWithDisabled> | ||
{dataset.isEditable ? ( | ||
<React.Fragment> | ||
<LinkWithDisabled | ||
to={`/datasets/${dataset.owningOrganization}/${dataset.name}/edit`} | ||
title="Open Dataset Settings" | ||
disabled={isReloading} | ||
> | ||
<SettingOutlined className="icon-margin-right" /> | ||
Settings | ||
</LinkWithDisabled> | ||
{reloadLink} | ||
</React.Fragment> | ||
) : null} | ||
</div> | ||
) : null} | ||
{dataset.isEditable && !dataset.isActive ? brokenDatasetActions : null} | ||
<div className="dataset-table-actions nowrap"> | ||
{dataset.isActive ? activeDatasetActions : null} | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
@@ -330,7 +336,7 @@ export function getDatasetActionContextMenu({ | |
}, | ||
} | ||
: null, | ||
dataset.isEditable && dataset.isActive | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Am I correct, that we no longer have a "not imported" state for a dataset? In that case, is it possible for a dataset to not be active? The only option would be to delete a dataset 🤔 My thought is that we may not need this field There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I don't know what happens now if a datasource properties json does not exist (or is incomplete). I assume the dataset won't be active then. However, the front-end should still show the edit button. Otherwise, the dataset would not be usable/fixable as you say. |
||
dataset.isEditable | ||
? { | ||
key: "edit", | ||
label: "Open Settings", | ||
|
@@ -340,15 +346,6 @@ export function getDatasetActionContextMenu({ | |
} | ||
: null, | ||
|
||
dataset.isEditable && !dataset.isActive | ||
? { | ||
key: "import", | ||
label: "Import", | ||
onClick: () => { | ||
window.location.href = `/datasets/${dataset.owningOrganization}/${dataset.name}/import`; | ||
}, | ||
} | ||
: null, | ||
{ | ||
key: "reload", | ||
label: "Reload", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As according to the pr description, the "import" should always be named edit, I got rid of the import route (see router.tsx). I hope I didn't misunderstand this 🤞