SDA-2977: UBS: Inconsistent 'Copy Email Address' output on MessageML (#1193)

* fix: SDA-2948 (Redesign notification) (#1186)

* fix: SDA-2948 - Redesign notification

* fix: SDA-2948 - Fix background color

* SDA-2977: add support for mailto links

Co-authored-by: Kiran Niranjan <kiran.niranjan@symphony.com>
This commit is contained in:
Vishwas Shashidhar 2021-03-01 16:43:33 +05:30 committed by GitHub
parent 426964ccaf
commit 57c363f956
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 20 deletions

View File

@ -36,25 +36,18 @@ const MIN_HEIGHT = 300;
*/
const verifyProtocolForNewUrl = (url: string): boolean => {
const parsedUrl = parse(url);
if (!parsedUrl) {
if (!parsedUrl || !parsedUrl.protocol) {
logger.info(
`child-window-handler: The url ${url} doesn't have a protocol. Returning false for verification!`,
);
return false;
}
const allowedProtocols = ['http:', 'https:', 'mailto:'];
// url parse returns protocol with :
if (parsedUrl.protocol === 'https:') {
if (allowedProtocols.includes(parsedUrl.protocol)) {
logger.info(
`child-window-handler: The url ${url} is a https url! Returning true for verification!`,
);
return true;
}
// url parse returns protocol with :
if (parsedUrl.protocol === 'http:') {
logger.info(
`child-window-handler: The url ${url} is a http url! Returning true for verification!`,
`child-window-handler: Protocol of the url ${url} is whitelisted! Returning true for verification!`,
);
return true;
}
@ -303,7 +296,7 @@ export const handleChildWindow = (webContents: WebContents): void => {
return;
}
logger.info(`child-window-handler: new window url is ${newWinUrl} which is not of the same host,
so opening it in the default browser!`);
so opening it in the default app!`);
windowHandler.openUrlInDefaultBrowser(newWinUrl);
}
};

View File

@ -434,16 +434,24 @@ class Notification extends NotificationHandler {
...this.activeNotifications,
};
const inactiveNotificationWindows = { ...[], ...this.inactiveWindows };
for (const activeWindow of activeNotificationWindows) {
if (activeWindow && windowExists(activeWindow)) {
await this.hideNotification(
(activeWindow as ICustomBrowserWindow).clientId,
);
if (activeNotificationWindows && Array.isArray(activeNotificationWindows)) {
for (const activeWindow of activeNotificationWindows) {
if (activeWindow && windowExists(activeWindow)) {
await this.hideNotification(
(activeWindow as ICustomBrowserWindow).clientId,
);
}
}
}
for (const inactiveWindow of inactiveNotificationWindows) {
if (inactiveWindow && windowExists(inactiveWindow)) {
inactiveWindow.close();
if (
inactiveNotificationWindows &&
Array.isArray(inactiveNotificationWindows)
) {
for (const inactiveWindow of inactiveNotificationWindows) {
if (inactiveWindow && windowExists(inactiveWindow)) {
inactiveWindow.close();
}
}
}