Skip to content

Commit e092101

Browse files
Copilothotlong
andcommitted
fix: Address code review feedback
- Fix toast.tsx: Move namespace from toast function call to ComponentRegistry metadata - Fix fields/index.tsx: Remove duplicate field registrations (lines 871-900) - These were overwriting the wrapped versions registered earlier - Wrapped versions (with createFieldRenderer) are the correct approach Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 0327ea0 commit e092101

2 files changed

Lines changed: 2 additions & 34 deletions

File tree

packages/components/src/renderers/feedback/toast.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ ComponentRegistry.register('toast',
2121
toast;
2222

2323
toastFn(schema.title || 'Notification', {
24-
namespace: 'ui',
25-
description: schema.description,
24+
description: schema.description,
2625
duration: schema.duration,
2726
});
2827
};
@@ -34,6 +33,7 @@ ComponentRegistry.register('toast',
3433
);
3534
},
3635
{
36+
namespace: 'ui',
3737
label: 'Toast',
3838
inputs: [
3939
{ name: 'title', type: 'string', label: 'Title' },

packages/fields/src/index.tsx

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -866,38 +866,6 @@ export function registerFields() {
866866
ComponentRegistry.register('geolocation', createFieldRenderer(GeolocationField), { namespace: 'field' });
867867
ComponentRegistry.register('signature', createFieldRenderer(SignatureField), { namespace: 'field' });
868868
ComponentRegistry.register('qrcode', createFieldRenderer(QRCodeField), { namespace: 'field' });
869-
870-
// Register with field: prefix for explicit field widgets
871-
ComponentRegistry.register('text', TextField, { namespace: 'field' });
872-
ComponentRegistry.register('textarea', TextAreaField, { namespace: 'field' });
873-
ComponentRegistry.register('number', NumberField, { namespace: 'field' });
874-
ComponentRegistry.register('email', EmailField, { namespace: 'field' });
875-
ComponentRegistry.register('phone', PhoneField, { namespace: 'field' });
876-
ComponentRegistry.register('url', UrlField, { namespace: 'field' });
877-
ComponentRegistry.register('currency', CurrencyField, { namespace: 'field' });
878-
ComponentRegistry.register('percent', PercentField, { namespace: 'field' });
879-
ComponentRegistry.register('password', PasswordField, { namespace: 'field' });
880-
ComponentRegistry.register('date', DateField, { namespace: 'field' });
881-
ComponentRegistry.register('datetime', DateTimeField, { namespace: 'field' });
882-
ComponentRegistry.register('time', TimeField, { namespace: 'field' });
883-
ComponentRegistry.register('lookup', LookupField, { namespace: 'field' });
884-
ComponentRegistry.register('file', FileField, { namespace: 'field' });
885-
ComponentRegistry.register('image', ImageField, { namespace: 'field' });
886-
ComponentRegistry.register('location', LocationField, { namespace: 'field' });
887-
ComponentRegistry.register('user', UserField, { namespace: 'field' });
888-
ComponentRegistry.register('object', ObjectField, { namespace: 'field' });
889-
890-
// NEW: field: prefix registrations for new widgets
891-
ComponentRegistry.register('color', ColorField, { namespace: 'field' });
892-
ComponentRegistry.register('slider', SliderField, { namespace: 'field' });
893-
ComponentRegistry.register('rating', RatingField, { namespace: 'field' });
894-
ComponentRegistry.register('code', CodeField, { namespace: 'field' });
895-
ComponentRegistry.register('avatar', AvatarField, { namespace: 'field' });
896-
ComponentRegistry.register('address', AddressField, { namespace: 'field' });
897-
ComponentRegistry.register('geolocation', GeolocationField, { namespace: 'field' });
898-
ComponentRegistry.register('signature', SignatureField, { namespace: 'field' });
899-
ComponentRegistry.register('qrcode', QRCodeField, { namespace: 'field' });
900-
ComponentRegistry.register('master_detail', MasterDetailField, { namespace: 'field' });
901869
}
902870

903871
export * from './widgets/types';

0 commit comments

Comments
 (0)