Git Product home page Git Product logo

tonic's People

Contributors

albertvp avatar dependabot[bot] avatar markets avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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

tonic's Issues

Prevent duplied names on data and provide generated id

Description

So if we have items with the same name in our data collection the front interaction does not work properly. We need to prevent this allowing duplicated names by providing unique id's for each item.

Requirements

  • Generate ID's inside items: [{ id: 'duplied2', name: 'duplied' },...]
  • Detail urls has to follow this id: /duplied2
  • JavaScript has follow the id's instead of sluggifying them again

Allow to filter items by parameters

So it will be easy to share 🌐 specific filtering by just copying the current URL:

https://my-collection.com?price_max=40&category=music

It should be quite feasible to implement with: getParam and setParam from Ralix.

High level:

  • once a filter is applied, use setParam(attribute, value)
  • on page load, use getParam to set currentFilters and apply filtering

Allow to disable detail pages

Let's expose a new flag to make the "detail" pages generation configurable.

We already have these couple of flags hide_filters and hide_sorting, so maybe hide_detail_pages?

πŸ’‘Another idea: a flag to configure detail page link? It will be more flexible:

  • internal (default, like now, no need to set the flag)
  • external link (read some attribute for each item, like: detail_page_link, external_link, ...)
  • null (disable detail pages and hide button in item card)

Generate a map of IDs

Instead of a sorted array we need a collection itself.
Then remove all data-attr and index by id.

Once we can match markup with data by id we'll have front-side state 🎯

Filter tags

Toggle elements visibility by single selected tag.

Url state with filters

Description

So we want to share our collection to someone else with the filters applied.
We don't have a server, neither SEO so url will have #/filter/ to init them.
While user is filtering the content the url must change to perform the change of state.

Requirements

  • Manage search: #/search/term
  • Concatenate tags: */tags/foo,...,bar
  • Concatenate custom: */price/20/category/js

Properly detect emails

Like we do for links, we should autodetect emails and:

  • force text for filters as the default
  • in detail page, render with "mailto"

Properly handle nested attributes

Example of item (address -> geo):

{
  "id": 1,
  "name": "Leanne Graham",
  "username": "Bret",
  "email": "[email protected]",
  "website": "hildegard.org",
  "address": {
    "street": "Kulas Light",
    "suite": "Apt. 556",
    "city": "Gwenborough",
    "zipcode": "92998-3874",
    "geo": {
      "lat": "-37.3159",
      "lng": "81.1496"
    }
  }
}

We should provide better support for:

  • filtering: join values + text
  • sorting: probably just skip
  • rendering: print all attributes iterating nested hashes

Card with image

Make collections with images to display the first image (images[0]) in the _item_card partial.

Probably introduce a config flag to enable/disable this πŸ€”? For large collections this could be a bit slow.

Remote collections

Allow to pull the collection YAML/JSON from a remote resource:

# data/config.yaml

remote_collection: https://jsonplaceholder.typicode.com/users

This will also allow to create Tonic collections for example from your remote APIs πŸ™ŒπŸΌ

Unique search-box

Only one search input, front may want to know which attributes are text?

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.