Skip to content

Commit 57f5bdf

Browse files
committed
WIP : Further polish sharing flow
Signed-off-by: fenn-cs <[email protected]>
1 parent 09b1c85 commit 57f5bdf

File tree

1 file changed

+16
-22
lines changed

1 file changed

+16
-22
lines changed

apps/files_sharing/src/views/SharingDetailsTab.vue

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@
142142
{{ t('file_sharing', 'Custom permissions') }}
143143
</NcCheckboxRadioSwitch>
144144
<section v-if="setCustomPermissions" class="custom-permissions-group">
145-
<NcCheckboxRadioSwitch :disabled="!allowsFileDrop && share.type === SHARE_TYPES.SHARE_TYPE_LINK" :checked.sync="hasRead">
145+
<NcCheckboxRadioSwitch :disabled="!allowsFileDrop && share.type === SHARE_TYPES.SHARE_TYPE_LINK"
146+
:checked.sync="hasRead">
146147
{{ t('file_sharing', 'Read') }}
147148
</NcCheckboxRadioSwitch>
148149
<NcCheckboxRadioSwitch v-if="isFolder" :disabled="!canSetCreate" :checked.sync="canCreate">
@@ -151,7 +152,9 @@
151152
<NcCheckboxRadioSwitch :disabled="!canSetEdit" :checked.sync="canEdit">
152153
{{ t('file_sharing', 'Update') }}
153154
</NcCheckboxRadioSwitch>
154-
<NcCheckboxRadioSwitch v-if="config.isResharingAllowed && share.type !== SHARE_TYPES.SHARE_TYPE_LINK" :disabled="!canSetReshare" :checked.sync="canReshare">
155+
<NcCheckboxRadioSwitch v-if="config.isResharingAllowed && share.type !== SHARE_TYPES.SHARE_TYPE_LINK"
156+
:disabled="!canSetReshare"
157+
:checked.sync="canReshare">
155158
{{ t('file_sharing', 'Share') }}
156159
</NcCheckboxRadioSwitch>
157160
<NcCheckboxRadioSwitch v-if="!isPublicShare" :disabled="!canSetDownload" :checked.sync="canDownload">
@@ -673,7 +676,7 @@ export default {
673676
}
674677
},
675678
expandCustomPermissions() {
676-
if (!this.advancedSectionAccordionExpanded) {
679+
if (!this.advancedSectionAccordionExpanded) {
677680
this.advancedSectionAccordionExpanded = true
678681
}
679682
this.toggleCustomPermissions()
@@ -684,34 +687,24 @@ export default {
684687
this.setCustomPermissions = isCustomPermissions
685688
},
686689
async initializeAttributes() {
687-
let hasAdvancedAttributes = false
688690
689691
if (this.isNewShare) {
690692
if (this.isPasswordEnforced && this.isPublicShare) {
691693
this.share.newPassword = await GeneratePassword()
692694
this.advancedSectionAccordionExpanded = true
693695
}
696+
if (this.hasExpirationDate) {
697+
this.share.expireDate = this.defaultExpiryDate
698+
this.advancedSectionAccordionExpanded = true
699+
}
694700
return
695701
}
696702
697-
if (this.isValidShareAttribute(this.share.note)) {
698-
this.writeNoteToRecipientIsChecked = true
699-
hasAdvancedAttributes = true
700-
}
701-
702-
if (this.isValidShareAttribute(this.share.password)) {
703-
hasAdvancedAttributes = true
704-
}
705-
706-
if (this.isValidShareAttribute(this.share.expireDate)) {
707-
hasAdvancedAttributes = true
708-
}
709-
710-
if (this.isValidShareAttribute(this.share.label)) {
711-
hasAdvancedAttributes = true
712-
}
713-
714-
if (hasAdvancedAttributes) {
703+
if (
704+
this.isValidShareAttribute(this.share.password)
705+
|| this.isValidShareAttribute(this.share.expireDate)
706+
|| this.isValidShareAttribute(this.share.label)
707+
) {
715708
this.advancedSectionAccordionExpanded = true
716709
}
717710
@@ -1017,6 +1010,7 @@ export default {
10171010
&__delete {
10181011
>button:first-child {
10191012
color: rgb(223, 7, 7);
1013+
background: linear-gradient(to top, rgba(255, 255, 255, 0), var(--color-main-background));
10201014
}
10211015
}
10221016

0 commit comments

Comments
 (0)