cartodb-4.42/lib/assets/javascripts/dashboard/views/organization/delete-organization-user-view.js

46 lines
1.1 KiB
JavaScript
Raw Normal View History

2024-04-06 13:25:13 +08:00
const CoreView = require('backbone/core-view');
const template = require('./delete-organization-user.tpl');
const checkAndBuildOpts = require('builder/helpers/required-opts');
const REQUIRED_OPTS = [
'modalModel',
'configModel',
'passwordNeeded',
'organizationUser',
'authenticityToken'
];
module.exports = CoreView.extend({
events: {
'click .js-cancel': '_closeDialog',
'submit .js-form': '_closeDialog'
},
options: {
authenticityToken: '',
organizationUser: {}
},
initialize: function (options) {
checkAndBuildOpts(options, REQUIRED_OPTS, this);
CoreView.prototype.initialize.apply(this);
},
render: function () {
this.$el.html(template({
username: this._organizationUser.get('username'),
formAction: `${this._configModel.prefixUrl()}/organization/users/${this._organizationUser.get('username')}`,
authenticityToken: this._authenticityToken,
passwordNeeded: this._passwordNeeded
}));
return this;
},
_closeDialog: function () {
if (this._modalModel) {
this._modalModel.destroy();
}
}
});