-
-
Notifications
You must be signed in to change notification settings - Fork 773
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
Better Block Message Support #4458
Conversation
- Allow subheadingHTML to display links - Fix safe area extended bug - Add BlockedPanelViewController
- Determines best error from array of errors - Parses error blockreason from wikitext to html - Fetches blocked template if necessary and updates placeholders with blockinfo
- Update WikiTextSectionUploader params so that we get more error info - Send response object into Fetcher helper method to resolve blocked error - Pass error informaation back to EditSaveViewController - Present panel and handle link taps
- Update SectionFetcher params so that we get more error info - Send blockInfo values into Fetcher helper method to resolve blocked error - Pass error information back into SectionEditorViewController - Don"t configure web view until after wikitext is fetched - Display blocked panel and set editor to read only
- DescriptionEditViewController - evaluate error upon publish, display blocked panel if needed - ShortDescriptionController - fetch block information upon landing and pass back to view controller - DescriptionEditViewController - display block panel upon landing and disable controls. - Minor renaming for clarity
- WikidataFetcher - Add method to fetch block information upon landing - WikidataFetcher - Adjust publish parameters & codable response to capture block information - WikidataFetcher - Resolve blocked error, pass back to view controller - WikidataFetcher - General model reordering / cleanup - DescriptionEditViewController - evaluate error upon publish, display blocked panel if needed - WikidataDescriptionController - fetch block information upon landing and pass back to view controller
- Adjust parameters to get html in response - Pass back html to view controller as failure - Present blocked panel from account creation view controller
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.
Nice – definitely more involved than I initially expected!
I haven"t yet tested in use beyond confirming basic presentation of the block panel when section editing from a blocked account, but below is my first pass of notes from pure code review.
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.
Nice! Was able to test most edit/creation block paths after I got Admin rights on test Wiki (other than Wikidata blocks), but as mentioned perhaps best to rely on QA for exhaustive testing.
Looks like just the conflict with our shared changes (sorry!) to the section editor to resolve.
@staykids thanks! Merged conflict is fixed. To merge our two features, I changed it so that if a blocked message does return from the wikitext call, we disable the automatic edit notice presentation (I feel there"s little need to show it to them if the editor is disabled). Writing up a Phab comment now for design to confirm this thinking. It was difficult to test because I doubt very many Test Wikipedia articles have edit notices. I basically did it by mapping the edit notice response locally with a response taken from EN Wikipedia. |
@tonisevener Cool - I tested by just stubbing out an always successful/available but empty edit notice in the section editor, and the behavior appears as you mention where the block alert supersedes the modal presentation, but the modal"s still available via toolbar button. I"ll go ahead and merge so this doesn"t fall too far off |
Phabricator:
https://phabricator.wikimedia.org/T169013
https://phabricator.wikimedia.org/T275118
https://phabricator.wikimedia.org/T201640
Notes
This PR adds improved display of blocked messages to users when creating an account, publishing an article description, and publishing an edit in our section editor. It adjusts the API calls in these areas and parses the error responses. It also adds a new blocked message panel (from our existing Panels.swift set of views) and disables the editors when the user is blocked.
This PR is best reviewed commit-by-commit. I tried to leave detail in the commit messages. Any developer testing should be tested with all commits in place.
There are a couple of things remaining after this PR for blocked messages:
Test Steps
Note: I also have blocked panels showing upon Publish, not just landing on the editors. Test steps for this will be a bit tedious - basically repeating 1-8, but unblocking your account in between each step so you can get past disabling of the editors. I didn"t include these steps in the interest of leaning on QA more for this.
Screenshots
Create Account Error
Section Editor Error