Skip to content

Commit

Permalink
WIP : Further polish sharing flow
Browse files Browse the repository at this point in the history
Signed-off-by: fenn-cs <[email protected]>
  • Loading branch information
nfebe committed Sep 26, 2023
1 parent 09b1c85 commit 57f5bdf
Showing 1 changed file with 16 additions and 22 deletions.
38 changes: 16 additions & 22 deletions apps/files_sharing/src/views/SharingDetailsTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,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 @@ -151,7 +152,9 @@
<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">
Expand Down Expand Up @@ -673,7 +676,7 @@ export default {
}
},
expandCustomPermissions() {
if (!this.advancedSectionAccordionExpanded) {
if (!this.advancedSectionAccordionExpanded) {
this.advancedSectionAccordionExpanded = true
}
this.toggleCustomPermissions()
Expand All @@ -684,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 @@ -1017,6 +1010,7 @@ export default {
&__delete {
>button:first-child {
color: rgb(223, 7, 7);
background: linear-gradient(to top, rgba(255, 255, 255, 0), var(--color-main-background));
}
}
Expand Down

0 comments on commit 57f5bdf

Please sign in to comment.