Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

docs(app): refactor the Docs App based on the MD prototype #10341

Closed
wants to merge 4 commits into from

Conversation

gkalpak
Copy link
Member

@gkalpak gkalpak commented Dec 5, 2014

I incorporated the prototype detailed in gkalpak#3.

Things that are different from the prototype (besides using actual data):

  • The left sidenav (toc) is not styled properly (or even readably).
  • Icons are missing (since we are not using FontAwesome). E.g. search-fab, toc-toggle, results
  • In the right sidenav (search) there are some unwanted horizontal scrollbars.
    (This section probably needs rethinking anyway.)
  • I have implemented a responsiveMenu directive to show the options in the header-menus
    (Learn/Develop/Discuss). The purpose is to show the options in a "dropdown-ish" menu on larger
    screens and using a BottomSheet on smaller. At the moment a BottomSheet is used on every
    screen-size.

Notes:

  • Still no version-picker and breadcrumbs (I have left the original implementation of those two
    commented out).
  • I have replaced the previous docs.css with a new one containing the style of the prototype.
    I have renamed the old one to docs_old.css and left it there temporarily for quick reference.
    We need to clean up this and the rest of the old CSS files.
  • The main content area is totally unstyled and needs some love (a lot actually).

I have also "sprinkled" the code with a few more TODOs/FIXMEs.

(For more details on known issues and missing features take a look at
gkalpak#3)

@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request) and all commit authors, but as best as we can tell these commits were authored by someone else. If that's the case, please add them to this pull request and have them confirm that they're okay with these commits being contributed to Google. If we're mistaken and you did author these commits, just reply here to confirm.

@gkalpak gkalpak force-pushed the materialize-2 branch 2 times, most recently from 2852225 to 1901974 Compare December 5, 2014 15:05
@googlebot
Copy link

CLAs look good, thanks!

@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request) and all commit authors, but as best as we can tell these commits were authored by someone else. If that's the case, please add them to this pull request and have them confirm that they're okay with these commits being contributed to Google. If we're mistaken and you did author these commits, just reply here to confirm.

@googlebot googlebot added cla: no and removed cla: yes labels Dec 5, 2014
@googlebot
Copy link

CLAs look good, thanks!

@googlebot googlebot added cla: yes and removed cla: no labels Dec 5, 2014
@gkalpak
Copy link
Member Author

gkalpak commented Dec 5, 2014

Finally, there :)

/ping @jesselpalmer, @joshkurz, @caitp, @petebacondarwin

@petebacondarwin
Copy link
Contributor

Awesome. I'll take a look shortly
On 5 Dec 2014 15:23, "Georgios Kalpakas" notifications@github.com wrote:

Finally, there :)

/ping @jesselpalmer https://github.com/jesselpalmer, @joshkurz
https://github.com/joshkurz, @caitp https://github.com/caitp,
@petebacondarwin https://github.com/petebacondarwin


Reply to this email directly or view it on GitHub
#10341 (comment).

targetElem.scrollIntoView();
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you not using $anchorScroll?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because scrolling does not happen on the window level (but a nested element), we don't want to scroll to top. Thus we need to tell $anchorScroll which element we want it to scroll to and the only way is to set $location.hash to its ID (e.g. top-anchor). And that wouldn't look nice imo.

BTW, I think there is an awesome PR that adds support for providing an explicit hash to $anchorScroll, in case we don't want it to scroll to $location.hash().
There it is: #9596 😉

@caitp caitp added this to the Materialize The Docs milestone Dec 5, 2014
}

