Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TS support to fields #8863

Merged
merged 35 commits into from
May 23, 2023
Merged
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
b7635e3
Add TS support to simple fields
djhi Apr 27, 2023
7dfa476
Fix demo types
djhi Apr 27, 2023
51d9352
Update all fields to support source inference
djhi May 3, 2023
0be2db9
Fix localforage and localstorage dataProviders
djhi May 3, 2023
e1cdc22
Add documentation
djhi May 3, 2023
973d573
Add BooleanField doc
djhi May 3, 2023
43f8e72
Revert to using RaRecord where possible
djhi May 11, 2023
ffc9e0d
Revert unnecessary changes
djhi May 11, 2023
94d6445
Revert more unnecessary changes
djhi May 11, 2023
2badd8a
Revert more unnecessary changes
djhi May 11, 2023
e66321d
Make it backward compatible
djhi May 13, 2023
7ca9511
Revert unnecessary changes
djhi May 13, 2023
356fed5
Revert more unnecessary changes
djhi May 13, 2023
63557cc
Add info about RaRecord
djhi May 13, 2023
e3b2a3f
Revert more unnecessary changes
djhi May 13, 2023
dcbc0e2
Apply suggestions from code review
djhi May 15, 2023
d54ea87
Revert CRM types changes
djhi May 15, 2023
cd69c5a
Add invalid TS example in Fields documentation
djhi May 15, 2023
8cefb44
Fix defaultProps breaking change
djhi May 15, 2023
91d22ac
Revert unnecessary change
djhi May 15, 2023
114bb31
Revert demo changes
djhi May 15, 2023
b0af5cd
Revert SortPayload changes
djhi May 15, 2023
7f32840
Revert SaveButton changes
djhi May 15, 2023
022d33d
Make BooleanField stories use a Resource
djhi May 15, 2023
b8b084f
Use RaRecord In ReferenceArrayField for now
djhi May 15, 2023
448a49d
Reorganization
djhi May 15, 2023
ed9128f
Fix string casting
djhi May 15, 2023
69e46f8
Add support for tsx in prism
djhi May 15, 2023
6463e7a
Fix FileFIeld and ImageField
djhi May 15, 2023
8b5f394
Revert withLifecycleCallbacks changes
djhi May 15, 2023
5ccd5ed
SImplify defaultProps handling
djhi May 15, 2023
aa2ae67
Backport ReferenceFieldView fix
djhi May 15, 2023
1776372
Fix tests
djhi May 15, 2023
3ef347e
Move hotscript in dev deps
djhi May 16, 2023
b914e0e
Revert ArrayField proptypes
djhi May 23, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ import { ListControllerResult, useList } from '../list';
import { useNotify } from '../../notification';

export interface UseReferenceArrayFieldControllerParams<
RecordType extends Record<string, unknown> = Record<string, any>
RecordType extends RaRecord = RaRecord
> {
filter?: any;
page?: number;
@@ -46,7 +46,7 @@ const defaultSort = { field: null, order: null };
* @returns {ListControllerResult} The reference props
*/
export const useReferenceArrayFieldController = <
RecordType extends Record<string, unknown> = Record<string, any>,
RecordType extends RaRecord = RaRecord,
ReferenceRecordType extends RaRecord = RaRecord
>(
props: UseReferenceArrayFieldControllerParams<RecordType>
4 changes: 2 additions & 2 deletions packages/ra-ui-materialui/src/field/ReferenceArrayField.tsx
Original file line number Diff line number Diff line change
@@ -78,7 +78,7 @@ import { ChipField } from './ChipField';
* </ReferenceArrayField>
*/
export const ReferenceArrayField = <
RecordType extends Record<string, unknown> = Record<string, any>,
RecordType extends RaRecord = RaRecord,
ReferenceRecordType extends RaRecord = RaRecord
>(
props: ReferenceArrayFieldProps<RecordType>
@@ -129,7 +129,7 @@ ReferenceArrayField.propTypes = {
};

export interface ReferenceArrayFieldProps<
RecordType extends Record<string, unknown> = Record<string, any>
RecordType extends RaRecord = RaRecord
> extends FieldProps<RecordType> {
children?: ReactNode;
filter?: FilterPayload;