From e9e1b68caf61a98ab2fee64e8782afc678b31a9d Mon Sep 17 00:00:00 2001 From: bogdannechyporenko Date: Mon, 30 Jan 2023 19:03:02 +0100 Subject: [PATCH 1/4] Aligning buttons to the same line Signed-off-by: bogdannechyporenko --- .../UnregisterEntityDialog.tsx | 43 ++++++++++++------- 1 file changed, 28 insertions(+), 15 deletions(-) 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? - + - - - ); }; From fab93c2fe8ad1316215fbec4fb1d08750e8fb69f Mon Sep 17 00:00:00 2001 From: bogdannechyporenko Date: Mon, 30 Jan 2023 19:03:59 +0100 Subject: [PATCH 2/4] Aligning buttons to the same line Signed-off-by: bogdannechyporenko --- .changeset/twenty-islands-wonder.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/twenty-islands-wonder.md diff --git a/.changeset/twenty-islands-wonder.md b/.changeset/twenty-islands-wonder.md new file mode 100644 index 0000000000..4a18545a27 --- /dev/null +++ b/.changeset/twenty-islands-wonder.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-react': minor +--- + +Aligined buttons on "Unregister entity" dialog to keep them on the same line From 958d922718f09b5b56a86b0fff23a5f45b372f27 Mon Sep 17 00:00:00 2001 From: bogdannechyporenko Date: Mon, 30 Jan 2023 19:12:49 +0100 Subject: [PATCH 3/4] Aligning buttons to the same line Signed-off-by: bogdannechyporenko --- .changeset/twenty-islands-wonder.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/twenty-islands-wonder.md b/.changeset/twenty-islands-wonder.md index 4a18545a27..fe3c5a05c8 100644 --- a/.changeset/twenty-islands-wonder.md +++ b/.changeset/twenty-islands-wonder.md @@ -2,4 +2,4 @@ '@backstage/plugin-catalog-react': minor --- -Aligined buttons on "Unregister entity" dialog to keep them on the same line +Aligned buttons on "Unregister entity" dialog to keep them on the same line From 0f79f14716c6548e420a4e04eca9dfe96dbba932 Mon Sep 17 00:00:00 2001 From: bogdannechyporenko Date: Mon, 30 Jan 2023 20:04:44 +0100 Subject: [PATCH 4/4] test fixed Signed-off-by: bogdannechyporenko --- .../UnregisterEntityDialog/UnregisterEntityDialog.test.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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(