2021-04-22 15:05:14 +00:00
|
|
|
// @flow
|
2017-09-18 07:09:43 +00:00
|
|
|
|
2021-04-22 15:05:14 +00:00
|
|
|
declare var APP: Object;
|
2015-03-13 14:01:42 +00:00
|
|
|
|
2016-01-15 14:59:35 +00:00
|
|
|
export default {
|
2015-03-13 14:01:42 +00:00
|
|
|
|
2016-01-15 14:59:35 +00:00
|
|
|
/**
|
|
|
|
* Show notification that external auth is required (using provided url).
|
2021-04-22 15:05:14 +00:00
|
|
|
* @param {string} url - URL to use for external auth.
|
|
|
|
* @param {function} callback - callback to invoke when auth popup is closed.
|
2016-01-15 14:59:35 +00:00
|
|
|
* @returns auth dialog
|
|
|
|
*/
|
2021-04-22 15:05:14 +00:00
|
|
|
showExternalAuthDialog(url: string, callback: ?Function) {
|
2017-10-12 23:02:29 +00:00
|
|
|
const dialog = APP.UI.messageHandler.openCenteredPopup(
|
2015-12-15 12:09:44 +00:00
|
|
|
url, 910, 660,
|
2017-10-12 23:02:29 +00:00
|
|
|
|
2015-12-15 12:09:44 +00:00
|
|
|
// On closed
|
|
|
|
callback
|
|
|
|
);
|
|
|
|
|
|
|
|
if (!dialog) {
|
2017-11-03 19:05:03 +00:00
|
|
|
APP.UI.messageHandler.showWarning({
|
|
|
|
descriptionKey: 'dialog.popupError',
|
|
|
|
titleKey: 'dialog.popupErrorTitle'
|
|
|
|
});
|
2015-12-15 12:09:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return dialog;
|
2015-03-13 14:01:42 +00:00
|
|
|
}
|
|
|
|
};
|