-
Notifications
You must be signed in to change notification settings - Fork 100
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 offline commenting feature and add post request handler to display offline/error templates. #728
Conversation
* Show offline and server error templates on the POST request.
Codecov Report
@@ Coverage Diff @@
## develop #728 +/- ##
=============================================
- Coverage 19.03% 19.02% -0.01%
Complexity 346 346
=============================================
Files 57 57
Lines 2322 2323 +1
=============================================
Hits 442 442
- Misses 1880 1881 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
* Show a message with `go back` link when user is making a POST request and offline/server-error occurs.
…ate tag to show submission failure on POST request
When a user makes a POST request and submission fails due to offline/server-error: s1.mp4When a user makes a POST request and it opens on a new page: s-2.mp4 |
@westonruter On thinking more about to show go back link, two use cases came up to my mind: 1 - When POST requests use the same tab to fulfill the request. In this case I am considering both use cases as you can see in the upper comment. Please let me know your thought on it. |
@thelovekesh You've made a great point about the go back link not working as expected when opening in a new window. In the case of form submitting into a new window, we may not be able to get It may be better to just tell the user to go back manually. |
This option looks cleaner to me. |
@westonruter I have changes made changes to |
Can you enable me to be able to push commits to your fork? |
@westonruter I've sent over the invite ✔️ |
…ancement/363-remove-offline-commenting-and-add-post-request-handler * 'develop' of github.com:GoogleChromeLabs/pwa-wp: (84 commits) Improve test phpdoc descriptions Further generalize naming for site icon code after bca28f1 Add customize cap check before adding button to Customizer Add paragraph wrapper and harden translation escaping Improve name of JS file Reset notifications when site icon has been removed Remove extraneous comments Fix boolean condition for whether icon is too small Improve method naming and return value Improve strings and presentation of site health test Add warning notifications for non-PNG and non-square icons Reuse l10n object in Customizer Remove extraneous variable Show missing icon notification when attachment is no longer present Use attachment data for notifications and update notifications when setting changes Improve function name Add notifications to control instead of section Use warning notification type Reuse existing variable and improve variable name Skip test_pwa_validate_site_icon_not_png on PHP 7.1 ...
…ancement/363-remove-offline-commenting-and-add-post-request-handler * 'develop' of github.com:GoogleChromeLabs/pwa-wp: Bump eslint-plugin-jsdoc from 39.2.0 to 39.2.1 Bump grunt from 1.5.1 to 1.5.2 Bump workbox-cli from 6.5.2 to 6.5.3 Bump eslint-plugin-jsdoc from 39.1.0 to 39.2.0 Bump actions/setup-node from 3.1.0 to 3.1.1 Bump eslint-plugin-jsdoc from 39.0.1 to 39.1.0 Bump grunt from 1.4.1 to 1.5.1 Bump eslint-plugin-jsdoc from 38.1.6 to 39.0.1 Bump @wordpress/scripts from 22.3.0 to 22.4.0 Bump php-stubs/wordpress-stubs from 5.9.1 to 5.9.3 Bump eslint-plugin-import from 2.25.4 to 2.26.0 Bump codecov/codecov-action from 2.1.0 to 3 Bump eslint-plugin-jsdoc from 38.1.4 to 38.1.6 Bump prettier from 2.6.1 to 2.6.2 Bump actions/setup-node from 3.0.0 to 3.1.0
body = body.replace( | ||
'{{{WP_SERVICE_WORKER_SUBMISSION_FAILURE_MESSAGE}}}', | ||
'' | ||
); |
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.
A problem here is that this will leave the document with:
<p><strong></strong></p>
When I try navigating to a page while offline: If I try submitting a comment while offline: When I forcibly try to introduce a 500 error: In this last case, I'm seeing something which may be a regression caused by #438: infinite-reload-on-post-submission-failure.movThis seems like a bug. If there is a 500 error, we definitely shouldn't be attempting to reload the page, and we shouldn't be doing a reload for a POST request either. |
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.
But that can be addressed in another PR. This looks good and behaves as expected otherwise.
Fixes: #363
This PR
Before
After