Commit graph

311 commits

Author SHA1 Message Date
bwang 8d9b148cf7 Setup header and sticky header to be able to be full width
- Move the header and skip link out of .mw-page-container-inner and the grid
- Wrap the header and sticky header with a .vector-header-container element, allowing us to easily update header styles in the future
- Update sticky header to use a <div> to fix a11y error. Update searchToggle.js to use .vector-header-container rather than <header>

Bug: T332449
Bug: T330438
Change-Id: I038fc17cbb88a29dbe8d7841b824761a91d38405
2023-03-30 16:37:15 -05:00
Jan Drewniak 40bbb8c3a9 remove Page Tools config & HTML
Removes the config option for Page Tool menu,
its associated logic, along with the associated HTML from
the mustache templates.

Hardcodes the `vector-feature-page-tools-enabled` class
into the HTML element to prevent breakage.

Bug: T332090
Change-Id: I6466d80c6970bcc8e28d897b6bdff911a90e3655
2023-03-30 11:32:36 -04:00
jenkins-bot e82d0b002f Merge "Enable the pinning for anonymous users when page tools is enabled." 2023-03-14 00:39:18 +00:00
Nicholas Ray 448a90665d Enable the pinning for anonymous users when page tools is enabled.
Bug: T331657
Change-Id: Idca2ccfe4aeef0a2ac0970f7baf54849a64a4070
2023-03-13 23:49:59 +00:00
Ed Sanders d290b98f56 Fix inconsistencies in sticky header font-size and spacing
* Ensure 8px spacing between all icons and buttons
* Move buttons to separate container, so they aren't
  grouped with -icons.
* Reducing horizontal padding of quiet labelled buttons
  to 5px to match spec.

Bug: T326571
Change-Id: I71c3aee82152f048c347f80747972d526039a8f0
2023-03-13 23:29:35 +00:00
jenkins-bot 7932f6894d Merge "Removes old style rule" 2023-03-10 20:52:42 +00:00
ksarabia aba94865c2 Removes old style rule
This patch removes the old style rules for .vector-toc-pinned after one
week of cache.
Also removes 'data-name' which was no longer used

Bug: T325032
Change-Id: I7c8d8e51a61646151706b71a1733b1daac5dbd45
2023-03-10 14:31:44 -06:00
Moh'd Khier Abualruz 022954aff5 [vector] Menus: Make Tabs template fully-data driven to support upcoming navigation restructure work
- Template changes to use data driven links
- Template changes to use data driven list items
- Update unit tests
- Stop the hook from clearing data

Bug: T329794
Depends-On: Ide47c7ca7acabc21a94991d803f3683240a85f67
Change-Id: I523d7555b603b5382aa59eb25091338c7cc050ec
2023-03-10 10:57:37 +01:00
jenkins-bot ba00ff199f Merge "Fixes missing account login in OfficeWiki" 2023-03-09 21:58:38 +00:00
ksarabia 108aeb2d88 Fixes missing account login in OfficeWiki
Addresses missing login button and dropwdown by adjusting Hooks.php

Bug: T329463
Change-Id: I0fa630f5fef7fdd651fda1331762ffefbb1c5b75
2023-03-09 15:39:50 -06:00
jenkins-bot e47d30a119 Merge "Add hash fragment support to table of contents" 2023-03-09 19:46:39 +00:00
Jon Robson f6d45621bc Drop unused template and associated code
Bernard pointed out this is currently not used.

Bug: T329794
Change-Id: Ia491c56f6cb57c93328d0e523d5c8aa634d92356
2023-03-09 10:53:33 -08:00
Nicholas Ray 17433b63fc Add hash fragment support to table of contents
Per T325086, the TOC should expand and activate the section that corresponds to
the window's hash fragment.

Additional changes:

* Moves logic  that runs on page load to determine the
intersection from section observer to main.js, since the hash fragment can
take precedence over the scroll position (e.g. when scrolled all the way to the
bottom).

* Make section observer's pause() cancel any pending intersection calculations
so that it doesn't interfere with other async logic.

* Moves onHeadingClick and onToggleClick logic to activate and expand a section
to tableOfContents.js to facilitate unit testing this behavior with clicks and
hash fragment changes.

