Allow uiSchema to be set as part of the settings for HomePage

Signed-off-by: ivgo <ivgo@spreadgroup.com>
This commit is contained in:
ivgo
2023-07-05 10:47:31 +02:00
parent 8b6067f885
commit 0b89ca8ce2
7 changed files with 24 additions and 3 deletions
+7 -1
View File
@@ -173,7 +173,8 @@ Available home page properties that are used for homepage widgets are:
To define settings that the users can change for your component, you should define the `layout` and `settings`
properties. The `settings.schema` object should follow
[react-jsonschema-form](https://rjsf-team.github.io/react-jsonschema-form/docs/) definition and the type of the schema
must be `object`.
must be `object`. As well, the `uiSchema` can be defined if a certain UI style needs to be applied fo any of the defined
properties. More documentation [here](https://rjsf-team.github.io/react-jsonschema-form/docs/api-reference/uiSchema).
```tsx
import { createCardExtension } from '@backstage/plugin-home-react';
@@ -201,6 +202,11 @@ export const HomePageRandomJoke = homePlugin.provide(
},
},
},
uiSchema: {
defaultCategory: {
'ui:widget': 'radio', // Instead of the default 'select'
},
},
},
}),
);