-
Notifications
You must be signed in to change notification settings - Fork 122
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
Ui improvements #293
Ui improvements #293
Conversation
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.
there are no tests around the list-components.js components? (the server-side and the client-side one)
over to you @matteofigus
} else if(mapped.state === 'experimental'){ | ||
experimental++; | ||
} | ||
|
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.
super minor one but what about this for readability?
if (mapped.state === 'deprecated') {
deprecated += 1;
}
if (mapped.state === 'experimental') {
experimental += 1;
}
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 removed this actually in favour of a more generic counts object that handles counts for any state. This should be also more flexible in case we add extra states in the future
@@ -3,7 +3,7 @@ extends layout | |||
mixin selectedCheckbox(name) | |||
input(type="checkbox", name=name, checked) | |||
.state | |||
span(class="component-state-" + name)=name | |||
span(class="component-state-" + name) #{name} (#{counts[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 ❤️ it
|
||
if(!!state){ | ||
stateCounts[state] = stateCounts[state] || 0; | ||
stateCounts[state]++; |
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'd rather do stateCounts[state] += 1;
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
@@ -30,11 +31,29 @@ oc.cmd.push(function(){ | |||
|
|||
var show = matches && !isHidden; | |||
selector[show ? 'removeClass' : 'addClass']('hide'); | |||
if(!show){ | |||
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.
same as above
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
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 👍 can I merge it?
// cc @matteofigus
|
||
if(!!state){ | ||
stateCounts[state] = stateCounts[state] || 0; | ||
stateCounts[state] += 1; |
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.
sweet!
return false; | ||
}; | ||
|
||
$('#filter-components').submit(componentsListChanged).keyup(componentsListChanged); | ||
$('#filter-components input[type=checkbox').change(componentsListChanged); | ||
|
||
if(!!q){ | ||
$('.search').val(q); |
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 one; you set the q
value then you call componentsListChanged()
Yes go for it @mattiaerre |
Hi @matteofigus let us know when deployed 😉 |
This is a PR for lots of small little improvements in the UI interface: