Skip to content

Commit

Permalink
Revert "Fix ScaffolderFieldExtensions deprecation (#10)" (#11)
Browse files Browse the repository at this point in the history
This reverts commit 4b4491f.
  • Loading branch information
Mauricio Alejandro Martínez Pacheco authored Oct 2, 2023
1 parent da6d8c4 commit 77c0b0e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
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-react';
import { ScaffolderFieldExtensions } from '@backstage/plugin-scaffolder';
```

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 now see the custom filed `DynamicPickExtension` clicking "Custom field explored" here `http://localhost:3000/create/edit`.
You should not 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: 0 additions & 2 deletions packages/dynamic-pick-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,10 @@
"@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

0 comments on commit 77c0b0e

Please sign in to comment.