Git Product home page Git Product logo

jsom-pagination's People

Contributors

aroeczek avatar avosa avatar codacy-badger avatar kbadzioch-u avatar swilgosz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

jsom-pagination's Issues

Add Dummy apps to `spec/dummy`

It would be nice to have a real Rails/Hanami/Sinatra applications to be sure everything is working well for all those frameworks and the documentation is valid.

Add CI using Github actions

Run all our tests automatically using github actions - it would be nice to have also the automatic gem push for rubygems.

References: You can look up for the existing implementation on FastCQRS gem

Add `JSOM::Pagination::Import` to allow injecting dependencies using dry-system

Currently, to get the paginator, we need to instantiate the object in the index class.

paginator = JSOM::Pagination::Paginator.new
paginated = paginator.call(collection, params: { number: 2, size: 3 }, base_ur: 'https://example.com')

It would be nice to instantiate it once during the application boot and allow to reuse the same object whenever it's needed. We could use dry-system for that:

include JSOM::Pagination::Import['paginator']

paginated = paginator.call(collection, params: { number: 2, size: 3 }, base_ur: 'https://example.com')

Add Configuration class for default page size

Currently we use Constant to define default page size.

This should be configurable, as when the default page size is requested, it's not included in the links.

Suggested solution:

Add singleton configuration class for JSOM:Pagination

Arrays As Query Parameters

Hello, thanks for making this gem. It has been really great to use and easy to get up and running.
That being said, I ran into a small issue with the pagination link section when I use arrays as query parameters.

I am making the request: http://localhost:3002/api/recipes?include[]=photo&include[]=nutrition_summary

And getting the return:

}
...
"links": {
    "self": "http://localhost:3002/api/recipes?include=photo=nutrition_summary",
    "next": "http://localhost:3002/api/recipes?include=photo=nutrition_summary&page[number]=2",
    "last": "http://localhost:3002/api/recipes?include=photo=nutrition_summary&page[number]=693"
  }
}

Is there something I am missing from the configuration?

Add Code Quality badges and reports

It would be nice to have badges for code quality, version and passing build

image

Todo

  • Hook up codacy/codeclimate for code quality reporting
  • Add badge for the code quality grade

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.