Skip to content

Commit

Permalink
fix modal confirm
Browse files Browse the repository at this point in the history
  • Loading branch information
stephane-m-dev committed Nov 15, 2024
1 parent 4742eaa commit e9716a6
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions packages/xo-web/src/xo-app/vm/tab-advanced.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ import BootOrder from './boot-order'
import VusbCreateModal from './vusb-create-modal'
import PciAttachModal from './pci-attach-modal'
import { subscribeSecurebootReadiness, subscribeGetGuestSecurebootReadiness } from '../../common/xo'
import { blockedOperation } from '../../common/intl/messages'

// Button's height = react-select's height(36 px) + react-select's border-width(1 px) * 2
// https://github.com/JedWatson/react-select/blob/916ab0e62fc7394be8e24f22251c399a68de8b1c/less/select.less#L21, L22
Expand Down Expand Up @@ -589,20 +588,15 @@ export default class TabAdvanced extends Component {
blockedOperations => STOP_OPERATIONS.every(op => op in blockedOperations)
)

_getIsMigrationAllowed = () => {
const blockedOperations = this.props.vm.blockedOperations
const isAllowed = this.props.vm && this.props.vm.blockedOperations &&
!['migrate_send', 'pool_migrate'].every(op => op in blockedOperations)
console.log({op: "_getIsMigrationAllow", blockedOperations, isAllowed})
createSelector(
() => this.props.vm && this.props.vm.blockedOperations,
blockedOperations => !['migrate_send', 'pool_migrate'].every(op => op in blockedOperations)
)
}
_getIsMigrationAllowed = createSelector(
() => this.props.vm?.blockedOperations,
blockedOperations =>
blockedOperations !== undefined && !['migrate_send', 'pool_migrate'].every(op => op in blockedOperations)
)

_onChangeAllowMigration = allow => {
console.log({allow})
const reasons = Object.keys(this.props.vm.blockedOperations).join(' ')
const reasons = JSON.stringify(this.props.vm.blockedOperations)
console.log({reasons})
confirm({
title: _('allowMigrationTitle'),
Expand Down

0 comments on commit e9716a6

Please sign in to comment.