mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 00:32:29 -04:00
Merge pull request #24025 from nextcloud/techdebt/no-testing-deprecation-logs
Do not print deprecation warnings during testing
This commit is contained in:
commit
03b436c000
6 changed files with 16 additions and 8 deletions
2
core/js/dist/login.js
vendored
2
core/js/dist/login.js
vendored
File diff suppressed because one or more lines are too long
2
core/js/dist/login.js.map
vendored
2
core/js/dist/login.js.map
vendored
File diff suppressed because one or more lines are too long
2
core/js/dist/main.js
vendored
2
core/js/dist/main.js
vendored
File diff suppressed because one or more lines are too long
2
core/js/dist/main.js.map
vendored
2
core/js/dist/main.js.map
vendored
File diff suppressed because one or more lines are too long
|
|
@ -117,7 +117,9 @@ export default {
|
|||
* @returns {string} timestamp formatted as requested
|
||||
*/
|
||||
formatDate(timestamp, format) {
|
||||
console.warn('OC.Util.formatDate is deprecated and will be removed in Nextcloud 21. See @nextcloud/moment')
|
||||
if (window.TESTING === undefined) {
|
||||
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)
|
||||
},
|
||||
|
|
@ -127,7 +129,9 @@ export default {
|
|||
* @returns {string} human readable difference from now
|
||||
*/
|
||||
relativeModifiedDate(timestamp) {
|
||||
console.warn('OC.Util.relativeModifiedDate is deprecated and will be removed in Nextcloud 21. See @nextcloud/moment')
|
||||
if (window.TESTING === undefined) {
|
||||
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) {
|
||||
return t('core', 'seconds ago')
|
||||
|
|
|
|||
|
|
@ -25,11 +25,15 @@ $.prototype.tooltip = (function(tooltip) {
|
|||
return tooltip.call(this, config)
|
||||
} catch (ex) {
|
||||
if (ex instanceof TypeError && config === 'destroy') {
|
||||
console.error('Deprecated call $.tooltip(\'destroy\') has been deprecated and should be removed')
|
||||
if (window.TESTING === undefined) {
|
||||
console.error('Deprecated call $.tooltip(\'destroy\') has been deprecated and should be removed')
|
||||
}
|
||||
return tooltip.call(this, 'dispose')
|
||||
}
|
||||
if (ex instanceof TypeError && config === 'fixTitle') {
|
||||
console.error('Deprecated call $.tooltip(\'fixTitle\') has been deprecated and should be removed')
|
||||
if (window.TESTING === undefined) {
|
||||
console.error('Deprecated call $.tooltip(\'fixTitle\') has been deprecated and should be removed')
|
||||
}
|
||||
return tooltip.call(this, '_fixTitle')
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue