aymendhaya / ra-data-firebase-client Goto Github PK
View Code? Open in Web Editor NEWfirebase data provider for react-admin framework
Home Page: https://aymendhaya.github.io/ra-data-firebase-client
firebase data provider for react-admin framework
Home Page: https://aymendhaya.github.io/ra-data-firebase-client
Hello
i want to show listing inside of main route..i am not finding a way to do so using firebase client or may be react admin ..
Like.. users - specific user -> Feedbacks listing
I m not able to list feedbacks listing on edit user .. feedbacks is not stored separate so i cant use referenceinput or reference fields
No updates for over 2 years. Is this project still being developed?
I’ve been struggling with getting it to work with the latest versions of React Admin and Firebase. I was going to post my findings here if anybody is interested.
when i run the script i get this error :
Module not found: Can't resolve 'sort-by'
ra-data-firebase-client requires that each resource has an id field to identify it. my data uses a different name for the primary key, can i map that name to id in your dataProvider.
I'm using the forked firestore version of this and when I try to use the image component to upload an image I get the following error:
DocumentReference.set() called with invalid data. Unsupported field value: a custom File object (found in field pictures.rawFile)
This is my component:
<ImageInput source="pictures" label="Slide picture" accept="image/*">
<ImageField source="src" title="title" />
</ImageInput>
Can we lose this, please?
console.log('reselut', result);
It's in src/lib/RestProvider.js, line 151.
Getting issue on login.
Not sure about the firebase data structure.
Is there any specific dB structure for users node.
Uploading a valid json structure will be helpful.
Are there any plans to support react-admin filters ?
https://marmelab.com/react-admin/Tutorial.html#adding-search-and-filters-to-the-list
Hello,
I love your boilerplate and using it for a project but there is a critical problem ( at least from user experience point of view ). After you update or delete the record it takes few seconds to reach out to this line. I tried debugging but could not found much.
/src/lib/RestProvider.js
181: console.log('UPDATE/CREATE');
Have you seen this issue before ?
I used your demo as a template to create my own app but all I keep getting is sign_in_error.
Are there some steps that I'm not doing or am I doing something wrong?
It seems to understand that the user exists with a certain email/pass but then it just errors.
import React from 'react';
import { Admin, Resource } from 'react-admin';
import Dashboard from './components/dashboard/dashboard';
import { RestProvider, AuthProvider, base64Uploader } from 'ra-data-firebase-client';
import { UserList } from './components/users/users';
import { PostList, PostEdit, PostCreate } from './components/posts/posts'
import UserIcon from '@material-ui/icons/Group';
import PostIcon from '@material-ui/icons/Book';
const firebaseConfig = {
apiKey: "",
authDomain: "",
databaseURL: "",
projectId: "",
storageBucket: "",
messagingSenderId: ""
};
const trackedResources = [{ name: 'posts', isPublic: true }, { name: 'users', isPublic: true }];
const authConfig = {
userProfilePath: '/users/',
userAdminProp: 'isAdmin'
};
const dataProvider = base64Uploader(RestProvider(firebaseConfig, {trackedResources}));
const App = () => (
<Admin dashboard={Dashboard} dataProvider={dataProvider} authProvider={AuthProvider(authConfig)}>
<Resource name="users" list={UserList} icon={UserIcon} />
<Resource name="posts" list={PostList} edit={PostEdit} create={PostCreate} icon={PostIcon} />
</Admin>
);
export default App;
./node_modules/ra-data-firebase-client/dist/index.es.js
Module not found: Can't resolve 'sort-by' in '/Users/PATH/node_modules/ra-data-firebase-client/dist'
I would like to display a list of users.
So, in the database I get something like this :
"users": {
"user1": true,
"user2": true,
"user3": true,
}
How can I display each users from a post resource ?
I'm try using ReferenceArrayField but doesn't works.
I have added a new user with the credentials from auth, however, there is sign_in_error that comes out.
Is it right for me to say that it does not work for firestore as of the moment? Thank you!
import React from 'react';
import { List, ReferenceArrayField, SingleFieldList, TextField, ChipField, Datagrid } from 'react-admin';
export const Orders = props => (
<List {...props}>
<Datagrid>
<TextField label="State" source="state" />
<ReferenceArrayField label="Products" reference="orderItem" source="items">
<SingleFieldList>
<ChipField source="price" />
</SingleFieldList>
</ReferenceArrayField>
</Datagrid>
</List>
);
DateInput works fine but DateTimeInput cannot be saved, the field is missing in firebase.
If there's a pre-defined field, it will be removed.
The Posts in the example can be used for reproduction.
Hello,
Firebase token seems to expire every 1 hour.
This causes problems when there are actions to be made, is there a way to automatically refresh the token in the background before the hour expires? Or some other solution?
We want the logged-in user to remain logged-in until they choose to logout.
Thanks.
P.S. Similar discussion here (for Android apps though):
https://stackoverflow.com/questions/38350843/how-to-handle-custom-firebase-token-expiry-in-firebase-3-x-x
P.S. Using react-admin v2.6.1
If I place ImageInput inside ArrayField:
<ArrayInput source="subBlocks">
<SimpleFormIterator>
<ImageInput source="images" label="Image" accept="image/*" multiple>
<ImageField source="src" title="title" />
</ImageInput>
</SimpleFormIterator>
</ArrayInput>```
The image url brokes. It does not looks like base-64 image and looks like "blob:http://localhost:8080/c7956ca5-9c1b-44c1-a001-d84b90e4d4b0" and stores locally.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.