diff --git a/src/Volo.Abp.Identity.Web/Pages/Identity/Users/Index.cshtml b/src/Volo.Abp.Identity.Web/Pages/Identity/Users/Index.cshtml index 7b06303c4c..fe35f568f5 100644 --- a/src/Volo.Abp.Identity.Web/Pages/Identity/Users/Index.cshtml +++ b/src/Volo.Abp.Identity.Web/Pages/Identity/Users/Index.cshtml @@ -10,10 +10,10 @@ @section scripts { + - } diff --git a/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/helpers/ModalManager.js b/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/helpers/ModalManager.js index 94026f26da..997e14cc08 100644 --- a/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/helpers/ModalManager.js +++ b/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/helpers/ModalManager.js @@ -31,6 +31,12 @@ $.validator.defaults.ignore = ''; //TODO: Would be better if we can apply only f return function (options) { + if (typeof options === 'string') { + options = { + viewUrl: options + }; + } + var _options = options; var _$modalContainer = null; diff --git a/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/users/index.js b/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/users/index.js index e9149a34c6..f362a313bb 100644 --- a/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/users/index.js +++ b/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/users/index.js @@ -3,13 +3,8 @@ var l = abp.localization.getResource('AbpIdentity'); var _identityUserAppService = volo.abp.identity.identityUser; - var _editModal = new abp.ModalManager({ - viewUrl: abp.appPath + 'Identity/Users/EditModal' - }); - - var _createModal = new abp.ModalManager({ - viewUrl: abp.appPath + 'Identity/Users/CreateModal' - }); + var _editModal = new abp.ModalManager(abp.appPath + 'Identity/Users/EditModal'); + var _createModal = new abp.ModalManager(abp.appPath + 'Identity/Users/CreateModal'); var app = new Vue({ el: '#IdentityUsersWrapper', @@ -30,42 +25,44 @@ ajax: abp.libs.datatables.createAjax(_identityUserAppService.getList), columnDefs: [ { + //TODO: Can we eleminate targets, data, orderable, autoWidth, defaultContent fields or make these values default targets: 0, data: null, orderable: false, autoWidth: false, defaultContent: '', rowAction: { - text: ' ' + l('Actions') + ' ', + text: ' ' + l('Actions') + ' ', //TODO: Add icon option and set text as only l('Actions') items: - [ - { - text: l('Edit'), - visible: function () { - return true; - }, - action: function (data) { - _editModal.open({ - id: data.record.id - }); - } - }, - { - text: l('Delete'), - visible: function () { - return true; + [ + { + //TODO: Allow to add icon + text: l('Edit'), + visible: function () { //TODO: Allow visible to be a boolean for simple cases + return true; + }, + action: function (data) { + _editModal.open({ + id: data.record.id + }); + } }, - action: function (data) { - if (confirm(l('UserDeletionConfirmationMessage', data.record.userName))) { - _identityUserAppService - .delete(data.record.id) - .then(function () { - _dataTable.ajax.reload(); - }); + { + text: l('Delete'), + visible: function () { + return true; + }, + action: function (data) { + if (confirm(l('UserDeletionConfirmationMessage', data.record.userName))) { + _identityUserAppService + .delete(data.record.id) + .then(function () { + _dataTable.ajax.reload(); + }); + } } } - } - ] + ] } }, { @@ -81,7 +78,7 @@ data: "phoneNumber" } ] - }); + }); _createModal.onResult(function () { _dataTable.ajax.reload();