-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Site Editor: Check whether the data is loaded. If the data is loaded and the template is still unknown, give appropriate feedback #30664
Site Editor: Check whether the data is loaded. If the data is loaded and the template is still unknown, give appropriate feedback #30664
Conversation
Size Change: +136 B (0%) Total Size: 1.31 MB
ℹ️ View Unchanged
|
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.
Looks good to me, however, I'd be more comfortable merging this with a 2nd review from someone
Hmmm I kinda prefer this implementation... It still shows the site-editor and I can navigate to a different template and keep working. The post-editor one is good at what it does, but it would feel a bit like a screen-of-death in the site-editor IMO 🤔 |
Maybe then a message on the "canvas" of the site editor? I don't feel strongly here either way :) |
This. The text in the header doesn't really stand out in this case so it's easy to miss it. We could use the same message as we use for the post editor: "You attempted to edit an item that doesn't exist. Perhaps it was deleted?" Otherwise looks good and works well! Thanks for working on this! 🙇 |
Thank you both for the feedback, excellent points! @bobbingwide is currently unavailable to continue working on this (the PR was part of a contributors-day) so I pushed a commit to add a notice in the canvas when the template can't be found: Would that work? |
I think you meant @boblinthorst |
Oops, my bad... apologies, bad github auto-complete 🤦 |
Looks good to me! Once we have a test I'm happy to approve 😄 |
That's going to be a problem... I don't (yet) know how to write these tests 🤐😅 |
Would you be interested in writing your first test? :D If not, let me know and I'll take it over. First of all, we don't really have a function that you can use to visit the site editor with specific URL parameters. In our case we need to visit the site editor with custom URL parameters to access a non-existing template. You can extend the existing
query .
Once that's done you can create a new test file in: https://github.com/WordPress/gutenberg/tree/trunk/packages/e2e-tests/specs/experiments You should copy-paste an existing test as a base for your test. https://github.com/WordPress/gutenberg/blob/37e15797f2259ee0661b56b5a8f877bde9f29099/packages/e2e-tests/specs/experiments/site-editor-export.test.js is a very short test file that should work for you. |
…ate is still unknown, give appropriate feedback.
7b26528
to
4d7d668
Compare
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.
Rebased, once tests are passing I'll merge
Description
Created to try and resolve #29265.
Shows "Template not found" if there's no found template for the post id.
I'm not particularly comfortable in this context, so if this PR does not solve the issue in the desired way, don't feel bad about closing it.
How has this been tested?
I visited the proved link in the issue, and checked the added feedback is shown. I also visited a normal template page, to ensure this feedback does not show when it is not appropriate.
Screenshots
Types of changes
Bug fix
Checklist:
*.native.js
files for terms that need renaming or removal).