minor: show toast message for browser popup blocked issue (#16087)

* minor: show toast message for browser popup blocked issue

* Update browser popup blocked message in language files

* Update browser popup blocked message in language files
This commit is contained in:
Sachin Chaurasiya 2024-04-30 18:02:54 +05:30 committed by GitHub
parent 87c8254c38
commit 7cc6015574
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 74 additions and 0 deletions

View File

@ -26,8 +26,11 @@ import React, {
useImperativeHandle,
} from 'react';
import { useMutex } from 'react-context-mutex';
import { toast } from 'react-toastify';
import { useApplicationStore } from '../../../hooks/useApplicationStore';
import { msalLoginRequest } from '../../../utils/AuthProvider.util';
import { getPopupSettingLink } from '../../../utils/BrowserUtils';
import { Transi18next } from '../../../utils/CommonUtils';
import {
AuthenticatorRef,
OidcUser,
@ -114,6 +117,20 @@ const MsalAuthenticator = forwardRef<AuthenticatorRef, Props>(
.catch((e) => {
// eslint-disable-next-line no-console
console.error(e);
if (e?.message?.includes('popup_window_error')) {
toast.error(
<Transi18next
i18nKey="message.popup-block-message"
renderElement={
<a
href={getPopupSettingLink()}
rel="noopener noreferrer"
target="_blank"
/>
}
/>
);
}
throw e;
});

View File

@ -1658,6 +1658,7 @@
"please-enter-to-find-data-assets": "Drücke Enter, um Datenvermögenswerte mit <0>{{keyword}}<0> zu finden.",
"please-refresh-the-page": "Please refresh the page to see the changes.",
"please-type-text-to-confirm": "Please type {{text}} to confirm.",
"popup-block-message": "The sign in pop-up was blocked by the browser. Please <0>enable</0> it and try again.",
"process-pii-sensitive-column-message": "Überprüfe die Spaltennamen, um PII-sensitive/nicht sensitive Spalten automatisch zu taggen.",
"process-pii-sensitive-column-message-profiler": "Wenn aktiviert, wird die Beispiel-Daten analysiert, um geeignete PII-Tags für jede Spalte zu bestimmen.",
"profile-sample-percentage-message": "Setze den Profiler-Wert als Prozentsatz",

View File

@ -1658,6 +1658,7 @@
"please-enter-to-find-data-assets": "Press Enter to find data assets containing <0>{{keyword}}<0>",
"please-refresh-the-page": "Please refresh the page to see the changes.",
"please-type-text-to-confirm": "Please type {{text}} to confirm.",
"popup-block-message": "The sign in pop-up was blocked by the browser. Please <0>enable</0> it and try again.",
"process-pii-sensitive-column-message": "Check column names to auto tag PII Senstive/nonSensitive columns.",
"process-pii-sensitive-column-message-profiler": "When enabled, the sample data will be analysed to determine appropriate PII tags for each column",
"profile-sample-percentage-message": "Set the Profiler value as percentage",

View File

@ -1658,6 +1658,7 @@
"please-enter-to-find-data-assets": "Presiona Enter para encontrar activos de datos que contengan <0>{{keyword}}<0>",
"please-refresh-the-page": "Please refresh the page to see the changes.",
"please-type-text-to-confirm": "Por favor, escribe {{text}} para confirmar.",
"popup-block-message": "The sign in pop-up was blocked by the browser. Please <0>enable</0> it and try again.",
"process-pii-sensitive-column-message": "Revisa los nombres de las columnas para etiquetar automáticamente las columnas sensibles/no sensibles de PII.",
"process-pii-sensitive-column-message-profiler": "Cuando está habilitado, los datos de muestra se analizarán para determinar las etiquetas de PII apropiadas para cada columna.",
"profile-sample-percentage-message": "Establece el valor del perfilador como porcentaje",

View File

@ -1658,6 +1658,7 @@
"please-enter-to-find-data-assets": "Appuyez sur Entrée pour trouver les actifs de données contenant <0>{{keyword}}</0>",
"please-refresh-the-page": "Please refresh the page to see the changes.",
"please-type-text-to-confirm": "Please type {{text}} to confirm.",
"popup-block-message": "The sign in pop-up was blocked by the browser. Please <0>enable</0> it and try again.",
"process-pii-sensitive-column-message": "Vérifiez les noms de colonne pour marquer automatiquement les colonnes sensibles/non sensibles.",
"process-pii-sensitive-column-message-profiler": "Quand activé, les données d'échantillon seront analysées pour déterminer les balises PII appropriées pour chaque colonne.",
"profile-sample-percentage-message": "Configurez la valeur du profilage en pourcentage.",

View File

@ -1658,6 +1658,7 @@
"please-enter-to-find-data-assets": "יש ללחוץ Enter כדי למצוא נכסי נתונים הכוללים <0>{{keyword}}</0>",
"please-refresh-the-page": "Please refresh the page to see the changes.",
"please-type-text-to-confirm": "Please type {{text}} to confirm.",
"popup-block-message": "The sign in pop-up was blocked by the browser. Please <0>enable</0> it and try again.",
"process-pii-sensitive-column-message": "בדוק את שמות העמודות כדי לקבוע תגי PII Sensistive/NonSensitive באופן אוטומטי.",
"process-pii-sensitive-column-message-profiler": "כאשר מופעל, המידע הדוגמא ינתח כדי לקבוע תגי PII המתאימים לכל עמודה.",
"profile-sample-percentage-message": "הגדר את ערך הפרופילר כאחוז",

View File

@ -1658,6 +1658,7 @@
"please-enter-to-find-data-assets": "Press Enter to find data assets containing <0>{{keyword}}<0>",
"please-refresh-the-page": "Please refresh the page to see the changes.",
"please-type-text-to-confirm": "Please type {{text}} to confirm.",
"popup-block-message": "The sign in pop-up was blocked by the browser. Please <0>enable</0> it and try again.",
"process-pii-sensitive-column-message": "Check column names to auto tag PII Senstive/nonSensitive columns.",
"process-pii-sensitive-column-message-profiler": "When enabled, the sample data will be analysed to determine appropriate PII tags for each column",
"profile-sample-percentage-message": "Set the Profiler value as percentage",

View File

@ -1658,6 +1658,7 @@
"please-enter-to-find-data-assets": "Druk op Enter om data-assets te vinden met <0>{{keyword}}<0>",
"please-refresh-the-page": "Please refresh the page to see the changes.",
"please-type-text-to-confirm": "Typ alstublieft {{text}} om te bevestigen.",
"popup-block-message": "The sign in pop-up was blocked by the browser. Please <0>enable</0> it and try again.",
"process-pii-sensitive-column-message": "Controleer kolomnamen om PII-gevoelige/niet-gevoelige kolommen automatisch te taggen.",
"process-pii-sensitive-column-message-profiler": "Indien ingeschakeld, wordt de voorbeelddata geanalyseerd om geschikte PII-tags voor elke kolom te bepalen",
"profile-sample-percentage-message": "Stel de Profiler-waarde in als percentage",

View File

@ -1658,6 +1658,7 @@
"please-enter-to-find-data-assets": "Pressione Enter para encontrar ativos de dados contendo <0>{{keyword}}<0>",
"please-refresh-the-page": "Please refresh the page to see the changes.",
"please-type-text-to-confirm": "Digite {{text}} para confirmar.",
"popup-block-message": "The sign in pop-up was blocked by the browser. Please <0>enable</0> it and try again.",
"process-pii-sensitive-column-message": "Verifique os nomes das colunas para marcar automaticamente as colunas PII Sensíveis/Não Sensíveis.",
"process-pii-sensitive-column-message-profiler": "Quando ativado, os dados de amostra serão analisados para determinar as tags PII apropriadas para cada coluna.",
"profile-sample-percentage-message": "Defina o valor do Examinador como porcentagem",

View File

@ -1658,6 +1658,7 @@
"please-enter-to-find-data-assets": "Press Enter to find data assets containing <0>{{keyword}}<0>",
"please-refresh-the-page": "Please refresh the page to see the changes.",
"please-type-text-to-confirm": "Please type {{text}} to confirm.",
"popup-block-message": "The sign in pop-up was blocked by the browser. Please <0>enable</0> it and try again.",
"process-pii-sensitive-column-message": "Проверьте имена столбцов, чтобы автоматически пометить столбцы с конфиденциальной/неконфиденциальной информацией PII.",
"process-pii-sensitive-column-message-profiler": "Если эта функция включена, образцы данных будут проанализированы для определения соответствующих тегов PII для каждого столбца.",
"profile-sample-percentage-message": "Установите значение профайлера в процентах",

View File

@ -1658,6 +1658,7 @@
"please-enter-to-find-data-assets": "Press Enter to find data assets containing <0>{{keyword}}<0>",
"please-refresh-the-page": "Please refresh the page to see the changes.",
"please-type-text-to-confirm": "Please type {{text}} to confirm.",
"popup-block-message": "The sign in pop-up was blocked by the browser. Please <0>enable</0> it and try again.",
"process-pii-sensitive-column-message": "检查列名以自动标记PII敏感/非敏感列",
"process-pii-sensitive-column-message-profiler": "启用后将分析样本数据以确定每个列的适当PII标记",
"profile-sample-percentage-message": "将分析器值设置为百分比",

View File

@ -0,0 +1,47 @@
/*
* Copyright 2024 Collate.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export const getBrowser = () => {
const userAgent = navigator.userAgent;
if (userAgent.match(/chrome|chromium|crios/i)) {
return 'Chrome';
} else if (userAgent.match(/firefox|fxios/i)) {
return 'Firefox';
} else if (userAgent.match(/safari/i)) {
return 'Safari';
} else if (userAgent.match(/opr\//i)) {
return 'Opera';
} else if (userAgent.match(/edg/i)) {
return 'Edge';
} else {
return 'Other';
}
};
export const getPopupSettingLink = () => {
const browser = getBrowser();
switch (browser) {
case 'Chrome':
return 'https://support.google.com/chrome/answer/95472';
case 'Firefox':
return 'https://support.mozilla.org/en-US/kb/pop-blocker-settings-exceptions-troubleshooting';
case 'Safari':
return 'https://support.apple.com/en-in/guide/safari/sfri40696/mac';
case 'Opera':
return 'https://help.opera.com/en/latest/web-preferences/#popUps';
case 'Edge':
return 'https://support.microsoft.com/en-us/microsoft-edge/block-pop-ups-in-microsoft-edge-1d8ba4f8-f385-9a0b-e944-aa47339b6bb5';
default:
return '';
}
};