Merge pull request #18675 from nextcloud/fix/17774/no_email_suggestions_when_linkshare_disabled

Do not show e-mail suggestions if link shares are disabled
This commit is contained in:
Roeland Jago Douma 2020-01-06 12:15:50 +01:00 committed by GitHub
commit d4d44c8fa1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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
}
/**