aymendhaya / ra-data-firebase-client

firebase data provider for react-admin framework
https://aymendhaya.github.io/ra-data-firebase-client
55 stars 51 forks source link

How will you use filter and how will you show a particular user #3

Closed Yingi closed 4 years ago

Yingi commented 6 years ago

const trackedResources = [{ name: 'users', isPublic: true }];

// to run this demo locally, please feel free to disable authProvider to bypass login page

const dataProvider = base64Uploader(RestProvider(firebaseConfig, { trackedResources })); const App = () => ( <Admin dataProvider={dataProvider}>

<Resource name="users" list={UserList} show={UserShow} edit={UserEdit} create={UserCreate} />

</Admin> );

show seems not to be working? I expected that when you click on a row of the User List, it is supposed to show the user details.

Secondly, i try implementing the filter component, but i am unable to search and filter records

const UserFilter = props => (

<Filter {...props}> <TextInput label="Search" source="Name" alwaysOn /> </Filter>

);

export const UserList = props => (

<List title="All Users" {...props} filters={<UserFilter />}> <Datagrid rowClick="show"> <TextField source="id" /> <TextField source="Name" /> <TextField source="Car.Brand" label="Car" /> <EditButton /> </Datagrid> </List>

);

I'd like to know what the possible problem is

rafalzawadzki commented 5 years ago

show seems not to be working? I expected that when you click on a row of the User List, it is supposed to show the user details.

This is not how clicks are handled. Please check out the react-admin docs here

Yingi commented 5 years ago

@rafalzawadzki I tried it but its not working. However i used the normal ShowButton component for each row. The main thing i am struggling with right now is the filter. I am unable to filter records from the List. Its not working even if when i search a user, the url/address bar seems to change like this

http://localhost:3000/#/user?filter=%7B%22details%22%3A%7B%22Name%22%3A%22Bella%22%7D%7D&order=DESC&page=1&perPage=10&sort=id

Still it doesnt filter out the particular user. And i know for sure the User Exists

rafalzawadzki commented 5 years ago

@Yingi afaik, this library does not support filtering yet, just sorting. If you are still on the early stage of the project, you might consider shifting your db to Firestore and using my fork of this library that supports filtering: https://github.com/rafalzawadzki/ra-data-firestore-client

Yingi commented 5 years ago

@rafalzawadzki Yes i wish i could migrate to Firestore. But my application is heavily dependent on Location querying and tracking which firestore have not supported as of now. The Geofirestore Library is not as comprehensive as Geofire which is basically for Firebase RealTime Database. So i am really confused as to what to do.

aymendhaya commented 4 years ago

Hi, please check the v3 release