Skip to content

Commit

Permalink
change unblockMigrationConfirm message, show modal only if reason is …
Browse files Browse the repository at this point in the history
…not null
  • Loading branch information
stephane-m-dev committed Nov 26, 2024
1 parent 2bc411d commit 4e8c6ee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/xo-web/src/common/intl/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -1522,7 +1522,7 @@ const messages = {
protectFromShutdown: 'Protect from accidental shutdown',
blockMigration: 'Block migration',
unblockMigrationTitle: 'Unblock migration',
unblockMigrationConfirm: 'This will unblock migration',
unblockMigrationConfirm: 'Are you sure you want to unblock migration for this VM?',
ha: 'HA',
srHaTooltip: 'SR used for High Availability',
nestedVirt: 'Nested virtualization',
Expand Down
5 changes: 4 additions & 1 deletion packages/xo-web/src/xo-app/vm/tab-advanced.js
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,10 @@ export default class TabAdvanced extends Component {
),
})

if (blockedOperations !== undefined && ['migrate_send', 'pool_migrate'].some(op => op in blockedOperations)) {
if (
blockedOperations !== undefined &&
['migrate_send', 'pool_migrate'].some(op => op in blockedOperations && blockedOperations[op].trim() !== 'true')
) {
confirm({
title: _('unblockMigrationTitle'),
body: (
Expand Down

0 comments on commit 4e8c6ee

Please sign in to comment.