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

Retry failed save and publish requests #6833

Merged
merged 7 commits into from
Dec 5, 2024
Merged

Conversation

bastianallgeier
Copy link
Member

@bastianallgeier bastianallgeier commented Dec 5, 2024

Description

The model views will now show a "Retry" dialog when a save or publish request failed.

Screenshot 2024-12-05 at 10 21 32
Screenshot 2024-12-05 at 10 21 48

The methods will be executed again after clicking the "Try again" button.

Summary of changes

  • New panel.content.closeRetryDialog() method
  • New panel.content.retry() method

Additional context

The easiest way to test this is with the following steps.

  1. Add this to the Kirby\Api\Controller\Changes class at the beginning of the save method:
if ($input === ['error' => true]) {
	throw new \Exception('Something went wrong');
}
  1. Open the browser console and check both dialog versions like this:
// to show the retry dialog for failed save requests
panel.content.save({error: true});
// to show the retry dialog for failed publish requests
panel.content.publish({error: true});

Changelog

Fixes

  • Fixed footer margin in dialogs if the cancelButton property is a string or object instead of a boolean.

Enhancements

  • New retry dialog if changes cannot be saved or published.

For review team

  • Add lab and/or sandbox examples (wherever helpful)
  • Add changes & docs to release notes draft in Notion

@bastianallgeier bastianallgeier requested a review from a team December 5, 2024 09:26
@bastianallgeier bastianallgeier added this to the 5.0.0-beta.1 milestone Dec 5, 2024
@afbora
Copy link
Member

afbora commented Dec 5, 2024

Works great for me 👍 Also I couldn't see a discard changes issue for this PR.

@bastianallgeier bastianallgeier merged commit d205d47 into v5/develop Dec 5, 2024
7 checks passed
@bastianallgeier bastianallgeier deleted the v5/retry branch December 5, 2024 15:39
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.

3 participants