Skip to content

Commit f1b3336

Browse files
committed
WIP : Further polish 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` Signed-off-by: fenn-cs <fenn25.fn@gmail.com>
1 parent 09b1c85 commit f1b3336

2 files changed

Lines changed: 21 additions & 25 deletions

File tree

apps/files_sharing/src/components/SharingEntryQuickShareSelect.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ export default {
238238
background-color: var(--color-main-background);
239239
border-radius: 8px;
240240
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
241+
border: 1px solid var(--color-border);
241242
padding: 4px 0;
242243
z-index: 1;
243244
@@ -256,11 +257,11 @@ export default {
256257
text-align: left;
257258
258259
&:hover {
259-
background-color: #f2f2f2;
260+
background-color: var(--color-background-dark);
260261
}
261262
262263
&.selected {
263-
background-color: #f0f0f0;
264+
background-color: var(--color-background-dark);
264265
}
265266
}
266267
}

apps/files_sharing/src/views/SharingDetailsTab.vue

Lines changed: 18 additions & 23 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">
@@ -539,7 +542,7 @@ export default {
539542
return this.share.newPassword !== undefined
540543
},
541544
passwordExpirationTime() {
542-
if (this.share.passwordExpirationTime === null) {
545+
if (!this.isValidShareAttribute(this.share.passwordExpirationTime)) {
543546
return null
544547
}
545548
@@ -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 bottom, rgba(255, 255, 255, 0), var(--color-border));
10201014
}
10211015
}
10221016
@@ -1028,6 +1022,7 @@ export default {
10281022
flex-direction: column;
10291023
justify-content: space-between;
10301024
align-items: flex-start;
1025+
background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--color-primary-light));
10311026
10321027
.button-group {
10331028
display: flex;

0 commit comments

Comments
 (0)