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 <julia.kirschenheuter@nextcloud.com>
  • Loading branch information
JuliaKirschenheuter committed Dec 8, 2023
1 parent cdb6f37 commit 696545b
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 12 deletions.
16 changes: 11 additions & 5 deletions apps/files_sharing/src/views/SharingDetailsTab.vue
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
3 changes: 3 additions & 0 deletions dist/3638-3638.js

Large diffs are not rendered by default.

File renamed without changes.
1 change: 1 addition & 0 deletions dist/3638-3638.js.map

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions dist/5211-5211.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/5211-5211.js.map

This file was deleted.

4 changes: 2 additions & 2 deletions dist/files_sharing-files_sharing_tab.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files_sharing-files_sharing_tab.js.map

Large diffs are not rendered by default.

0 comments on commit 696545b

Please sign in to comment.