refinedev / refine Goto Github PK
View Code? Open in Web Editor NEWA React Framework for building internal tools, admin panels, dashboards & B2B apps with unmatched flexibility.
Home Page: https://refine.dev
License: MIT License
A React Framework for building internal tools, admin panels, dashboards & B2B apps with unmatched flexibility.
Home Page: https://refine.dev
License: MIT License
Bir input yaratmak istediğimizde FormItem'a sarmak yerine bunu her input'da yapıp, prop'larını merge edelim
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.
{
admin: {
resources: {},
loading: 0,
notifications: [],
ui: {
sidebarOpen: false,
}
},
}
eğer edit yoksa list'e yönlendirelim
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.
ImportButton -> Prop'ları
{
resourceName?: string;
mapData?(value: BaseRecord, index: number, array: BaseRecord[]): BaseRecord;
csvProps?: CSVReaderProps; ????
}
mapData -> Gender, 1 : 2 => gender === 1 ? "female" : "male"
IDataContext
interface içinde interfacelerinin hazırlanması.src/dataProviders/jsonServer.ts
dosyası eklenmesi.Bu prop ile default olarak resource'u sort etmeli.
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.
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.
useList hook'unu kullanarak custom şekilde page yaratabilmeliyiz.
Bu prop ile default olarak resource'u filtrelemeli.
saveButton props yapıcaz
Form Inputs
Input -> TextInput
Textarea -> TextAreaInput
...otherInputs
Table Fields
Text -> TextField
Boolean -> BooleanField
...otherFields
antd notification kullanarak istediğimiz yerde notification gösterebilmeliyiz. useNotification
hook'u oluşturup hem içerde hemde export etmeliyiz.
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.