Skip to content

Commit

Permalink
Replace input filed with password field and added password error message
Browse files Browse the repository at this point in the history
Remove unneeded NcDateTimePicker

Signed-off-by: julia.kirschenheuter <[email protected]>

(cherry picked from commit 696545b)
Signed-off-by: julia.kirschenheuter <[email protected]>
  • Loading branch information
JuliaKirschenheuter authored and AndyScherzinger committed Dec 15, 2023
1 parent 49bff0f commit deb40c6
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions apps/files_sharing/src/views/SharingDetailsTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@
<NcCheckboxRadioSwitch :checked.sync="isPasswordProtected" :disabled="isPasswordEnforced">
{{ t('files_sharing', 'Set password') }}
</NcCheckboxRadioSwitch>
<NcInputField v-if="isPasswordProtected"
:type="hasUnsavedPassword ? 'text' : 'password'"
:value="hasUnsavedPassword ? share.newPassword : '***************'"
<NcPasswordField v-if="isPasswordProtected"
:value="hasUnsavedPassword ? share.newPassword : ''"
:error="passwordError"
:helper-text="errorPasswordLabel"
:required="isPasswordEnforced"
:label="t('files_sharing', 'Password')"
@update:value="onPasswordChange" />
Expand Down Expand Up @@ -219,8 +219,8 @@ import { getLanguage } from '@nextcloud/l10n'
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import NcInputField from '@nextcloud/vue/dist/Components/NcInputField.js'
import NcPasswordField from '@nextcloud/vue/dist/Components/NcPasswordField.js'
import NcAvatar from '@nextcloud/vue/dist/Components/NcAvatar.js'
import NcDateTimePicker from '@nextcloud/vue/dist/Components/NcDateTimePicker.js'
import NcDateTimePickerNative from '@nextcloud/vue/dist/Components/NcDateTimePickerNative.js'
import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js'
import NcLoadingIcon from '@nextcloud/vue/dist/Components/NcLoadingIcon.js'
Expand Down Expand Up @@ -256,7 +256,7 @@ export default {
NcAvatar,
NcButton,
NcInputField,
NcDateTimePicker,
NcPasswordField,
NcDateTimePickerNative,
NcCheckboxRadioSwitch,
NcLoadingIcon,
Expand Down Expand Up @@ -646,6 +646,12 @@ export default {
advancedControlExpandedValue() {
return this.advancedSectionAccordionExpanded ? 'true' : 'false'
},
errorPasswordLabel() {
if (this.passwordError) {
return t('files_sharing', "Password field can't be empty")
}
return undefined
},
},
watch: {
setCustomPermissions(isChecked) {
Expand Down

0 comments on commit deb40c6

Please sign in to comment.