Following on from T215370 we will begin removing inheritance in the TalkSectionAddOverlay.
The TalkSectionAddOverlay currently extends Overlay. It is another rather simplistic overlay.
It is an overlay which contains three Panel views, each containing some text, an input and a textarea!
Let's create a new component (proposed name UserInput) that contains these 3.
Acceptance criteria
- The TalkSectionAddOverlay is replaced with a factory function (maybe this is the same factory function in mobile.startup/talk/overlay but takes an additional parameter ?
- The factory function lives inside mobile.startup
- The overlay for #/talk/new loads instantly without a LoadingOverlay.
- The factory function that loads the UserInput component, its i18n message and the code to wire it up with appropriate events is inside mobile.talk.overlays ResourceLoader module off the critical path
- The new components do not use templatePartials property on View
- Inline templates that are necessary, drop any that are redundant (e.g. the header templatePartial)
- The event bus is probably not needed any more. Consider replacing the talk-added-wo-overlay, talk-discussion-added events with a callback inside skins.minerva.talk/init.js that updates the parent talk overlay directly.
- All changes are backwards compatible. For every patch merged the add talk topic overlay is kept in tact.
- All code touched as part of this change has 100% code coverage or a good explanation to why it's not exactly 100%.
- The size of the mobile.startup module remains more or less the same.
QA steps
Scenario 1: A successful save:
- Login
- Visit https://reading-web-staging.wmflabs.org/w/index.php?title=Spain&mobileaction=toggle_view_mobile#/talk
- Click add discussion in the top right.
- Fill in details of a topic
- Hit save
- Confirm the new talk topic shows on the list of talk topics
- Confirm the content of the newly created talk topic matches what you put in
Scenario 2: A failed save:
- Login
- Visit https://reading-web-staging.wmflabs.org/w/index.php?title=Spain&mobileaction=toggle_view_mobile#/talk/new
- Fill in details of a topic
- Drop your internet connection to 2g using your browsers developer tools (network tab)
- Verify that on hitting save the form save button disables and inputs are not selectable
- Quickly click the offline checkbox
- Verify that the save button is enabled again and you can type in inputs again
- Do this a few times
- Verify that when your connection is normal the save finally goes through
- Confirm the new talk topic shows on the list of talk topics
Sign off steps
- Unstall T217810