Skip to content

Commit

Permalink
Merge pull request #967 from sap-labs-france/notifications
Browse files Browse the repository at this point in the history
Fixed notifications
  • Loading branch information
AlixH authored Jan 9, 2023
2 parents 9f33ac3 + dfc82b5 commit 1ae8f12
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ export default class App extends React.Component<Props, State> {
}
},
getStateFromPath: (url, options) => {
const path = url.split('#')?.[0].split('?')?.[0];
const path = url.split('/')?.[1].split('#')?.[0].split('?')?.[0];
const query = url.split('?')?.[1]?.split('#')?.[0];
const fragment = url.split('#')?.[1];
const newURL = path + (fragment ? '/' + fragment : '') + (query ? '?' + query : '');
Expand Down
3 changes: 2 additions & 1 deletion src/I18n/languages/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@
"mandatoryErrorDescription": "Popis je povinný",
"reportErrorSuccess": "Chyba byla úspěšně nahlášena",
"reportErrorFailed": "Chybu nelze nahlásit",
"createEndpoint": "Create endpoint"
"createEndpoint": "Create endpoint",
"wrongOrganization": "Wrong organization"
},
"qrCode": {
"qrCode": "QR kód",
Expand Down
3 changes: 2 additions & 1 deletion src/I18n/languages/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@
"mandatoryErrorDescription": "Die Beschreibung ist notwendig",
"reportErrorSuccess": "Der Fehler wurde erfolgreich gemeldet",
"reportErrorFailed": "Der Fehler kann nicht gemeldet werden",
"createEndpoint": "Endpunkt erstellen"
"createEndpoint": "Endpunkt erstellen",
"wrongOrganization": "Wrong organization"
},
"qrCode": {
"qrCode": "QR Code",
Expand Down
3 changes: 2 additions & 1 deletion src/I18n/languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@
"mandatoryErrorDescription": "The description is mandatory",
"reportErrorSuccess": "The error has been reported successfully",
"reportErrorFailed": "Cannot report the error",
"createEndpoint": "Create endpoint"
"createEndpoint": "Create endpoint",
"wrongOrganization": "Wrong organization"
},
"qrCode": {
"qrCode": "QR Code",
Expand Down
3 changes: 2 additions & 1 deletion src/I18n/languages/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@
"mandatoryErrorDescription": "La descripción es obligatoria",
"reportErrorSuccess": "El error se ha informado correctamente",
"reportErrorFailed": "No se puede informar el error",
"createEndpoint": "Create endpoint"
"createEndpoint": "Create endpoint",
"wrongOrganization": "Wrong organization"
},
"qrCode": {
"qrCode": "Código QR",
Expand Down
3 changes: 2 additions & 1 deletion src/I18n/languages/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@
"mandatoryErrorDescription": "La description est obligatoire",
"reportErrorSuccess": "L'erreur a été envoyée avec succès",
"reportErrorFailed": "Impossible d'envoyer l'erreur",
"createEndpoint": "Créer endpoint"
"createEndpoint": "Créer endpoint",
"wrongOrganization": "L'organisation actuelle ne correspond pas"
},
"qrCode": {
"qrCode": "QR Code",
Expand Down
3 changes: 2 additions & 1 deletion src/I18n/languages/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@
"mandatoryErrorDescription": "La descrizione è obbligatoria",
"reportErrorSuccess": "L'errore è stato segnalato con successo",
"reportErrorFailed": "Impossibile segnalare l'errore",
"createEndpoint": "Créer endpoint"
"createEndpoint": "Créer endpoint",
"wrongOrganization": "Wrong organization"
},
"qrCode": {
"qrCode": "Codice QR",
Expand Down
3 changes: 2 additions & 1 deletion src/I18n/languages/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@
"mandatoryErrorDescription": "A descrição é obrigatória",
"reportErrorSuccess": "O erro foi relatado com sucesso",
"reportErrorFailed": "Não é possível comunicar o erro",
"createEndpoint": "Créer endpoint"
"createEndpoint": "Créer endpoint",
"wrongOrganization": "Wrong organization"
},
"qrCode": {
"qrCode": "QR Code",
Expand Down
6 changes: 4 additions & 2 deletions src/notification/Notifications.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,13 @@ export default class Notifications {
}
const currentSubdomain = this.centralServerProvider.getUserInfo()?.tenantSubdomain;
if (notificationSubdomain !== currentSubdomain) {
Message.showError('Wrong subdomain');
Message.showError(I18n.t('authentication.wrongOrganization'));
return false;
}
return true;
} else {
return false;
}
return true;
}

public static async canHandleNotification(remoteMessage: Notification): Promise<boolean> {
Expand Down

0 comments on commit 1ae8f12

Please sign in to comment.