Skip to content

Commit

Permalink
Merge pull request #26026 from nextcloud/backport/25933/stable21
Browse files Browse the repository at this point in the history
[stable21] Hide expiration date field for remote shares
  • Loading branch information
rullzer authored Mar 10, 2021
2 parents f94c691 + ff95956 commit cc48b81
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 cc48b81

Please sign in to comment.