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

fix: Model delete redirect only needed if inside the model [WEB-1867] #8512

Merged
merged 2 commits into from
Dec 1, 2023

Conversation

mapmeld
Copy link
Contributor

@mapmeld mapmeld commented Nov 30, 2023

Description

Bug: deleting a model from a Workspace's Model Registry tab redirects us to the wrong place (general /det/models page)

Solution: a redirect is only needed if the user is requesting delete from the Model Details page, where I will pass a listPath prop. Actions on the model registry tables will no longer trigger a redirect.

Note: we don't use the store in models, so the registry takes a few seconds to update

Alternatives: I considered always passing a workspace to the delete modal, and redirecting by default. The issue was that ModelActionDropdown is wrapped by InteractiveTable/ContextMenu and cannot pass new props

Test Plan

  • Create two models within a workspace
  • Click into one model's details page. Delete the model from this page, and you will be redirected back to the workspace's registry tab
  • Delete the other model from the workspace tab / table view. There is no redirect

Checklist

  • Changes have been manually QA'd
  • User-facing API changes need the "User-facing API Change" label.
  • Release notes should be added as a separate file under docs/release-notes/.
    See Release Note for details.
  • Licenses should be included for new code which was copied and/or modified from any external code.

Copy link

netlify bot commented Nov 30, 2023

Deploy Preview for determined-ui ready!

Name Link
🔨 Latest commit 51944d4
🔍 Latest deploy log https://app.netlify.com/sites/determined-ui/deploys/6569639b35602a0008e2c8bd
😎 Deploy Preview https://deploy-preview-8512--determined-ui.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Comment on lines 152 to 157
const listPath = useMemo(
() =>
model.workspaceId ? paths.workspaceDetails(model.workspaceId, 'models') : paths.modelList(),
[model.workspaceId],
);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: given that the model is already being passed into the modal component, and the path is only used when the modal is confirmed, can we move this into the deleteModelModal component?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense; with the new commit I've changed the prop to redirectOnDelete and did the redirect path in the modal code

Copy link
Contributor

@ashtonG ashtonG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@mapmeld mapmeld merged commit 88784cc into main Dec 1, 2023
69 of 80 checks passed
@mapmeld mapmeld deleted the modeldelete branch December 1, 2023 14:53
@dannysauer dannysauer added this to the 0.26.7 milestone Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants