BridgeCityBicycleCoop / workstand

Membership sign-in web application for the Bridge City Bicycle Co-operative.
MIT License
6 stars 3 forks source link

Separate Inactive Members #87

Open FeXd opened 5 years ago

FeXd commented 5 years ago

When sorting for members, it would be nice to not have inactive members fill the list first.

Could they be listed last? Or through another search?

drwlrsn commented 5 years ago

Great idea! This feels like it should probably be done in the front end when we fetch our in members.

https://github.com/BridgeCityBicycleCoop/workstand/blob/d203111eecc0d622eb5c48ba2a4d9a81d89fd94b/bikeshop_project/assets/js/members/components/MemberTable/index.jsx#L38-L49

nemesis1346 commented 5 years ago

IN the front end, when do they get inactive? by pressing banned or suspended in the edition of the member? so far I tried to suspend them or baned them and nothing in the isActive flag happened.

nemesis1346 commented 5 years ago

I was trying to do something like this.

componentDidMount() { fetch('/api/v1/members/', { credentials: 'same-origin' }) .then(checkStatus) .then(parseJSON) .then((data) => { console.log('RESPONSE FRONT END'); console.log(data); let is_active_filter_data = data.filter(function(item){ return item.is_active; }); console.log('FILTERED ARRAY'); console.log(is_active_filter_data); this.setState({ members: is_active_filter_data }); console.log('request succeeded with JSON response', data); }) .catch((error) => { console.log('request failed', error); }); } `

FeXd commented 5 years ago

Regarding "when are they inactive: I think the focus is not on banner or suspended members, but rather how often they are coming.

If a member was the shop last week, they should be close to the top of the list. If a member hasn't been to the shop for a few months, they would be lower on the list. If a member hasn't been to the shop in over a year, they should be at the bottom.

foltra commented 5 years ago

Hey @nemesis1346, I would try adding some extra users (inactive, etc) to fixtures.yml, then with ./manage.py loaddata ... so you have something to test with.

We could write js tests for this, but It looks like they're jet to be setup?

nemesis1346 commented 5 years ago

Should I push the changes so far in a branch of my fork?

Is there some folder or place where you guys have js tests?

nemesis1346 commented 5 years ago

Sorry didnt see the feedback before. So then the backend should response back the same list plus some parameter of date of creation? or something like that?