Bug: T325086
Change-Id: I8a2cf0e6a96467fae97608450b321c181155e424
2023-03-09 00:33:37 -07:00
jenkins-bot 5f6932c605 Merge "Increase scroll-padding-top for page sections" 2023-03-01 19:46:33 +00:00
ksarabia 74addde337 [WIP] Removes the TOC class in body and adds in html
Adds new constants for TOC and registers feature.

Bug: T325032
Change-Id: I5e0f5f3a6d186b245bdbc98c2bb9e4cc17a03fdb
2023-02-28 17:21:16 -06:00
Jan Drewniak cfc454f615 Increase scroll-padding-top for page sections
This introduces a general scroll-padding-top value of 50px
for Vector 2022's HTML element.

This changes makes it so that when navigating sections via the
TOC, the section headings are 50px lower on the screen.

This change has been synced with the ToC active sections as well,
so that active sections become active at the same offset.

Bug: T314419
Change-Id: I99e5fe2047f5ad1e61ef51b6ba7e76a6cac36fc5
2023-02-28 14:48:31 -05:00
bwang 392a2f0e97 Only render TOC related HTML when TOC is available
Bug: T328719
Change-Id: I3484a790ce8ebadf21054ac1d222d5632b2dc5a4
2023-02-27 16:31:03 -06:00
jenkins-bot eaf0e2d57e Merge "Table of contents: FIXME cleanup" 2023-02-24 20:55:28 +00:00
Jon Robson c06c547b02 Table of contents: FIXME cleanup
Follow up to Ib42d532d4e900c01061e1c5e39c03b17f0619c46

Hoist hook binding into main.js and update tests

main.js now only tests hook wire up.
tableOfContents calls reloadTableOfContents directly.

Bug: T316025
Change-Id: Ia06feab7cfb47a64ac3519bd7bd0428dc661045a
2023-02-24 01:16:20 +00:00
bwang 6b3ef91c74 Ignore noisy rule for a11y test
Change-Id: Ic17f788b1fa463d1f9a843e5047479e03acd90a7
2023-02-23 15:01:48 -06:00
bwang 0e5ef398b2 Rename IconLink to Link
Now that there is a Link.mustache, I think other components like Button, Link should use the Icon template, and not include icon in the name, as its possible to have a link or button that doesnt use an icon as well.

Change-Id: I6d8a17dd956f09bb3df7a2503f55d255599874f8
2023-02-22 22:00:24 +00:00
Moh'd Khier Abualruz efe33d5d76 Ensure ToC is always accessible via landmark region (<nav>)
- We had to add nav element to wrap TOC in all places
- Make sure proper nav is only displayed so landmark do not get confused
- Remove Eslint block on rules compat/compat for no support IE 11, this was blocking commit
- Run lint:fix:js and lint:fix:styles
- Fix maxSize in bundlesize.config.json

Bug: T324505
Change-Id: I36d26240b87de33318ff1edf97a410872a438103
2023-02-21 22:19:52 +01:00
bwang 159d298aaa Reduce verbosity of menu dropdown with aria-hidden
Bug: T325026
Change-Id: I9cd919b083dcbd0ca417cde3488968be9e2c503e
2023-02-16 15:21:53 -06:00
Jan Drewniak e4af2b5df3 Prevent addPortletLinkHandler from looping over links twice
- Prevents the addPortletLinkHandler function from looping
over the same links multiple times by indexing
the HTMLElement instead of just the ID, which is an
optional parameter.
- Conditionally adds the icon class if the ID parameter
exists.
- Refactors the function to calculate the width of the
vector toolbar.
- Adds Jest tests to account for the dual icon scenario
and updates existing Jest tests.

Bug: T327369
Change-Id: I2a0934405efebd0e95919bc523d711866236a7e6
2023-02-16 20:05:54 +00:00
bwang fca03c873b Update user links dropdown id
- Update naming convention to use dropdown instead of menu

Follow-up: Iac0586893fec26a8a6c2c904ce08fbf1e19b339c
Change-Id: Ie51f7fc280eeef8470613c07850dad83e4435ee8
2023-02-16 11:21:56 -06:00
Jon Robson a2b9847dda [Code organization] Move dropdownMenus test to correct directory
Change-Id: I28fa3f9127e92a4c55819e4fa64ae990118e2c8c
2023-02-16 10:01:35 -05:00
jenkins-bot c14ea4cc71 Merge "Remove custom handling of user links menu items and handle case when anon editor links are disabled" 2023-02-09 22:05:34 +00:00
bwang 9e4bdd00bf Remove custom handling of user links menu items and handle case when anon editor links are disabled
Rather than try to build individually build login, logout, and create account menu items, we handle them the same as all other user links menu items in Hooks.php. While Hooks isnt ideal, there currently isnt a good path for moving that code to SkinComponents until core provides menu data. In the meantime, this patch reduces code complexity and prevents bugs like T324638.
This approach also allows us to move user links logic from SkinVector22 to VectorComponentUserLinks.php, and ensures the user links dropdown contains multiple menus, which allows us to reuse styles from page tools dropdowns.

Expected 11 visual changes:
* minor visual change where the user links dropdown has an
additional 4px vertical padding.
This padding was originally added to the page tools dropdowns
per Alex's request, but Alex also said that dropdowns should share
the same spacing. This change makes the styles all consistent
* Order of talk and contribution links have been swapped

Bug: T289212
Bug: T319356
Bug: T328954
Change-Id: Iac0586893fec26a8a6c2c904ce08fbf1e19b339c
2023-02-09 13:37:17 -06:00
jenkins-bot 388a8cc6ce Merge "Replace automated testing code with npm package" 2023-02-09 00:26:49 +00:00
bwang f415a556dd Additional FIXME cleanup relating to moving feature classes from body
Additional follow up to Id5afe2c60dc0067e7c74433eda5cd7858f54b0d7
(55bb37f2a)

Change-Id: Id98161572a09b1d3fc340d75bd8e28b277d68e30
2023-02-08 10:49:13 -06:00
bwang 575ab2af9c Replace automated testing code with npm package
Change-Id: I36786bd8a378110672a832f511cd41424ed0709f
2023-02-08 01:05:22 +00:00
bwang 766249492f Move Log in link to overflow menu
Bug: T289212
Change-Id: I585bf644eeb68832cb0db079abd9f34256c0a1fe
2023-02-06 17:15:49 -06:00
bwang fcc3d3c9a9 Rename data-user-menu prefix to data-user-links, matching the template and component naming convention, create UserLinksDropdown.mustache
Change-Id: I6f0de836e39ba6bdcd5a8ff832e951164d69e586
2023-02-06 13:01:01 -06:00
bwang f3ddc51534 Add setFocusToToggleButton function to pinnableElement.js
Bug: T325020
Change-Id: I3829b146551ea55b84ae717a5db27003b0f2b97b
2023-02-01 14:31:53 -06:00
jenkins-bot 57c8e24b35 Merge "Remove VectorComponentTableOfContentsContainer in favor of directly using VectorComponentPinnableContainer," 2023-01-25 19:38:20 +00:00
bwang 2f29620a31 Disable headless puppeteer for a11y testing
Change-Id: I50c2d9f978e33b0757b9d520bebce606ae7127ca
2023-01-24 16:55:35 -06:00
bwang e703774b6d Update puppeteer actions for page tools
Change-Id: I11a6b779ed9c72c5aa4aaa226c0e7e855dcba437
2023-01-19 22:52:40 +00:00
Ed Sanders 7323d6af4e Use tabs consistently in .mustache files
Change-Id: I3874b8a03f8a512a4d31f4c85a030de63cbc3c69
2023-01-17 11:48:34 +00:00
bwang 128a01bd35 [Clean up] Remove CSS and HTML from cached TOC html
Follow-up: I5b9228380f5c4674ef424d33127a5cb4010822da
Change-Id: I2a1167278c5ece9c0540cff9b5c06fcf185bc64d
2023-01-16 17:21:12 -06:00
bwang 0032b7b970 Remove VectorComponentTableOfContentsContainer in favor of directly using VectorComponentPinnableContainer,
- Remove all TOC components from markup when TOC isnt available
- Ensure TOC components have a consistent naming convention

Follow-up: Icd871e1bdf4ab0c7aa5b906b913416f4b1747750
Change-Id: I63519b5e5392b9eb546876e7eea060b9a6c147dc
2023-01-16 17:20:03 -06:00
Moh'd Khier Abualruz 29a2254b9a Update tableOfContents.js to rerender only the TOC contents rather than the entire pinnable element
Extra:
- Reactivated active list element, This still does not work if the current active gets edited.
- Removed pinning event reattach as we do not replace teh full element anymore.

Known Issues:
 - Collapse/Expand not working

Bug: T326839
Change-Id: I2ce251f5312659b827ac2941d789248473bb0ef5
2023-01-16 12:39:05 +01:00
jenkins-bot 70ddd1f3f7 Merge "[Clean up] Remove unnecessary container and CSS in sticky header" 2023-01-13 20:57:24 +00:00
bwang 787b065f99 [Clean up] Remove unnecessary container and CSS in sticky header
Change-Id: I7a1f75e8997ea6c87955f72c971f6d1d08e6ab22
2023-01-13 20:11:21 +00:00
jenkins-bot 5f53d90e59 Merge "Override PinnableElement behaviour at low resolutions." 2023-01-13 19:52:28 +00:00
Jan Drewniak 4d1c0b8940 Override PinnableElement behaviour at low resolutions.
At resolutions below 1000px, we want pinned elements
such as the Page Tools menu and Main Menu to collapse.
This behaviour is temporary and when the browser is resized,
the pinned elements should revert to their previous pinned state.

We also want to remove the ability to pin these menus at
low resolutions, so the "hide/move" button is hidden.

A new matchMedia event handler is added to PinnableElement.js
to handle this behaviour.

CSS is also added to hide the pinned menus at low resolution.
This is to account for the situation where the page is loaded
at narrow widths, with pinned elements,
and the JS hasn't loaded yet.

features.js is refactors so that class toggling can happen
independently of saving the state to user preferences
(since we want to toggle the classes but not save the state
at lower resolutions).

Bug: T326364
Change-Id: I3113ab83deb15843e04ed63ec767a85c522517b5
2023-01-13 18:09:11 +00:00
Jon Robson eea5373940 Components: StickyHeader
complete the migration to components.

Changes:
* shouldHideLanguages only used inside SkinVector22 so abstract method
and legacy implementation removed.
* Move isLanguagesInContent method to SkinVector22, updating one usage
in SkinVectorLegacy which is always falsey (languages are always portals
in legacy Vector)
* Remove unused isLanguagesInContentAt method from SkinVectorLegacy
and move getLanguagesCached, isULSExtensionEnabled,
canHaveLanguages, isLanguagesInContentAt to SkinVector22
* runOnSkinTemplateNavigationHooks copied to both Vector skins
* isResponsive moved to Vector22. In Legacy Vector it has no
real use since legacy Vector has no responsive styles.
* SkinVector class now (empty), is removed.

Bug: T319355
Change-Id: Ib5df956cecb841b7c97264975d137af32e5da4ab
2023-01-12 00:32:35 +00:00
Jon Robson 0c0ce631ee Components: Model table of contents in title bar.
Bug: T320927
Change-Id: Icd871e1bdf4ab0c7aa5b906b913416f4b1747750
2023-01-11 15:42:23 -08:00
Jon Robson e153561255 Component: UserLinks
Simplify the user links component
Introduce MenuListItem and IconLink components.

HTML changes:
* Logout, login and account links are now wrapped in a ul and li tag
instead of a DIV for consistent with other menus (this occurs due
to use of MenuContents). Code reviewer can see tests
for an understanding of how the template data and markup has changed.

VISUAL CHANGE:
* Increased margins in user links menu relating to change from DIV to
UL / LI tags.

Bug: T320927
Change-Id: Ia24be48105e1ff85da227883abb5dddb3d54388d
2023-01-11 21:48:11 +00:00
Jon Robson e032d68703 Remove vector-menu-dropdown-noicon class
No longer needed.

Change-Id: I3a0e7f7f2a467fc55b138fc3a9d06096c84a8f8e
2023-01-10 23:48:05 +00:00
jenkins-bot bd2f9b6ca6 Merge "Log events for pinnable header button" 2023-01-06 15:53:54 +00:00