Hide expiration date field for remote shares

Remote shares currently do not support expiration date.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Signed-off-by: npmbuildbot-nextcloud[bot] <npmbuildbot-nextcloud[bot]@users.noreply.github.com>
This commit is contained in:
Vincent Petry 2021-03-04 16:35:30 +01:00 committed by npmbuildbot-nextcloud[bot]
parent 45cc358d79
commit ff95956e5d
3 changed files with 16 additions and 6 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -84,14 +84,16 @@
</ActionCheckbox>
<!-- expiration date -->
<ActionCheckbox :checked.sync="hasExpirationDate"
<ActionCheckbox
v-if="canHaveExpirationDate"
:checked.sync="hasExpirationDate"
:disabled="config.isDefaultInternalExpireDateEnforced || saving"
@uncheck="onExpirationDisable">
{{ config.isDefaultInternalExpireDateEnforced
? t('files_sharing', 'Expiration date enforced')
: t('files_sharing', 'Set expiration date') }}
</ActionCheckbox>
<ActionInput v-if="hasExpirationDate"
<ActionInput v-if="canHaveExpirationDate && hasExpirationDate"
ref="expireDate"
v-tooltip.auto="{
content: errors.expireDate,
@ -222,8 +224,16 @@ export default {
},
canHaveNote() {
return this.share.type !== this.SHARE_TYPES.SHARE_TYPE_REMOTE
&& this.share.type !== this.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP
return !this.isRemoteShare
},
canHaveExpirationDate() {
return !this.isRemoteShare
},
isRemoteShare() {
return this.share.type === this.SHARE_TYPES.SHARE_TYPE_REMOTE
|| this.share.type === this.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP
},
/**