Merge pull request #21155 from nextcloud/td/move_to_capabilities_package

Move to @nextcloud/capabilities package
This commit is contained in:
Roeland Jago Douma 2020-05-30 08:58:19 +02:00 committed by GitHub
commit 43a0bf7215
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 95 additions and 84 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

32
core/js/dist/login.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

54
core/js/dist/main.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -19,7 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
const capabilities = window._oc_capabilities || {}
import { getCapabilities as realGetCapabilities } from '@nextcloud/capabilities'
/**
* Returns the capabilities
@ -28,4 +28,7 @@ const capabilities = window._oc_capabilities || {}
*
* @since 14.0
*/
export const getCapabilities = () => capabilities
export const getCapabilities = () => {
console.warn('OC.getCapabilities is deprecated and will be removed in Nextcloud 21. See @nextcloud/capabilities')
return realGetCapabilities()
}

View File

@ -114,7 +114,6 @@ setDeprecatedProp('moment', () => moment, 'please ship your own, this will be re
window['OC'] = OC
setDeprecatedProp('initCore', () => initCore, 'this is an internal function')
setDeprecatedProp('oc_appswebroots', () => OC.appswebroots, 'use OC.appswebroots instead, this will be removed in Nextcloud 20')
setDeprecatedProp('oc_capabilities', OC.getCapabilities, 'use OC.getCapabilities instead, this will be removed in Nextcloud 20')
setDeprecatedProp('oc_config', () => OC.config, 'use OC.config instead, this will be removed in Nextcloud 20')
setDeprecatedProp('oc_current_user', () => OC.getCurrentUser().uid, 'use OC.getCurrentUser().uid instead, this will be removed in Nextcloud 20')
setDeprecatedProp('oc_debug', () => OC.debug, 'use OC.debug instead, this will be removed in Nextcloud 20')

View File

@ -292,7 +292,6 @@ class JSConfigHelper {
'longFooter' => $this->defaults->getLongFooter(),
'folder' => \OC_Util::getTheme(),
]),
"_oc_capabilities" => json_encode($capabilities),
];
if ($this->currentUser !== null) {

9
package-lock.json generated
View File

@ -1453,6 +1453,15 @@
"resolved": "https://registry.npmjs.org/@nextcloud/browserslist-config/-/browserslist-config-1.0.0.tgz",
"integrity": "sha512-f+sKpdLZXkODV+OY39K1M+Spmd4RgxmtEXmNn4Bviv4R7uBFHXuw+JX9ZdfDeOryfHjJ/TRQxQEp0GMpBwZFUw=="
},
"@nextcloud/capabilities": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@nextcloud/capabilities/-/capabilities-1.0.2.tgz",
"integrity": "sha512-HR5vnT2GKTvoQla/WdP+V0/MD1eAGUNWCM0QXVGXQ0TCHb0AORYYMdEQafROsjNSH2kriArFnS/l3YZQrUa9yA==",
"requires": {
"@nextcloud/initial-state": "^1.1.2",
"core-js": "^3.6.4"
}
},
"@nextcloud/dialogs": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/@nextcloud/dialogs/-/dialogs-1.3.0.tgz",

View File

@ -28,6 +28,7 @@
"@chenfengyuan/vue-qrcode": "^1.0.2",
"@nextcloud/auth": "^1.2.3",
"@nextcloud/axios": "^1.3.2",
"@nextcloud/capabilities": "^1.0.2",
"@nextcloud/dialogs": "^1.3.0",
"@nextcloud/event-bus": "^1.1.4",
"@nextcloud/initial-state": "^1.1.2",