Merge pull request #19455 from nextcloud/techdebt/deprecate-oc-router-helpers

Deprecate OC router helpers that are provided by packages
This commit is contained in:
Roeland Jago Douma 2020-02-13 20:30:17 +01:00 committed by GitHub
commit 584e729029
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 46 additions and 10 deletions

BIN
core/js/dist/login.js vendored

Binary file not shown.

Binary file not shown.

BIN
core/js/dist/main.js vendored

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -23,6 +23,7 @@
* Get a variable by name
* @param {string} context context
* @returns {Function} getter
* @deprecated 19.0.0 use https://lodash.com/docs#get
*/
export const get = context => name => {
const namespaces = name.split('.')
@ -41,6 +42,7 @@ export const get = context => name => {
* Set a variable by name
* @param {string} context context
* @returns {Function} setter
* @deprecated 19.0.0 use https://lodash.com/docs#set
*/
export const set = context => (name, value) => {
const namespaces = name.split('.')

View file

@ -85,13 +85,16 @@ import L10N, {
} from './l10n'
import {
filePath,
generateUrl,
getRootPath,
generateFilePath,
generateOcsUrl,
generateRemoteUrl,
getRootUrl,
imagePath,
linkTo,
linkToOCS,
linkToRemote,
} from '@nextcloud/router'
import {
linkToRemoteBase,
} from './routing'
import msg from './msg'
@ -146,7 +149,7 @@ export default {
* Currently logged in user or null if none
*
* @type String
* @deprecated use {@link OC.getCurrentUser} instead
* @deprecated use `getCurrentUser` from https://www.npmjs.com/package/@nextcloud/auth
*/
currentUser,
dialogs: Dialogs,
@ -156,6 +159,7 @@ export default {
* user (public page mode)
*
* @since 9.0.0
* @deprecated 19.0.0 use `getCurrentUser` from https://www.npmjs.com/package/@nextcloud/auth
*/
getCurrentUser,
isUserAdmin,
@ -248,18 +252,45 @@ export default {
theme,
Util,
debug,
filePath,
/**
* @deprecated 19.0.0 use `generateFilePath` from https://www.npmjs.com/package/@nextcloud/router
*/
filePath: generateFilePath,
/**
* @deprecated 19.0.0 use `generateUrl` from https://www.npmjs.com/package/@nextcloud/router
*/
generateUrl,
/**
* @deprecated 19.0.0 use https://lodash.com/docs#get
*/
get: get(window),
/**
* @deprecated 19.0.0 use https://lodash.com/docs#set
*/
set: set(window),
getRootPath,
/**
* @deprecated 19.0.0 use `getRootUrl` from https://www.npmjs.com/package/@nextcloud/router
*/
getRootPath: getRootUrl,
/**
* @deprecated 19.0.0 use `imagePath` from https://www.npmjs.com/package/@nextcloud/router
*/
imagePath,
redirect,
reload,
requestToken: getRequestToken(),
/**
* @deprecated 19.0.0 use `linkTo` from https://www.npmjs.com/package/@nextcloud/router
*/
linkTo,
linkToOCS,
linkToRemote,
/**
* @deprecated 19.0.0 use `generateOcsUrl` from https://www.npmjs.com/package/@nextcloud/router
*/
linkToOCS: generateOcsUrl,
/**
* @deprecated 19.0.0 use `generateRemoteUrl` from https://www.npmjs.com/package/@nextcloud/router
*/
linkToRemote: generateRemoteUrl,
linkToRemoteBase,
/**
* Relative path to Nextcloud root.
@ -267,7 +298,7 @@ export default {
*
* @type string
*
* @deprecated since 8.2, use OC.getRootPath() instead
* @deprecated 19.0.0 use `getRootUrl` from https://www.npmjs.com/package/@nextcloud/router
* @see OC#getRootPath
*/
webroot,

View file

@ -106,6 +106,7 @@ export const generateUrl = (url, params, options) => {
* @param {string} app the app id to which the image belongs
* @param {string} file the name of the image file
* @returns {string}
* @deprecated 19.0.0 use `imagePath` from https://www.npmjs.com/package/@nextcloud/router
*/
export const imagePath = (app, file) => {
if (file.indexOf('.') === -1) {
@ -122,6 +123,7 @@ export const imagePath = (app, file) => {
* @param {string} type the type of the file to link to (e.g. css,img,ajax.template)
* @param {string} file the filename
* @returns {string} Absolute URL for a file in an app
* @deprecated 19.0.0 use `generateFilePath` from https://www.npmjs.com/package/@nextcloud/router
*/
export const filePath = (app, type, file) => {
const isCore = coreApps.indexOf(app) !== -1
@ -172,6 +174,7 @@ export const filePath = (app, type, file) => {
*
* @returns {string} web root path
*
* @deprecated 19.0.0 use `getRootUrl` from https://www.npmjs.com/package/@nextcloud/router
* @since 8.2
*/
export const getRootPath = () => OC.webroot