-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add component for configuring features #579
Conversation
Staging instance deployed by Travis CI! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Visit /flags (might need a query parameter if your browser's stored a redirect from /flags -> /results/flags.
I don't think that'd ever happen. We use temporary redirect, not permanent.
How do we access the flags? Is there an easy way to make this component a globally accessible singleton?
webapp/flags_handler.go
Outdated
@@ -0,0 +1,15 @@ | |||
// Copyright 2017 The WPT Dashboard Project. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: 2018
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just edit the PR in cases like this :)
I was seeing that behaviour (redirecting) locally. We'd simply need a |
Yeah that generally looks fine. The only minor concern I have is about race conditions. It'd be good to clearly separate "editor" and read-only "reader". |
Done; I've separated the readonly into a mixin, and the writable into an actual component (since the readonly behaviour is intended as just checking the flags). PTAL. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Using localStorage is a good idea! We don't want cookies :)
webapp/components/wpt-flags.html
Outdated
<script> | ||
const WPT_FYI_FEATURES = ['queryBuilder']; | ||
|
||
const _wptFlags = (superClass, opt_writable) => class extends superClass { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name opt_writable
is a bit unclear to me. What is opt
? Optional?
Also, what about using readOnly
directly as the argument to avoid the extra negation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
ready() { | ||
super.ready(); | ||
for (const feature of WPT_FYI_FEATURES) { | ||
this._createMethodObserver(`valueChanged(${feature}, '${feature}')`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The leading underscore made me a bit worried at first, but looks like it's documented: https://www.polymer-project.org/2.0/docs/devguide/observers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had the same reaction.
We'll use this to hide the component I'm building for #535 |
Description
As discussed in #440, we should be putting new features behind flags by default.
This PR adds an
wpt-flags
component which useswindow.localStorage
to store feature state.Also configurable with
wpt-flags-editor
component, which uses checkboxes.Review Information
Visit /flags (might need a query parameter if your browser's stored a redirect from
/flags
->/results/flags
.