Giter Club home page Giter Club logo

ra-resource-aggregator's People

Contributors

dependabot[bot] avatar mihaildu avatar

Stargazers

 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

ra-resource-aggregator's Issues

All records are stored in memory

Right now we keep all the records in memory while we process everything (e.g. getAllRecords in runGetQueries). Not ideal, since we can deal with large databases in the back. Would be better to apply sorting, pagination & filter at database level. However, not sure this is possible since we only have access to other data providers.

Allow option to have resources without id field

Currently this packages makes the assumption that all resources have an id field. There might be cases where this is not true.

One example where this assumption is made is in getAllRecords where (since some data providers requires sort objects) it always sorts after id. Another example is in GET_ONE or even when running the accumulate queries for many-to-many relationships here.

Null values with react-admin version 3

Some values get replaced by null when updating. Steps to reproduce:

  1. Start the example example_users_profiles_groups (make sure you have the package.json with react-admin version 3, which is the default one or package.json.ra3 if you replaced it).
  2. Click on one User Profile from the list to edit it. This will send a GET_ONE / getOne action to the data provider. The data provider will return data similar to this:
{
  "id": 1,
  "username": "jim",
  "email": "[email protected]",
  "profiles_id": 1,
  "first_name": "Jim",
  "last_name": "Doe",
  "user_id": 1
}
  1. Click on Save to update the new record (you can either change a value or leave it as it is, it doesn't matter). This will send a UPDATE / update action to the data provider with the following params:
params: {
  "id": "1",
  "data": {
    "id": 1,
    "username": "jim",
    "email": "[email protected]",
    "profiles_id": null,
    "first_name": "Jim",
    "last_name": "Doe",
    "user_id": 1
  },
  "previousData": {
    "id": 1,
    "username": "jim",
    "email": "[email protected]",
    "profiles_id": 1,
    "first_name": "Jim",
    "last_name": "Doe",
    "user_id": 1
  }
}

As you can see, the profiles_id was replaced in data from 1 to null. You might have to try this several times as it seems it's nondeterministic, which makes the whole thing more confusing. Another thing that's confusing is that user_id never gets replaced by null. In the edit view I have neither of them:

const UserProfilesEdit = props => (
  <Edit {...props}>
      <SimpleForm>
        <TextInput source="username" />
        <TextInput source="email" />
        <TextInput source="first_name" />
        <TextInput source="last_name" />
      </SimpleForm>
  </Edit>
);

I will try to reproduce this without the data aggregator, maybe it's a bug in react-admin. Possible solution to try is to add everything in the edit view, disabling ids.

Rename symbols

I'm not happy with a lot of the names I used in the project. For example dataProviderMappings (could be just mappings), accumulate, key etc. A lot of these names were picked in a hurry so I can hit first MVP but it would be nice if someone goes back over them and find better names.

Props validation

No props validations are done at the moment. It would be nice to have them.

Implement sorting by table header

Right now sorting doesn't work. I had an attempt at fixing it in #9 but actually this broke sorting completely as it currently only sorts data on current page (and not all records).

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.