Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
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 <[email protected]>
  • Loading branch information
nfebe committed Oct 2, 2023
commit a092bae72008ac0fa6297013ae4ba86a1827fc93
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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);
}
}
}
Expand Down
57 changes: 27 additions & 30 deletions apps/files_sharing/src/views/SharingDetailsTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,13 @@
type="radio"
button-variant-grouped="vertical"
@update:checked="toggleCustomPermissions">
{{ t('files_sharing', 'Allow upload and editing') }}
<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>
Expand Down Expand Up @@ -132,6 +138,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>
Expand All @@ -145,7 +154,8 @@
{{ t('file_sharing', 'Custom permissions') }}
</NcCheckboxRadioSwitch>
<section v-if="setCustomPermissions" class="custom-permissions-group">
<NcCheckboxRadioSwitch :disabled="!allowsFileDrop && share.type === SHARE_TYPES.SHARE_TYPE_LINK" :checked.sync="hasRead">
<NcCheckboxRadioSwitch :disabled="!allowsFileDrop && share.type === SHARE_TYPES.SHARE_TYPE_LINK"
:checked.sync="hasRead">
{{ t('file_sharing', 'Read') }}
</NcCheckboxRadioSwitch>
<NcCheckboxRadioSwitch v-if="isFolder" :disabled="!canSetCreate" :checked.sync="canCreate">
Expand All @@ -154,12 +164,11 @@
<NcCheckboxRadioSwitch :disabled="!canSetEdit" :checked.sync="canEdit">
{{ t('file_sharing', 'Update') }}
</NcCheckboxRadioSwitch>
<NcCheckboxRadioSwitch v-if="config.isResharingAllowed && share.type !== SHARE_TYPES.SHARE_TYPE_LINK" :disabled="!canSetReshare" :checked.sync="canReshare">
<NcCheckboxRadioSwitch v-if="config.isResharingAllowed && share.type !== SHARE_TYPES.SHARE_TYPE_LINK"
:disabled="!canSetReshare"
: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>
Expand Down Expand Up @@ -542,7 +551,7 @@ export default {
return this.share.newPassword !== undefined
},
passwordExpirationTime() {
if (this.share.passwordExpirationTime === null) {
if (!this.isValidShareAttribute(this.share.passwordExpirationTime)) {
return null
}

Expand Down Expand Up @@ -629,9 +638,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)
Expand Down Expand Up @@ -676,7 +682,7 @@ export default {
}
},
expandCustomPermissions() {
if (!this.advancedSectionAccordionExpanded) {
if (!this.advancedSectionAccordionExpanded) {
this.advancedSectionAccordionExpanded = true
}
this.toggleCustomPermissions()
Expand All @@ -687,34 +693,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
}

Expand Down Expand Up @@ -1031,6 +1027,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-group {
display: flex;
Expand Down
2 changes: 2 additions & 0 deletions dist/3609-3609.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/3609-3609.js.map

Large diffs are not rendered by default.

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

This file was deleted.

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

This file was deleted.

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

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions dist/5912-5912.js

This file was deleted.

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

This file was deleted.

2 changes: 0 additions & 2 deletions dist/6678-6678.js

This file was deleted.

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

This file was deleted.

2 changes: 2 additions & 0 deletions dist/6870-6870.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/6870-6870.js.map

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/comments-comments-app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/comments-comments-app.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/comments-init.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/comments-init.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/core-common.js

Large diffs are not rendered by default.

18 changes: 16 additions & 2 deletions dist/core-common.js.LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@
* @license MIT
*/

/*!
* Sizzle CSS Selector Engine v2.3.10
* https://sizzlejs.com/
*
* Copyright JS Foundation and other contributors
* Released under the MIT license
* https://js.foundation/
*
* Date: 2023-02-14
*/

/*!
* The buffer module from node.js, for the browser.
*
Expand Down Expand Up @@ -42,14 +53,17 @@
*/

/*!
* jQuery JavaScript Library v3.7.1
* jQuery JavaScript Library v3.6.4
* https://jquery.com/
*
* Includes Sizzle.js
* https://sizzlejs.com/
*
* Copyright OpenJS Foundation and other contributors
* Released under the MIT license
* https://jquery.org/license
*
* Date: 2023-08-28T13:37Z
* Date: 2023-03-08T15:28Z
*/

/*!
Expand Down
2 changes: 1 addition & 1 deletion dist/core-common.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/core-login.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-login.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/core-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-main.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/core-profile.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-profile.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/core-unified-search.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-unified-search.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/core-unsupported-browser-redirect.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-unsupported-browser-redirect.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/core-unsupported-browser.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-unsupported-browser.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/dav-settings-personal-availability.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/dav-settings-personal-availability.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/federatedfilesharing-vue-settings-admin.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/federatedfilesharing-vue-settings-admin.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/federatedfilesharing-vue-settings-personal.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/federatedfilesharing-vue-settings-personal.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/files-init.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files-init.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/files-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files-main.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/files-personal-settings.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files-personal-settings.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/files-reference-files.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files-reference-files.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/files-sidebar.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files-sidebar.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/files_external-init.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files_external-init.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/files_reminders-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files_reminders-main.js.map

Large diffs are not rendered by default.

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.

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

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/files_trashbin-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files_trashbin-main.js.map

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

Loading