Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
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
64 changes: 33 additions & 31 deletions apps/files_sharing/src/views/SharingDetailsTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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>
Expand All @@ -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>
Expand Down Expand Up @@ -360,13 +368,19 @@ export default {
*/
hasExpirationDate: {
get() {
const isDefaultExpireDateEnabled = this.config.isDefaultExpireDateEnabled
const hasExistingExpirationDate = !!this.share.expireDate || isDefaultExpireDateEnabled
const isDefaultInternalExpireDateEnabled = this.config.isDefaultInternalExpireDateEnabled
const isDefaultRemoteExpireDateEnabled = this.config.isDefaultRemoteExpireDateEnabled
if (this.isPublicShare) {
return !!this.share.expireDate || this.config.isDefaultExpireDateEnforced
return hasExistingExpirationDate
}

if (this.isRemoteShare) {
return !!this.share.expireDate || this.config.isDefaultInternalExpireDateEnforced || this.config.isDefaultExpireDateEnforced
return hasExistingExpirationDate || isDefaultRemoteExpireDateEnabled
}
return !!this.share.expireDate || this.config.isDefaultInternalExpireDateEnforced || this.config.isDefaultExpireDateEnforced

return hasExistingExpirationDate || isDefaultInternalExpireDateEnabled
},
set(enabled) {
this.share.expireDate = enabled
Expand Down Expand Up @@ -531,7 +545,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 @@ -618,9 +632,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,34 +687,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 @@ -1028,6 +1029,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);
Expand Down
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.