Skip to content

Javascript error when the dashlet is shown to non-admin users. #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ghost opened this issue Aug 9, 2013 · 5 comments
Closed

Javascript error when the dashlet is shown to non-admin users. #1

ghost opened this issue Aug 9, 2013 · 5 comments
Assignees

Comments

@ghost
Copy link

ghost commented Aug 9, 2013

Add audit application dashlet to a site dashboard and get "TypeError: this.searchBoxLabelContainer is null" in firebug console. It subsequently blocks any following javascript. However, the dashlet does display message "You need to be an admin user to query audit entries."

@romainguinot
Copy link
Member

Well are you an admin user ? The js error is irrelevant if you're not because the server side (repository) audit api requires you to be an admin . on what version are you testing ?

@ghost
Copy link
Author

ghost commented Aug 9, 2013

For a non-admin user, although the "non admin" message is shown, the javascript is still trying to bind events to non-existing html elements and this is breaking any javascript (could belong to components other than audit trail dashlet) that follows. If an user is not an admin, can't it skip any javascript initiation for the dashlet? I've downloaded 0.51 from google code.

@romainguinot
Copy link
Member

I'll look into it when I get back thx for reporting this . it's unlikely that I'll be able to look into it for at least a month though... I'm considering this minor because there's absolutely no point setting it up for a non admin user, so it's probably better to set it up on an admin user dashboard rather than on a site dashboard, except if all users of the site are admin.

@ghost ghost assigned romainguinot Aug 9, 2013
@ghost
Copy link
Author

ghost commented Aug 10, 2013

This is a minor issue. There are two things I'd suggest.
1, Make the dashlet a member of user-dashlet so it wouldn't be available for site dashboard.
2, A user who's non admin may mistakenly add this dashlet to his/her dashboard and skip any javascript for non-admin users.

romainguinot pushed a commit that referenced this issue Aug 28, 2013
    - fixed javascript issue with non-admin users. Addresses (new) Github issue #1.
@romainguinot
Copy link
Member

A new build (0.52) has been uploaded in the releases section. It fixes the js issue in my local testing : init no longer attempts to bind to non existing elements. Those elements do not exist if the user is not an admin, so there's no point trying to initialize them.

Please re-open if this is not fixed for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant