From 64ffceb4384c19d15d138ea3adb616094e054756 Mon Sep 17 00:00:00 2001 From: Arpit Jalan Date: Sun, 15 Feb 2015 22:13:28 +0530 Subject: [PATCH] UX: add confirmation dialog for user archive export --- .../javascripts/discourse/controllers/user.js.es6 | 11 ++++++++++- config/locales/client.en.yml | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/controllers/user.js.es6 b/app/assets/javascripts/discourse/controllers/user.js.es6 index b06636277..e3a055627 100644 --- a/app/assets/javascripts/discourse/controllers/user.js.es6 +++ b/app/assets/javascripts/discourse/controllers/user.js.es6 @@ -69,7 +69,16 @@ export default ObjectController.extend(CanCheckEmails, { }, exportUserArchive: function() { - Discourse.ExportCsv.exportUserArchive(); + bootbox.confirm( + I18n.t("admin.export_csv.user_archive_confirm"), + I18n.t("no_value"), + I18n.t("yes_value"), + function(confirmed) { + if (confirmed) { + Discourse.ExportCsv.exportUserArchive(); + } + } + ); } } }); diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 0d89d9b01..705331a26 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -1729,6 +1729,7 @@ en: confirm: "Are your sure you want to rollback the database to the previous working state?" export_csv: + user_archive_confirm: "Are you sure you want to download your posts?" success: "Export initiated, you will be notified via private message when the process is complete." failed: "Export failed. Please check the logs." rate_limit_error: "Posts can be downloaded once per day, please try again tomorrow."