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

Duplicate and restore project #9816

Open
wants to merge 14 commits into
base: develop
Choose a base branch
from

Conversation

somebody1234
Copy link
Collaborator

@somebody1234 somebody1234 commented Apr 30, 2024

Pull Request Description

Important Notes

  • There is an UI issue when restoring a project - the placeholder UI is removed one render tick later than the "list versions" query is refetched, so an extra version appears for one frame.

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • The documentation has been updated, if necessary.
  • Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.
  • All code follows the
    Scala,
    Java,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • All code has been tested:
    • Unit tests have been written where possible.
    • If GUI codebase was changed, the GUI was tested when built using ./run ide build.

@somebody1234 somebody1234 added CI: No changelog needed Do not require a changelog entry for this PR. x-new-feature Type: new feature request g-dashboard labels Apr 30, 2024
@PabloBuchu
Copy link
Contributor

@somebody1234 can you fix the conflicts? I will QA this later today and would be great to merge

Copy link
Contributor

@MrFlashAccount MrFlashAccount left a comment

Choose a reason for hiding this comment

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

LGTM except a few improvents in UX

backend={backend}
latestVersion={latestVersion}
dispatchAssetListEvent={dispatchAssetListEvent}
doRestore={() => {
restoreMutation.mutate({
Copy link
Contributor

Choose a reason for hiding this comment

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

can we use mutateAsync here? If we pass a function that returns a promise to a button, button will automatically set loading state and remove it once promise resolves

await versionsQuery.refetch()
},
onError: (error: unknown) => {
toastAndLog('restoreProjectError', error, item.item.title)
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure it's a good idea to toast the error, because it will frustrate users - errors happen, but the user can't do anything with the error. Maybe we can show additional actions in Toast? Or maybe display the error inline?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

i don't know about additional actions in toast tbh. inline sounds fine but not sure what's the best way to send the error info back to the button that was responsible for the error

backend={backend}
latestVersion={latestVersion}
dispatchAssetListEvent={dispatchAssetListEvent}
Copy link
Contributor

Choose a reason for hiding this comment

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

Also I think it worth to add "restore" and "duplicate" button right in "Compare" dialog , either in top bar above the editor or in the footer below.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: No changelog needed Do not require a changelog entry for this PR. g-dashboard x-new-feature Type: new feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants