Skip to content
This repository has been archived by the owner on Jun 20, 2018. It is now read-only.

Filters on junior story model #16

Merged
merged 22 commits into from
Dec 11, 2016

Conversation

TPei
Copy link
Contributor

@TPei TPei commented Mar 6, 2016

allows to filter for several fields on the junior_story model

TODO:

  • specs
  • making it work
  • error handling
  • update csv download button to respect filters as well
  • some kind of ui for filter creation

BONUS, but maybe later in separate branch:

  • comparator filter actions like: income > 5000
  • multiple queries on field, like: income > 5000, income < 10000
  • support for logical operators: or and maybe not

@berlintam
Copy link
Contributor

Thanks so much for this @TPei ! I'll try to take a look tomorrow.

@@ -33,4 +37,41 @@ def junior_story_params
:remote, :tech_team_size, :company_size, :company_age, :person_of_colour, :other,
:publishing_consent, :freelancer)
end

def allowed_params
Copy link
Contributor

Choose a reason for hiding this comment

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

these values are exactly the same as the junior_story_params above, aren't they - what's the benefit of doing it this way?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope, the difference is in the require(:junior_story). Do we really need that above?

@berlintam
Copy link
Contributor

Hey @TPei thanks so much for this! There's some really awesome things happening here.

I've made a few comments along the way on things I don't understand/could be moved. I'm also learning here & don't always know the best way to do things, so this is an adventure for the both of us. In general though I think this is really awesome & a definite improvement! Sorry I've been so slow on further developing this but you know... life :)

Additionally, I have some further comments/thoughts:

  • filter stories as a popup doesn't make too much sense to me - the filtering I know/am used to is done via select boxes or dropdowns via some sort of nav structure. I think that would make more sense here. In the issue I referred to our Rorganize.it project which also makes use of filtering, and I envisioned it to be similar for WDJGP https://rorganize.it/groups
  • The pop up modal consists of text boxes where the user can write in whatever they want. However, the form we ask users to fill out is now mostly drop downs (in order to have consistent data). If we decide to continue with the pop up, I think it makes sense for the pop up to offer the same choice.
  • because of the point mentioned above, when someone writes 'Junior Developer', a 'junior developer' story will not be matched.
  • also don't think it's important to be able to filter according everything. Especially if we go with a dropdown structure. In the issue I mentioned a couple of filters we could start off with: filter by city, country, gender, intern, junior_developer etc.... #8. I think it's best to just limit it to a few in the beginning.
  • We need to give the user some kind of feedback about what sort of filter they used. If we have dropdowns, we can leave the selected term in the drop down for reference. This is also important if a user selects more than one filtering option. For example if I select 'junior developer', 'female', 'Berlin', 'RoR', by the time I've finished filling out the form I've forgotten what I even wanted to see.
  • reset filters button shouldn't be visible if there are no filters being used - this relates to the usability point above.
  • if you could put your TODO points into separate issues so that @sareg0 and I can comment on them/discuss them with you further, that would be awesome.

So, those are my thoughts! I think though that some of these can be pulled out into separate issues.

Where do you think we should go from here? If you want to address my in-line comments, I have no problem merging this & then we can go about changing the modal to a filter system.

Thanks again! 🎉

@TPei
Copy link
Contributor Author

TPei commented Mar 13, 2016

Heyho, a lot to comment on here, hang on^^

  • dropdowns where appropriate is an awesome idea, will integrate this. should've had a better look at the add form beforehand^^
  • concerning the modal I'm not sure. I personally don't think it would be suited to be in a sidebar. I mean, it largely depends on how many fields we allow filtering for... if we only go with three or four: maybe, if we do dynamic adding à la rails_admin: fine. But since we got so many I was actually very happy with the idea
  • reset filters can be hidden if not needed. will do!
  • whatever the user filtered for should be visible, agreed

UX improvements like positioning of the filter fields and visibility of filtered fields/values could be a follow-up ticket imo

@TPei
Copy link
Contributor Author

TPei commented Mar 13, 2016

Updated TODO:

  • dropdowns where appropriate
  • hide reset filters button if nothing was filtered for

@berlintam
Copy link
Contributor

Sounds good!

concerning the modal I'm not sure. I personally don't think it would be suited to be in a sidebar. I mean, it largely depends on how many fields we allow filtering for... if we only go with three or four: maybe, if we do dynamic adding à la rails_admin: fine. But since we got so many I was actually very happy with the idea

Yes, we have a lot, but I was thinking we would only show a few, not all, otherwise it's quite overwhelming. Maybe only 5, max. It could be a side bar or a top bar. That being said, I'm fine with leaving the modal in for now & seeing how it develops.

UX improvements in a separate ticket are fine w/ me. I'm happy to merge once the drop downs are in the modal :)

@TPei
Copy link
Contributor Author

TPei commented Apr 25, 2016

I'm not really sure how to best go about this...
So far this has all been hard coded in the junior_stories "new" view like:
<%= f.input :freelancer, required: true, collection: ['yes', 'no' ], label: 'I am a freelancer' %>
I really don't want to replicate this, any thoughts?

@berlintam
Copy link
Contributor

hey @TPei sorry for being so slow about this! Pls feel free to ping me in slack next time!

In your comment above, what part exactly are you talking about? Where are you wanting to replicate it? Do you mean in the filtering modal? I suppose you could always pull out the filterable attributes into a partial & include it in the form & then also in the modal? Does that make sense/answer your question?

@TPei
Copy link
Contributor Author

TPei commented Dec 9, 2016

Would you say we could merge this and create follow-up issues @berlintam ? I don't see myself having much time anytime soon and this way someone could take over. Filtering works flawlessly (including exporting only the matched items), only the UI is a bit cluttered :)

@berlintam
Copy link
Contributor

berlintam commented Dec 10, 2016

Hi @TPei thanks for all your hard work on this! I'm fine with merging but can you pls merge master into it to fix conflicts first? (let me know if you need any help with this)

@TPei
Copy link
Contributor Author

TPei commented Dec 10, 2016

all done @berlintam 😄

@berlintam berlintam merged commit 0eeadf3 into rubycorns:master Dec 11, 2016
@berlintam
Copy link
Contributor

wonderful

Thanks for all your hard work on this @TPei!

@TPei TPei deleted the filters_on_junior_story_model branch December 11, 2016 11:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants