-
Notifications
You must be signed in to change notification settings - Fork 58
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
[ENG-6117] Add Filter for Orcid on Instutional Dashboard #2315
[ENG-6117] Add Filter for Orcid on Instutional Dashboard #2315
Conversation
5bdd0e5
to
affe0a4
Compare
affe0a4
to
b37bddd
Compare
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 have some concerns with the implementation of the toggle-slider right now. I'm hoping there's a slightly easier way to implement this, so will do a little bit of research to see if there's a potentially more accessible way to implement it.
I had another comment regarding the usage of sass color variables ($color-name
) instead of hard-coded hex values in the css files.
<div local-class='orcid-switch'> | ||
<label for='switches-container' local-class='orcid-toggle-label'>{{t 'institutions.dashboard.users_list.has_orcid'}}</label> | ||
<div local-class='switches-container'> | ||
<input type='radio' id='switchOrcidNo' name='switchPlan' value='No' checked={{not this.hasOrcid}} {{on 'change' (fn this.toggleOrcidFilter false)}} /> | ||
<input type='radio' id='switchOrcidYes' name='switchPlan' value='Yes' checked={{this.hasOrcid}} {{on 'change' (fn this.toggleOrcidFilter true)}} /> | ||
<label for='switchOrcidNo'><span></span></label> | ||
<label for='switchOrcidYes'><span></span></label> | ||
<div local-class='switch-wrapper'> | ||
<div local-class='switch'> | ||
<div> | ||
<button type='button' {{on 'click' (fn this.clickToggleOrcidFilter this.hasOrcid)}}> | ||
<span></span> | ||
</button> | ||
</div> | ||
<div> | ||
<button type='button' {{on 'click' (fn this.clickToggleOrcidFilter this.hasOrcid)}}> | ||
<span></span> | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
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've got a some concerns with this implementation of the slider. My biggest concern with this right now is the usage of extra <button>
elements overlayed on top of the <input>
and <label>
elements. It feels like we are forcing a type of behavior onto these inputs that may not be appropriate. Could we use a single <input type='checkbox'>
instead of a combination of <input type='radio'>
with <button>
s on top? I think that would simplify the HTML and CSS greatly and make it more accessible
--switches-bg-color: #d3d3d3; /* lightgrey */ | ||
--switches-label-color: #808080; /* grey */ | ||
--switch-bg-color: #808080; /* grey */ | ||
--switch-text-color: #d3d3d3; /* lightgrey */ |
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.
For CSS colors, we typically try to use our predefined color variables (defined in app/styles/_variables.scss). This prevents us from having too many different "one-off" colors and also helps readability without having to leave comments in the CSS next to the color values (although I appreciate comments in CSS files, generally speaking!). So this could be re-written as something like:
--switches-bg-color: #d3d3d3; /* lightgrey */ | |
--switches-label-color: #808080; /* grey */ | |
--switch-bg-color: #808080; /* grey */ | |
--switch-text-color: #d3d3d3; /* lightgrey */ | |
--switches-bg-color: $color-bg-gray-light; | |
--switches-label-color: $color-bg-gray; | |
--switch-bg-color: $color-bg-gray; | |
--switch-text-color: $color-bg-gray-light; |
|
||
/* Hide the radio buttons */ | ||
.switches-container input { | ||
visibility: hidden; |
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'm a little reluctant to use visibility: hidden;
here, as it seems to make it un-tabbable, and that feels like a bit of an accessibility smell to me.
aef1660
to
8d3ddab
Compare
@@ -9,10 +9,6 @@ interface SortArrowArgs { | |||
|
|||
export default class SortArrow extends Component<SortArrowArgs> { | |||
|
|||
get sortBy() { | |||
return this.args.sortBy || 'user_name'; |
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 thought I'd just clean this up here in this PR.
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.
Nice, I think this is a good update. I did notice that in this component file, there's still some references to this deleted property, so instances of this.sortBy
should be replaced with this.args.sortBy
(line 17, 21)
8d3ddab
to
bea22fc
Compare
bea22fc
to
a30a3d1
Compare
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.
We're close! Just a couple of small things
@@ -9,10 +9,6 @@ interface SortArrowArgs { | |||
|
|||
export default class SortArrow extends Component<SortArrowArgs> { | |||
|
|||
get sortBy() { | |||
return this.args.sortBy || 'user_name'; |
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.
Nice, I think this is a good update. I did notice that in this component file, there's still some references to this deleted property, so instances of this.sortBy
should be replaced with this.args.sortBy
(line 17, 21)
opacity: 0; | ||
width: 0; | ||
height: 0; | ||
display: none; |
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 believe doing display: none
on an input will make it impossible to tab to, so I'd like to remove this property for accessibility sake.
transition: background-color 0.4s; | ||
background-color: #ccc; | ||
cursor: pointer; | ||
position: relative; |
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.
If we remove display: none
from the input as above, we'll have to likely change this to position: absolute
and maybe remove display: flex
so the slider goes over the input element
margin-left: 3px; | ||
border-radius: 50%; | ||
transition: transform 0.4s, background-color 0.4s; | ||
position: relative; |
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 think this will have to be position: absolute
as well if the input is now shown
<label for='switches-container' local-class='orcid-toggle-label'>{{t 'institutions.dashboard.users_list.has_orcid'}}</label> | ||
<label local-class='switch'> | ||
<input type='checkbox' checked={{this.hasOrcid}} {{on 'change' (fn this.toggleOrcidFilter (not this.hasOrcid))}}> |
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 input doesn't have a valid label right now, so you will have to add id='switches-container'
to the <input>
element to associate the "Has ORCID" label to this input
313b39a
to
7bd7566
Compare
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.
🌟
f6311c4
into
CenterForOpenScience:feature/insti-dash-improv
…ForOpenScience/ember-osf-web into filter-dashboard * 'feature/insti-dash-improv' of https://github.com/CenterForOpenScience/ember-osf-web: [ENG-6117] Add Filter for Orcid on Instutional Dashboard (CenterForOpenScience#2315) [ENG-6181] Update search mirage view (CenterForOpenScience#2318) # Conflicts: # app/institutions/dashboard/-components/institutional-users-list/component.ts # app/institutions/dashboard/-components/institutional-users-list/styles.scss # app/institutions/dashboard/-components/institutional-users-list/template.hbs
Purpose
Add the ability to filter users by Orcid status, ensure filter works with sorting.
Summary of Changes
Screenshot(s)
Side Effects
QA Notes