Add Student Sonar frontend code.
Review Request #6897 — Created Feb. 3, 2015 and submitted
The frontend is architected using the new hotness of ES6 and web components.
There are two custom elements currently in use: x-student card, which provides
a small clickable avatar + name, and x-student-view, which is a full-page view
showing the student's name/school/email/avatar, and contains the different
analytics for each student.At the moment, we show their participation on Slack using a github-like heatmap
calendar, and a list of their review requests on Review Board. Future
improvements will show code reviews, status reports, and links to their notes.There's a lot still to be improved here, but this is a good start.
Description | From | Last Updated |
---|---|---|
Blank line between these. |
brennie | |
Blank line between these. |
brennie | |
Nit - double-quotes for href and rel |
mike_conley | |
As mentioned in Slack, we'll need the shim-shadowdom attribute set here to activate the polyfills for things like /deep/. |
mike_conley | |
While this is ocurring, would it be worth displaying a spinner or loading message instead of just a blank page? |
mike_conley | |
innerText is non-standard. We should use textContent here. |
mike_conley | |
So I think I've found a cross-browser solution that allows us to avoid adding the template <style> rules to style.css. … |
mike_conley | |
I assume, reading the rest of these rules, that an updated CSS spec says that we don't need a semi-colon … |
mike_conley | |
Nit - spaces after : |
mike_conley |
- Change Summary:
-
- Make requested fixes.
- Use browser history API to enable the back button, get rid of the hacky "back" link.
- Load webcomponents.js as a normal
<script>
tag. - Tweak some cal-heatmap options.
- Commit:
-
62634fa863e56cbcc721578779bb81f944ff812179d79fabf387f50ee8e8eaa1c13be8355b4d8ff3
-
Tool: PEP8 Style Checker Ignored Files: index.html lib/frontend/x-student-view.js lib/frontend/main.js lib/frontend/x-student-card.js lib/frontend/components.js style.css README.md Tool: Pyflakes Ignored Files: index.html lib/frontend/x-student-view.js lib/frontend/main.js lib/frontend/x-student-card.js lib/frontend/components.js style.css README.md
-
-
-
As mentioned in Slack, we'll need the shim-shadowdom attribute set here to activate the polyfills for things like /deep/.
-
While this is ocurring, would it be worth displaying a spinner or loading message instead of just a blank page?
-
-
So I think I've found a cross-browser solution that allows us to avoid adding the template <style> rules to style.css.
Add a cssAdded boolean to the list of module variables at the top, then in createdCallback, after creating the clone:
if (Platform.ShadowCSS && !cssAdded) { let style = clone.querySelector('style'); let cssText = Platform.ShadowCSS.shimCssText( style.textContent, tagName); Platform.ShadowCSS.addCssToDocument(cssText); cssAdded = true; }
You can probably do it before the clone by querying template.content too, but I didn't try that.
-
I assume, reading the rest of these rules, that an updated CSS spec says that we don't need a semi-colon after the last rule... right?
If so, I guess we don't need the semi-colon after block.
-
-
Tool: PEP8 Style Checker Ignored Files: index.html lib/frontend/x-student-view.js lib/frontend/main.js lib/frontend/x-student-card.js lib/frontend/components.js style.css README.md Tool: Pyflakes Ignored Files: index.html lib/frontend/x-student-view.js lib/frontend/main.js lib/frontend/x-student-card.js lib/frontend/components.js style.css README.md
- Description:
-
The frontend is architected using the new hotness of ES6 and web components.
~ Unfortunately this means that we're limited to Chrome right now (theoretically, ~ There are two custom elements currently in use: x-student card, which provides - Firefox should be supported because we're pulling in webcomponents.js, but even - with that there are some major issues right now; perhaps a Firefox developer - might be interested in looking at the problems). - - There are two custom elements currently in use: x-student card, which provides
a small clickable avatar + name, and x-student-view, which is a full-page view showing the student's name/school/email/avatar, and contains the different analytics for each student. At the moment, we show their participation on Slack using a github-like heatmap
calendar, and a list of their review requests on Review Board. Future improvements will show code reviews, status reports, and links to their notes. There's a lot still to be improved here, but this is a good start.