Giter Site home page Giter Site logo

refinedev / refine Goto Github PK

View Code? Open in Web Editor NEW
25.2K 124.0 1.9K 3.64 GB

A React Framework for building internal tools, admin panels, dashboards & B2B apps with unmatched flexibility.

Home Page: https://refine.dev

License: MIT License

TypeScript 97.35% JavaScript 2.29% Shell 0.01% Dockerfile 0.02% Smarty 0.03% CSS 0.18% Handlebars 0.03% HTML 0.09%
react typescript admin admin-ui ant-design react-framework frontend-framework graphql nestjs nextjs

refine's Issues

Admin logo

Admin'e logo isminde optional prop ekleyip header kısımında göstermeliyiz. Eğer gelmez ise default olarak Readmin yazabiliriz.

image

Redux

Actions

Register Resource
Resource'leri analiz ederek yeni bir resource objesi hazırlar ve admin.resources altına key users olarak pushlar.

{
  "props": {
    "name": "users",
    "options": {},
    "hasList": true,
    "hasEdit": true,
    "hasShow": true,
    "hasCreate": false
  },
  "data": [],
  "list": {
    "params": {
      "sort": null,
      "order": null,
      "page": 1,
      "perPage": null,
      "filter": {}
    },
    "selectedIds": [],
    "total": null
  },
}

Fetch Start
Global loading objesini (admin.loading) true setler.

Fetch End
Global loading objesini (admin.loading) false setler.

CRUD Get List (Request | Success | Failed )
Crud List için request başlatır ve sonlandırır.

CRUD Get One (Request | Success | Failed )
Crud One için request başlatır ve sonlandırır.

Inital State

{
  admin: {
    resources: {},
    loading: 0,
    notifications: [],
    ui: {
      sidebarOpen: false,
    }
  },
}

List empty prop

Optional olarak list componentine eklemeliyiz. Eğer gösterilen resource'da hiç kayıt yoksa bu prop render edilmeli. Default olarak gösterilecek bir ui ihtiyacımız var.

CSV Import

ImportButton -> Prop'ları
{
resourceName?: string;
mapData?(value: BaseRecord, index: number, array: BaseRecord[]): BaseRecord;
csvProps?: CSVReaderProps; ????
}

mapData -> Gender, 1 : 2 => gender === 1 ? "female" : "male"

Admin ready props

Eğer hiç resource tanımlanmadıysa bu propu render etmeliyiz. Eğer gelmezse default olarak gösterebileceğimiz bir component'e ihtiyacımız var.

useSelect, useCheckbox, useRadio data fetch size

ReferenceInput düzenleme ekranında düzenleme yapılan element ve ilk 25 kayıtın getirilmesi.

Ör: Post datası bu şekilde:

{
  "id": "1",
  "title": "test",
  "categoryId": "50"
}

Edit ekranında ReferenceInput category resource'den 25 kayıt çekiyor bunlar içinde 50 id'li kayıt yoksa select'de 50 seçili hale geliyor.

Çözüm olarak ilk 25 kaydı çekip ve edit yaptığımız kaydı ayrıca in yapmamak gerekiyor.

Geçiçi olarak pageSize: 999 yaparak çözdüm.

Custom Page

useList hook'unu kullanarak custom şekilde page yaratabilmeliyiz.

Rename Inputs/Fields components.

Form Inputs
Input -> TextInput
Textarea -> TextAreaInput
...otherInputs

Table Fields
Text -> TextField
Boolean -> BooleanField
...otherFields

Notification

antd notification kullanarak istediğimiz yerde notification gösterebilmeliyiz. useNotification hook'u oluşturup hem içerde hemde export etmeliyiz.

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.