|
105 | 105 | <NcCheckboxRadioSwitch :checked.sync="isPasswordProtected" :disabled="isPasswordEnforced"> |
106 | 106 | {{ t('files_sharing', 'Set password') }} |
107 | 107 | </NcCheckboxRadioSwitch> |
108 | | - <NcInputField v-if="isPasswordProtected" |
109 | | - :type="hasUnsavedPassword ? 'text' : 'password'" |
110 | | - :value="hasUnsavedPassword ? share.newPassword : '***************'" |
| 108 | + <NcPasswordField v-if="isPasswordProtected" |
| 109 | + :value="hasUnsavedPassword ? share.newPassword : ''" |
111 | 110 | :error="passwordError" |
| 111 | + :helper-text="errorPasswordLabel" |
112 | 112 | :required="isPasswordEnforced" |
113 | 113 | :label="t('files_sharing', 'Password')" |
114 | 114 | @update:value="onPasswordChange" /> |
@@ -219,8 +219,8 @@ import { getLanguage } from '@nextcloud/l10n' |
219 | 219 |
|
220 | 220 | import NcButton from '@nextcloud/vue/dist/Components/NcButton.js' |
221 | 221 | import NcInputField from '@nextcloud/vue/dist/Components/NcInputField.js' |
| 222 | +import NcPasswordField from '@nextcloud/vue/dist/Components/NcPasswordField.js' |
222 | 223 | import NcAvatar from '@nextcloud/vue/dist/Components/NcAvatar.js' |
223 | | -import NcDateTimePicker from '@nextcloud/vue/dist/Components/NcDateTimePicker.js' |
224 | 224 | import NcDateTimePickerNative from '@nextcloud/vue/dist/Components/NcDateTimePickerNative.js' |
225 | 225 | import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js' |
226 | 226 | import NcLoadingIcon from '@nextcloud/vue/dist/Components/NcLoadingIcon.js' |
@@ -256,7 +256,7 @@ export default { |
256 | 256 | NcAvatar, |
257 | 257 | NcButton, |
258 | 258 | NcInputField, |
259 | | - NcDateTimePicker, |
| 259 | + NcPasswordField, |
260 | 260 | NcDateTimePickerNative, |
261 | 261 | NcCheckboxRadioSwitch, |
262 | 262 | NcLoadingIcon, |
@@ -646,6 +646,12 @@ export default { |
646 | 646 | advancedControlExpandedValue() { |
647 | 647 | return this.advancedSectionAccordionExpanded ? 'true' : 'false' |
648 | 648 | }, |
| 649 | + errorPasswordLabel() { |
| 650 | + if (this.passwordError) { |
| 651 | + return t('files_sharing', "Password field can't be empty") |
| 652 | + } |
| 653 | + return undefined |
| 654 | + }, |
649 | 655 | }, |
650 | 656 | watch: { |
651 | 657 | setCustomPermissions(isChecked) { |
|
0 commit comments