-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MetaStore: If the user is already logged in, this is now displayed di…
…rectly in the 'Search' tab.
- Loading branch information
1 parent
535d7c8
commit c49fdb1
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ | |
<script src="js/semantic-ui/dropdown.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/keycloak.min.js"></script> | ||
<script src="./js/download.js"></script> | ||
<script src="js/apply-config.js"></script> | ||
|
||
<link rel="stylesheet" href="./css/styles.css"/> | ||
|
||
|
@@ -311,6 +312,16 @@ <h1 class="ui block header"> | |
let from = 0; | ||
let size = page_size; | ||
|
||
applyConfig(keycloak, showServiceUrl,appDescription, config, addMessage, (login, username) => { | ||
if(login){ | ||
$("#logged_in_as").text("Logged in as " + username); | ||
$("#editor-create-button").removeAttr("disabled"); | ||
}else{ | ||
$("#logged_in_as").text("Not logged in."); | ||
$("#editor-create-button").attr("disabled", "disabled"); | ||
} | ||
}); | ||
|
||
Handlebars.registerHelper('isOpen', function (list) { | ||
if (list != null && list.indexOf("anonymousUser") > -1) { | ||
return true; | ||
|
@@ -438,6 +449,15 @@ <h1 class="ui block header"> | |
from = from + size; | ||
doSearch(true); | ||
}); | ||
|
||
if (localStorage.getItem("userLoggedIn")) { | ||
localStorage.removeItem("userLoggedIn") | ||
$("#login_button").click(); | ||
} | ||
|
||
if (typeof keycloak != typeof undefined && config.token == null) { | ||
$("#editor-create-button").attr("disabled", "disabled"); | ||
} | ||
addMessage(0, "Search successfully initialized."); | ||
|
||
|
||
|