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

Separate Inactive Members #87

Open
FeXd opened this issue May 10, 2019 · 7 comments
Open

Separate Inactive Members #87

FeXd opened this issue May 10, 2019 · 7 comments

Comments

@FeXd
Copy link
Member

FeXd commented May 10, 2019

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
Copy link
Collaborator

drwlrsn commented May 22, 2019

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

componentDidMount() {
fetch('/api/v1/members/', { credentials: 'same-origin' })
.then(checkStatus)
.then(parseJSON)
.then((data) => {
this.setState({ members: data });
console.log('request succeeded with JSON response', data);
})
.catch((error) => {
console.log('request failed', error);
});
}

@nemesis1346
Copy link

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
Copy link

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
Copy link
Member Author

FeXd commented Jun 12, 2019

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
Copy link
Collaborator

foltra commented Jun 12, 2019

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
Copy link

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
Copy link

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?

@FeXd FeXd changed the title Request: Separate Inactive Members Separate Inactive Members Jul 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants