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:
commit
584e729029
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
|
@ -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('.')
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue