Skip to content

Commit

Permalink
Improve sharing flow
Browse files Browse the repository at this point in the history
Resolves: #26691

Signed-off-by: fenn-cs <[email protected]>
  • Loading branch information
Fenn-CS committed Jul 24, 2023
1 parent bef4053 commit 7cf0c6c
Show file tree
Hide file tree
Showing 4 changed files with 313 additions and 14 deletions.
55 changes: 44 additions & 11 deletions apps/files_sharing/src/components/SharingEntry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,22 @@
:menu-position="'left'"
:url="share.shareWithAvatar" />

<component :is="share.shareWithLink ? 'a' : 'div'"
:title="tooltip"
:aria-label="tooltip"
:href="share.shareWithLink"
class="sharing-entry__desc">
<span>{{ title }}<span v-if="!isUnique" class="sharing-entry__desc-unique"> ({{ share.shareWithDisplayNameUnique }})</span></span>
<p v-if="hasStatus">
<span>{{ share.status.icon || '' }}</span>
<span>{{ share.status.message || '' }}</span>
</p>
</component>
<div class="sharing-entry__summary" @click="openSharingDetails">

Check failure on line 32 in apps/files_sharing/src/components/SharingEntry.vue

View workflow job for this annotation

GitHub Actions / eslint

Expected "\t" character, but found " " character
<component :is="share.shareWithLink ? 'a' : 'div'"

Check failure on line 33 in apps/files_sharing/src/components/SharingEntry.vue

View workflow job for this annotation

GitHub Actions / eslint

Expected "\t" character, but found " " character
:title="tooltip"

Check failure on line 34 in apps/files_sharing/src/components/SharingEntry.vue

View workflow job for this annotation

GitHub Actions / eslint

Expected "\t" character, but found " " character
:aria-label="tooltip"

Check failure on line 35 in apps/files_sharing/src/components/SharingEntry.vue

View workflow job for this annotation

GitHub Actions / eslint

Expected "\t" character, but found " " character
:href="share.shareWithLink"

Check failure on line 36 in apps/files_sharing/src/components/SharingEntry.vue

View workflow job for this annotation

GitHub Actions / eslint

Expected "\t" character, but found " " character
class="sharing-entry__desc">

Check failure on line 37 in apps/files_sharing/src/components/SharingEntry.vue

View workflow job for this annotation

GitHub Actions / eslint

Expected "\t" character, but found " " character
<span>{{ title }}<span v-if="!isUnique" class="sharing-entry__desc-unique"> ({{ share.shareWithDisplayNameUnique }})</span></span>

Check failure on line 38 in apps/files_sharing/src/components/SharingEntry.vue

View workflow job for this annotation

GitHub Actions / eslint

Expected "\t" character, but found " " character
<p v-if="hasStatus">

Check failure on line 39 in apps/files_sharing/src/components/SharingEntry.vue

View workflow job for this annotation

GitHub Actions / eslint

Expected "\t" character, but found " " character
<span>{{ share.status.icon || '' }}</span>

Check failure on line 40 in apps/files_sharing/src/components/SharingEntry.vue

View workflow job for this annotation

GitHub Actions / eslint

Expected "\t" character, but found " " character
<span>{{ share.status.message || '' }}</span>

Check failure on line 41 in apps/files_sharing/src/components/SharingEntry.vue

View workflow job for this annotation

GitHub Actions / eslint

Expected "\t" character, but found " " character
</p>
</component>
<select class="share-select">
<option>Can edit</option>
</select>
</div>
<NcActions menu-align="right"
class="sharing-entry__actions"
@close="onMenuClose">
Expand Down Expand Up @@ -456,6 +461,9 @@ export default {
onMenuClose() {
this.onNoteSubmit()
},
openSharingDetails() {
this.$emit('open-sharing-details');
},
},
}
</script>
Expand All @@ -469,7 +477,9 @@ export default {
display: flex;
flex-direction: column;
justify-content: space-between;
// border: 1px solid red;
padding: 8px;
padding-bottom: 0;
line-height: 1.2em;
p {
color: var(--color-text-maxcontrast);
Expand All @@ -481,5 +491,28 @@ export default {
&__actions {
margin-left: auto;
}
&__summary {
padding: 0 !important;
display: flex;
flex-direction: column;
.share-select {
appearance: none;
-webkit-appearance: none;
-moz-appearance: none;
border: none;
margin: 0;
outline: none;
font-size: 12px;
height: auto;
width: unset;
min-height: initial;
font-weight: bold;
color: var(--color-primary-element);
}
}
}
</style>
252 changes: 252 additions & 0 deletions apps/files_sharing/src/views/SharingDetailsTab.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,252 @@
<template>
<div class="sharingTabDetailsView">
<div class="sharingTabDetailsView__header">
<span>
<FolderIcon :size="40" />
</span>
<span>
<h1>{{ t('file_sharing', 'Edit Share Link') }}</h1>
<small>Dummy: Important documents</small>
</span>
</div>
<div class="sharingTabDetailsView__quick-permissions">
<ul>
<li> <span>
<ViewIcon />
</span> View only</li>
<li> <span>
<EditIcon />
</span> Edit</li>
<li> <span>
<UploadIcon />
</span> File drop</li>
</ul>
</div>
<div class="sharingTabDetailsView__advanced-control">
<button @click="advancedSectionAccordionExpanded = !advancedSectionAccordionExpanded">
Advanced Settings
<span>
<MenuDownIcon />
</span>
</button>
</div>
<div v-if="advancedSectionAccordionExpanded" class="sharingTabDetailsView__advanced">
<section>
<NcTextField :value.sync="noteToRecipient" :label="t('file_sharing', 'Note to recipient')"
:label-visible="true" :show-trailing-button="noteToRecipient !== ''"
@trailing-button-click="noteToRecipient = ''">
</NcTextField>
<NcCheckboxRadioSwitch :checked.sync="setPassword">{{ t('file_sharing', 'Set password') }}
</NcCheckboxRadioSwitch>
<NcInputField :label="t('file_sharing', 'Password')">
</NcInputField>

<NcCheckboxRadioSwitch :checked.sync="setExpirationDate">{{ t('file_sharing', 'Set expiration date') }}
</NcCheckboxRadioSwitch>
<NcInputField :value.sync="expirationDate" :label="t('file_sharing', 'Expiration date')">
</NcInputField>
<NcCheckboxRadioSwitch :checked.sync="hideDownload">{{ t('file_sharing', 'Hide download') }}
</NcCheckboxRadioSwitch>
<NcInputField :value.sync="shareLabel" :label-visible="true" :label="t('file_sharing', 'Share label')">
</NcInputField>
</section>
</div>

<div class="sharingTabDetailsView__footer">
<a href="">
<CloseIcon />
Delete link
</a>
<div class="button-group">
<NcButton @click="$emit('close-sharing-details')">{{ t('file_sharing', 'Cancel') }}</NcButton>
<NcButton>{{ t('file_sharing', 'Share & copy link') }}</NcButton>
</div>
</div>
</div>
</template>

<script>
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import NcInputField from '@nextcloud/vue/dist/Components/NcInputField.js'
import NcTextField from '@nextcloud/vue/dist/Components/NcTextField.js'
import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js'
import FolderIcon from 'vue-material-design-icons/Folder.vue'
import CloseIcon from 'vue-material-design-icons/Close.vue'
import EditIcon from 'vue-material-design-icons/Pencil.vue'
import ViewIcon from 'vue-material-design-icons/Eye.vue'
import UploadIcon from 'vue-material-design-icons/Upload.vue'
import MenuDownIcon from 'vue-material-design-icons/MenuDown.vue'
export default {
name: 'SharingDetailsTab',
components: {
NcButton,
NcInputField,
NcTextField,
NcCheckboxRadioSwitch,
FolderIcon,
CloseIcon,
EditIcon,
ViewIcon,
UploadIcon,
MenuDownIcon,
},
data() {
return {
setPassword: false,
password: '',
noteToRecipient: '',
setExpirationDate: false,
expirationDate: '',
hideDownload: false,
shareLabel: '',
advancedSectionAccordionExpanded: false,
};
},
methods: {
},
mounted() {
}
};
</script>

<style lang="scss" scoped>
.sharingTabDetailsView {
width: 96%;
margin: 0 auto;
&__header {
display: flex;
align-items: center;
justify-content: left;
width: 100%;
margin-bottom: 0.2em;
box-sizing: border-box;
span:nth-child(1) {
align-items: center;
justify-content: center;
color: var(--color-primary-element);
padding: 0.1em;
}
span:nth-child(2) {
display: flex;
flex-direction: column;
justify-content: left;
align-items: flex-start;
text-align: left;
h1 {
margin: 0;
font-size: 16px;
}
small {
font-size: 12px;
margin-top: 0;
color: rgb(65, 62, 62);
}
}
}
&__quick-permissions {
display: flex;
justify-content: center;
margin-bottom: 0.2em;
ul {
list-style: none;
margin: 0;
border: 2px solid #ddd;
text-align: left;
width: 100%;
box-sizing: border-box;
li {
padding: 0.5em;
display: flex;
flex-direction: row;
border-bottom: 1px solid #ddd;
span:nth-child(1) {
align-items: center;
justify-content: center;
color: var(--color-primary-element);
padding: 0.1em;
}
&:last-child {
border-bottom: none;
}
}
}
}
&__advanced-control {
button {
display: flex;
border: none;
background-color: transparent;
color: inherit;
font: inherit;
font-weight: bolder;
line-height: normal;
overflow: visible;
text-align: inherit;
text-transform: none;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
cursor: pointer;
&:focus {
outline: none;
}
}
}
&__advanced {
margin-bottom: 0.5em;
section {
input {
border-radius: 0 !important;
}
}
}
&__footer {
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: flex-start;
a {
display: flex;
align-items: center;
color: rgb(223, 7, 7);
text-decoration: underline;
font-size: 16px;
}
.button-group {
display: flex;
justify-content: space-between;
width: 100%;
margin-top: 16px;
button {
flex: 1;
margin-left: 16px;
&:first-child {
margin-left: 0;
}
}
}
}
}
</style>
3 changes: 2 additions & 1 deletion apps/files_sharing/src/views/SharingList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
:file-info="fileInfo"
:share="share"
:is-unique="isUnique(share)"
@remove:share="removeShare" />
@remove:share="removeShare"
@open-sharing-details="$emit('open-sharing-details')"/>
</ul>
</template>

Expand Down
Loading

0 comments on commit 7cf0c6c

Please sign in to comment.