Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move deprecation warnings to debug #38852

Merged
merged 4 commits into from
Jun 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions apps/files/js/filelist.js
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@
* @param {string} [tabId] optional tab id to select
*/
showDetailsView: function(fileName, tabId) {
console.warn('showDetailsView is deprecated! Use OCA.Files.Sidebar.activeTab. It will be removed in nextcloud 20.');
OC.debug && console.warn('showDetailsView is deprecated! Use OCA.Files.Sidebar.activeTab. It will be removed in nextcloud 20.');
this._updateDetailsView(fileName);
if (tabId) {
OCA.Files.Sidebar.setActiveTab(tabId);
Expand Down Expand Up @@ -3879,7 +3879,7 @@
* Register a tab view to be added to all views
*/
registerTabView: function(tabView) {
console.warn('registerTabView is deprecated! It will be removed in nextcloud 20.');
OC.debug && console.warn('registerTabView is deprecated! It will be removed in nextcloud 20.');
const enabled = tabView.canDisplay || undefined
if (tabView.id) {
OCA.Files.Sidebar.registerTab(new OCA.Files.Sidebar.Tab({
Expand All @@ -3905,7 +3905,7 @@
* Register a detail view to be added to all views
*/
registerDetailView: function(detailView) {
console.warn('registerDetailView is deprecated! It will be removed in nextcloud 20.');
OC.debug && console.warn('registerDetailView is deprecated! It will be removed in nextcloud 20.');
if (detailView.el) {
OCA.Files.Sidebar.registerSecondaryView(detailView)
}
Expand Down
4 changes: 2 additions & 2 deletions apps/files/js/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@
* @deprecated used OCA.Files.FileList.generatePreviewUrl instead
*/
generatePreviewUrl: function(urlSpec) {
console.warn('DEPRECATED: please use generatePreviewUrl() from an OCA.Files.FileList instance');
OC.debug && console.warn('DEPRECATED: please use generatePreviewUrl() from an OCA.Files.FileList instance');
return OCA.Files.App.fileList.generatePreviewUrl(urlSpec);
},

Expand All @@ -290,7 +290,7 @@
* @deprecated used OCA.Files.FileList.lazyLoadPreview instead
*/
lazyLoadPreview : function(path, mime, ready, width, height, etag) {
console.warn('DEPRECATED: please use lazyLoadPreview() from an OCA.Files.FileList instance');
OC.debug && console.warn('DEPRECATED: please use lazyLoadPreview() from an OCA.Files.FileList instance');
return FileList.lazyLoadPreview({
path: path,
mime: mime,
Expand Down
2 changes: 1 addition & 1 deletion apps/files_sharing/src/services/ExternalLinkActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default class ExternalLinkActions {
* @return {boolean}
*/
registerAction(action) {
console.warn('OCA.Sharing.ExternalLinkActions is deprecated, use OCA.Sharing.ExternalShareAction instead')
OC.debug && console.warn('OCA.Sharing.ExternalLinkActions is deprecated, use OCA.Sharing.ExternalShareAction instead')

if (typeof action === 'object' && action.icon && action.name && action.url) {
this._state.actions.push(action)
Expand Down
2 changes: 1 addition & 1 deletion core/src/OC/capabilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ import { getCapabilities as realGetCapabilities } from '@nextcloud/capabilities'
* @since 14.0.0
*/
export const getCapabilities = () => {
console.warn('OC.getCapabilities is deprecated and will be removed in Nextcloud 21. See @nextcloud/capabilities')
OC.debug && console.warn('OC.getCapabilities is deprecated and will be removed in Nextcloud 21. See @nextcloud/capabilities')
return realGetCapabilities()
}
4 changes: 2 additions & 2 deletions core/src/OC/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export default {
*/
formatDate(timestamp, format) {
if (window.TESTING === undefined) {
console.warn('OC.Util.formatDate is deprecated and will be removed in Nextcloud 21. See @nextcloud/moment')
OC.debug && console.warn('OC.Util.formatDate is deprecated and will be removed in Nextcloud 21. See @nextcloud/moment')
}
format = format || 'LLL'
return moment(timestamp).format(format)
Expand All @@ -136,7 +136,7 @@ export default {
*/
relativeModifiedDate(timestamp) {
if (window.TESTING === undefined) {
console.warn('OC.Util.relativeModifiedDate is deprecated and will be removed in Nextcloud 21. See @nextcloud/moment')
OC.debug && console.warn('OC.Util.relativeModifiedDate is deprecated and will be removed in Nextcloud 21. See @nextcloud/moment')
}
const diff = moment().diff(moment(timestamp))
if (diff >= 0 && diff < 45000) {
Expand Down
2 changes: 1 addition & 1 deletion core/src/OCA/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default class Search {
* @deprecated 20.0.0, will be removed in Nextcloud 22
*/
constructor() {
console.warn('OCA.Search is deprecated. Please use the unified search API instead')
OC.debug && console.warn('OCA.Search is deprecated. Please use the unified search API instead')
}

}
4 changes: 2 additions & 2 deletions core/src/Polyfill/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ $.prototype.tooltip = (function(tooltip) {
} catch (ex) {
if (ex instanceof TypeError && config === 'destroy') {
if (window.TESTING === undefined) {
console.error('Deprecated call $.tooltip(\'destroy\') has been deprecated and should be removed')
OC.debug && console.warn('Deprecated call $.tooltip(\'destroy\') has been deprecated and should be removed')
}
return tooltip.call(this, 'dispose')
}
if (ex instanceof TypeError && config === 'fixTitle') {
if (window.TESTING === undefined) {
console.error('Deprecated call $.tooltip(\'fixTitle\') has been deprecated and should be removed')
OC.debug && console.warn('Deprecated call $.tooltip(\'fixTitle\') has been deprecated and should be removed')
}
return tooltip.call(this, '_fixTitle')
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ import { getToken as getRequestToken } from './OC/requesttoken.js'

const warnIfNotTesting = function() {
if (window.TESTING === undefined) {
console.warn.apply(console, arguments)
OC.debug && console.warn.apply(console, arguments)
}
}

Expand Down
2 changes: 1 addition & 1 deletion core/src/jquery/placeholder.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ const toRgb = (s) => {
}

String.prototype.toRgb = function() {
console.warn('String.prototype.toRgb is deprecated! It will be removed in Nextcloud 22.')
OC.debug && console.warn('String.prototype.toRgb is deprecated! It will be removed in Nextcloud 22.')

return toRgb(this)
}
Expand Down
4 changes: 2 additions & 2 deletions dist/core-install.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

Loading