Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How hide Jira top bar before login?

Luiz Ricardo Pereira da Silva
Contributor
February 9, 2018

Hello, I need to know if we have the possibility to hide the main menu of Jira before the user logs in.
I wish the Dashboard menu was not displayed before Login.
It's possible?
Tks.

1 answer

0 votes
Pedro Felgueiras
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 9, 2018

Hy @Luiz Ricardo Pereira da Silva

 

You can add some javascript on the announcement banner and check if the user is login and if's not hide the banner. 

You can check some info here: https://confluence.atlassian.com/adminjiraserver073/configuring-an-announcement-banner-861253135.html

 

You can view the code to check if a user is logedin here: 

https://community.atlassian.com/t5/Jira-questions/how-to-check-currently-logged-in-user-of-JIRA-in-velocity/qaq-p/201867

 

And to hide the banner: $(".aui-header").hide()

 

This isn't totally advised because they don't guarantee that is upgrade safe. 

 

Best regards, 

Pedro Felgueiras 

Danyal Iqbal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 9, 2018

I would use javascript in the announcement banner to hide the div. e.g to hide the announcement bannner if the user is not logged in.

Announcements
<script type="text/javascript">

function currentUserName() {
    return AJS.params.loggedInUser;
}

var user=currentUserName();
if (user.lengeth==0))
AJS.$("#announcement-banner").hide();
</script>
Kim Whitehorn June 5, 2018

I've tried that script in my announcement banner and it doesn't appear to work.

I checked the content of user and it is undefined whether a user is logged in or not.

Is some extra setting or add-on required for these variables to be initialised?

Kind regards,

Kim.

Danyal Iqbal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 11, 2018

No. Open the console and see if

AJS.params.loggedInUser

 gives you the username of the logged in user. If it does not return anything than you need to explore 

$authcontext.loggedInUser.name

Suggest an answer

Log in or Sign up to answer