Skip to content

Commit

Permalink
Move to @nextcloud/capabilities package
Browse files Browse the repository at this point in the history
And kill of oc_capabilities and _oc_capabilities globals

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
  • Loading branch information
rullzer committed May 29, 2020
1 parent 532f4c4 commit 0209532
Show file tree
Hide file tree
Showing 21 changed files with 95 additions and 84 deletions.
4 changes: 2 additions & 2 deletions core/js/dist/files_client.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion core/js/dist/files_client.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion core/js/dist/files_fileinfo.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion core/js/dist/files_fileinfo.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion core/js/dist/files_iedavclient.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion core/js/dist/files_iedavclient.js.map

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions core/js/dist/install.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion core/js/dist/install.js.map

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions core/js/dist/login.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion core/js/dist/login.js.map

Large diffs are not rendered by default.

54 changes: 27 additions & 27 deletions core/js/dist/main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion core/js/dist/main.js.map

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions core/js/dist/maintenance.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion core/js/dist/maintenance.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions core/js/dist/recommendedapps.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion core/js/dist/recommendedapps.js.map

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions core/src/OC/capabilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
}
1 change: 0 additions & 1 deletion core/src/globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
1 change: 0 additions & 1 deletion lib/private/Template/JSConfigHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,6 @@ public function getConfig() {
'longFooter' => $this->defaults->getLongFooter(),
'folder' => \OC_Util::getTheme(),
]),
"_oc_capabilities" => json_encode($capabilities),
];

if ($this->currentUser !== null) {
Expand Down
9 changes: 9 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 0209532

Please sign in to comment.