From 39259b4fbd9cc182e1a72da9e9eae66406695812 Mon Sep 17 00:00:00 2001 From: "Jingwei.Zhang" Date: Mon, 6 Jun 2022 10:10:46 +0800 Subject: [PATCH] [Animbus]fix: Fix danger button style in batch actions 1. Fix danger button style in table batch actions 2. Update reboot vm button to danger 3. Update resize vm button to danger Change-Id: Ibabc1259e4914042214842acecde4c16f7e6d19e --- src/components/Tables/Base/ActionButton/index.jsx | 6 ++++-- src/components/Tables/Base/BatchActionButtons/index.jsx | 5 +++-- src/components/Tables/Base/ItemActionButtons/index.jsx | 2 +- src/pages/compute/containers/Instance/actions/Reboot.jsx | 4 ++++ src/pages/compute/containers/Instance/actions/Resize.jsx | 2 ++ .../compute/containers/Instance/actions/ResizeOnline.jsx | 2 ++ 6 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/components/Tables/Base/ActionButton/index.jsx b/src/components/Tables/Base/ActionButton/index.jsx index 53decebb..138443dc 100644 --- a/src/components/Tables/Base/ActionButton/index.jsx +++ b/src/components/Tables/Base/ActionButton/index.jsx @@ -64,6 +64,7 @@ export class ActionButton extends Component { isAllowed: PropTypes.bool, needHide: PropTypes.bool, buttonType: PropTypes.string, + isDanger: PropTypes.bool, items: PropTypes.array, isBatch: PropTypes.bool, path: PropTypes.string, @@ -83,6 +84,7 @@ export class ActionButton extends Component { confirm: false, needHide: true, buttonType: 'link', + isDanger: false, isLink: false, items: [], isBatch: false, @@ -493,7 +495,7 @@ export class ActionButton extends Component { name, id, title, - danger, + isDanger, style, maxLength, isFirstAction, @@ -509,7 +511,7 @@ export class ActionButton extends Component { const button = ( diff --git a/src/components/Tables/Base/ItemActionButtons/index.jsx b/src/components/Tables/Base/ItemActionButtons/index.jsx index cdf6dfe4..e9193568 100644 --- a/src/components/Tables/Base/ItemActionButtons/index.jsx +++ b/src/components/Tables/Base/ItemActionButtons/index.jsx @@ -32,7 +32,7 @@ function getActionConf(action) { name: buttonText || title, actionType, action, - danger: isDanger, + isDanger, }; } diff --git a/src/pages/compute/containers/Instance/actions/Reboot.jsx b/src/pages/compute/containers/Instance/actions/Reboot.jsx index f39414ef..04ef73e7 100644 --- a/src/pages/compute/containers/Instance/actions/Reboot.jsx +++ b/src/pages/compute/containers/Instance/actions/Reboot.jsx @@ -35,6 +35,10 @@ export default class RebootAction extends ConfirmAction { return t('reboot instance'); } + get isDanger() { + return true; + } + get passiveAction() { return t('be rebooted'); } diff --git a/src/pages/compute/containers/Instance/actions/Resize.jsx b/src/pages/compute/containers/Instance/actions/Resize.jsx index a5cf2129..fffa3893 100644 --- a/src/pages/compute/containers/Instance/actions/Resize.jsx +++ b/src/pages/compute/containers/Instance/actions/Resize.jsx @@ -29,6 +29,8 @@ export class Resize extends ModalAction { static title = t('Resize'); + static isDanger = true; + init() { this.store = globalFlavorStore; } diff --git a/src/pages/compute/containers/Instance/actions/ResizeOnline.jsx b/src/pages/compute/containers/Instance/actions/ResizeOnline.jsx index a231b4bd..56ca4469 100644 --- a/src/pages/compute/containers/Instance/actions/ResizeOnline.jsx +++ b/src/pages/compute/containers/Instance/actions/ResizeOnline.jsx @@ -30,6 +30,8 @@ export class ResizeOnline extends ModalAction { static title = t('Online Resize'); + static isDanger = true; + init() { this.store = globalFlavorStore; }