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

Attributions #2591

Merged
merged 10 commits into from
Mar 12, 2021
Merged

Attributions #2591

merged 10 commits into from
Mar 12, 2021

Conversation

mbc32
Copy link
Contributor

@mbc32 mbc32 commented Mar 7, 2021

This new REST endpoint is for getting User attributions. It is similar to the getHistory endpoint but simpler also it is not used to build the website so changes to the website should not affect this endpoint.
TODO: The test in FeatureEventServiceSpec.groovy has not been tested due to problem with my setup but the code has been tested via REST calls.
I am considering if we should have attributions by organism both because it makes sense to break the attributions down by organism but also because it would make less load on the server if there is a lot of feature events.

@nathandunn
Copy link
Contributor

@mbc32 I made some small changes and fixed the test. Please let me know if this still works.

Also, if you want to order the feature event (not necessary though), you would use something like this: http://docs.grails.org/3.1.1/ref/Domain%20Classes/listOrderBy.html

e.g. List<FeatureEvent> featureEvents = FeatureEvent.listOrderByDateCreated([max:max])

Cheers

@nathandunn nathandunn added this to To do in 2.6.4 LTS Mar 8, 2021
@nathandunn nathandunn moved this from To do to In progress in 2.6.4 LTS Mar 8, 2021
@mbc32
Copy link
Contributor Author

mbc32 commented Mar 8, 2021

Hi Nathan,
Thanks for looking at this. Setting a max limit for feature Event is a good idea but it does not seam to have any effect. If I change params.max to inputObject.get(‘max’) the output changes but the effect is unpredictable: 0 seams to give me all results and any other int give me one results back?
I think this needs further testing. I will look at it tomorrow.

@nathandunn
Copy link
Contributor

Hi Nathan,
Thanks for looking at this. Setting a max limit for feature Event is a good idea but it does not seam to have any effect. If I change params.max to inputObject.get(‘max’) the output changes but the effect is unpredictable: 0 seams to give me all results and any other int give me one results back?
I think this needs further testing. I will look at it tomorrow.

I had put that on the get string. I fixed that. 0, but default is false so it returns the default 1000. When I put in 1, 2, 3, etc. it returns the proper number of feature events, regardless of the number of users.

@mbc32
Copy link
Contributor Author

mbc32 commented Mar 12, 2021

Hi Nathan,
When using real numbers 1,2,3 I get the expected result. The fact that the limit is feature events and not users confused me a bit. I tried to make a better solution for ‘0’. But since it is optional you can't require max to be greater than 0. So 0 defaults to 1000 I think that is fine.
Thanks,
Mikkel

@nathandunn nathandunn merged commit 956b78f into GMOD:develop Mar 12, 2021
2.6.4 LTS automation moved this from In progress to Done Mar 12, 2021
@mbc32 mbc32 deleted the attributions branch March 12, 2021 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants