From 2076141f479d17687dd1c0daedd30bfbbe2d942e Mon Sep 17 00:00:00 2001 From: badrAZ Date: Fri, 7 May 2021 13:47:47 +0200 Subject: [PATCH] feat(xo-web): add warning on restoring metadata backup (#5769) See xoa-support#3691 --- CHANGELOG.unreleased.md | 3 +++ packages/xo-web/src/common/intl/messages.js | 2 ++ .../restore/restore-metadata-backups-modal-body.js | 9 +++++++++ 3 files changed, 14 insertions(+) diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md index c672d7a14..abedc18b2 100644 --- a/CHANGELOG.unreleased.md +++ b/CHANGELOG.unreleased.md @@ -7,6 +7,8 @@ > Users must be able to say: “Nice enhancement, I'm eager to test it” +- [Metadata Backup] Add a warning on restoring a metadata backup (PR [#5769](https://github.com/vatesfr/xen-orchestra/pull/5769)) + ### Bug fixes > Users must be able to say: “I had this issue, happy to know it's fixed” @@ -29,3 +31,4 @@ > In case of conflict, the highest (lowest in previous list) `$version` wins. - xo-server-backup-reports patch +- xo-web minor diff --git a/packages/xo-web/src/common/intl/messages.js b/packages/xo-web/src/common/intl/messages.js index 54d9fc581..f60e7b765 100644 --- a/packages/xo-web/src/common/intl/messages.js +++ b/packages/xo-web/src/common/intl/messages.js @@ -1581,6 +1581,8 @@ const messages = { restoreVmBackupsBulkTitle: 'Restore {nVms, number} VM{nVms, plural, one {} other {s}}', restoreVmBackupsBulkMessage: 'Restore {nVms, number} VM{nVms, plural, one {} other {s}} from {nVms, plural, one {its} other {their}} {oldestOrLatest} backup.', + restoreMetadataBackupWarning: + 'This operation will overwrite the host metadata. Only perform a metadata restore if it is a new server with nothing running on it.', oldest: 'oldest', latest: 'latest', restoreVmBackupsStart: 'Start VM{nVms, plural, one {} other {s}} after restore', diff --git a/packages/xo-web/src/xo-app/backup/restore/restore-metadata-backups-modal-body.js b/packages/xo-web/src/xo-app/backup/restore/restore-metadata-backups-modal-body.js index eb0f83d96..cf4d274ea 100644 --- a/packages/xo-web/src/xo-app/backup/restore/restore-metadata-backups-modal-body.js +++ b/packages/xo-web/src/xo-app/backup/restore/restore-metadata-backups-modal-body.js @@ -1,5 +1,6 @@ import _ from 'intl' import Component from 'base-component' +import Icon from 'icon' import PropTypes from 'prop-types' import React from 'react' import SingleLineRow from 'single-line-row' @@ -8,6 +9,12 @@ import { Container, Col } from 'grid' import { FormattedDate } from 'react-intl' import { Select } from 'form' +const restorationWarning = ( +

+ {_('restoreMetadataBackupWarning')} +

+) + export default class RestoreMetadataBackupModalBody extends Component { static propTypes = { backups: PropTypes.array, @@ -46,6 +53,7 @@ export default class RestoreMetadataBackupModalBody extends Component { /> + {restorationWarning} ) } @@ -76,6 +84,7 @@ export class RestoreMetadataBackupsBulkModalBody extends Component { /> ), })} + {restorationWarning} ) }