Skip to content

Commit

Permalink
feat: make login link open in new tab
Browse files Browse the repository at this point in the history
  • Loading branch information
plinnegan committed Mar 10, 2022
1 parent ecdb3ad commit e47be24
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dashboard-information",
"version": "1.1.2",
"version": "1.1.1",
"private": true,
"dependencies": {
"@dhis2/ui": "^7.16.1",
Expand Down
2 changes: 1 addition & 1 deletion public/manifest.webapp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"appType": "DASHBOARD_WIDGET",
"name": "Information",
"version": "1.1.2",
"version": "1.1.1",
"description": "Rich text editor for DHIS2 dashboard content, created for PEPFAR. Allows embedding videos. Strips Javascript from user-created content. For more info, see https://github.com/pepfar-datim/dashboard-information-widget",
"developer": {
"name": "PEPFAR"
Expand Down
16 changes: 9 additions & 7 deletions src/modules/shared/components/LoggedOutMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,19 @@ const LoggedOutMessage = () => {
fontFamily: 'Roboto',
},
};
const handleLogin = () => {
const baseUrl = window.parent.location.origin;
window.parent.location.href = `${baseUrl}/dhis-web-commons/security/login.action`;
};
const baseUrl = window.parent.location.origin;
return (
<p style={styles.loggedOut}>
You are no longer logged in, please click{' '}
<p style={styles.loginLink} onClick={handleLogin}>
<a
style={styles.loginLink}
rel="noreferrer"
href={`${baseUrl}/dhis-web-commons/security/login.action`}
target="_blank"
>
here
</p>{' '}
to return to the login page.
</a>{' '}
to open a new tab and login, then refresh the current page.
</p>
);
};
Expand Down

0 comments on commit e47be24

Please sign in to comment.