Skip to content

Commit

Permalink
Confirm before deleting a project.
Browse files Browse the repository at this point in the history
  • Loading branch information
louim authored and simonprev committed Jun 29, 2018
1 parent 399dc3a commit 15e53ec
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion webapp/app/locales/en/translations.js
Expand Up @@ -333,7 +333,8 @@ export default {
title: 'Danger zone',
delete_project_title: 'Delete this project',
delete_project_text: 'Once you delete a project, there is no going back.',
delete_project_button: 'Delete this project'
delete_project_button: 'Delete this project',
delete_project_confirm: 'Are you sure you want to delete this project? This action cannot be undone.'
},
form: {
update_button: 'Update project',
Expand Down
@@ -1,11 +1,18 @@
import Component from '@ember/component';
import {inject as service} from '@ember/service';

// Attributes
// project: Object <project>
// onSubmit: Function
export default Component.extend({
i18n: service(),

actions: {
deleteProject() {
/* eslint-disable no-alert */
if (!window.confirm(this.i18n.t('components.project_settings.delete_form.delete_project_confirm'))) return;
/* eslint-enable no-alert */

this.onSubmit();
}
}
Expand Down

0 comments on commit 15e53ec

Please sign in to comment.