@backstage/plugin-scaffolder-react fixes
Signed-off-by: Paul Cowan <paul.cowan@cutting.scot>
This commit is contained in:
@@ -20,19 +20,16 @@ import {
|
||||
FIELD_EXTENSION_WRAPPER_KEY,
|
||||
} from '../extensions/keys';
|
||||
|
||||
type Extension = Omit<FieldExtensionOptions, 'validation'> & { validation?: unknown }
|
||||
|
||||
/**
|
||||
* Hook that returns all custom field extensions from the current outlet.
|
||||
* @public
|
||||
*/
|
||||
export const useCustomFieldExtensions = <
|
||||
TComponentDataType = FieldExtensionOptions
|
||||
TComponentDataType = FieldExtensionOptions,
|
||||
>(
|
||||
outlet: React.ReactNode,
|
||||
defaultScaffolderFieldExtensions: Extension[] = []
|
||||
) => {
|
||||
const customFieldExtensions = useElementFilter(outlet, elements =>
|
||||
return useElementFilter(outlet, elements =>
|
||||
elements
|
||||
.selectByComponentData({
|
||||
key: FIELD_EXTENSION_WRAPPER_KEY,
|
||||
@@ -40,15 +37,5 @@ export const useCustomFieldExtensions = <
|
||||
.findComponentData<TComponentDataType>({
|
||||
key: FIELD_EXTENSION_KEY,
|
||||
}),
|
||||
) as FieldExtensionOptions[];
|
||||
|
||||
return [
|
||||
...customFieldExtensions,
|
||||
...defaultScaffolderFieldExtensions.filter(
|
||||
({ name }) =>
|
||||
!customFieldExtensions.some(
|
||||
customFieldExtension => customFieldExtension.name === name,
|
||||
),
|
||||
),
|
||||
];
|
||||
);
|
||||
};
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { useAnalytics, useApiHolder, useRouteRefParams } from '@backstage/core-plugin-api';
|
||||
import { useAnalytics, useApiHolder } from '@backstage/core-plugin-api';
|
||||
import { JsonValue } from '@backstage/types';
|
||||
import {
|
||||
Stepper as MuiStepper,
|
||||
@@ -34,7 +34,6 @@ import { useTemplateSchema } from '../../hooks/useTemplateSchema';
|
||||
import { useFormDataFromQuery } from '../../hooks/useFormDataFromQuery';
|
||||
import validator from '@rjsf/validator-ajv6';
|
||||
|
||||
|
||||
const useStyles = makeStyles(theme => ({
|
||||
backButton: {
|
||||
marginRight: theme.spacing(1),
|
||||
@@ -64,7 +63,7 @@ export type StepperProps = {
|
||||
onComplete: (values: Record<string, JsonValue>) => Promise<void>;
|
||||
initialFormState?: Record<string, JsonValue>;
|
||||
ReviewStateWrapper?: (props: ReviewStateProps) => JSX.Element;
|
||||
}
|
||||
};
|
||||
|
||||
// TODO(blam): We require here, as the types in this package depend on @rjsf/core explicitly
|
||||
// which is what we're using here as the default types, it needs to depend on @rjsf/core-v5 because
|
||||
|
||||
Reference in New Issue
Block a user