1079 Commits

Author SHA1 Message Date
Paul Gschwendtner 26ab3687bb refactor(docs-infra): enable ip anonymization for legacy universal analytics (#46801)
In GA4 ip anonymization is enabled by default, but in universal
analytics with `analytics.js`, this needs to be explicitly enabled.

PR Close #46801
2022-07-12 19:43:18 +00:00
Paul Gschwendtner f2a1ea39a4 refactor: move error reporting for analytics to service (#46801)
This is acceptable because `gtag.js` is also only loaded as part of the
service, similary `ga` is only registered in the service (so the
reporting was a noop if errors are thrown before -- no change here)

We can benefit from downleveling etc. and do not need to be careful
with the inline script in the `index.html`

PR Close #46801
2022-07-12 19:43:18 +00:00
Paul Gschwendtner a786cf68e2 feat(docs-infra): set up Google Analytics 4 along with keeping legacy Universal Analytics (#46801)
We currently use Universal Analytics. This is deprecated in favor of
Google Analytics 4 and UA will stop processing hits in October 2023.

This change intends to prepare us for this migration, and to already
pre-populate our GA4 property (there is no way to migrate existing data
/properties into a GA4 property -- a new one needs to be created).

This will help us minimize the data gap so that we can:

* Continue to look at the UA property with the full time span until
  October 2023
* Can start using the GA4 property long-term in the future, starting
  with data even before Universal Analytics stops processing new data.

We need to keep the existing `analytics.js` setup. Initially we have
considered using `gtag.js` for both the UA and GA4 properties, as it
supports that, but that doesn't work with our strict trusted types
enforcement because it results in multiple `gtag.js` scripts (specific
versions for UA or GA4) that recreate the same trusted type policies.
This causes runtime errors and breaks the setup.

Instead, with continued use of `analytics.js` we have the benefit of
a good separation of trusted types + events and configuration. There is
some problematic with translation of Universal Analytics Events to GA4,
or the other way around (even though we don't use custom events
currenlty)

We also do not need to send page views for our GA4 property because GA4
with gtag supports this automatically (respecting the history state --
using the `Enhanced measurement events` setting in the UI).
For our UA legacy instance we continue to dispatch events manually. This
logic can be removed in the future.

More details can be found here:
https://docs.google.com/document/d/1aK8u4ZlXbqQ2wMqmgSX7Ces8iLgamC13oCoG6VeBruA/edit?usp=sharing&resourcekey=0-EVe-Rhnme3bj_pkz2RcOmw.

PR Close #46801
2022-07-12 19:43:18 +00:00
dario-piotrowicz 92657998e9 fix(docs-infra): change color of code copy button (#46460)
change the color of the code copy button so that it has a better color
contrast with its background

resolves #37817

PR Close #46460
2022-06-27 09:06:39 -07:00
dario-piotrowicz f930fc284a refactor(docs-infra): create external-link-with-icon mixin (#46482)
create external-link-with-icon mixin in order to reduce scss code
duplication

PR Close #46482
2022-06-24 15:28:02 -07:00
dario-piotrowicz 2a144950d7 feat(docs-infra): redesign contributors page (#46347)
redesign the aio contributors page so that it displays the contributors
details as a list instead of using flipping cards, this should improve
the usability of the page and especially its accessibility

resolves #44346

PR Close #46347
2022-06-24 13:11:56 -07:00
dario-piotrowicz d05e9a96e5 fix(docs-infra): slightly improve aio-top-menu css (#46429)
slightly improve the aio-top-menu css by making it more robust
regarding differnt font-sizes and also remove unnecessary css rules

PR Close #46429
2022-06-21 12:19:12 -07:00
dario-piotrowicz 639277b96f feat(docs-infra): add open_in_new icon to external nav-item links (#46384)
add a mat open_in_new icon to the blog external link present in the
left sidenav on smaller screens so that it can be distinguished from
the other (/internal) links

this is a continuation of #45876

PR Close #46384
2022-06-21 11:45:58 -07:00
dario-piotrowicz 958dcf81b2 feat(docs-infra): add open_in_new icon to external aio-top-menu links (#45876)
add an open_in_new icon to the blog external link present in the
aio-top-menu so that it can be distinguished from the other (/internal)
links

resolves #38412

PR Close #45876
2022-06-15 14:03:30 -07:00
markostanimirovic 469d9b6ebe feat(docs-infra): show dark scrollbars in dark mode (#46363)
With this commit, dark scrollbars will be shown when angular.io is in dark mode.

PR Close #46363
2022-06-15 15:56:38 +00:00
dario-piotrowicz b60d15c704 fix(docs-infra): improve accessibility of aio-select component (#46013)
improve the accessibility of the aio-select component so that it is
clear for screen reader users its functionality (currently it is
presented as a simple button), following the WAI-ARIA authoring
practices (see: https://www.w3.org/TR/wai-aria-practices/#combobox)

A first attempt in improving the accessibility of the component has been
tried in PR #45937 by replacing it with the material select component,
such implementation has however been scrapped since the increase of
payload sizes has proven prohibitively large

(also note that given native select elements haven't been used given the lack
of syling options for such elements)

PR Close #46013
2022-06-10 16:10:35 +00:00
dario-piotrowicz fc97c768f7 fix(docs-infra): add missing aria-labels to contributors page (#46324)
add proper aria-labels for the twitter and website link of contributors
(which being icons they have no text) so that they can be correctly read
by screenreaders

also add aria-labels to the view-bio buttons for a better user
experience

PR Close #46324
2022-06-10 16:09:25 +00:00
Alex Rickabaugh c2c520341f feat(docs-infra): add @developerPreview tag for APIs in developer preview (#46050)
This commit adds a tag processor for `@developerPreview`. Adding this tag to
an exported symbol or to a decorator parameter causes an API status tag to
be shown for the API which links to the Developer Preview documentation.

PR Close #46050
2022-06-01 16:01:59 -07:00
dario-piotrowicz bf340479ca feat(docs-infra): add group role and label for aio-notification (#45770)
add a role and an aria-label to the aio-notification component so that
it can be handled better by assistive technologies

resolves #44345

PR Close #45770
2022-05-23 13:48:31 -07:00
George Kalpakas c92b242f22 build(docs-infra): update Angular CLI/framework to v14.0.0-rc.0 in AIO (#45997)
Update angular.io to the latest prerelease versions of Angular CLI and
framework (v14.0.0-rc.0).

Also update angular.io to more closely align with new CLI apps. See also
the [diff][1] between a basic v13.0.0-next.9 CLI app and a v14.0.0-rc.0
one.

[1]: https://github.com/cexbrayat/angular-cli-diff/compare/13.0.0-next.9...14.0.0-rc.0

PR Close #45997
2022-05-23 13:20:11 -07:00
dario-piotrowicz 83159749a2 fix(docs-infra): fix wrong heading structure in aio resources page (#45822)
in the aio resources page there is a main h1 heading and then the next
headings used are h3 and h4, thus h2 is being skipped, change such
headings so that there is no heading skipping (which is a bad practice
and can result to confusing experiences from screen reader users)

PR Close #45822
2022-05-02 09:20:36 -07:00
dario-piotrowicz d1a9fd5cc1 docs: make sure aio home has a non-ignored h1 (#45740)
currently the aio home page presents a single h1 which is ignored by
assistive technologies since it has its display set none, so replace it
with a new h1 containing the main text of the page instead

PR Close #45740
2022-04-27 09:06:12 -07:00
dario-piotrowicz f282ca4f62 fix(docs-infra): fix alert child margin issue (#45761)
replace the generic `*` selector used in the alert styling with
`p` (which is what gets generated from the markdown) as the styling adds
margins which are not always wanted

PR Close #45761
2022-04-27 09:04:30 -07:00
dario-piotrowicz 0b6407241c fix(docs-infra): fix aio search-results issue with toolbar and notification (#45579)
use border-top-width instead of padding-top as the strategy for moving
the search-results panel down, this fixes the issue of the panel going
behind the toolbar (which causes either overlapping text in the home
page or the results scrollbar to be hidden behind the toolbar in other
pages)

PR Close #45579
2022-04-15 14:22:14 -07:00
dario-piotrowicz 9e69579440 fix(docs-infra): amend notification close button aria-label (#45579)
move the aria-label used inside the close-button to the button itself
(since otherwise the button's aria-label overrides the childs)

PR Close #45579
2022-04-15 14:22:14 -07:00
dario-piotrowicz d2436bfc91 feat(docs-infra): add close button to search-results aio panel (#45579)
add a close button to the search-results aio panel so that the user can
conveniently close it via keyboard

this complements the focus trap implemented in PR #44989
(more here: https://github.com/angular/angular/pull/44989#issuecomment-1037287678)

PR Close #45579
2022-04-15 14:22:13 -07:00
George Kalpakas 2a81e440f4 docs: remove out-of-order <h3> elements from footer (#45510)
The footer uses `h3` elements out of order, which causes a "Heading
elements are not in a sequentially-descending order" a11y error.
Replace the `h3` elements with `div` to improve a11y.

Fixes #44338

PR Close #45510
2022-04-07 21:01:58 +00:00
George Kalpakas 24649b9930 fix(docs-infra): add shell to the list of code-example languages recognized as cli commands (#45551)
Previously, only `language="sh"` and `language="bash"` would be
recognized (and formatted) as cli commands in `<code-example>`.

This commit adds `shell` to the list of languages recognized as cli
commands.

(NOTE: This will fix the [CI failures][1] in #45325.)

[1]: https://circleci.com/gh/angular/angular/1145559

PR Close #45551
2022-04-07 20:59:19 +00:00
dario-piotrowicz 7d9492353d fix(docs-infra): implement focus trap for aio search results (#44989)
currently if a user tries to navigate via keyboard, once the are
presented with search results, the search results panel remains
present and can potentially hide most of the content on the page,
in such case keyboard navigation will be severly hindered and
the only option for the user would be to go back to the seach input
text and clear its value, fix such inconvenience by looping the
focus in the header area close to the search results and the
results panel itself

note: an alternative implementation using the cdkTrapFocus has been
attempted in PR #45194, such alternative implementation presented a
number of (minor) drawbacks (including the increase main bundle size
due to the inclusion of the A11yModule), so it was agreed to proceed
with the manual implementation present in these changes instead.

PR Close #44989
2022-03-29 16:56:03 -07:00
zverbeta 099fedc9b3 docs: add notification to support ukraine (#45376)
PR Close #45376
2022-03-29 15:25:49 -07:00
dario-piotrowicz 0fc4571b85 fix(docs-infra): assign different aria labels to main aio navs (#45209)
assign different aria labels to the primary nav and the one used for
guides and docs, so that impaired users can more easily distinguish the
two

PR Close #45209
2022-03-29 09:23:12 -07:00
dario-piotrowicz 734bd8d953 fix(docs-infra): remove redundant main roles (#45209)
remove redundant main role as pages should always have a
single element with a main role (also remove the role assigne
to the main tag as that is implied)

PR Close #45209
2022-03-29 09:23:12 -07:00
dario-piotrowicz be5dce2cdd fix(docs-infra): wrap the main aio mat-toolbar in a header (#45209)
wrap the main aio mat-toolbar in a header element to provide better
accessibility

resolves #16938 (the first point)

PR Close #45209
2022-03-29 09:23:12 -07:00
dario-piotrowicz 7ef071769f fix(docs-infra): remove navigation role to aio-top-menu ul (#45209)
currently the navigation ul used in aio-top-menu has a role of
navigation, but listitems should be owned by list parents
(see more: https://www.w3.org/TR/wai-aria-1.1/#listitem)
so wrap the ul in a nav and remove the role="navigation" from the
ul element to fix such issue

resolves #44562
resolves #16938 (the second point)

PR Close #45209
2022-03-29 09:23:12 -07:00
Tobias Speicher 4ddcf81e61 refactor: replace deprecated String.prototype.substr() (#45397)
.substr() is deprecated so we replace it with functions which work similarily but aren't deprecated

Signed-off-by: Tobias Speicher <rootcommander@gmail.com>

PR Close #45397
2022-03-24 11:48:09 -07:00
dario-piotrowicz 702e196037 fix(docs-infra): make hamburger menu non focusable when not visible (#45067)
the header hamburger menu gets removed from the page by moving it
outside the screen, it can however still be accessed via keyboard
navigation, add a visibility hidden to the element to prevent such
behavior

PR Close #45067
2022-02-18 13:36:11 -08:00
markostanimirovic 444354855b refactor(docs-infra): replace deprecated toPromise usages (#45045)
This commit replaces deprecated `Observable.toPromise` usages
with `lastValueFrom`.

PR Close #45045
2022-02-11 14:34:28 -08:00
markostanimirovic b4157449c4 refactor(docs-infra): replace deprecated subscribe usages (#45046)
This commit replaces deprecated `Observable.subscribe` usages.

PR Close #45046
2022-02-11 14:33:45 -08:00
mgechev 39b90b46b6 docs: remove banner after survey expiration (#44949)
The survey is now over. We can remove the banner.

PR Close #44949
2022-02-02 19:50:20 +00:00
mgechev 1b56437376 docs: update the survey expiration date (#44938)
Extend with a few more days since the survey is still open.

PR Close #44938
2022-02-02 01:56:40 +00:00
Andrew Scott fdfcef5a0a build: enable useUnknownInCatchVariables (#44679)
This unblocks the internal migration to turn the option on in g3.

PR Close #44679
2022-02-01 18:17:29 +00:00
George Kalpakas 3d07d1f772 fix(docs-infra): make it possible to see whole notification text on smaller screens (#44900)
Previously, when the notification text did not fit on the viewport
width, it got truncated and it was not possible to see the whole text.

This commit fixes this by making the notification scrollable when the
text overflows.

PR Close #44900
2022-01-31 19:44:52 +00:00
George Kalpakas 2320025a8e fix(docs-infra): make it easier to interact with notification on smaller screens (#44900)
On smaller screens, the action button in `NotificationComponent` is
hidden (due to limited horizontal screen "real estate"). Thus, the only
way to perform the action is to click on the notification message, which
is typically a link.

Previously, the link inside the notification did not take up the whole
height of the notification bar. As a result, clicking outside the link
would dismiss the notification without following the link.

This commit makes it easier to interact with the notification (esp. on
smaller screens) by ensuring the link covers the whole notification bar
(width and height).

PR Close #44900
2022-01-31 19:44:52 +00:00
George Kalpakas 0650066d59 Revert "fix(docs-infra): content overflow in mobile (#44851)" (#44899)
This reverts commit c2e09e0911, because it
messes up the table layouts on some resolutions/pages. See #44891 for
details.

Fixes #44891

PR Close #44899
2022-01-31 17:10:50 +00:00
fru2 c2e09e0911 fix(docs-infra): content overflow in mobile (#44851)
When reading the docs page on mobile, some page tend to scroll in horizontal direction quite a lot which is unpleasant

Fixes #44850

PR Close #44851
2022-01-28 18:01:47 +00:00
Andrew Kushnir c12110f2f8 docs: update survey id (#44865)
The survey id is used as a key in the local storage to keep the state (don't show the message again). Reusing this survey id will make the message invisible to some users who already have that key in local storage.

PR Close #44865
2022-01-27 21:52:35 +00:00
Paul Gschwendtner a82165e3f9 test(docs-infra): fix type checking errors with new jasmine types (#44735)
The jasmine types for `spyObj.calls().all()` seem to be more specific,
relying on `ThisType<Fn>` to determine the context/receiver for an invoked
spy. This type does not work as expected with class members as it seems.

This commit fixes three of these type checking failures by explicitly casting
the spy context to the actual class owning the method member.

PR Close #44735
2022-01-27 21:51:28 +00:00
mgechev 1312ac1d98 docs: enable the survey banner (#44861)
PR Close #44861
2022-01-27 11:43:54 -08:00
George Kalpakas 7480660a95 fix(docs-infra): track error docs during serve-and-sync (#44704)
Refs #42966.

Look for changes in error docs (i.e. docs under `aio/content/error/`) in
`authors-package`, so that such docs are tracked when running the
`serve-and-sync` script.

PR Close #44704
2022-01-24 10:41:13 -08:00
Derek Cormier ec1057014b fix(docs-infra): fix date parsing in a flaky test (#44763)
Mock dates in EventsComponent tests are parsed in inconsistent ways
across platforms/browsers, which makes the comparison to the mocked
UTC "now" date behave differently causing the test to fail. This fix
ensures that the mocked "now" date is parsed in the same way as the
test dates to avoid inconsistencies.

PR Close #44763
2022-01-19 16:47:16 -08:00
Dario Piotrowicz c57e22a21b refactor(docs-infra): remove IE11 code (#44570)
since IE11 is no longer a supported browser, remove angular.io code
implemented specifically for IE11 support

this change reverts the following PRs:
 - #26059 (slightly)
 - #28188 (fully)
 - #32871 (fully)
 - #41183 (partially)

PR Close #44570
2022-01-07 18:11:35 +00:00
dario-piotrowicz a864d1c926 fix(docs-infra): adjust code link styling height (#44376)
the height of code links (anchors inside code tags or
code tags inside anchors) is inconsistent, fix such
issue by also making sure that code links to external
resources do not get wrongly styled

PR Close #44376
2022-01-04 12:19:08 -08:00
Dario Piotrowicz 67c81ccef0 refactor(docs-infra): improve aio-footer's layout (#44532)
improve aio-footer's layout by using grid instead of flexbox,
such change makes it so that we have four columns on wide window
sizes (desktop), two columns on medium window sizes (desktop/tablet)
and a single column on small window sizes (mobile), compared to the
flex implementation which could only have either 4 columns or 1

this makes the footer look generally nicer for various window sizes
(especially in the middle range in which one column was too little
and four were too much)

note: also a scroll of auto has been added so we that we can be sure
that overflowing footer content never creates a global layout issue

PR Close #44532
2022-01-04 12:13:22 -08:00
Adam Plumer 79d1afaf5b build: bump license year (#44590)
The year has advanced by one cycle. In accordance with this
practice, we increment the value of the bounding set of our
license year by one.

PR Close #44590
2022-01-04 12:05:25 -08:00
George Kalpakas f7ea5249de refactor(docs-infra): replace use of deprecated Compiler with createNgModuleRef() (#44293)
Remove a use of the deprecated `Compiler` class in `ElementsLoader` and
use the `createNgModuleRef()` function instead.

PR Close #44293
2021-12-01 11:56:47 -08:00