fixup! Use external Toast implementation and deprecate the OCP API
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
parent
f83c11e923
commit
efe52c96e3
18 changed files with 92 additions and 28 deletions
BIN
apps/files/js/dist/personal-settings.js
vendored
BIN
apps/files/js/dist/personal-settings.js
vendored
Binary file not shown.
BIN
apps/files/js/dist/personal-settings.js.map
vendored
BIN
apps/files/js/dist/personal-settings.js.map
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.
Binary file not shown.
BIN
core/js/dist/login.js
vendored
BIN
core/js/dist/login.js
vendored
Binary file not shown.
BIN
core/js/dist/login.js.map
vendored
BIN
core/js/dist/login.js.map
vendored
Binary file not shown.
BIN
core/js/dist/main.js
vendored
BIN
core/js/dist/main.js
vendored
Binary file not shown.
BIN
core/js/dist/main.js.map
vendored
BIN
core/js/dist/main.js.map
vendored
Binary file not shown.
BIN
core/js/dist/maintenance.js
vendored
BIN
core/js/dist/maintenance.js
vendored
Binary file not shown.
BIN
core/js/dist/maintenance.js.map
vendored
BIN
core/js/dist/maintenance.js.map
vendored
Binary file not shown.
|
@ -1,11 +1,10 @@
|
|||
import { showSuccess, showWarning, showError, showInfo, showMessage } from '@nextcloud/dialogs'
|
||||
|
||||
import * as AppConfig from './appconfig'
|
||||
import * as Comments from './comments'
|
||||
import Loader from './loader'
|
||||
import { loadState } from '@nextcloud/initial-state'
|
||||
import Collaboration from './collaboration'
|
||||
import * as WhatsNew from './whatsnew'
|
||||
import Toast from './toast'
|
||||
|
||||
/** @namespace OCP */
|
||||
export default {
|
||||
|
@ -22,27 +21,6 @@ export default {
|
|||
/**
|
||||
* @deprecated 19.0.0 use the `@nextcloud/dialogs` package instead
|
||||
*/
|
||||
Toast: {
|
||||
/**
|
||||
* @deprecated 19.0.0 use `showSuccess` from the `@nextcloud/dialogs` package instead
|
||||
*/
|
||||
success: showSuccess,
|
||||
/**
|
||||
* @deprecated 19.0.0 use `showWarning` from the `@nextcloud/dialogs` package instead
|
||||
*/
|
||||
warning: showWarning,
|
||||
/**
|
||||
* @deprecated 19.0.0 use `showError` from the `@nextcloud/dialogs` package instead
|
||||
*/
|
||||
error: showError,
|
||||
/**
|
||||
* @deprecated 19.0.0 use `showInfo` from the `@nextcloud/dialogs` package instead
|
||||
*/
|
||||
info: showInfo,
|
||||
/**
|
||||
* @deprecated 19.0.0 use `showMessage` from the `@nextcloud/dialogs` package instead
|
||||
*/
|
||||
message: showMessage,
|
||||
},
|
||||
Toast,
|
||||
WhatsNew,
|
||||
}
|
||||
|
|
86
core/src/OCP/toast.js
Normal file
86
core/src/OCP/toast.js
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* @copyright Copyright (c) 2019 Julius Härtl <jus@bitgrid.net>
|
||||
*
|
||||
* @author Julius Härtl <jus@bitgrid.net>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
import {
|
||||
showError,
|
||||
showInfo, showMessage,
|
||||
showSuccess,
|
||||
showWarning,
|
||||
} from '@nextcloud/dialogs'
|
||||
|
||||
const defaultOptions = {
|
||||
selector: !window.TESTING ? 'content' : 'testArea',
|
||||
}
|
||||
|
||||
export default {
|
||||
/**
|
||||
* @deprecated 19.0.0 use `showSuccess` from the `@nextcloud/dialogs` package instead
|
||||
*
|
||||
* @param {string} text the toast text
|
||||
* @param {object} options options
|
||||
* @returns {Toast}
|
||||
*/
|
||||
success(text, options) {
|
||||
return showSuccess(text, Object.assign({}, defaultOptions, options))
|
||||
},
|
||||
/**
|
||||
* @deprecated 19.0.0 use `showWarning` from the `@nextcloud/dialogs` package instead
|
||||
*
|
||||
* @param {string} text the toast text
|
||||
* @param {object} options options
|
||||
* @returns {Toast}
|
||||
*/
|
||||
warning(text, options) {
|
||||
return showWarning(text, Object.assign({}, defaultOptions, options))
|
||||
},
|
||||
/**
|
||||
* @deprecated 19.0.0 use `showError` from the `@nextcloud/dialogs` package instead
|
||||
*
|
||||
* @param {string} text the toast text
|
||||
* @param {object} options options
|
||||
* @returns {Toast}
|
||||
*/
|
||||
error(text, options) {
|
||||
return showError(text, Object.assign({}, defaultOptions, options))
|
||||
},
|
||||
/**
|
||||
* @deprecated 19.0.0 use `showInfo` from the `@nextcloud/dialogs` package instead
|
||||
*
|
||||
* @param {string} text the toast text
|
||||
* @param {object} options options
|
||||
* @returns {Toast}
|
||||
*/
|
||||
info(text, options) {
|
||||
return showInfo(text, Object.assign({}, defaultOptions, options))
|
||||
},
|
||||
/**
|
||||
* @deprecated 19.0.0 use `showMessage` from the `@nextcloud/dialogs` package instead
|
||||
*
|
||||
* @param {string} text the toast text
|
||||
* @param {object} options options
|
||||
* @returns {Toast}
|
||||
*/
|
||||
message(text, options) {
|
||||
return showMessage(text, Object.assign({}, defaultOptions, options))
|
||||
},
|
||||
|
||||
}
|
6
package-lock.json
generated
6
package-lock.json
generated
|
@ -3003,9 +3003,9 @@
|
|||
"integrity": "sha512-f+sKpdLZXkODV+OY39K1M+Spmd4RgxmtEXmNn4Bviv4R7uBFHXuw+JX9ZdfDeOryfHjJ/TRQxQEp0GMpBwZFUw=="
|
||||
},
|
||||
"@nextcloud/dialogs": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@nextcloud/dialogs/-/dialogs-1.1.0.tgz",
|
||||
"integrity": "sha512-RjA+AEBwIkT2YEtMcfni3KQxn8o2SgbnVGp0n00z9tEhuvx9g3Z7Eh5+bY7zzanedFqryJSazMhk0voUyxr8Ow==",
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@nextcloud/dialogs/-/dialogs-1.2.0.tgz",
|
||||
"integrity": "sha512-yB2GRzgiIlGg02XAD9A9yTKhPhI6MTqHdOc6T6xIs8IBmlHJrCRcL1e6kBKUTQ4GXVzYDU8JFZ5b88RSiEwS1w==",
|
||||
"requires": {
|
||||
"core-js": "3.6.4",
|
||||
"toastify-js": "^1.6.2"
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
"@chenfengyuan/vue-qrcode": "^1.0.2",
|
||||
"@nextcloud/auth": "^1.2.1",
|
||||
"@nextcloud/axios": "^1.3.1",
|
||||
"@nextcloud/dialogs": "^1.1.0",
|
||||
"@nextcloud/dialogs": "^1.2.0",
|
||||
"@nextcloud/event-bus": "^1.1.2",
|
||||
"@nextcloud/initial-state": "^1.1.0",
|
||||
"@nextcloud/l10n": "^1.0.1",
|
||||
|
|
Loading…
Reference in a new issue