DEV: Make admin-start-backup template extendable (#18904)

We need to change the content of this modal in different
plugins based on context, so move some parts of it into
the JS file.
This commit is contained in:
Martin Brennan 2022-11-08 10:40:56 +10:00 committed by GitHub
parent ac2ef0bd9d
commit b93075a445
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 1 deletions

View File

@ -1,9 +1,22 @@
import Controller, { inject as controller } from "@ember/controller";
import discourseComputed from "discourse-common/utils/decorators";
import ModalFunctionality from "discourse/mixins/modal-functionality";
export default Controller.extend(ModalFunctionality, {
adminBackupsLogs: controller(),
@discourseComputed
warningMessage() {
// this is never shown here, but we may want to show different
// messages in plugins
return "";
},
@discourseComputed
yesLabel() {
return "yes_value";
},
actions: {
startBackupWithUploads() {
this.send("closeModal");

View File

@ -1,5 +1,8 @@
<DModalBody @title="admin.backups.operations.backup.confirm">
<DButton @class="btn-primary backup-with-uploads" @action={{action "startBackupWithUploads"}} @label="yes_value" />
{{#if this.warningMessage}}
<div class="alert alert-warning">{{html-safe this.warningMessage}}</div>
{{/if}}
<DButton @class="btn-primary backup-with-uploads" @action={{action "startBackupWithUploads"}} @label={{this.yesLabel}} />
<DButton @class="backup-no-uploads" @action={{action "startBackupWithoutUploads"}} @label="admin.backups.operations.backup.without_uploads" />
<DButton @class="btn-default" @action={{action "cancel"}} @label="no_value" />
</DModalBody>

View File

@ -2136,6 +2136,7 @@ backups:
include_s3_uploads_in_backups:
default: false
hidden: true
client: true
search:
use_pg_headlines_for_excerpt: