Last active
September 11, 2021 01:45
-
-
Save benjdlambert/259dfca6849549376e2744233ad8b76a to your computer and use it in GitHub Desktop.
Scaffolder Extension
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//packages/app/src/scaffolder/extensions/index.ts | |
import { scaffolderPlugin, createScaffolderFieldExtension } from '@backstage/plugin-scaffolder'; | |
import { BitbucketToken } | |
export const BitbucketFieldExtension = scaffolderPlugin.provide( | |
createScaffolderFieldExtension({ | |
name: 'BitbucketToken', | |
component: BitbucketToken, | |
}) | |
); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// packages/app/src/scaffolder/extensions/Bitbucket/index.tsx | |
import React, { useCallback, useEffect } from 'react'; | |
import { FieldProps } from '@rjsf/core'; | |
export const BitbucketToken = ({ | |
onChange, | |
uiSchema, | |
rawErrors, | |
formData, | |
}: FieldProps<string>) => { | |
return ( | |
<> | |
<FormControl | |
margin="normal" | |
required | |
error={rawErrors?.length > 0} | |
> | |
<InputLabel htmlFor="tokenInput">Organization</InputLabel> | |
<Input | |
id="tokenInput" | |
onChange={(e) => onChange(e.target.value)} | |
value={formData} | |
/> | |
<FormHelperText>the token</FormHelperText> | |
</FormControl> | |
</> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment