25 Commits

Author SHA1 Message Date
Pete Bacon Darwin
c5c6d84fe6 style(aio): enforce strict TypeScript checks (#21342)
Closes #20646

PR Close #21342
2018-01-12 14:36:43 -08:00
Peter Bacon Darwin
717c68089d build(aio): remove unused imports and local variables (#19682)
PR Close #19682
2017-10-13 09:18:41 -07:00
Georgios Kalpakas
38addacda0 build(aio): switch from @angular/http to @angular/common/http
```
$ ls -l dist/*.js

 14942            dist/0.b19e913fbdd6507d346b.chunk.js
  1535            dist/inline.a1b446562b36eebb766d.bundle.js
524385  (+  682)  dist/main.19fec4390ff7837ee6ef.bundle.js
 37402            dist/polyfills.9f7e0e53bce2a6c8326e.bundle.js
 54001            dist/worker-basic.min.js

632265  (+  682)  total
```
2017-08-15 15:13:47 -07:00
Peter Bacon Darwin
5b96fb9320 build(aio): rename src/content to src/generated
This commit will definitely require a clean up of your
working folder:

```
cd aio
git clean -xdf
yarn setup
```
2017-05-03 13:40:46 -07:00
Georgios Kalpakas
c04e51cb15 fix(aio): do not create ToC for file-not-found and fetching-error documents
Related to #16078.
2017-04-28 15:06:05 +01:00
Ward Bell
3f46645f5f feat(aio): add Table of Contents (toc) component. (#16078) 2017-04-27 15:32:46 -07:00
George Kalpakas
9c1318d731 fix(aio): strip leading slashes from path (and improve DRY-ness) (#16238)
Previously, the path returned by `LocationService.path()` preserved leading
slashes, which resulted in requests with consequtive slashes in the URL. Such
requests would fail (with a 404) on staging.

This commit fixes it, by removing leading slashes from the path. It also
refactors `LocationService` a bit, converting path to an observable,
`currentPath` (similar to `currentUrl`), and applies certain clean-ups (e.g.
stripping slashes, query, hash) in one place, which simplifies consumption.

Closes #16230
2017-04-21 13:35:40 -07:00
Ward Bell
c390b06da2 feat(aio): add prettier network fail page (#16139) 2017-04-20 22:15:16 -05:00
Peter Bacon Darwin
5e6a3ff6a7 refactor(aio): rename DocumentContents url to id and tidy up (#16139)
Dgeni is now providing the `id` for all the documents to be viewed. So we
no longer need to add this to the DocumentContents object.

There are some notable changes in the refactoring:

`DocumentService`:

* The id of the document to render is now obtained from `LocationService.path()`.
* The `getFileNotFoundDoc` and `getErrorDoc` methods have been extracted from
the `fetchDocument` method.

`AppComponent`:

* the `pageId` is now computed in a separate `setPageId` method.

`AppComponen` spec file:

* The `TestHttp` has had the hard coded documents removed and replaced with
a function that will generate docs as needed.
2017-04-20 22:14:58 -05:00
Peter Bacon Darwin
e951612af2 fix(aio): set the pageId to the file-not-found URL if the doc is not available
Previously, the `AppComponent.pageId` was set via the current URL, rather than
the document being displayed. This is only really noticeable when the URL does not
match a valid doc and we are actually displaying a 404 page.

Now we compute the `pageId` from the  URL of the document being viewed,
which is returned from the  `DocumentService.currentDocument` observable instead.
2017-04-19 09:09:31 +01:00
Ward Bell
f09fd6ec16 test(aio): add sidenav tests and refactor related tests 2017-04-12 14:17:14 -07:00
Ward Bell
9f2acf54bc feat(aio): refactors AppComponent and its kids + sidenav hiding (#15570)
-hides sidenav when current doc is not in sidenav menu
-displays top menu on the side as nodes instead of mini top menu
2017-03-29 14:13:40 -07:00
Peter Bacon Darwin
ff82756415 fix(aio): ensure DocumentService doesn't crash on bad JSON 2017-03-28 10:21:46 +01:00
Peter Bacon Darwin
fc1f6efe0d build(aio): fix paths to "index" pages
Content pages like `tutorial/index.md` were being mapped to `tutorial.index.json`,
which meant that they could only be rendered if you browsed to `/tutorial/index`.

This didn't sit well so now these pages are mapped to `tutorial.json`, which
means that you browser to them via `/tutorial/` or just `/tutorial`.

Fixed #15335
2017-03-21 15:20:28 -05:00
Ward Bell
1c1085b140 feat(aio): add google analytics (#15081) 2017-03-13 18:08:23 -07:00
Ward Bell
5ad5301a3e feat(aio): add API list page (#14899) 2017-03-08 13:08:19 -08:00
Peter Bacon Darwin
3529813ca0 fix(aio): move interfaces into their own files to workaround compile weirdness
For some reason the tree-shaker is not picking up these interfaces
(perhaps TS is not passing it through) when they are in the same file
as their related services. This results in a distracting warning message.
2017-03-06 22:27:32 -08:00
Peter Bacon Darwin
fe962f6de7 fix(aio): LocationService urls should never start with a slash
There is a weirdness in the Angular Location service.
If the `baseHref` is only a single slash (`'/'`) then it
changes it to be an empty string (`''`). The effect of this
is that `Location.normaliseUrl(url)` does not strip off the
leading slash from url paths.

The problem is that the leading slash only appears on the
initial Location path, and not on urls that arrive from subscribing
to the Location service.

This commit is a workaround this problem.
2017-03-06 22:27:32 -08:00
Peter Bacon Darwin
d6c1ccaf14 fix(aio): emit a hard-coded doc if file-not-found fails
Closes #14848
2017-03-06 22:27:32 -08:00
Peter Bacon Darwin
4abd6f333c fix(aio): map the empty url to the correct doc path 2017-03-06 22:27:32 -08:00
Peter Bacon Darwin
dd50922747 refactor(aio): move document path computation
Do the path computation before doing the cache look up.
2017-03-06 22:27:32 -08:00
Peter Bacon Darwin
66cc88c8a8 fix(aio): ensure that only one request per document is made 2017-03-06 22:27:32 -08:00
Peter Bacon Darwin
01ff427685 test(aio): reimplemented all the commented-out unit tests 2017-03-05 08:41:26 -08:00
Peter Bacon Darwin
71e22b8d11 feat(aio): implement doc and navigation UI 2017-03-02 00:21:06 -08:00
Peter Bacon Darwin
5ae4b77d8b feat(aio): add document service 2017-03-02 00:21:06 -08:00