Skip to content

Commit

Permalink
Hide expiration date field for remote shares
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
PVince81 authored and npmbuildbot-nextcloud[bot] committed Mar 10, 2021
1 parent 45cc358 commit ff95956
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion apps/files_sharing/js/dist/files_sharing_tab.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

18 changes: 14 additions & 4 deletions apps/files_sharing/src/components/SharingEntry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
},

/**
Expand Down

0 comments on commit ff95956

Please sign in to comment.