diff --git a/.changeset/twenty-islands-wonder.md b/.changeset/twenty-islands-wonder.md new file mode 100644 index 0000000000..fe3c5a05c8 --- /dev/null +++ b/.changeset/twenty-islands-wonder.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-react': minor +--- + +Aligned buttons on "Unregister entity" dialog to keep them on the same line diff --git a/plugins/catalog-react/src/components/UnregisterEntityDialog/UnregisterEntityDialog.test.tsx b/plugins/catalog-react/src/components/UnregisterEntityDialog/UnregisterEntityDialog.test.tsx index 4173ca85b2..baa4b3732c 100644 --- a/plugins/catalog-react/src/components/UnregisterEntityDialog/UnregisterEntityDialog.test.tsx +++ b/plugins/catalog-react/src/components/UnregisterEntityDialog/UnregisterEntityDialog.test.tsx @@ -80,7 +80,11 @@ describe('UnregisterEntityDialog', () => { it('can cancel', async () => { const onClose = jest.fn(); - stateSpy.mockImplementation(() => ({ type: 'loading' })); + stateSpy.mockImplementation(() => ({ + type: 'bootstrap', + location: '', + deleteEntity: jest.fn(), + })); await renderInTestApp( diff --git a/plugins/catalog-react/src/components/UnregisterEntityDialog/UnregisterEntityDialog.tsx b/plugins/catalog-react/src/components/UnregisterEntityDialog/UnregisterEntityDialog.tsx index 48aa2f4012..6c4984129e 100644 --- a/plugins/catalog-react/src/components/UnregisterEntityDialog/UnregisterEntityDialog.tsx +++ b/plugins/catalog-react/src/components/UnregisterEntityDialog/UnregisterEntityDialog.tsx @@ -39,14 +39,19 @@ const useStyles = makeStyles({ advancedButton: { fontSize: '0.7em', }, + dialogActions: { + display: 'inline-block', + }, }); const Contents = ({ entity, onConfirm, + onClose, }: { entity: Entity; onConfirm: () => any; + onClose: () => any; }) => { const alertApi = useApi(alertApiRef); const configApi = useApi(configApiRef); @@ -92,6 +97,14 @@ const Contents = ({ [alertApi, onConfirm, state], ); + const DialogActionsPanel = () => ( + + + + ); + if (state.type === 'loading') { return ; } @@ -112,15 +125,18 @@ const Contents = ({ {!showDelete && ( - + <> + + + )} {showDelete && ( @@ -140,6 +156,7 @@ const Contents = ({ > Delete Entity + )} @@ -162,6 +179,7 @@ const Contents = ({ > Delete Entity + ); } @@ -258,13 +276,8 @@ export const UnregisterEntityDialog = (props: UnregisterEntityDialogProps) => { Are you sure you want to unregister this entity? - + - - - ); };