Skip to content
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

Merged
merged 7 commits into from
Sep 23, 2016
Merged

Ui improvements #293

merged 7 commits into from
Sep 23, 2016

Conversation

matteofigus
Copy link
Member

This is a PR for lots of small little improvements in the UI interface:

Copy link
Member

@mattiaerre mattiaerre left a 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++;
}

Copy link
Member

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;
  }

Copy link
Member Author

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]})
Copy link
Member

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]++;
Copy link
Member

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;

see: http://eslint.org/docs/rules/no-plusplus

Copy link
Member Author

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++;
Copy link
Member

Choose a reason for hiding this comment

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

same as above

Copy link
Member Author

Choose a reason for hiding this comment

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

done

Copy link
Member

@mattiaerre mattiaerre left a 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;
Copy link
Member

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);
Copy link
Member

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()

@matteofigus
Copy link
Member Author

Yes go for it @mattiaerre

@mattiaerre mattiaerre merged commit 3e5a57d into master Sep 23, 2016
@mattiaerre mattiaerre deleted the ui-improvements branch September 23, 2016 12:11
@mattiaerre
Copy link
Member

Hi @matteofigus let us know when deployed 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants