Commit graph

1054 commits

Author SHA1 Message Date
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
George Kalpakas
15d38a1302 refactor(docs-infra): remove obsolete ViewEngine code path from ElementsLoader (#44293)
Remove a code path that was only reached in ViewEngine mode and is now
(with the removal of ViewEngine) obsolete.

PR Close #44293
2021-12-01 11:56:47 -08:00
Kristiyan Kostadinov
95ed446009 refactor(docs-infra): clean up entryComponents usages (#44257)
Cleans up some usages of `entryComponents` from AIO.

PR Close #44257
2021-11-30 13:49:45 -05:00
George Kalpakas
ef140a76d9 fix(docs-infra): fix the main content layout (#44282)
Fix the layout of the main docs content on both small and large screens.
On small screens, content could overlap with the floating ToC, while on
large screens the content was not centered correctly (see screenshots
below).

(For reference, this was accidentally broken in #44236.)

**Before:**
- ![content on small screen before](https://user-images.githubusercontent.com/8604205/143491577-97255ee7-f79d-4c95-9287-ff2afeb5b29d.png)
- ![content on large screen before](https://user-images.githubusercontent.com/8604205/143491582-2c19f7a2-d5ad-475a-a58b-e449efc492a9.png)

**After:**
- ![content on small screen after](https://user-images.githubusercontent.com/8604205/143491580-a405f650-cd4a-4804-8e65-422fc91f4c6e.png)
- ![content on large screen after](https://user-images.githubusercontent.com/8604205/143491585-d0d2e914-a1a2-45ba-8e6b-b9546aa80354.png)

PR Close #44282
2021-11-29 17:21:14 -05:00
dario-piotrowicz
8fae7df512 fix(docs-infra): add safari-only media query for aio footer flex (#44266)
safari handles rem based media queries differently so in order to
provide a similar user-experience to safari users, add a new
safari-only media query for the footer's flex container

resolves #44242

PR Close #44266
2021-11-29 12:37:44 -05:00
Pete Bacon Darwin
47f1c0fa33 fix(docs-infra): ensure deprecated styling is not overridden (#44275)
The `.code-anchor` styling was overriding the `.deprecated-api-item` styling.
The `text-decoration` is not needed on `.code-anchor` since it inherits this from the `a` rule in the typography.scss file.

Fixes #44264

PR Close #44275
2021-11-29 12:36:23 -05:00
dario-piotrowicz
2bf131a8a0 fix(docs-infra): move aio footer inside mat-sidenav-container (#44236)
currently the aio footer sits outside the mat-sidenav-container, as a
result when the mat-sidenav in over mode appears, the footer is not
placed under the sidenav backdrop, move the footer inside the
mat-sidenav-container so that it does

PR Close #44236
2021-11-24 17:04:01 +00:00
dario-piotrowicz
d8ae34aea8 fix(docs-infra): remove negative margin (#44126)
remove the top padding for the homepage article, instead of
having that top padding and moving the element up via a
negative bottom margin in the intro section

note: the result is identical except for when the article's media query
is applied, the difference is barely noticeable anyways

PR Close #44126
2021-11-19 19:32:29 +00:00
dario-piotrowicz
9255d0b05d fix(docs-infra): fix aio homepage breaking on certain widths (#44126)
the aio homepage has a fixed width for its hero content,
that is not handling well certain window widths, fix that by removing
the fixed width and tweaking related media queries

PR Close #44126
2021-11-19 19:32:29 +00:00
mgechev
02b84af5bd docs: update the survey expiry date (#44021)
PR Close #44021
2021-11-04 18:55:24 +00:00
Paul Gschwendtner
ac8b5bffe4 build(docs-infra): update AIO to angular framework/components/cli final RCs (#43583)
Updates AIO to the latest v13 release-candidate version of all
Angular-owned packages, such as Angular CDK and Angular Material.

Applies changes needed for the v13 CLI as performed by the CLI
through `ng update`:

7ff8c5350e/packages/schematics/angular/migrations/update-13.

Additionally, the web components polyfill has been removed as all browsers
supported by Angular seem to support custom elements v1 natively, according to:

* https://caniuse.com/custom-elementsv1
* https://www.webcomponents.org/ (scroll down to browser support)

Co-authored-by: George Kalpakas <kalpakas.g@gmail.com>

PR Close #43583
2021-11-02 17:31:58 -07:00
Alan Agius
408e4dafbd fix(docs-infra): search box input line-height (#43983)
This fixes an issue on Safari which caused the text to be pushed down when blurring out of the search input field. The root cause of the problem appears to be that previously the computed line height was that of 32px, which caused a shift in content.

Closes #43935

PR Close #43983
2021-10-29 15:47:06 -07:00
George Kalpakas
a01e02d4e2 refactor(docs-infra): remove obsolete way of disabling DocViewer animations (#43977)
Previously, there were two ways to disable view transition animations in
`DocViewerComponent`: Using a `.no-animations` CSS class on the
`<aio-doc-viewer>` element and setting the static
`DocViewerComponent.animationsEnabled` property to `false`. The latter
was only used to disable animations for testing purposes.

With the recent introduction of `AppComponent.reducedMotion`, there is
now an easy way to disable animations in tests using the
`.no-animations` class (which is applied by `AppComponent` based on the
value of `AppComponent.reducedMotion`). Therefore, it is no longer
necessary to have `DocViewerComponent.animationEnabled`.

This commit removes the now obsolete `animationsEnalbed` property.

PR Close #43977
2021-10-29 15:44:58 -07:00
George Kalpakas
df5f737081 fix(docs-infra): improve accessibility by respecting prefers-reduced-motion (#43977)
Make the app easier to use for people with motion sensitivities by
disabling several animations (esp. ones involving moving things around)
when the user prefers reduced motion. The user's preference is detected
using the [prefers-reduced-motion][1] CSS media feature.

Disabled animations include:
- View fade in/out transitions.
- Sidenav open/close animations.
- Top-menu color and size changes.
- Contributor cards flip animations.

For more details on using `prefers-reduced-motion` and disabling
Angular animations see:
- [Designing with reduced motion for motion sensitivities][2]
- [Disabling Angular animations at runtime][3]

[1]: https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion
[2]: https://www.smashingmagazine.com/2020/09/design-reduced-motion-sensitivities/
[3]: https://dev.to/this-is-angular/disabling-angular-animations-at-runtime-9a6

PR Close #43977
2021-10-29 15:44:58 -07:00
George Kalpakas
4f4b2b5ac9 refactor(docs-infra): convert deploy-to-firebase script to ESM (#43963)
Convert the `deploy-to-firebase` script (and corresponding tests) from
CommonJS format to ESM.

PR Close #43963
2021-10-29 15:05:02 -07:00
George Kalpakas
f8ab6e9eb3 refactor(docs-infra): move deploy-to-firebase.js into a dedicated directory (#43963)
This commit moves the `aio/scripts/deploy-to-firebase.js` script into a
new directory, `aio/scripts/deploy-to-firebase/`. This will make it
easier to break it up into multiple smaller files to better organize the
code (without polluting the `aio/scripts/` directory).

PR Close #43963
2021-10-29 15:05:02 -07:00
dario-piotrowicz
efeb5adf95 fix(docs-infra): add paddings to docs-card titles (#43859)
improve the aio docs-card title by adding some padding
so that it doesn't get too close to the card's edges

PR Close #43859
2021-10-18 09:23:15 -07:00
dario-piotrowicz
17c9f67e21 fix(docs-infra): apply minor style fixes to aio contributor cards (#43844)
improve the aio contributors card by aligning centrally the
contributor's name and adding some padding so that it doesn't
get too close to the card's edges

Note: the name's aligning was already present by wrongly removed in
PR #43355

PR Close #43844
2021-10-15 10:12:55 -07:00
dario-piotrowicz
eec3839e83 fix(docs-infra): improve cancel icon in top-menu search (#43600)
webkit browsers show a cancel X icon in the input search on focus/hover
which allows to clear the content of the input, such icon has small
glitches/imperfections so use a mat-icon instead

(this also adds such icon to non-webkit browsers)

PR Close #43600
2021-10-12 17:50:29 +00:00
George Kalpakas
0849a09fd1 fix(docs-infra): ensure SwUpdatesService is instantiated (#43766)
In 305d05545a, we accidentally stopped
instantiating the `SwUpdatesService` service, which meant that we were
no longer subscribing to ServiceWorker update events and proactively
checking for updates. We would still gets updates, because the
ServiceWorker automatically checks on each navigation request and when a
new ServiceWorker instance is created, but we would not proactively
fetch updates and also miss `unrecoverable` errors.

This commit fixes this by exposing an `enable()` method from
`SwUpdatesService`, which has to be explicitly called for the service to
be enabled, and ensures that the method is called when `AppComponent` is
initialized.
The commit also gets rid of the `SwUpdatesModule` (whose only purpose
was to provide `SwUpdatesService`) in favor of using `providedIn`.

Fixes #43695

PR Close #43766
2021-10-08 20:39:44 +00:00
George Kalpakas
300230c255 fix(docs-infra): avoid prepending version info to error messages twice (#43767)
Previously, we used to prepend version info to error messages by
updating their `message` property and their `stack` property. However,
due to the fact that on some browsers `error.stack` is lazily computed
based on `error.message` the first time the `stack` property is
accessed, this resulted in prepending the version info twice.

This commit ensures that the version info is only prepended to
`error.stack` once to avoid unnecessary repetition in error messages.

PR Close #43767
2021-10-08 20:17:58 +00:00
George Kalpakas
18d14b50f9 fix(docs-infra): fix Sass rule resulting in invalid CSS (#43767)
The way the Sass rule was defined previously resulted in invalid CSS of
the form:
```css
table > thead > { ... }
```

This, in turn, resulted in a build-time warning:
```
Warning:  > styles.9a5a35b070498c08.css:3079:14: warning: Unexpected "{"
    3079 │ table thead > {
         ╵               ^
```

This commit fixes the affected rule (mostly to avoid the warning,
because this change doesn't seem to have any visual difference). It also
fixes other rules that were currently not affected (because they only
had nested rules and no direct styles), but were susceptible to being
affected in the future.

PR Close #43767
2021-10-08 20:17:58 +00:00
hchiam
8920fa093b docs(docs-infra): fix a11y of external links (#43725)
prevent screen readers from falsely announcing "open_in_new" since they may not actually open new tabs/windows but simply send the current page to a domain outside angular.io

Fixes #43512

PR Close #43725
2021-10-07 20:55:23 +00:00
George Kalpakas
b8ab5ff0fb build(docs-infra): update AIO to align with new v13.0.0-next.9 CLI apps (#43686)
This commit updates angular.io to more closely align with new apps
created with the latest Angular CLI and remove redundant files/config
now that CLI has dropped support for differential loading.

PR Close #43686
2021-10-06 10:05:54 -07:00
George Kalpakas
81d3919102 refactor(docs-infra): prefix error messages with Angular version info (#43686)
Prefix error messages with the Angular version currently used in the
angular.io app. This applies to both errors logged to the console and
reported to Google Analytics and makes debugging certain errors easier.

PR Close #43686
2021-10-06 10:05:54 -07:00
dario-piotrowicz
6ac35d0660 fix(docs-infra): convert button-like elements to actual buttons (#43601)
some elements in the aio application are anchors or divs but behave
like buttons, it is semantically (and a11y) more correct to convert
them to actual button elements instead

PR Close #43601
2021-10-06 09:22:04 -07:00