mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 01:30:50 -04:00
refactor: remove remaining usage of OC::getCapabilities
Signed-off-by: Varun Patil <varunpatil@ucla.edu>
This commit is contained in:
parent
4828ac3521
commit
9bd50a7296
4 changed files with 16 additions and 11 deletions
|
|
@ -46,6 +46,7 @@
|
|||
<script>
|
||||
import { generateOcsUrl } from '@nextcloud/router'
|
||||
import { getCurrentUser } from '@nextcloud/auth'
|
||||
import { getCapabilities } from '@nextcloud/capabilities'
|
||||
import axios from '@nextcloud/axios'
|
||||
import debounce from 'debounce'
|
||||
import NcSelect from '@nextcloud/vue/dist/Components/NcSelect.js'
|
||||
|
|
@ -175,7 +176,7 @@ export default {
|
|||
async getSuggestions(search, lookup = false) {
|
||||
this.loading = true
|
||||
|
||||
if (OC.getCapabilities().files_sharing.sharee.query_lookup_default === true) {
|
||||
if (getCapabilities().files_sharing.sharee.query_lookup_default === true) {
|
||||
lookup = true
|
||||
}
|
||||
|
||||
|
|
@ -191,7 +192,7 @@ export default {
|
|||
this.SHARE_TYPES.SHARE_TYPE_SCIENCEMESH,
|
||||
]
|
||||
|
||||
if (OC.getCapabilities().files_sharing.public.enabled === true) {
|
||||
if (getCapabilities().files_sharing.public.enabled === true) {
|
||||
shareType.push(this.SHARE_TYPES.SHARE_TYPE_EMAIL)
|
||||
}
|
||||
|
||||
|
|
@ -499,7 +500,7 @@ export default {
|
|||
shareType: value.shareType,
|
||||
shareWith: value.shareWith,
|
||||
password,
|
||||
permissions: this.fileInfo.sharePermissions & OC.getCapabilities().files_sharing.default_permissions,
|
||||
permissions: this.fileInfo.sharePermissions & getCapabilities().files_sharing.default_permissions,
|
||||
attributes: JSON.stringify(this.fileInfo.shareAttributes),
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
*/
|
||||
|
||||
import { loadState } from '@nextcloud/initial-state'
|
||||
import { getCapabilities } from '@nextcloud/capabilities'
|
||||
|
||||
export default class Config {
|
||||
|
||||
|
|
@ -213,7 +214,7 @@ export default class Config {
|
|||
* @memberof Config
|
||||
*/
|
||||
get isMailShareAllowed() {
|
||||
const capabilities = OC.getCapabilities()
|
||||
const capabilities = getCapabilities()
|
||||
// eslint-disable-next-line camelcase
|
||||
return capabilities?.files_sharing?.sharebymail !== undefined
|
||||
// eslint-disable-next-line camelcase
|
||||
|
|
@ -272,7 +273,7 @@ export default class Config {
|
|||
* @memberof Config
|
||||
*/
|
||||
get isPasswordForMailSharesRequired() {
|
||||
return (OC.getCapabilities().files_sharing.sharebymail === undefined) ? false : OC.getCapabilities().files_sharing.sharebymail.password.enforced
|
||||
return (getCapabilities().files_sharing.sharebymail === undefined) ? false : getCapabilities().files_sharing.sharebymail.password.enforced
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -281,7 +282,7 @@ export default class Config {
|
|||
* @memberof Config
|
||||
*/
|
||||
get shouldAlwaysShowUnique() {
|
||||
return (OC.getCapabilities().files_sharing?.sharee?.always_show_unique === true)
|
||||
return (getCapabilities().files_sharing?.sharee?.always_show_unique === true)
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -326,7 +327,7 @@ export default class Config {
|
|||
* @memberof Config
|
||||
*/
|
||||
get passwordPolicy() {
|
||||
const capabilities = OC.getCapabilities()
|
||||
const capabilities = getCapabilities()
|
||||
return capabilities.password_policy ? capabilities.password_policy : {}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -46,6 +46,8 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { getCapabilities } from '@nextcloud/capabilities'
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
import Share from '../models/Share.js'
|
||||
import ShareTypes from '../mixins/ShareTypes.js'
|
||||
|
|
@ -80,7 +82,7 @@ export default {
|
|||
|
||||
data() {
|
||||
return {
|
||||
canLinkShare: OC.getCapabilities().files_sharing.public.enabled,
|
||||
canLinkShare: getCapabilities().files_sharing.public.enabled,
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
import api from './api.js'
|
||||
import axios from '@nextcloud/axios'
|
||||
import { generateOcsUrl } from '@nextcloud/router'
|
||||
import { getCapabilities } from '@nextcloud/capabilities'
|
||||
import logger from '../logger.js'
|
||||
|
||||
const orderGroups = function(groups, orderBy) {
|
||||
|
|
@ -428,9 +429,9 @@ const actions = {
|
|||
},
|
||||
|
||||
getPasswordPolicyMinLength(context) {
|
||||
if (OC.getCapabilities().password_policy && OC.getCapabilities().password_policy.minLength) {
|
||||
context.commit('setPasswordPolicyMinLength', OC.getCapabilities().password_policy.minLength)
|
||||
return OC.getCapabilities().password_policy.minLength
|
||||
if (getCapabilities().password_policy && getCapabilities().password_policy.minLength) {
|
||||
context.commit('setPasswordPolicyMinLength', getCapabilities().password_policy.minLength)
|
||||
return getCapabilities().password_policy.minLength
|
||||
}
|
||||
return false
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue