-
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
Conversation
77d5fce
to
c9f752a
Compare
- but keep isEditMode prop due to onboarding process needing this prop
…ove-wkw-suggestions
Yes, since manually edited jsons are rare, it's okay in my opinion. |
<Button | ||
onClick={() => history.push(`/datasets/${organization}/${datasetName}/import`)} | ||
onClick={() => history.push(`/datasets/${organization}/${datasetName}/edit`)} |
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 🤞
@@ -137,54 +131,6 @@ function DatasetActionView(props: Props) { | |||
setIsReloading(false); | |||
}; | |||
|
|||
const onDeleteDataset = async () => { |
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.
This function was only used in the importLink
. And as I removed this, I also removed this function here
@@ -330,7 +236,7 @@ export function getDatasetActionContextMenu({ | |||
}, | |||
} | |||
: null, | |||
dataset.isEditable && dataset.isActive |
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.
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 isActive
anymore / do not need to consider it any longer in the frontend 🤔
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.
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?
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.
// Ensure that zarr layers (which aren't inferred by the back-end) are still | ||
// included in the inferred data source | ||
if ( | ||
savedDataSourceOnServer && | ||
"dataLayers" in savedDataSourceOnServer && | ||
inferredDataSource != null | ||
) { |
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.
This cannot be done as there is no longer a inferredDataSource
. So does this maybe result in errors with zarr layers?
I'd say the frontend changes are ready for the first review / comments |
const importLink = ( | ||
<div className="dataset-table-actions"> | ||
<Link | ||
to={`/datasets/${dataset.owningOrganization}/${dataset.name}/import`} | ||
className="import-dataset" | ||
> | ||
<PlusCircleOutlined className="icon-margin-right" /> | ||
Import | ||
</Link> | ||
{reloadLink} | ||
<a | ||
onClick={() => | ||
Modal.error({ | ||
title: "Cannot load this dataset", | ||
content: ( | ||
<div> | ||
<p>{dataset.status}</p> | ||
{dataset.status === "Deleted by user." ? ( | ||
<p> | ||
Even though this dataset was deleted by a user, it is still shown here, because | ||
it was referenced by at least one annotation. | ||
</p> | ||
) : null} | ||
</div> | ||
), | ||
}) | ||
} | ||
> | ||
<WarningOutlined className="icon-margin-right" /> | ||
Show Error | ||
</a> | ||
{dataset.status !== "Deleted by user." ? ( | ||
<a onClick={() => onDeleteDataset()}> | ||
<DeleteOutlined className="icon-margin-right" /> | ||
Delete Dataset | ||
</a> |
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.
I'm not sure whether it's a good idea to delete this. The use case is:
- a dataset exists on disk, but wk isn't able to read it properly (e.g., because of an invalid json)
- in that case, as a user I want to be able to see the issue, be able to fix it or to delete the dataset directly from the table.
I don't think that removing the wkw datasource suggestions means that the above use cases goes away.
cc @fm3
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.
I agree, it should still be possible to fix the json, and parsing errors should be reported. Just not the automated suggestions.
messages: dataSourceMessages, | ||
dataSourceSettingsStatus, | ||
}); | ||
// TODOM: handle case in which dataSource is null / could not be parsed by the server |
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.
todo
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.
please see my post below :)
I'd say both cases are handle relatively adequately. Thus, I removed this todo
This feature was added not long ago. See here for context. I think, it would be good to keep it :) |
…ove-wkw-suggestions
…ets in dataset table
I'd say I applied all requested cases. How to we want to proceed with this @fm3? Maybe we can check together my changes requested by philipp and then merge this once its clear to go? |
Do you think that letting this PR lie will create many merge conflicts? If not, I’d say it’s fair to wait until Philipp returns. |
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.
sweet, red lines :) front-end lgtm 👍
…knossos into remove-wkw-suggestions
…knossos into remove-wkw-suggestions
Removes the automatic datasource-properties.json suggestions for the Dataset Settings view. They only worked for WKW and confusing errors popped up for other data formats. Also, since most dataset creation code already generates valid jsons, it was mostly unused.
At some point in the future we may want to use the explore code to bring them back, if that turns out to be a comon use case. (We’d probably have to add an Explorer for WKW).
Steps to test:
TODOs:
existingDataSourceProperties
in case of Unusable json)Issues: