From 4cf50a45c5e0e26c7517080dee3306232a7635d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=CC=81rgio=20Ramos?= Date: Fri, 2 Mar 2018 14:18:11 +0000 Subject: [PATCH] fix(instances): prompt to mutate instance on summary --- .../my-joy-instances/src/components/instances/summary.js | 8 ++++---- .../my-joy-instances/src/containers/instances/summary.js | 5 +++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/my-joy-instances/src/components/instances/summary.js b/packages/my-joy-instances/src/components/instances/summary.js index b461e26b..1707e0a6 100644 --- a/packages/my-joy-instances/src/components/instances/summary.js +++ b/packages/my-joy-instances/src/components/instances/summary.js @@ -41,10 +41,10 @@ const GreyLabel = styled(Label)` `; const TrimedLabel = styled(Label)` - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; -` + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +`; const Flex = styled.div` align-items: center; diff --git a/packages/my-joy-instances/src/containers/instances/summary.js b/packages/my-joy-instances/src/containers/instances/summary.js index 29127ffa..146e225f 100644 --- a/packages/my-joy-instances/src/containers/instances/summary.js +++ b/packages/my-joy-instances/src/containers/instances/summary.js @@ -25,6 +25,7 @@ import RebootInstance from '@graphql/reboot-instance.gql'; import RemoveInstance from '@graphql/remove-instance.gql'; import SummaryScreen from '@components/instances/summary'; import parseError from '@state/parse-error'; +import Confirm from '@state/confirm'; export const Summary = ({ instance, @@ -196,6 +197,10 @@ export default compose( const { instance } = ownProps; const { id } = instance; + if (!await Confirm(`Do you want to ${action} "${instance.name}"?`)) { + return; + } + const gerund = `${action}ing`; const name = `${id}-summary-${gerund}`;