summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorfenn-cs <fenn25.fn@gmail.com>2023-09-26 08:22:43 +0100
committerfenn-cs <fenn25.fn@gmail.com>2023-10-09 15:49:35 +0100
commitfe9258a7c5b46b056a16f9b830b5c87cb8002668 (patch)
treeab32b48675814939e952dab5cbad03c5d07bf8e8 /apps/files_sharing
parente6832ed9320512b0e7d1cc1c9f0b0312157eb15e (diff)
downloadnextcloud-server-fe9258a7c5b46b056a16f9b830b5c87cb8002668.tar.gz
nextcloud-server-fe9258a7c5b46b056a16f9b830b5c87cb8002668.zip
Updates to sharing flow
- Show enforced expiry date for new shares. - Improve quick share dropdown visibility in dark mode. - Prevent expiry date from showing expire for incoming shares. by updating the check for `share.passwordExpirationTime` to equally check for `undefined`. - Move "Download permission/attribute" from custom setting (as it is just another advanced setting and not an actual permission). - Show correct text for upload/editing when "allow public uploads" is enabled or disabled by admin. Signed-off-by: fenn-cs <fenn25.fn@gmail.com>
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/src/components/SharingEntryQuickShareSelect.vue5
-rw-r--r--apps/files_sharing/src/views/SharingDetailsTab.vue52
2 files changed, 27 insertions, 30 deletions
diff --git a/apps/files_sharing/src/components/SharingEntryQuickShareSelect.vue b/apps/files_sharing/src/components/SharingEntryQuickShareSelect.vue
index b89574a2fca..2bf30533b59 100644
--- a/apps/files_sharing/src/components/SharingEntryQuickShareSelect.vue
+++ b/apps/files_sharing/src/components/SharingEntryQuickShareSelect.vue
@@ -238,6 +238,7 @@ export default {
background-color: var(--color-main-background);
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
+ border: 1px solid var(--color-border);
padding: 4px 0;
z-index: 1;
@@ -256,11 +257,11 @@ export default {
text-align: left;
&:hover {
- background-color: #f2f2f2;
+ background-color: var(--color-background-dark);
}
&.selected {
- background-color: #f0f0f0;
+ background-color: var(--color-background-dark);
}
}
}
diff --git a/apps/files_sharing/src/views/SharingDetailsTab.vue b/apps/files_sharing/src/views/SharingDetailsTab.vue
index e5703a54253..c102a1f1d97 100644
--- a/apps/files_sharing/src/views/SharingDetailsTab.vue
+++ b/apps/files_sharing/src/views/SharingDetailsTab.vue
@@ -34,8 +34,16 @@
type="radio"
button-variant-grouped="vertical"
@update:checked="toggleCustomPermissions">
- <EditIcon :size="20" />
- <span>{{ t('files_sharing', 'Allow upload and editing') }}</span>
+ <template v-if="allowsFileDrop">
+ {{ t('files_sharing', 'Allow upload and editing') }}
+ </template>
+ <template v-else>
+ {{ t('files_sharing', 'Allow editing') }}
+ </template>
+
+ <template #icon>
+ <EditIcon :size="20" />
+ </template>
</NcCheckboxRadioSwitch>
<NcCheckboxRadioSwitch v-if="allowsFileDrop"
:button-variant="true"
@@ -124,6 +132,9 @@
@update:checked="onPasswordProtectedByTalkChange">
{{ t('file_sharing', 'Video verification') }}
</NcCheckboxRadioSwitch>
+ <NcCheckboxRadioSwitch v-if="!isPublicShare" :disabled="!canSetDownload" :checked.sync="canDownload">
+ {{ t('file_sharing', 'Allow download') }}
+ </NcCheckboxRadioSwitch>
<NcCheckboxRadioSwitch :checked.sync="writeNoteToRecipientIsChecked">
{{ t('file_sharing', 'Note to recipient') }}
</NcCheckboxRadioSwitch>
@@ -149,9 +160,6 @@
:checked.sync="canReshare">
{{ t('file_sharing', 'Share') }}
</NcCheckboxRadioSwitch>
- <NcCheckboxRadioSwitch v-if="!isPublicShare" :disabled="!canSetDownload" :checked.sync="canDownload">
- {{ t('file_sharing', 'Download') }}
- </NcCheckboxRadioSwitch>
<NcCheckboxRadioSwitch :disabled="!canSetDelete" :checked.sync="canDelete">
{{ t('file_sharing', 'Delete') }}
</NcCheckboxRadioSwitch>
@@ -531,7 +539,7 @@ export default {
return this.share.newPassword !== undefined
},
passwordExpirationTime() {
- if (this.share.passwordExpirationTime === null) {
+ if (!this.isValidShareAttribute(this.share.passwordExpirationTime)) {
return null
}
@@ -618,9 +626,6 @@ export default {
if (hasPermissions(this.share.permissions, ATOMIC_PERMISSIONS.SHARE)) {
perms.push('share')
}
- if (this.share.hasDownloadPermission) {
- perms.push('download')
- }
const capitalizeFirstAndJoin = array => array.map((item, index) => index === 0 ? item[0].toUpperCase() + item.substring(1) : item).join(', ')
return capitalizeFirstAndJoin(perms)
@@ -676,34 +681,24 @@ export default {
this.setCustomPermissions = isCustomPermissions
},
async initializeAttributes() {
- let hasAdvancedAttributes = false
if (this.isNewShare) {
if (this.isPasswordEnforced && this.isPublicShare) {
this.share.newPassword = await GeneratePassword()
this.advancedSectionAccordionExpanded = true
}
+ if (this.hasExpirationDate) {
+ this.share.expireDate = this.defaultExpiryDate
+ this.advancedSectionAccordionExpanded = true
+ }
return
}
- if (this.isValidShareAttribute(this.share.note)) {
- this.writeNoteToRecipientIsChecked = true
- hasAdvancedAttributes = true
- }
-
- if (this.isValidShareAttribute(this.share.password)) {
- hasAdvancedAttributes = true
- }
-
- if (this.isValidShareAttribute(this.share.expireDate)) {
- hasAdvancedAttributes = true
- }
-
- if (this.isValidShareAttribute(this.share.label)) {
- hasAdvancedAttributes = true
- }
-
- if (hasAdvancedAttributes) {
+ if (
+ this.isValidShareAttribute(this.share.password)
+ || this.isValidShareAttribute(this.share.expireDate)
+ || this.isValidShareAttribute(this.share.label)
+ ) {
this.advancedSectionAccordionExpanded = true
}
@@ -1028,6 +1023,7 @@ export default {
flex-direction: column;
justify-content: space-between;
align-items: flex-start;
+ background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--color-main-background));
>button:first-child {
color: rgb(223, 7, 7);