aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornfebe <fenn25.fn@gmail.com>2024-11-11 15:55:25 +0100
committernfebe <fenn25.fn@gmail.com>2024-12-03 15:25:22 +0100
commitb3740550e291f6914381545070078374965fb56f (patch)
tree26f9c683c43f479324a5da127bbd11e88ec797ed
parent220fffc9b1f0384e4b25f890eddda449d262c769 (diff)
downloadnextcloud-server-fix/48829/visual-feedback-4-encryption-toggle.tar.gz
nextcloud-server-fix/48829/visual-feedback-4-encryption-toggle.zip
fix(settings): Show feedback 4 server-sde encryption togglefix/48829/visual-feedback-4-encryption-toggle
Show visual feedback if user clicks on encryption toggle when it cannot be activated. Signed-off-by: nfebe <fenn25.fn@gmail.com>
-rw-r--r--apps/settings/src/components/Encryption.vue10
1 files changed, 8 insertions, 2 deletions
diff --git a/apps/settings/src/components/Encryption.vue b/apps/settings/src/components/Encryption.vue
index 060be3fc5eb..fe3985b020c 100644
--- a/apps/settings/src/components/Encryption.vue
+++ b/apps/settings/src/components/Encryption.vue
@@ -14,6 +14,10 @@
{{ t('settings', 'Enable server-side encryption') }}
</NcCheckboxRadioSwitch>
+ <div v-if="!hasEncryptionModules || !encryptionReady" class="notecard warning" role="alert">
+ <p>{{ t('settings', 'Encryption is not available. Please enable the Encryption app or an encryption module.') }}</p>
+ </div>
+
<div v-if="shouldDisplayWarning && !encryptionEnabled" class="notecard warning" role="alert">
<p>{{ t('settings', 'Please read carefully before activating server-side encryption:') }}</p>
<ul>
@@ -34,7 +38,7 @@
<div v-if="encryptionEnabled">
<div v-if="encryptionReady">
- <p v-if="encryptionModules.length === 0">
+ <p v-if="!hasEncryptionModules">
{{ t('settings', 'No encryption module loaded, please enable an encryption module in the app menu.') }}
</p>
<template v-else>
@@ -89,8 +93,9 @@ export default {
},
data() {
const encryptionModules = loadState('settings', 'encryption-modules')
+ const hasEncryptionModules = encryptionModules instanceof Array && encryptionModules.length > 0
let defaultCheckedModule = ''
- if (encryptionModules instanceof Array && encryptionModules.length > 0) {
+ if (hasEncryptionModules) {
const defaultModule = Object.entries(encryptionModules).find((module) => module[1].default)
if (defaultModule) {
defaultCheckedModule = foundModule[0]
@@ -107,6 +112,7 @@ export default {
shouldDisplayWarning: false,
migrating: false,
defaultCheckedModule,
+ hasEncryptionModules,
}
},
methods: {