Commit graph

482 commits

Author SHA1 Message Date
Volker E 454eb6dcf4 Move main normalization to explicit selector
Change-Id: I8904bd531e14ee0bfcd7c057637fbea89c75d446
2019-03-04 19:51:15 -08:00
Jan Drewniak 864a1766a7 Refactor pageActions menu to accommodate AMC mode
This patch refactors the markup and JS associated with the page actions
menu in order to achieve greater flexibility in its presentation.
The menu items are now positioned via flexbox and rendered using a mustache
template in PHP.

The goal of this refactor is to accommodate both AMC mode and default
mode with the same markup. No changes should be visible for non-AMC
users with this refactor. No changes to AMC mode have been made in this
patch either.

This patch includes temporary workarounds to avoid problems caused by HTML caching.

Changes include:
- Changing the data structure of the page_actions property in SkinMinerva.php
- Passing that modified data structure into a new mustache template, PageActionMenu.mustache
- Adding new CSS for the new page actions menu HTML
- changing the query selectors in JS to match the new markup
- Making the JS-modified page-actions compatible with the new markup
- Keeping existing CSS and JS to avoid breaking cached HTML

Bug: T213352
Depends-On: I95cf726c4b6d8c3895a26aa6e07f4b1747ee30fe
Change-Id: I5a7d73b20617cb3c6d6379084ac4bea23ec3bc74
2019-02-28 12:31:57 +01:00
Jan Drewniak 99aa7a28a4 HYGIENE: Remove element nav selector from mainmenu.less
The top level `nav` CSS selector (combined with the nested element
selectors, i.e. `nav ul li a`) represent a general DOM structure
which is not limited to the navigation menu and can interfere with
other styles.

This replaces the `nav` selectors (which have only been used to select
the main navigation) with a `#mw-mf-page-left` selector instead, since
that represents the main navigation as well.

Change-Id: I047108974fd295f196d9f7150c3721c05ac40c6d
2019-02-27 15:01:08 -08:00
jenkins-bot 4f42e4949d Merge "Allow us to distinguish errors for logged in users" 2019-02-26 22:05:28 +00:00
jdlrobson 52918caff9 Allow us to distinguish errors for logged in users
Logged in users may be more likely to have client side errors - either
through using interfaces that require authentication or through gadgets
that they run. I'd like to separate the two.

Bucketing like this means we can still continue to count all client
side errors, but we can have additional graph lines for logged in.
This way we can notice spikes in bugs limited to logged in users
for example T216853

Change-Id: I965c45f8b548abb16b400571ddf7852ca088529b
2019-02-26 18:03:39 +00:00
jenkins-bot a76bd6f9e2 Merge "Fix talk overlay workflow" 2019-02-25 23:12:50 +00:00
jdlrobson 7fd843cd89 Fix talk overlay workflow
The talk overlay must subscribe to the creation of new topics
so that the list of topics in the talk overlay contains the
newly created topic. It does this by subscribing to the
talk-discussion-added event and forcing a route refresh when that
has completed.

Additional changes to browser tests:
1) QA: CSS selector changed for talk overlay
Since I42fd7b08c4b9d92dee549d06de8a0012ea037d28 the '.add' class
was removed from the talk button. This makes the browser test fail
but is a false positive.

2) One of the browser tests was using the same selector to mean
two different elements - the add discussion button in the talk overlay
is now clearly distinguish from the "add discussion" button that is blue
and appears at the bottom of talk pages

Change-Id: I935b3c5f37baf242c06585ae0e2f13d059b9c324
2019-02-25 14:14:53 -08:00
jenkins-bot ea6a11a7a0 Merge "Adds a CSS rule for <main> element to support IE11 and under." 2019-02-25 20:54:49 +00:00
Jan Drewniak dce28f061b Adds a CSS rule for <main> element to support IE11 and under.
Bug: T207618
Change-Id: I7d750a82129559bd70500b77f4462938f95d34a1
2019-02-25 20:36:50 +00:00
jdlrobson 4da113422c Talk overlay no longer uses the loadingOverlay pattern
The overlay will load instantly, the spinner will show for
the talkBoard inside the overlay.

id is always set as it will be undefined if not present and also
ignored by talkOverlay

Bug: T215370
Depends-On: I791b22ac8b5060c4620168a3bf8db81a96f3d022
Change-Id: I01f2bbc32ad6d81e7b15f510f0a91cbf2df750ce
2019-02-22 16:11:22 -08:00
jdlrobson 78ca1922f8 Correct path for obtaining loadingOverlay
An undefined thing is not a constructor clearly
Introduced in 5593b23aa8

Bug: T216853
Change-Id: Ief5ca9098fc76a4ae8436dc6a3b4352e3c845147
2019-02-22 14:12:28 -08:00
Nicholas Ray 7cfcb3641b Refactor LanguageOverlay styles
In I629245100f4ca430a88e450939b90d075e7021f1, languageOverlay styles and
LanguageSearcher styles were split into two different files. This commit
mimics that change in skinStyles. All languageOverlay specific styles
were moved to languageOverlay.less, while all LanguageSearcher styles
were moved to LanguageSearcher.less.

Other chagnes:

* Changed a reference in init.js

Bug: T215657
Change-Id: I395a61cd6051ad5c6b6601205f112b55f5ab8273
2019-02-22 11:02:30 -07:00
Nicholas Ray a48df04a75 Call new language factory instead of LanguageOverlay
When merged with I629245100f4ca430a88e450939b90d075e7021f1, the need to
use rlModuleLoader.js (white screen loader) with LanguageOverlay is
eliminated. When calling the language factory function, an Overlay is
now synchronously returned with a spinner shown in its content area
while the lazy load request + xhr request are executing. PromisedView
will replace this spinner with the LanguageSearcher component when the
promise resolves (rejects continue to be unhandled).

* The getDeviceLanguage function was moved into languageFactory.js
inside MobileFrontend

* the lazy load code and gateway.getPageLanguages code was also moved
into languageFactory.

Bug: T215657
Depends-On: I629245100f4ca430a88e450939b90d075e7021f1
Change-Id: Ie6dad4bd3c80e6cfcc1d7f9ad38941a323ba3cc6
2019-02-21 12:15:55 -08:00
jenkins-bot cfca2184dd Merge "Avoid deprecated View.$" 2019-02-20 22:02:07 +00:00
Jan Drewniak a1d52a1cdd Remove hard-coded z-index value from page-issues read-more link
Defines the z-index value of the "fade-out" below the read-more text
as a variable instead of a hard-coded value. The variable is essentially
1 value below the z-index of the parent element.

The output of this change remains the same, the parent z-index value
is 0 so the "fade-out" z-index value still remains -1.

Bug: T214550
Change-Id: Ib1fa53cbb83e995c3c7b0320ba177ea087a8931b
2019-02-20 00:45:20 +00:00
jenkins-bot f6acb0deb7 Merge "Remove margin from tagline and add .page-heading element" 2019-02-20 00:19:13 +00:00
jenkins-bot 680019d45e Merge "Revert "Switch to outside list style for ordered lists too"" 2019-02-19 23:41:42 +00:00
Jdlrobson ddc667905e Revert "Switch to outside list style for ordered lists too"
Per discussion in humans of the web, 
this causes problems with lists with items >= 100. Reverting (and
later SWATing) with this new information.

This reverts commit abf223da58.

Bug:  T150377
Change-Id: I962824dae8c855bb3d01ba346ae08aa3f6234073
2019-02-19 23:32:37 +00:00
Jan Drewniak f92b117158 Remove margin from tagline and add .page-heading element
Even though on most pages the tagline is empty, it still
has a bottom margin associated with it. This patch moves
that bottom margin into a container element that wraps
both the h1 and tagline.

This approach allows us to remove the bottom-margin from the tagline
as well as the top-margin from the AMC tabs in favour of just
one bottom margin on the .page-heading element.

Bug: T214195

Change-Id: I67d3938ab4a75f994acc28a8eefdf19e531c1f3d
2019-02-19 12:37:27 +01:00
Ed Sanders eeebb86270 Avoid deprecated View.$
Replace with View.$el.find.

Bug: T216264
Change-Id: I78045c410c168bf458ab8f5537036711fc5b577c
2019-02-15 19:04:11 +00:00
jdlrobson 44ed0f5e69 Talk tab select should sit on top of page actions
Per design review with Alex.

Bug: T212216
Change-Id: Id4e1f5167c50a8d75a0682c4e8ed219c36b93be3
2019-02-13 11:42:15 -08:00
jenkins-bot a2173b0061 Merge "Remove backwards compatible CSS" 2019-02-13 05:36:17 +00:00
jdlrobson 577b72a14d Remove backwards compatible CSS
This is no longer needed when Varnish cache has cleared (About a
week from I7e989a3d4553eb3357598a5cad3ccebf51dc9fae being deployed

Bug: T212216
Change-Id: I1afb68f68cc90d89c442907426bd046ddc68f488
2019-02-12 17:40:49 -08:00
Stephen Niedzielski 7d4ca12a2e Hygiene: remove unused page issues function
Remove getAllIssuesSections(). This is no longer in use and does not
appear to be sufficiently general purpose to want to maintain.

Bug: T212371
Change-Id: I7ed73408705cba64b26dd318e78ae415b707e687
2019-02-13 01:34:32 +00:00
Stephen Niedzielski f54b4e75db Hygiene: move variable from file to local scope
Move allIssues from file scope to local scope.

Bug: T212371
Change-Id: I74693925ff0b20a36ec6acd53490cfde7273c984
2019-02-13 01:33:04 +00:00
Stephen Niedzielski 8ee27ed610 Hygiene: favor page issues all sections symbol
In pageIssues.js:

- Consistently use the KEYWORD_ALL_SECTIONS symbol instead of hardcoding
  the string, "all".

- Improve typing for allIssues.

- Wrap a long line.

Bug: T212371
Change-Id: I429fe37f88311c787e91946bb1438c6961eeeb5b
2019-02-13 01:32:29 +00:00
Stephen Niedzielski 3dc9cff2c2 Hygiene: separate page issue view logic
- Move page issue view components that do not modify the DOM during
  during construction to PageIssueLearnMoreLink.js and PageIssueLink.js.
  PascalCase is used optimistically for filenaming in the hopes that
  these functions can become something like a JSX component. A "new"
  function prefix is used in the meantime.

- Move page issue view logic that munges the existing DOM to
  pageIssueFormatter.js. Substitute "create" prefixes for insert so that
  clients won't forget that calling the function is a modify operation.
  Alternative naming welcome but it shouldn't be confused with more
  idealistic components that do not depend on DOM state for
  construction.

- Consolidate createPageIssueBanner() and
  createPageIssueBannerMultiple() into insertPageIssueBanner() as the
  code was quite similar and were it a true component, it would probably
  be a single component.

All new files appear under page/ to keep their distinction from the
overlay code clear.

Some view logic remains in pageIssues.js but it shall be difficult to
isolate.

Bug: T212376
Change-Id: Iccce709c34fa8de5a28a5a00098add5775e3dc9a
2019-02-13 00:42:56 +00:00
jdlrobson 7e423c07b7 Talk tabs in AMC mode
A new feature/skin option is added that is enabled safely inside
a MobileFrontend available/unavailable hook that changes the skin
to place talk tabs at the top of the page.

These new talk tabs purposely show on the main page, user page
and standard pages and do not show on special pages.


Depends-On: Ie1a583657176acc6f7046c569c2e94fa2f72ff93
Bug: T212216
Change-Id: I57b70cd325666a287678dc897159b5bf9d089b78
2019-02-13 00:02:35 +00:00
Stephen Niedzielski c561fbc794 Hygiene: update categoryOverlay to use factory API
- Revise M.require( 'mobile.categories.overlays/CategoryOverlay' ) to
  'mobile.categories.overlays/categoryOverlay' (lowercase c).

- The category overlay is a factory function not a class. Replace new
  operator with function invocation. This only looked strange and didn't
  break anything since the new operator uses the returned value if
  specified, not `this`, which was the result of the factory function
  and the OverlayManager understands both Overlays and functions that
  return Overlays.

Bug: T208915
Change-Id: Ife098ee5ed1a8a164a4e31013a490076658f4147
2019-02-11 22:49:59 +00:00
jenkins-bot 985311dddd Merge "Make section edit icons display:block, predictable height" 2019-02-11 22:42:21 +00:00
Ed Sanders 023364caa1 Make section edit icons display:block, predictable height
Previously they had an extra few pixels caused by line-height.
This makes some heading levels slightly shorter, but heading
heights more predictable.

Change-Id: I25cb1f39ab6c80bf9f318de18339e716156c9a2b
2019-02-11 23:19:56 +01:00
Stephen Niedzielski 198688fe5f Hygiene: update talkOverlay to use factory API
- Revise M.require( 'mobile.talk.overlays/TalkOverlay' ) to
  'mobile.talk.overlays/talkOverlay' (lowercase t).

- The category overlay is a factory function not a class. Replace new
  operator with function invocation. This only looked strange and didn't
  break anything since the new operator uses the returned value if
  specified, not `this`, which was the result of the factory function
  and the OverlayManager understands both Overlays and functions that
  return Overlays.

Bug: T208915
Change-Id: I496f78c24c485d88b046bac6889c7ff09267b250
2019-02-11 15:11:06 -07:00
jenkins-bot 718527e061 Merge "Switch to outside list style for ordered lists too" 2019-02-11 20:13:26 +00:00
jenkins-bot e668cd36d7 Merge "Revert "Hygiene: Track minerva errors count only once"" 2019-02-11 18:27:52 +00:00
Jdlrobson 29bfece958 Revert "Hygiene: Track minerva errors count only once"
We talked about this in standup today and given Sam's comment
in T212970#4943448 and a potential loss of data, we've considered
this a little risky and would like to revert and discuss this.

We can reapply the patch later if necessary.

This reverts commit a486bde329.

Bug: T212970
Change-Id: I0aad3937dde92bf7a46df8c1cf892bf5ce257e17
2019-02-11 18:11:16 +00:00
jenkins-bot e79e2202b9 Merge "Apply <sup> styling to Parsoid refs as well" 2019-02-09 19:23:55 +00:00
Ed Sanders cc727b9c11 Apply <sup> styling to Parsoid refs as well
Currently they are 0.8em, instead of 0.75em.

Change-Id: Ieb91c1251839ff4bb54451aae69af9fb88322219
2019-02-09 14:10:52 +00:00
jenkins-bot 6b22dc3906 Merge "Change z-index of page-issues read-more link" 2019-02-08 23:10:28 +00:00
Stephen Niedzielski 66c44402d7 Hygiene: replace OO.mfExtend with mobile.mfExtend
Use the mobile.startup module mfExtend export directly instead of
OO. This will allow MobileFrontend to reduce its exposed API.

Bug: T208915
Depends-On: Idededf132f724176c38c5e0a7c9327f00489a09d
Change-Id: Id582325c830c229240b88cf4e151afea48fea750
2019-02-08 21:42:03 +00:00
Stephen Niedzielski 28b0aa441d Hygiene: rename mobile.startup variable in search
Rename `client` to `mobile` in search.js. This was the only deviation in
naming when persisting `M.require( 'mobile.startup' )`.

Bug: T208915
Change-Id: I46f8a7a560cbb78fdec970cc0d2eff32238bf59e
2019-02-08 13:52:54 -07:00
jenkins-bot 578eb28966 Merge "Hygiene: move PageGateway import to top" 2019-02-08 20:09:53 +00:00
Stephen Niedzielski 9cf8da6514 Hygiene: move PageGateway import to top
Move synchronous import to the top of the file next to other
mobile.startup imports to make it easier to find.

Bug: T215648
Depends-On: I6393e4403034cce51c01003bdf5bcaf3b76ae9f1
Change-Id: Icf52160b84f05a4ac3e069112460cf0bc97a0b4b
2019-02-08 11:59:16 -08:00
jenkins-bot cbd624d6ab Merge "page actions is no longer position absolute" 2019-02-08 19:22:42 +00:00
jenkins-bot 4bf79bd6df Merge "Merge skins.minerva.scripts.top and skins.minerva.mainMenu into scripts" 2019-02-08 19:10:03 +00:00
Bartosz Dziewoński abf223da58 Switch to outside list style for ordered lists too
See design rationale on T150377.

Furthermore, 'inside' lists cause rendering issues inside VisualEditor
(tested with Chrome 71 and Firefox 65 on desktop), as seen on T208102.

Bug: T150377
Bug: T208102
Change-Id: Ia8e47ab98226a78cb5a3a4ef5f09d729ea3c8791
2019-02-08 18:40:19 +01:00
jenkins-bot 2496a33fa8 Merge "Hygiene: Track minerva errors count only once" 2019-02-08 15:57:39 +00:00
jdlrobson b356c7f134 Merge skins.minerva.scripts.top and skins.minerva.mainMenu into scripts
These modules can safely be merged.

Since skins.minerva.scripts.top is added via addModules to the HTML it must
be marked as deprecated and remain temporarily as a redirection to skins.minerva.scripts

All modules have been renamed to be in there new home - no deprecation notices are needed
as they are not used outside Minerva.

I leave skins.minerva.mainMenu.styles as it is used by Special:MobileMenu
and needs to continue to do so.

Change-Id: Ie919151630f4389f8e84e808bec003a6d3d07bd9
2019-02-07 18:10:15 -08:00
Jan Drewniak 73885e01c2 Change z-index of page-issues read-more link
Changes z-index from 1 to 0 on page-issues link to avoid showing
white background when navigation menu slides over.

Also changing z-index value on SpecialNotificationsOverlay.less
from the hard-coded value of 2 to @z-indexOverOverlay
(which is set to 2).

Bug: T214550
Change-Id: If033755115f2a266869fb87c4314798c422d88ed
2019-02-07 19:37:02 -05:00
Piotr Miazga a486bde329 Hygiene: Track minerva errors count only once
To minimize the traffic sent to the stats endpoint we should
track errors only once after request is done, not on every
error occurence.

Bug: T212970
Change-Id: I64f101159aa1f2179e612effa850851fffcf39c6
2019-02-07 23:46:14 +00:00
Stephen Niedzielski 5593b23aa8 Hygiene: replace mobile.startup/paths with props
Replace all occurrences of `M.require( 'mobile.startup/pathToModule' )`
with `M.require( 'mobile.startup' ).pathToModule`. Where multiple
requires existed, add an intermediate variable,
`var mobile = M.require( 'mobile.startup' )`, and dot off that.

This changes improves the consistency of MinervaNeue which currently
contains a mix of require styles and eliminates any deprecated requires.

Bug: T208915
Change-Id: If14f280672d914d07275197100b12421bb217b67
2019-02-07 14:55:04 -07:00