Do not show e-mail suggestions if link shares are disabled

For #17774

This removes the e-mail suggestions from the share input if link shares
are disabled. As e-mail shares use just link shares.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2020-01-05 15:54:35 +01:00
parent a7b3ed32ad
commit 9a8b361911
No known key found for this signature in database
GPG Key ID: F941078878347C0C
4 changed files with 83 additions and 67 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -132,7 +132,7 @@ export default {
return t('files_sharing', 'Name, federated cloud ID or email address …')
}
return t('files_sharing', 'Name …')
return t('files_sharing', 'Name …')
},
isValidQuery() {
@ -184,6 +184,20 @@ export default {
lookup = true
}
const shareType = [
this.SHARE_TYPES.SHARE_TYPE_USER,
this.SHARE_TYPES.SHARE_TYPE_GROUP,
this.SHARE_TYPES.SHARE_TYPE_REMOTE,
this.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP,
this.SHARE_TYPES.SHARE_TYPE_CIRCLE,
this.SHARE_TYPES.SHARE_TYPE_ROOM,
this.SHARE_TYPES.SHARE_TYPE_GUEST,
]
if (OC.getCapabilities()['files_sharing']['public']['enabled'] === true) {
shareType.push(this.SHARE_TYPES.SHARE_TYPE_EMAIL)
}
const request = await axios.get(generateOcsUrl('apps/files_sharing/api/v1') + 'sharees', {
params: {
format: 'json',
@ -191,6 +205,7 @@ export default {
search,
lookup,
perPage: this.config.maxAutocompleteResults,
shareType,
},
})

View File

@ -179,6 +179,7 @@ export default class Config {
*/
get isMailShareAllowed() {
return OC.appConfig.shareByMailEnabled !== undefined
&& OC.getCapabilities()['files_sharing']['public']['enabled'] === true
}
/**