diff --git a/apps/settings/js/vue-6.js b/apps/settings/js/vue-6.js index ebe10cb405f140b66e68522eb75ea5c1553cd6f7..65bc6d458948929a7032d7c1e96a658205c09293 100644 Binary files a/apps/settings/js/vue-6.js and b/apps/settings/js/vue-6.js differ diff --git a/apps/settings/js/vue-6.js.map b/apps/settings/js/vue-6.js.map index a466334dd331399b670ab3124cae2fb70e2f25bf..b41d77bd0c0dd39629d4b1b23e9daf59277985dc 100644 Binary files a/apps/settings/js/vue-6.js.map and b/apps/settings/js/vue-6.js.map differ diff --git a/apps/settings/js/vue-settings-apps-users-management.js b/apps/settings/js/vue-settings-apps-users-management.js index 2e1e4da774475880317bab907953c930fd20be30..f0bdec3d432ec7f275840f61ae5706a57cd071cd 100644 Binary files a/apps/settings/js/vue-settings-apps-users-management.js and b/apps/settings/js/vue-settings-apps-users-management.js differ diff --git a/apps/settings/js/vue-settings-apps-users-management.js.map b/apps/settings/js/vue-settings-apps-users-management.js.map index 4a534261794b0e5f9a428a3bc197580b6559e683..75ffefc7eedad818d6000f4d56e1c9ec558915c6 100644 Binary files a/apps/settings/js/vue-settings-apps-users-management.js.map and b/apps/settings/js/vue-settings-apps-users-management.js.map differ diff --git a/apps/settings/src/components/UserList/UserRow.vue b/apps/settings/src/components/UserList/UserRow.vue index c27523dfadf70f68a9ce16aa5f70eb6afb04b161..435f1b8bb7c1d75d17cb4db23d281c1db77a7e1d 100644 --- a/apps/settings/src/components/UserList/UserRow.vue +++ b/apps/settings/src/components/UserList/UserRow.vue @@ -1,7 +1,9 @@ <!-- - @copyright Copyright (c) 2018 John Molakvoæ <skjnldsv@protonmail.com> + - @copyright Copyright (c) 2019 Gary Kim <gary@garykim.dev> - - @author John Molakvoæ <skjnldsv@protonmail.com> + - @author Gary Kim <gary@garykim.dev> - - @license GNU AGPL version 3 or any later version - @@ -428,25 +430,55 @@ export default { }, wipeUserDevices() { - this.loading.wipe = true - this.loading.all = true let userid = this.user.id - return this.$store.dispatch('wipeUserDevices', userid) - .then(() => { - this.loading.wipe = false - this.loading.all = false - }) + OC.dialogs.confirmDestructive( + t('settings', 'In case of lost device or exiting the organization, this can remotely wipe the Nextcloud data from all devices associated with {userid}. Only works if the devices are connected to the internet.', { userid: userid }), + t('settings', 'Remote wipe of devices'), + { + type: OC.dialogs.YES_NO_BUTTONS, + confirm: t('settings', 'Wipe {userid}\'s devices', { userid: userid }), + confirmClasses: 'error', + cancel: t('settings', 'Cancel') + }, + (result) => { + if (result) { + this.loading.wipe = true + this.loading.all = true + this.$store.dispatch('wipeUserDevices', userid) + .then(() => { + this.loading.wipe = false + this.loading.all = false + }) + } + }, + true + ) }, deleteUser() { - this.loading.delete = true - this.loading.all = true let userid = this.user.id - return this.$store.dispatch('deleteUser', userid) - .then(() => { - this.loading.delete = false - this.loading.all = false - }) + OC.dialogs.confirmDestructive( + t('settings', 'Fully delete {userid}\'s account including all their personal files, app data, etc.', { userid: userid }), + t('settings', 'Account deletion'), + { + type: OC.dialogs.YES_NO_BUTTONS, + confirm: t('settings', 'Delete {userid}\'s account', { userid: userid }), + confirmClasses: 'error', + cancel: t('settings', 'Cancel') + }, + (result) => { + if (result) { + this.loading.delete = true + this.loading.all = true + return this.$store.dispatch('deleteUser', userid) + .then(() => { + this.loading.delete = false + this.loading.all = false + }) + } + }, + true + ) }, enableDisableUser() { diff --git a/core/css/inputs.scss b/core/css/inputs.scss index 375a5cdc360b5c49b81b2c92d302bed7563610df..566ce24b646f11bb724d750ebf8d777526a0bcd1 100644 --- a/core/css/inputs.scss +++ b/core/css/inputs.scss @@ -115,6 +115,11 @@ div[contenteditable=true], cursor: default; } } + + &.error { + background-color: var(--color-error) !important; + border-color: var(--color-error); + } } div[contenteditable=false] { diff --git a/core/js/dist/login.js b/core/js/dist/login.js index 2adbb1c4deb2b0fc7afb46b85d5b82d3cb0a1932..36e02c09f381a998ae21cf353823224fd9984844 100644 Binary files a/core/js/dist/login.js and b/core/js/dist/login.js differ diff --git a/core/js/dist/login.js.map b/core/js/dist/login.js.map index c657ac9120ac1771ef770b0d49ac644721a9918c..3eb8f8d55be6b29b63f2fbaa49698ccbf6ced939 100644 Binary files a/core/js/dist/login.js.map and b/core/js/dist/login.js.map differ diff --git a/core/js/dist/main.js b/core/js/dist/main.js index ae6e05b147340a2a3a809d4210a67466cb7fa844..a72d8de139a6028fb0352c4cdb03d0adc10970e0 100644 Binary files a/core/js/dist/main.js and b/core/js/dist/main.js differ diff --git a/core/js/dist/main.js.map b/core/js/dist/main.js.map index 3df49e3547a5ba67a87a29e57035b60438171568..385508af8fe1031fb3153d1739bc8bd6720681f3 100644 Binary files a/core/js/dist/main.js.map and b/core/js/dist/main.js.map differ diff --git a/core/js/dist/maintenance.js b/core/js/dist/maintenance.js index 412261d807c9660e59bfe03aaa8a86c90afabb4a..9d26d68535e29cbe079016271382237bf6f27005 100644 Binary files a/core/js/dist/maintenance.js and b/core/js/dist/maintenance.js differ diff --git a/core/js/dist/maintenance.js.map b/core/js/dist/maintenance.js.map index f9fa46a81dfe2b6e82b2e0bd8ad04950c46cc736..6b5bf8fa3807d0a953f10804c707109e8c747ba9 100644 Binary files a/core/js/dist/maintenance.js.map and b/core/js/dist/maintenance.js.map differ diff --git a/core/src/OC/dialogs.js b/core/src/OC/dialogs.js index abc5b3e1c3a4b237fbd97410f345c38f4bceceeb..8f50a5d06067216531a2ee6d72bf73165fd169fd 100644 --- a/core/src/OC/dialogs.js +++ b/core/src/OC/dialogs.js @@ -2,8 +2,10 @@ /* eslint-disable */ /* * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> + * @copyright Copyright (c) 2019 Gary Kim <gary@garykim.dev> * * @author 2019 Christoph Wurst <christoph@winzerhof-wurst.at> + * @author Gary Kim <gary@garykim.dev> * * @license GNU AGPL version 3 or any later version * @@ -89,6 +91,25 @@ const Dialogs = { modal ) }, + /** + * displays confirmation dialog + * @param {string} text content of dialog + * @param {string} title dialog title + * @param {{type: Int, confirm: String, cancel: String, confirmClasses: String}} buttons text content of buttons + * @param {function} callback which will be triggered when user presses OK (true or false would be passed to callback respectively) + * @param {boolean} [modal] make the dialog modal + * @returns {Promise} + */ + confirmDestructive: function(text, title, buttons, callback, modal) { + return this.message( + text, + title, + 'none', + buttons, + callback, + modal + ) + }, /** * displays confirmation dialog * @param {string} text content of dialog @@ -534,6 +555,34 @@ const Dialogs = { defaultButton: true } break + default: + if (typeof(buttons) === 'object') { + switch (buttons.type) { + case Dialogs.YES_NO_BUTTONS: + buttonlist = [{ + text: buttons.cancel || t('core', 'No'), + click: function() { + if (callback !== undefined) { + callback(false) + } + $(dialogId).ocdialog('close') + } + }, + { + text: buttons.confirm || t('core', 'Yes'), + click: function() { + if (callback !== undefined) { + callback(true) + } + $(dialogId).ocdialog('close') + }, + defaultButton: true, + classes: buttons.confirmClasses + }] + break + } + } + break } $(dialogId).ocdialog({ diff --git a/core/src/jquery/css/jquery-ui-fixes.scss b/core/src/jquery/css/jquery-ui-fixes.scss index b1f7afc188347eb14c9bce1b047c652495741deb..34243062ba67f76e18732be5c23b2fddf2aaa737 100644 --- a/core/src/jquery/css/jquery-ui-fixes.scss +++ b/core/src/jquery/css/jquery-ui-fixes.scss @@ -115,6 +115,9 @@ .ui-state-error-text .ui-icon { background-image: url('images/ui-icons_ffd27a_256x240.png'); } +.ui-icon.ui-icon-none { + display: none; +} /* Misc visuals ----------------------------------*/ @@ -230,4 +233,4 @@ .ui-draggable-handle, .ui-selectable { touch-action: pan-y; -} \ No newline at end of file +} diff --git a/core/src/jquery/css/jquery.ocdialog.scss b/core/src/jquery/css/jquery.ocdialog.scss index 7372f308727c95cbc2ee231b4bbd8385bc7568ae..89653ae181a04ac9764b284c464924d233a755f5 100644 --- a/core/src/jquery/css/jquery.ocdialog.scss +++ b/core/src/jquery/css/jquery.ocdialog.scss @@ -74,6 +74,7 @@ .oc-dialog-content { width: 100%; + max-width: 550px; } .oc-dialog.password-confirmation {