-
Notifications
You must be signed in to change notification settings - Fork 179
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
Story Locking: Ensure author users and below correctly see information #12559
Conversation
if (showLockedDialog && currentUserLoaded) { | ||
getStoryLockById(storyId, stories) | ||
.then(({ locked, nonce: newNonce, _embedded }) => { | ||
(async () => { |
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.
Converted this to async code is not needed for this, but made it easier to read.
Plugin builds for bb234cb are ready 🛎️!
|
Size Change: -50 B (0%) Total Size: 2.72 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.
At first glance looks good 👍 (besides the failing tests of course)
tests/phpunit/integration/tests/REST_API/Stories_Lock_Controller.php
Outdated
Show resolved
Hide resolved
tests/phpunit/integration/tests/REST_API/Stories_Lock_Controller.php
Outdated
Show resolved
Hide resolved
Just ocurred to me that the dashboard needs changing here as well. Can you check that? see #12604 |
@spacedmonkey @swissspidy -- I tested the This take over dialog is different from the one that the Admin-user sees, when Author-user takes over a story that Admin-user was editing: I am not clear which of these two dialogs should appear in Author-users editor when Admin-user takes over the story that Author-user was editing. |
Both users can see both dialogs. You see one when trying to open a locked story, the other when someone takes over editing from you. In both cases, users should at all time see the name & avatar of the other user. |
Added a fix for #12604 |
@kkalarickal Can you re-test #12604 here? |
@swissspidy I noticed that the following and wanted to get your take on if this is ok:
Example: This is the view for Admin user The same dashboard, when viewed by Author user
|
@kkalarickal Not sure if I understood correctly, but if a user is not allowed to edit a story, then there's no point in showing them that it's currently locked, so that is expected and sounds correct to me. |
@swissspidy - thank you for confirming. I agree that if user-profile cannot edit a story authored by someone with higher level of access, then there is no need to show the locked/thumbnail. For the scenario where the same user is accessing the Story dashboard from different browser instances, I was thinking we should indicate that another instance is open. However, when I looked at the WP Post workflow - it also does not show the lock-icon or thumbnail for same user login from another browser. So I guess we are at par with WP Post workflow. |
Context
Summary
Instead of using the embedded user rest api request, just hardcode the user data in the api response.
Relevant Technical Choices
To-do
User-facing changes
Testing Instructions
This PR can be tested by following these steps:
Reviews
Does this PR have a security-related impact?
Does this PR change what data or activity we track or use?
Does this PR have a legal-related impact?
Checklist
Type: XYZ
label to the PRFixes #12441
Fixes #12604