.type-hint-date {
background:pink;
.md-tile-left .fa {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider renaming the 'fa' class. I can't really tell what this is just by reading it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the FontAwesome base class (so can't rename it).
I am leaving them for now (in case we choose to temporarily use FontAwesome, until materlia design's icon font is released.

We can remove them eventually.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, or should I say awesome :)


.view-source {
margin-right:10px;
#sidenav-toc.md-locked-open[flex="33"] {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add return.

I incorporated the prototype detailed in #3.

Things that are different from the prototype (besides using actual data):

 * The left sidenav (toc) is not styled properly (or even readably).
 * The subheaders in the left sidenav are not "stickying" properly (only `ng` becomes sticky).
 * Icons are missing (since we are not using FontAwesome). E.g. search-fab, toc-toggle, results
 * In the right sidenav (search) there are some unwanted horizontal scrollbars.
   (This section probably needs rethinking anyway.)
 * I have implemented a `responsiveMenu` directive to show the options in the header-menus
   (Learn/Develop/Discuss). The purpose is to show the options in a "dropdown-ish" menu on larger
   screens and using a BottomSheet on smaller. At the moment a BottomSheet is used on every
   screen-size.

Notes:

 - Still no version-picker and breadcrumbs (I have left the original implementation of those two
   commented out).
 - I have replaced the previous docs.css with a new one containing the style of the prototype.
   I have renamed the old one to `docs_old.css` and left it there temporarily for quick reference.
   We need to clean up this and the rest of the old CSS files.
 - The main content area is totally unstyled and needs some love (a lot actually).

I have also "sprinkled" the code with a few more TODOs/FIXMEs.

(For more details on known issues and missing features take a look at
 #3)
@gkalpak
Copy link
Member Author

gkalpak commented Dec 5, 2014

Updated the PR based on the comments.
/cc @jesselpalmer, @joshkurz, @caitp, @petebacondarwin

@caitp
Copy link
Contributor

caitp commented Dec 6, 2014

So, just checked it out --- I think it's a reasonable baseline to start with --- there is that huge list of TODOs that we'll want to work on, but I think we could land this to start with, so that Jesse could start working on individual design aspects, and we could start trying to improve the various features in isolation

@jesselpalmer
Copy link
Member

@caitp Sounds good to me.

@gkalpak
Copy link
Member Author

gkalpak commented Dec 6, 2014

BTW, some tests have been broken:

  1. E2E tests (both jqlite and jQuery), examples 89 and 90 fail because they rely on Bootstrap's glyphicons (which have been removed). We could modify them to make them pass, but I suggest we leave them until we sort out the icons issue, so we can replace the glyphicons icons with material icons.
    I think we can just ignore them failing (temporarily).

  2. Units tests for the Docs app (task tests:docs) fail, because:
    The DocsContoller module, depends on the new ViewUtils module, which in turn depends on the ngMaterial module (which has a few dependencies of its own: ngAria, ngAnimate, Hammer.js).
    Since Karma only loads angular.js and angular-mocks.js (plus the source and test files for the Docs app), there is no ngMaterial, causing ViewUtils to fail loading, which causes DocController to fail loading.

    On the long term, this issue might be resolved by structuring the app better, so that each controller has a single area of responsibility (e.g. right now the DocsControllers does anything from setting up Google Analytics, to watching the path, to determining nav-item classes, to setting the current version, to exposing the openPlunkr service).
    The question is, how should we handle the failing tests in the meantime ?

    Options off the top of my head:

    1. Have karma load all necessary files.
    2. Ignore the failing tests.
    3. Disable the failing tests (until we have more complete test coverage).
    4. Remove the ViewUtils dependency from the DocsController module (since it is not used from the failing test-suite). (I don't really like this option.)

@jesselpalmer
Copy link
Member

I like the disable failing test option. That way we can just update the failing tests after the page is more stable and remove whichever ones we don't need anymore.

@caitp
Copy link
Contributor

caitp commented Dec 6, 2014

We can just disable the docsapp tests for now on the materialize branch --- but yes we will need to re-enable them before shipping this

@caitp
Copy link
Contributor

caitp commented Dec 6, 2014

but actually, since we will need to update them anyways, it's probably better to fix them as you go

@gkalpak
Copy link
Member Author

gkalpak commented Dec 7, 2014

I pushed a few changes (in a new commit for easier review; should probably be squashed when merging):

  • Fixed some styling-related issues on the left sidenav
  • Added FontAwesome (as a temporary solution).
  • (Wrapped some lines at 100chars in the tests.)

/fyi @jesselpalmer, @joshkurz, @caitp, @petebacondarwin

Since the structure was a little different than the prototype,
classes/styles where not applied correctly to the links in the left
sidenav. This commit fixes the issue.

I also added FontAwesome, in order to be able to display icons until the
Material Design icon-font is released. Since this is a temporary meassure,
I didn't added as a bower dependency; just added a `font-awesome` folder
in assets and added `font-awesome/css/font-awesome.css` to the stylesheets
of each deployment (under `docs/config/services/deployments/`.
@gkalpak
Copy link
Member Author

gkalpak commented Dec 8, 2014

@caitp: Making sure I understood you correctly: We should ignore e2e tests failing for examples 89 and 90 (temporarily) and disable unit-testing for the Docs app (temporarily again) ?

Should I make the changes in this PR or a separate one ?

(@caitp: Will you merge this (as soon as we sort out the above) or shall I do it ?)

@caitp
Copy link
Contributor

caitp commented Dec 8, 2014

I think you should fix the e2e tests so that it's easier to merge into master later. I was going to do it myself, but you are welcome to do it

Due to the recent changes ragarding the Docs app "Materialization", some
tests where failing for the following reasons:

1. JQuery wasn't being copied to 'build/docs/components/'.
2. E2E examples 89 and 90 were relying on the Bootstrap's glyphicons.
   Temporarily replaced with FontAwesome icons; to be replaced with
   Material Design iconfont, when ready.
3. `ngMaterial` (and its various dependencies) weren't loaded by Karma
during unit testing (causing modules depending on it to fail). Added a
fake `ngMaterial` module (as a temporary solution).
@gkalpak
Copy link
Member Author

gkalpak commented Dec 8, 2014

Added a new commit (gkalpak@caed914) fixing test-related errors (more details in the commit's message).
All tests should pass now (waiting to see what Travis has to say on that).

@caitp
Copy link
Contributor

caitp commented Dec 9, 2014

Closed by 8edece2...3d5af88

@caitp caitp closed this Dec 9, 2014
@gkalpak gkalpak deleted the materialize-2 branch December 15, 2014 11:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants