Skip to content

Commit acfb71a

Browse files
committed
feat(files_sharing): Modularize SharingInput to adapt with share sections
Signed-off-by: nfebe <[email protected]>
1 parent d626d39 commit acfb71a

2 files changed

Lines changed: 36 additions & 3 deletions

File tree

apps/files_sharing/src/components/SharingInput.vue

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,14 @@ export default {
7373
type: Boolean,
7474
required: true,
7575
},
76+
isExternal: {
77+
type: Boolean,
78+
default: false,
79+
},
80+
placeholder: {
81+
type: String,
82+
default: '',
83+
},
7684
},
7785
7886
data() {
@@ -105,6 +113,10 @@ export default {
105113
if (!this.canReshare) {
106114
return t('files_sharing', 'Resharing is not allowed')
107115
}
116+
if (this.placeholder) {
117+
return this.placeholder
118+
}
119+
108120
// We can always search with email addresses for users too
109121
if (!allowRemoteSharing) {
110122
return t('files_sharing', 'Name or email …')
@@ -170,16 +182,19 @@ export default {
170182
const shareType = [
171183
ShareType.User,
172184
ShareType.Group,
173-
ShareType.Remote,
174-
ShareType.RemoteGroup,
175185
ShareType.Team,
176186
ShareType.Room,
177187
ShareType.Guest,
178188
ShareType.Deck,
179189
ShareType.ScienceMesh,
180190
]
181191
182-
if (getCapabilities().files_sharing.public.enabled === true) {
192+
if (this.isExternal) {
193+
shareType.push(ShareType.Remote)
194+
shareType.push(ShareType.RemoteGroup)
195+
}
196+
197+
if (getCapabilities().files_sharing.public.enabled === true && this.isExternal) {
183198
shareType.push(ShareType.Email)
184199
}
185200

apps/files_sharing/src/views/SharingTab.vue

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
:link-shares="linkShares"
3838
:reshare="reshare"
3939
:shares="shares"
40+
:placeholder="t('files_sharing', 'Add users and teams')"
4041
@open-sharing-details="toggleShareDetailsView" />
4142

4243
<!-- other shares list -->
@@ -58,6 +59,15 @@
5859
<h6>{{ t('files_sharing', 'External shares') }}</h6>
5960
<InfoIcon v-tooltip="t('files_sharing', 'Displays shares made to outside users.')" :size="16" />
6061
</div>
62+
<SharingInput v-if="!loading"
63+
:can-reshare="canReshare"
64+
:file-info="fileInfo"
65+
:link-shares="linkShares"
66+
:is-external="true"
67+
:placeholder="t('files_sharing', 'Email, federated cloud id')"
68+
:reshare="reshare"
69+
:shares="shares"
70+
@open-sharing-details="toggleShareDetailsView" />
6171
<!-- link shares list -->
6272
<SharingLinkList v-if="!loading"
6373
ref="linkShareList"
@@ -111,6 +121,7 @@ import axios from '@nextcloud/axios'
111121
import moment from '@nextcloud/moment'
112122
import Tooltip from '@nextcloud/vue/dist/Directives/Tooltip.js'
113123
import NcAvatar from '@nextcloud/vue/dist/Components/NcAvatar.js'
124+
import NcInputField from '@nextcloud/vue/dist/Components/NcInputField.js'
114125
115126
import { shareWithTitle } from '../utils/SharedWithMe.js'
116127
@@ -125,6 +136,8 @@ import SharingLinkList from './SharingLinkList.vue'
125136
import SharingList from './SharingList.vue'
126137
import SharingDetailsTab from './SharingDetailsTab.vue'
127138
139+
import ShareDetails from '../mixins/ShareDetails.js'
140+
128141
export default {
129142
name: 'SharingTab',
130143
@@ -136,6 +149,7 @@ export default {
136149
CollectionList,
137150
InfoIcon,
138151
NcAvatar,
152+
NcInputField,
139153
SharingEntryInternal,
140154
SharingEntrySimple,
141155
SharingInherited,
@@ -144,6 +158,7 @@ export default {
144158
SharingList,
145159
SharingDetailsTab,
146160
},
161+
mixins: [ShareDetails],
147162
148163
data() {
149164
return {
@@ -166,6 +181,9 @@ export default {
166181
showSharingDetailsView: false,
167182
shareDetailsData: {},
168183
returnFocusElement: null,
184+
185+
// external shars
186+
externalShareQuery: '',
169187
}
170188
},
171189

0 commit comments

Comments
 (0)