cartodb-4.42/lib/assets/javascripts/dashboard/views/organization/delete-organization-view.js
2024-04-06 05:25:13 +00:00

41 lines
942 B
JavaScript

const CoreView = require('backbone/core-view');
const template = require('./delete-organization.tpl');
const checkAndBuildOpts = require('builder/helpers/required-opts');
const REQUIRED_OPTS = [
'userModel',
'modalModel',
'authenticityToken'
];
/**
* When an organization owner wants to delete the full organization
*
*/
module.exports = CoreView.extend({
options: {
authenticityToken: ''
},
events: {
'click .js-cancel': '_closeDialog',
'submit .js-form': '_closeDialog'
},
initialize: function (options) {
checkAndBuildOpts(options, REQUIRED_OPTS, this);
},
render: function () {
return this.$el.html(template({
formAction: `${this._userModel.get('base_url')}/organization`,
authenticityToken: this._authenticityToken,
passwordNeeded: !!this._userModel.get('needs_password_confirmation')
}));
},
_closeDialog: function () {
this._modalModel.destroy();
}
});