diff --git a/app/assets/javascripts/admin/addon/components/modal/start-backup.hbs b/app/assets/javascripts/admin/addon/components/modal/start-backup.hbs index fcd126e8689..8fdf21f3466 100644 --- a/app/assets/javascripts/admin/addon/components/modal/start-backup.hbs +++ b/app/assets/javascripts/admin/addon/components/modal/start-backup.hbs @@ -1,23 +1,27 @@ <:body> {{#if this.warningMessage}} -
{{html-safe this.warningMessage}}
+
{{html-safe + this.warningMessage + }}
+ {{/if}} + {{#if this.canManageUploadsInBackup}} + {{/if}} <:footer> - - +
\ No newline at end of file diff --git a/app/assets/javascripts/admin/addon/components/modal/start-backup.js b/app/assets/javascripts/admin/addon/components/modal/start-backup.js index 889cab6fd2c..8dd1bf27a0e 100644 --- a/app/assets/javascripts/admin/addon/components/modal/start-backup.js +++ b/app/assets/javascripts/admin/addon/components/modal/start-backup.js @@ -1,16 +1,37 @@ import Component from "@glimmer/component"; import { action } from "@ember/object"; +import { tracked } from "@glimmer/tracking"; +import { inject as service } from "@ember/service"; +import I18n from "I18n"; export default class StartBackup extends Component { - @action - startBackupWithUploads() { - this.args.model.startBackup(true); - this.args.closeModal(); + @service siteSettings; + @tracked includeUploads = true; + + get canManageUploadsInBackup() { + return ( + !this.siteSettings.enable_s3_uploads || + this.siteSettings.include_s3_uploads_in_backups + ); + } + + get warningCssClasses() { + return ""; + } + + get warningMessage() { + if ( + this.siteSettings.enable_s3_uploads && + !this.siteSettings.include_s3_uploads_in_backups + ) { + return I18n.t("admin.backups.operations.backup.s3_upload_warning"); + } + return ""; } @action - startBackupWithoutUploads() { - this.args.model.startBackup(false); + startBackup() { + this.args.model.startBackup(this.includeUploads); this.args.closeModal(); } } diff --git a/app/assets/stylesheets/common/admin/backups.scss b/app/assets/stylesheets/common/admin/backups.scss index 2c6b9ccf26f..b46aeddca98 100644 --- a/app/assets/stylesheets/common/admin/backups.scss +++ b/app/assets/stylesheets/common/admin/backups.scss @@ -89,11 +89,8 @@ button.ru { } .start-backup-modal { - .btn { - margin: 10px 0 10px 5px; - } - .btn:first-of-type { - margin-left: 10px; + .alert { + margin-bottom: 0; } } diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 6d0967bd80f..d913fe2b0fb 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -5043,7 +5043,8 @@ en: label: "Backup" title: "Create a backup" confirm: "Do you want to start a new backup?" - without_uploads: "Yes (do not include uploads)" + include_uploads: "include all uploads" + s3_upload_warning: 'This is for database backups only. Uploads will not be included, meaning all images and other file uploads can be missing if the backup is restored to another hosting setup. To enable a full backup including your S3 uploads please see this guide.' download: label: "Download" title: "Send email with download link"