Skip to content

[needs testing] Add commit and publish dialog#41

Open
magland wants to merge 2 commits intomainfrom
commit-and-publish
Open

[needs testing] Add commit and publish dialog#41
magland wants to merge 2 commits intomainfrom
commit-and-publish

Conversation

@magland
Copy link
Collaborator

@magland magland commented Jan 15, 2026

Changes

This PR adds a confirmation dialog when committing metadata changes with three options:

  • Cancel: Discard the commit action
  • Commit Only: Commit metadata to draft without publishing
  • Commit and Publish (Recommended): Commit metadata and immediately publish a new version

Implementation details:

  1. Proxy Server - Added endpoint to handle publish requests to DANDI API
  2. API Utils - Added publishDandiset() function for calling the publish endpoint
  3. Commit Dialog - New CommitConfirmDialog component with three action buttons
  4. Commit Button - Updated to show dialog before committing, handles both commit-only and commit-and-publish flows

The 'Commit and Publish' option is styled as the preferred/default action.

Note: This needs testing before merging, particularly:

  • Verify the publish endpoint works correctly
  • Test both commit-only and commit-and-publish flows
  • Confirm error handling works properly

@magland
Copy link
Collaborator Author

magland commented Jan 15, 2026

@bendichter I haven't tested this.
It's on the preview site: https://dandiset-metadata-assistant.surge.sh/dandiset-metadata-assistant

@h-mayorquin
Copy link
Collaborator

h-mayorquin commented Jan 16, 2026

As soon as I entered one of my datasets I got "pending changes already":

image

Looking at the diff more in detail it seems that it somehow comparing cached data from another of my datasets...

image

@magland
Copy link
Collaborator Author

magland commented Jan 16, 2026

@h-mayorquin That bug has been fixed in #43

@h-mayorquin
Copy link
Collaborator

I tried this again. I clicked on "commit" and got "Failed to Fetch"

image

Also, should we really recommend “Commit and publish”? What is the logic behind this? Should the behavior be different when the dataset is still in draft?

I think that for drafts this option should not be available. We might want to have a separate Publish button that only works after a commit has already been completed. This would avoid errors when a user clicks Publish by mistake, since publishing is irreversible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants