696 Commits

Author SHA1 Message Date
George Kalpakas
6bc016f3fa build(docs-infra): update @angular/* to 9.0.0-next.10 ()
Also, remove work-around for template type-checking issue that was fixed
in .

Fixes 

PR Close 
2019-10-15 16:48:29 +00:00
JoostK
cd7b199219 feat(ivy): check regular attributes that correspond with directive inputs ()
Prior to this change, a static attribute that corresponds with a
directive's input would not be type-checked against the type of the
input. This is unfortunate, as a static value always has type `string`,
whereas the directive's input type might be something different. This
typically occurs when a developer forgets to enclose the attribute name
in brackets to make it a property binding.

This commit lets static attributes be considered as bindings with string
values, so that they will be properly type-checked.

PR Close 
2019-10-14 20:25:20 +00:00
JoostK
f05999730a build(docs-infra): fix template type check errors ()
In  a limitation of Ivy's template type checker was fixed, where
all directive inputs would incorrectly allow `undefined` to be passed,
even when the input's type did not allow for it. Due to the fix, some
additional type errors were uncovered in AIO, where potential
`undefined` values would be passed to inputs that were not typed to
allow `undefined`.

PR Close 
2019-10-14 20:25:20 +00:00
George Kalpakas
3001716a2f test(docs-infra): ensure spy returns new observable every time ()
Previously, some spies in `DovViewerComponent` tests would return the
same `of(undefined)` observable for all invocations of the spy in a
test. While there is usually only one invocation per spy in each test,
this is not always the case. In case of multiple invocations within the
same test, subsequent calls would return an already completed
observable, which deviates from the actual behavior of the spied
function.

This commit fixes it by ensuring a fresh `of(undefined)` observable is
returned on each invocation.

PR Close 
2019-10-10 13:56:15 -07:00
George Kalpakas
d349cd91b1 refactor(docs-infra): fix some linting warnings ()
PR Close 
2019-10-10 13:56:14 -07:00
George Kalpakas
a2d2a5d572 build(docs-infra): enable fullTemplateTypeCheck (and fix failures) ()
PR Close 
2019-10-10 13:56:14 -07:00
George Kalpakas
b2666a2857 build(docs-infra): enable more TypeScript strictness flags ()
PR Close 
2019-10-10 13:56:14 -07:00
George Kalpakas
4e1f37fc17 refactor(docs-infra): replace mousewheel event with wheel event ()
This commit replaces the non-standard, depecated [mousewheel][1] event
(which is not supported in Firefox and possibly other browsers too) with
the standard [wheel][2] event, which works on all supported browsers
according to [MDN's compatibility table][3].

I manually tested it in Chrome, Firefox, Edge and IE11.

[1]: https://developer.mozilla.org/en-US/docs/Web/API/Element/mousewheel_event
[2]: https://developer.mozilla.org/en-US/docs/Web/API/Element/wheel_event
[3]: https://developer.mozilla.org/en-US/docs/Web/API/Element/wheel_event#Browser_compatibility

PR Close 
2019-10-10 13:56:14 -07:00
Koala
40d87dd801 docs: fix accessibility lint rules ()
Add and fix accessibility rules, bump codelyzer to support pseudo events
for template-click-events-have-key-events rule.

PR Close 
2019-10-07 11:22:48 -07:00
George Kalpakas
ea9245446f refactor(docs-infra): replace System.import() with import() ()
`System.import()` has been deprecated in webpack and produces the
following warning when building the app:

```
WARNING in ./src/app/custom-elements/code/pretty-printer.service.ts
System.import() is deprecated and will be removed soon. Use import()
instead.
```

Switching to `import()` to get rid of the warning.

Fixes 
Closes 

PR Close 
2019-10-04 08:27:21 -07:00
George Kalpakas
090732fc2d fix(docs-infra): show hamburger button on getting started guide ()
In 1c3ee4190, the `getting-started` guide/tutorial was renamed to
`start`, but the corresponding CSS class that controls the display of
the top-left hamburger (and it automatically derived based on the URL)
was not updated.

This commit updates the class to ensure that the hamburger is not hidden
when navigating to the getting started guide.

PR Close 
2019-10-02 09:20:22 -07:00
George Kalpakas
85990c3213 fix(docs-infra): correctly run on IE11 ()
Since 007282d2b, [TocService][1] uses [forEach()][2] to iterate over a
`NodeList`. This breaks in IE11, which does not support
`NodeList#forEach()`.

This commit wraps the returned `NodeList` in a regular `Array` to have
access to array methods (such as `forEach()`).

Fixes 

[1]: https://github.com/angular/angular/blob/fbad4ff65/aio/src/app/shared/toc.service.ts#L68
[2]: https://developer.mozilla.org/en-US/docs/Web/API/NodeList/forEach

PR Close 
2019-09-26 17:05:38 -07:00
Carlos Ortiz García
9166baf709 refactor(core): Migrate TestBed.get to TestBed.inject ()
This is cleanup/followup for PR 

PR Close 
2019-09-09 19:10:54 -04:00
George Kalpakas
d4003452c7 fix(docs-infra): do not include GitHub links in Table of Content ()
The docs template for cli commands ([cli-command.template.html][1])
includes an `h2` element with GitHub links for [long description][2].
Since the content of `h2` elements is replicated in the auto-generated
Table of Contents, the GitHub links were replicated as well (which is
undesirable).

This commit fixes it by explicitly excluding `.github-links` elements,
when extracting the content for the ToC (in
[TocService#extractHeadingSafeHtml()][3]). This is similar to what we do
for the auto-generated `.header-link` anchors.

[1]: https://github.com/angular/angular/blob/1537791f0/aio/tools/transforms/templates/cli/cli-command.template.html
[2]: https://github.com/angular/angular/blob/1537791f0/aio/tools/transforms/templates/cli/cli-command.template.html#L18
[3]: https://github.com/angular/angular/blob/1537791f0/aio/src/app/shared/toc.service.ts#L56

PR Close 
2019-09-05 13:33:06 -04:00
George Kalpakas
007282d2bb fix(docs-infra): exclude heading anchor icon text from ToC tooltips ()
The Table of Contents (ToC) is auto-generated based on the content of
heading elements on the page. At the same time, anchor links are
auto-generated and added to each heading element. Note that the Material
Icons used for the anchor icon make use of ligatures, which means that
the icons are specified by using their textual name as text content of
the icon element. As a result, the name of the icon is included in the
parent element's `textContent`.

Previously, the `TocService` used to strip off these anchor elements
when generating the content of ToC items, but not when generating the
content of their tooltips. Thus, tooltips for ToC items would
confusingly include a `link` suffix (`link` is the textual name of the
icon used in heading anchor links).

This commit fixes this by deriving the tooltip content from the
transformed text content (which already has anchor links stripped off),
instead of from the original heading content.

PR Close 
2019-09-05 13:33:06 -04:00
Carlos Ortiz García
3aba7ebe6a feat(core): Introduce TestBed.inject to replace TestBed.get ()
TestBed.get is not type safe, fixing it would be a massive breaking
change. The Angular team has proposed replacing it with TestBed.inject
and deprecate TestBed.get.

Deprecation from TestBed.get will come as a separate commit.

Issue 
Fixes 

BREAKING CHANGE: Injector.get now accepts abstract classes to return
type-safe values. Previous implementation returned `any` through the
deprecated implementation.

PR Close 
2019-08-28 21:26:46 -07:00
Kapunahele Wong
984d23f687 fix(docs-infra): fix broken toc ul styles ()
Fixes 

PR Close 
2019-08-14 12:01:17 -07:00
Stefanie Fluin
382d3ed1d2 fix(docs-infra): ui polish ()
- Change margin to the header so that the the label aligns with the header
- Make code in API pages pre-wrap so that you can see the actual text on the screen - helps with issue 
- Modified text to be title case in label API to be consistent with rest of app labels
- Removed unused table of contents SCSS file
- TOC SCSS file reorg cleanup
- Soften headers font-weight in API pages
- Make linenums ordered list inside code examples always show as numbers

PR Close 
2019-08-05 12:53:02 -07:00
George Kalpakas
dd0be7feb7 fix(docs-infra): always default to no linenums in <aio-code> ()
Previously, `linenums` defaulted to true if the content was more than 10
lines long and false otherwise.

Since in most cases linenums add unnecessary visual noise, this commit
changes `linenums` to always default to false (regardless of the size of
the content). It can be still be turned on by explicitly setting to true
or a number.

PR Close 
2019-07-24 14:38:54 -07:00
Stefanie Fluin
c845a7b887 fix(docs-infra): fix logo to have branded red color ()
Replace logo nav 2x logo file with one that has the correct branding red color in shield

PR Close 
2019-07-22 09:54:00 -07:00
Stefanie Fluin
b9a94c6d02 fix(docs-infra): improve small screen experience for docs cards layout ()
- Make docs cards expand to full width in smaller screen sizes.
- Reduce spacing around card container to match general spacing patterns seen in angular.io.
- Improve SCSS formatting.

PR Close 
2019-07-22 09:51:11 -07:00
Stefanie Fluin
ebc71f7caa fix(docs-infra): fix mobile toc styles ()
Return mobile toc styles from bug in PR#31013
Give docs pages header a width limit so it does not run into the Github icon link

PR Close 
2019-07-22 09:50:21 -07:00
George Kalpakas
b66d82e308 build(docs-infra): upgrade jasmine-/karma-related dependencies ()
Note: `jasmine-ts` is intentionally held back at 0.2.1, because of a bug
in 0.3.0: svi3c/jasmine-ts#33

PR Close 
2019-07-18 10:17:13 -07:00
George Kalpakas
d7ca263cc4 test(docs-infra): run tests in random order (and make them pass) ()
This commit updates the necessary config files to run the angular.io and
docs tooling unit tests in random order (and fixes the tests that were
failing due to their dependence on the previous ordered execution).

Besides being a good idea anyway, running tests in random order is the
new [default behavior in jasmine@3.0.0][1], so this commit is in
preparation of upgrading jasmine to the latest version.

[1]: https://github.com/jasmine/jasmine/blob/v3.0.0/release_notes/3.0.md#breaking-changes

PR Close 
2019-07-18 10:17:13 -07:00
Stefanie Fluin
3a09d01c63 fix(docs-infra): fix API list search color and styles ()
- Add more spacing to inputs.
- Correct placeholder colors in inputs.
- Add aria label to input for accessibility.
- Clean up layout styles and mobile view.

Fixes 

PR Close 
2019-07-12 17:55:02 -04:00
Stefanie Fluin
a55c6df07b feat(docs-infra): add prominent archive mode banner styling ()
Fixes 

PR Close 
2019-07-11 13:00:11 -04:00
Stefanie Fluin
d33204956f fix(docs-infra): fix code hover style in TOC ()
Fixes 

PR Close 
2019-07-11 12:57:32 -04:00
Tzvi Melamed
66d6b53fb1 fix(docs-infra): fix get started button rendering ()
Fixes 

PR Close 
2019-07-11 12:56:29 -04:00
George Kalpakas
e85fa5d4ff fix(docs-infra): fix layout of file-not-found page ()
The `.sidenav-content` element, [which is also][1] the `#file-not-found`
element, [already has][2] the necessary padding. Especially the top
padding is important to ensure the element is not obscured by the
top-bar.

[1]: https://github.com/angular/angular/blob/1d3e22766/aio/src/app/app.component.html#L51
[2]: https://github.com/angular/angular/blob/1d3e22766/aio/src/styles/1-layouts/_content-layout.scss#L10

PR Close 
2019-07-11 12:15:34 -04:00
George Kalpakas
0c00c94f34 test(docs-infra): clean up global listeners after ScrollService tests ()
The `ScrollService` sets up some global `window` listeners.

Previously, these listeners were never unregistered. This was not a
problem in the real app, because the `ScrollService` instance exists for
the lifetime of a user session. In tests, however, where the `window`
instance is among all tests, the listeners would survive the
`ScrollService` tests. This, in addition to the fact that we used a mock
`ViewportScroller` which did not return the expected type from
`getScrollPosition()`, caused errors to be thrown in unrelated tests
(i.e. whenever a scroll event was emitted on `window`). See [here][1]
for an example failure.

This commit fixes it by adding an `ngOnDestroy()` method that
unregisters the listeners and ensuring it is called after each
`ScrollService` test.

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

PR Close 
2019-07-11 12:15:34 -04:00
George Kalpakas
9b29ca95a2 fix(docs-infra): show (and style correctly) the 'No results found' message ()
PR Close 
2019-07-11 12:15:34 -04:00
George Kalpakas
479d926b4b fix(docs-infra): improve search-results layout on smaller screens ()
Previously, the `search-results` layout was switch from horizontal to
vertical at 480px. Yes, since some search queries can yield more than 5
`.search-area`s, even 600px are too narrow to accomodate a horizontal
layout.

This commit changes the breakpoint at which the layout switches to
vertical from 480px to 600px.

PR Close 
2019-07-11 12:15:34 -04:00
George Kalpakas
b9195289a5 fix(docs-infra): remove redundant search-results styles ()
Previously, `.search-area` had a default style of `display: flex`, but
it was overriden to `display: block` in media queries for
`max-width: 480px` and `min-width: 600px`. As a result, it only had
`display: flex` between 481px and 599px.

Since no flex layout features are necessary inside `.search-area`, this
commit changes the style to always be `display: block` (i.e. the default
for `div` elements).

PR Close 
2019-07-11 12:15:34 -04:00
George Kalpakas
75b6b0e1ba refactor(docs-infra): clean up aio-search-results styles ()
PR Close 
2019-07-11 12:15:34 -04:00
George Kalpakas
2d4f507b61 style(docs-infra): make indentation in _search-results.scss consistent with other .scss files ()
PR Close 
2019-07-11 12:15:34 -04:00
George Kalpakas
00ecfc7f9a fix(docs-infra): separate vendor-specific CSS selectors ()
In , some vendor-specific selectors were combined in one rule-set.
As pointed out in [this comment][1], this would result in the whole
rule-set being ignored by all browsers, since one invalid/unrecognized
selector invalidates the declaration block.

This commit fixes it by defining a separate rule-set per selector. The
list of vendor-specific selectors is also adjusted to better target the
currently supported browsers.

[1]: https://github.com/angular/angular/pull/31118/files#r296923652

PR Close 
2019-06-25 10:25:31 -07:00
George Kalpakas
6ff3970ec7 style(docs-infra): clean up some styles ()
PR Close 
2019-06-25 10:25:31 -07:00
Stefanie Fluin
f7e9659c4d fix(docs-infra): return full width highlight to sidenav ()
PR Close 
2019-06-24 20:17:27 -07:00
Stefanie Fluin
65974154e2 feat(docs-infra): change typography font sizes to be rem based ()
PR Close 
2019-06-21 14:22:20 -07:00
Vani
5909c442b7 docs: update group() link to point to the animations group API ()
PR Close 
2019-06-18 10:49:46 -07:00
Stefanie Fluin
c52ade2878 fix(docs-infra): fix search result header color ()
PR Close 
2019-06-17 16:33:53 -07:00
Alan
82e0b4a4fb fix(docs-infra): enable only vertical scrolling for contributors bio ()
- `auto` will enable scrolling only when needed
- `overflow-y` will ensure to keep the scrolling horizontally only

PR Close 
2019-06-12 11:47:13 -07:00
Stefanie Fluin
699283c4ee feat(docs-infra): layout ui polish ()
PR Close 
2019-06-11 14:20:35 -07:00
George Kalpakas
87b1a2af4d refactor(docs-infra): avoid hard-coding URLs to redirect on archive mode ()
Related discussion:
https://github.com/angular/angular/pull/30894#pullrequestreview-246731995

PR Close 
2019-06-11 00:07:43 +00:00
George Kalpakas
a2cd401a2e fix(docs-infra): do not redirect docs URLs on archive deployments ()
To avoid showing outdated info (such as events, resources, etc.) but
still allow people to see docs for older versions, we redirect
non-documentation URLs to `/docs`. Recently(-ish) we have added
documentation content under the `/cli/...` and `/start/...`
path-prefixes, but we haven't added them to the list of documentation
URLs that should not be redirected. As a result, on archive deployments
(e.g. https://v7.angular.io/cli), they are redirected to `/docs`, making
it impossible to see the documentation for these versions (unless you
know about the `?mode=stable` work-around).

This commit fixes it by adding `cli` and `start` to the list of
documentation URLs that are excluded from redirection.

PR Close 
2019-06-11 00:07:42 +00:00
George Kalpakas
93af1f8456 refactor(docs-infra): make archive redirection tests DRY ()
PR Close 
2019-06-11 00:07:42 +00:00
Stefanie Fluin
383ab8515d feat(docs-infra): white background and corresponding figure updates ()
PR Close 
2019-06-06 13:48:15 -07:00
Brandon
32886cf9ac docs(docs-infra): compile module first for Ivy when loading element modules ()
In View Engine, NgModule factories are created for each NgModule and loaded when the module is requested. Ivy doesn't generate the
factories by design and only loads the module class, so it must be compiled after being loaded.

PR Close 
2019-05-31 15:24:22 -07:00
Brandon
fcef39048a refactor(docs-infra): update loading of custom elements to use dynamic import syntax ()
Removes the usage of `NgModuleFactoryLoader` and string-based imports for lazy loading.

PR Close 
2019-05-31 15:24:22 -07:00
Alex Rickabaugh
84dd2679a9 fix(core): require 'static' flag on queries in typings ()
This commit makes the static flag on @ViewChild and @ContentChild required.

BREAKING CHANGE:

In Angular version 8, it's required that all @ViewChild and @ContentChild
queries have a 'static' flag specifying whether the query is 'static' or
'dynamic'. The compiler previously sorted queries automatically, but in
8.0 developers are required to explicitly specify which behavior is wanted.
This is a temporary requirement as part of a migration; see
https://angular.io/guide/static-query-migration for more details.

@ViewChildren and @ContentChildren queries are always dynamic, and so are
unaffected.

PR Close 
2019-05-24 16:55:00 -04:00