Git Product home page Git Product logo

ra-dp-strapi's Introduction

Personal User Manual

๐Ÿ™‹โ€โ™‚๏ธ Hello there. Nice to have you here reading this manual on how to deal with me. The aim is to provide a little sneak peek into my crazy head and help you understand how I would be as a co-worker.

Conditions I like to work in ๐Ÿ–ฅ

  • I get very easily distracted, so I try to not hear conversation when working
  • I aspire for a clean desk, but it is seldom so
  • I like to have one Mate Mate a day before 2 pm

The times/Hours I like to work ๐Ÿ•ฐ

  • I will be available between 10am to 4pm always. Some days I like to start working at 7 am and others I'm content with starting at 10 am.
  • I like blocking times to do focussed work so keep an eye out on that calendar when you book a meeting with me.

The best ways to communicate with me ๐Ÿ“ฌ

  • I'm a big fan of async communication.
  • When not possible to have async communication, I like having video calls with the camera switched ON
  • Please try to schedule meetings rather than having them ad-hoc

The ways I like to receive feedback โšก๏ธ

  • I like to the point feedback. Please don't sugarcoat it. I get confused by this
  • I would appreciate if you include a specific example

Things I need โœ”๏ธ

  • I like having time to research something before forming an opinion about it
  • I love having idea sessions but atleast I should know what we will discuss
  • I only want to have discussions in good faith. If I sense a discussion is only happening to soothe someone's ego, I will withdraw

Things I struggle with ๐Ÿ™€

  • Sometimes I focus too much on the meta-work instead of the actual work
  • I hate using will power. I'll take habits over will power any day
  • Self-confidence.

Things I love โค๏ธ

  • Pair/mob programming
  • Snowboarding to an extent
  • My family :)

Other things to know about me

I ask a lot of questions ๐Ÿ—ฃ

I ask questions just to clarify. It sometimes seems like I'm trying to undermine the idea ro trying to give you a hard time. But I'm just trying to assess the situation. So, saying "I don't know" is a perfectly valid response to my questions.

Strong opinions loosely held ๐Ÿฅธ

I will believe in something for a long time until I get a good argument against it. If I get the argument, I will instantly switch my opinion. This can be jarring.


Template

I found this template very nice and have used it for v1.

ra-dp-strapi's People

Contributors

mohammedfaragallah avatar pritoj avatar

Stargazers

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

Watchers

 avatar  avatar

ra-dp-strapi's Issues

don`t Work

I try use it

App.js

import React from 'react';
import { apiUrl } from './config';
import { Admin, Resource ,fetchUtils} from 'react-admin';
import Strapi from 'strapi-sdk-javascript/build/main';
import strapiDataProvider from 'ra-dp-strapi';
import { ProductList,ProductCreate,ProductEdit } from './products';
import authProvider from './authProvider';

const httpClient = (url, options = {}) => {
  if (!options.headers) {
      options.headers = new Headers({ Accept: 'application/json' });
  }
  const token = localStorage.getItem('token');
  options.headers.set('Authorization', `Bearer ${token}`);
  return fetchUtils.fetchJson(url, options);
};

const strapi = new Strapi(apiUrl);

const App = () => (
<Admin authProvider={authProvider} dataProvider={strapiDataProvider(strapi,httpClient)}>
      <Resource name="products" list={ProductList} create={ProductCreate} edit={ProductEdit}/>
  </Admin>
);

export default App;

authProvider.js

export default {
    // called when the user attempts to log in
    login: ({ username }) => {
        localStorage.setItem('username', username);
        // accept all username/password combinations
        return Promise.resolve();
    },
    // called when the user clicks on the logout button
    logout: () => {
        localStorage.removeItem('username');
        return Promise.resolve();
    },
    // called when the API returns an error
    checkError: ({ status }) => {
        if (status === 401 || status === 403) {
            localStorage.removeItem('username');
            return Promise.reject();
        }
        return Promise.resolve();
    },
    // called when the user navigates to a new location, to check for authentication
    checkAuth: () => {
        return localStorage.getItem('username')
            ? Promise.resolve()
            : Promise.reject();
    },
    // called when the user navigates to a new location, to check for permissions / roles
    getPermissions: () => Promise.resolve(),
};

Forbidden error

Hi @Pritoj,
I try to use this awesome plugin but it's return Forbiden error. It's my code:

/// IMPORTANT to import like this.
import Strapi from 'strapi-sdk-javascript/build/main';
import strapiDataProvider from 'ra-dp-strapi';
import React from 'react';
import { render } from 'react-dom';
import { Admin, Resource } from 'react-admin';
import { TestList } from './tests/list';

const apiUrl = 'http://localhost:1337';
const strapi = new Strapi(apiUrl);


class App extends React.Component {
  render() {
    return (
        <Admin dataProvider={strapiDataProvider(strapi)}>
            <Resource name="tests" list={TestList}/>
        </Admin>
    );
  }
}

export default App;
// in list.js
import React from 'react';
import { List, Datagrid, Edit, Create, SimpleForm, DateField, TextField, EditButton, DisabledInput, TextInput, LongTextInput, DateInput } from 'react-admin';
import BookIcon from '@material-ui/icons/Book';
export const PostIcon = BookIcon;

export const TestList = (props) => (
    <List {...props}>
        <Datagrid>
            <TextField source="id" />
            <TextField source="title" />
            <DateField source="description" />
        </Datagrid>
    </List>
);

Can you guide me to fix this?

internal server error

Thank you so much for this you help connect two great tools.

I have a problem with sorting it keeps giving me "Unkown order value: "desc", available values are: ASC, DESC" and I don't know where to modify it.

Mongo database id

When using MongoDB as database the starting query go for _sort=id while it should be _id

compile error.

I just started to learn nodejs. Trying to connect react-admin to strapi api.
When I start react-admin with ra-dp-strapi I get this error:

Failed to compile.

./node_modules/strapi-sdk-javascript/build/module/lib/sdk.js
Module parse failed: Unexpected token (14:12)
You may need an appropriate loader to handle this file type.
| baseURL,
| paramsSerializer: qs.stringify,
| ...requestConfig
| });
| this.storeConfig = {

What should I do?

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.