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

Fix ScaffolderFieldExtensions deprecation - round 2 #12

Merged
merged 1 commit into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions packages/dynamic-pick-extension/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Add the import to your `packages/app/src/App.tsx` on the frontend package of you

```js
import { DynamicPickFieldExtension } from '@premise/plugin-dynamic-pick-extension';
import { ScaffolderFieldExtensions } from '@backstage/plugin-scaffolder';
import { ScaffolderFieldExtensions } from '@backstage/plugin-scaffolder-react';
```

Then add the imported field extension as a child of `ScaffolderFieldExtensions` inside `Route`
Expand All @@ -27,7 +27,7 @@ Then add the imported field extension as a child of `ScaffolderFieldExtensions`
</Route>
```

You should not see the custom filed `DynamicPickExtension` clicking "Custom field explored" here `http://localhost:3000/create/edit`.
You should now see the custom filed `DynamicPickExtension` clicking "Custom field explored" here `http://localhost:3000/create/edit`.

## Usage
To use the extension on a [Backstage Template Action](https://backstage.io/docs/features/software-templates/writing-templates) just add the `ui-field` and `ui-options` fields to the parameter
Expand Down
2 changes: 2 additions & 0 deletions packages/dynamic-pick-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@
"@backstage/core-components": "^0.12.4",
"@backstage/core-plugin-api": "^1.4.0",
"@backstage/plugin-scaffolder": "^1.11.0",
"@backstage/plugin-scaffolder-react": "^1.1.0",
"@backstage/theme": "^0.2.17",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.57",
"zod": "~3.18.0",
"react-use": "^17.2.4"
},
"peerDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const DynamicPickExtension = ({
id={idSchema?.$id}
loading={loading}
value={formData ?? null}
renderInput={(params) =>
renderInput={(params) => (
<TextField
{...params}
label={title}
Expand All @@ -60,7 +60,7 @@ export const DynamicPickExtension = ({
error={rawErrors?.length > 0 && !formData}
helperText={description}
/>
}
)}
options={formDataOptions}
onChange={(_, value) => onChange(value)}
getOptionSelected={(option, value) => option === value}
Expand Down
Loading