diff options
Diffstat (limited to 'apps')
6 files changed, 78 insertions, 60 deletions
diff --git a/apps/files_sharing/src/components/SharingEntry.vue b/apps/files_sharing/src/components/SharingEntry.vue index d6aaec53cb4..3bf13343517 100644 --- a/apps/files_sharing/src/components/SharingEntry.vue +++ b/apps/files_sharing/src/components/SharingEntry.vue @@ -150,7 +150,6 @@ export default { <style lang="scss" scoped> .sharing-entry { display: flex; - justify-content: space-between; align-items: center; height: 44px; &__summary { @@ -159,13 +158,11 @@ export default { display: flex; flex-direction: column; justify-content: center; - width: 75%; - min-width: 75%; + width: 80%; + min-width: 80%; &__desc { display: inline-block; - flex-direction: column; - justify-content: space-between; padding-bottom: 0; line-height: 1.2em; white-space: nowrap; diff --git a/apps/files_sharing/src/components/SharingEntryInherited.vue b/apps/files_sharing/src/components/SharingEntryInherited.vue index eb39597149a..6a71b55d612 100644 --- a/apps/files_sharing/src/components/SharingEntryInherited.vue +++ b/apps/files_sharing/src/components/SharingEntryInherited.vue @@ -102,6 +102,7 @@ export default { flex-direction: column; justify-content: space-between; padding: 8px; + padding-left: 10px; line-height: 1.2em; p { color: var(--color-text-maxcontrast); diff --git a/apps/files_sharing/src/components/SharingEntryLink.vue b/apps/files_sharing/src/components/SharingEntryLink.vue index 7cf0804b841..bb5c8ab52b4 100644 --- a/apps/files_sharing/src/components/SharingEntryLink.vue +++ b/apps/files_sharing/src/components/SharingEntryLink.vue @@ -21,35 +21,36 @@ --> <template> - <li :class="{'sharing-entry--share': share}" class="sharing-entry sharing-entry__link"> + <li :class="{ 'sharing-entry--share': share }" class="sharing-entry sharing-entry__link"> <NcAvatar :is-no-user="true" :icon-class="isEmailShareType ? 'avatar-link-share icon-mail-white' : 'avatar-link-share icon-public-white'" class="sharing-entry__avatar" /> - <div class="sharing-entry__desc" @click.prevent="toggleQuickShareSelect"> - <span class="sharing-entry__title" :title="title"> - {{ title }} - </span> - <p v-if="subtitle"> - {{ subtitle }} - </p> - <QuickShareSelect v-if="share && share.permissions !== undefined" - :share="share" - :file-info="fileInfo" - :toggle="showDropdown" - @open-sharing-details="openShareDetailsForCustomSettings(share)" /> - </div> - <!-- clipboard --> - <NcActions v-if="share && !isEmailShareType && share.token" - ref="copyButton" - class="sharing-entry__copy"> - <NcActionLink :href="shareLink" - target="_blank" - :title="copyLinkTooltip" - :aria-label="copyLinkTooltip" - :icon="copied && copySuccess ? 'icon-checkmark-color' : 'icon-clippy'" - @click.stop.prevent="copyLink" /> - </NcActions> + <div class="sharing-entry__summary"> + <div class="sharing-entry__desc" @click.prevent="toggleQuickShareSelect"> + <span class="sharing-entry__title" :title="title"> + {{ title }} + </span> + <p v-if="subtitle"> + {{ subtitle }} + </p> + <QuickShareSelect v-if="share && share.permissions !== undefined" + :share="share" + :file-info="fileInfo" + :toggle="showDropdown" + @open-sharing-details="openShareDetailsForCustomSettings(share)" /> + </div> + + <!-- clipboard --> + <NcActions v-if="share && !isEmailShareType && share.token" ref="copyButton" class="sharing-entry__copy"> + <NcActionLink :href="shareLink" + target="_blank" + :title="copyLinkTooltip" + :aria-label="copyLinkTooltip" + :icon="copied && copySuccess ? 'icon-checkmark-color' : 'icon-clippy'" + @click.stop.prevent="copyLink" /> + </NcActions> + </div> <!-- pending actions --> <NcActions v-if="!pending && (pendingPassword || pendingEnforcedPassword || pendingExpirationDate)" @@ -59,9 +60,7 @@ :open.sync="open" @close="onNewLinkShare"> <!-- pending data menu --> - <NcActionText v-if="errors.pending" - icon="icon-error" - :class="{ error: errors.pending}"> + <NcActionText v-if="errors.pending" icon="icon-error" :class="{ error: errors.pending }"> {{ errors.pending }} </NcActionText> <NcActionText v-else icon="icon-info"> @@ -128,8 +127,7 @@ @close="onMenuClose"> <template v-if="share"> <template v-if="share.canEdit && canReshare"> - <NcActionButton :disabled="saving" - @click.prevent="openSharingDetails"> + <NcActionButton :disabled="saving" @click.prevent="openSharingDetails"> <template #icon> <Tune /> </template> @@ -148,7 +146,7 @@ :share="share" /> <!-- external legacy sharing via url (social...) --> - <NcActionLink v-for="({icon, url, name}, index) in externalLegacyLinkActions" + <NcActionLink v-for="({ icon, url, name }, index) in externalLegacyLinkActions" :key="index" :href="url(shareLink)" :icon="icon" @@ -568,7 +566,7 @@ export default { this.pending = false component.open = true - // Nothing is enforced, creating share directly + // Nothing is enforced, creating share directly } else { const share = new Share(shareDefaults) await this.pushNewLinkShare(share) @@ -774,21 +772,33 @@ export default { align-items: center; min-height: 44px; + &__summary { + padding: 8px; + padding-left: 10px; + display: flex; + justify-content: space-between; + width: 80%; + min-width: 80%; + &__desc { display: flex; flex-direction: column; - justify-content: space-between; - padding: 8px; line-height: 1.2em; p { color: var(--color-text-maxcontrast); } - } - &__title { - text-overflow: ellipsis; - overflow: hidden; - white-space: nowrap; + + &__title { + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + } + } + + &__copy { + + } } &:not(.sharing-entry--share) &__actions { @@ -816,9 +826,9 @@ export default { // put menus to the left // but only the first one .action-item { - margin-left: auto; - ~ .action-item, - ~ .sharing-entry__loading { + + ~.action-item, + ~.sharing-entry__loading { margin-left: 0; } } diff --git a/apps/files_sharing/src/components/SharingEntrySimple.vue b/apps/files_sharing/src/components/SharingEntrySimple.vue index 5e858de990b..29464e88f34 100644 --- a/apps/files_sharing/src/components/SharingEntrySimple.vue +++ b/apps/files_sharing/src/components/SharingEntrySimple.vue @@ -87,6 +87,7 @@ export default { min-height: 44px; &__desc { padding: 8px; + padding-left: 10px; line-height: 1.2em; position: relative; flex: 1 1; diff --git a/apps/files_sharing/src/mixins/ShareDetails.js b/apps/files_sharing/src/mixins/ShareDetails.js index 53ec8bfe16a..3884d22dae6 100644 --- a/apps/files_sharing/src/mixins/ShareDetails.js +++ b/apps/files_sharing/src/mixins/ShareDetails.js @@ -2,12 +2,29 @@ import Share from '../models/Share.js' export default { methods: { - openSharingDetails(share) { - const shareRequestObject = { + async openSharingDetails(shareRequestObject) { + let share = {} + // handle externalResults from OCA.Sharing.ShareSearch + // TODO : Better name/interface for handler required + // For example `externalAppCreateShareHook` with proper documentation + if (shareRequestObject.handler) { + if (this.suggestions) { + shareRequestObject.suggestions = this.suggestions + shareRequestObject.fileInfo = this.fileInfo + shareRequestObject.query = this.query + } + share = await shareRequestObject.handler(shareRequestObject) + share = new Share(share) + } else { + share = this.mapShareRequestToShareObject(shareRequestObject) + } + + const shareDetails = { fileInfo: this.fileInfo, - share: this.mapShareRequestToShareObject(share), + share, } - this.$emit('open-sharing-details', shareRequestObject) + + this.$emit('open-sharing-details', shareDetails) }, openShareDetailsForCustomSettings(share) { share.setCustomPermissions = true diff --git a/apps/files_sharing/src/views/SharingDetailsTab.vue b/apps/files_sharing/src/views/SharingDetailsTab.vue index 281775652b9..ea6ed5512c5 100644 --- a/apps/files_sharing/src/views/SharingDetailsTab.vue +++ b/apps/files_sharing/src/views/SharingDetailsTab.vue @@ -777,6 +777,7 @@ export default { shareWith: this.share.shareWith, attributes: this.share.attributes, note: this.share.note, + fileInfo: this.fileInfo, } if (this.hasExpirationDate) { @@ -803,15 +804,6 @@ export default { * @param {object} fileInfo file data */ async addShare(share, fileInfo) { - - // handle externalResults from OCA.Sharing.ShareSearch - if (share.handler) { - const shareFromHandler = await share.handler(this) - this.$emit('add:share', new Share(shareFromHandler)) - return true - } - - // this.loading = true // Are we adding loaders the new share flow? console.debug('Adding a new share from the input for', share) try { const path = (fileInfo.path + '/' + fileInfo.name).replace('//', '/') |