-
Notifications
You must be signed in to change notification settings - Fork 27
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
Add non-admin view for scopes #281
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of those commits need squashing down into self contained commits with commit messages that can be understood without the context of the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also confirm you have searched the codebase for instances of Admin_scope and scopes_help?
Is it ok now?
Yes I have. There were still some references in the unused/undeleted scripts, but I can't see any now I've deleted them too. |
Yep! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any issues now, but I don't currently have a set-up to test the changes against - so I will leave the final approval to someone who does.
acf2780
to
03bbd33
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finger trouble reviewing. Approved subject to https://github.com/GOCDB/gocdb/pull/281/files?file-filters%5B%5D=.php&file-filters%5B%5D=.xml&hide-deleted-files=true#r672099274
692dd87
to
7b5b7bf
Compare
(Squashed requested change into last commit) |
Might it be worth hiding some of the information behind a help button, similar to the Downtimes Calendar page? |
What information did you have in mind? |
I was thinking potentially some/all of the sections from the Scope_Help page that weren't on the Admin_Scopes page: I would imagine most people would visit the page for the list of scopes itself, similar to most of the other pages, which was partly why my combined page has the table first. However, the explanatory information could end up quite far down the page, particularly as the number of scopes increases, which isn't necessarily as convenient as having it hidden but displayable at the top. I'm not sure though, it was just an idea. |
That sounds like a good improvement to make 😄 |
I would have preferred the help button to be styled more consistently with the downtimes calendar help button, but it didn't seem to fit as well, particularly with the Add Scope button, although most people won't see that. I can change it back if it people think it would look better. |
perhaps we could have some kind of Collapsible if it could be style to fit in with the rest of GOCDB? |
The Calendar page 'header' anyway seems inconsistent with other pages in missing a one-line description. Perhaps such a line with a collapsible 'Show more ...', or similar, would work consistently for both cases. The help and question-mark does look out of place IMHO. |
Hmm it feels like a collapsible might be a little intrusive, but perhaps it is still the best solution.
To clarify, are you suggesting a collapsible in the same place as other one-lines, or add a similar one-line as well as a collapsible below (e.g. similar to the Projects and NGIs pages, but a collapsible rather than a "What is a..." link?) In terms of general consistency, the Scopes page is also lacking its own icon. |
The latter: one liner plus collapsible.
A nice hackathon/first change issue for somebody then. 😃 |
40752f8
to
2e310d9
Compare
As discussed with @ineilson and @gregcorbett, toggling to show/hide the information is now done via a link, the text of which changes to provide the correct context. Overall the page is also now more consistent with others (e.g. NGIs), apart from the lack of an image. |
The scope/scopes views and controllers have been moved out of their respective admin directories, as they are forming the basis for the non-admin scripts. Rather than throwing an error if the user is not an admin, the controllers instead pass a flag to the views, hiding admin controls, although the controls would not work for a non-admin user anyway. References to Admin_Scopes pages have been updated to Scopes, and the page has been added to the menu for non-admin users. The Scope_Help link has also been renamed to more clearly differentiate it, as previously the Admin_Scopes and Scope_Help pages were both labelled "Scopes".
Add information from Scope Help page to Scopes, including help information, scope descriptions and whether scopes are reserved.
Deleted Scope Help view, controller and menu link, as all information is now in Scopes page. References to the page have been updated to instead reference Scopes.
Similar to the downtimes calendar view, this hides the scope help information by default, but allows it to be viewed by clicking a link. This means the list of scopes is displayed first, but it is not necessary to scroll past the entire table to see the help information. The link text also changes on clicking.
rebasing on the latest dev |
2e310d9
to
32a0dad
Compare
Resolves #273
As suggested in #273, Page_Type=Scope_Help and Page_Type=Admin_Scopes have been combined into a single page, Page_Type=Scopes, with admin controls inaccessible to non-admin users.
Similarly, the Page_Type=Admin_Scope page has been replaced with Page_Type=Scope, which displays the same information, except the admin controls are inaccessible to non-admin users.
Two new controllers, scopes.php and scope.php have also been added, based on the equivalent admin controllers. Their functionality is largely the same, except they pass whether the user is an admin to the views, rather than throwing an exception for non-admin users.
The scopes.php controller also passes lists of reserved and optional scopes, to allow Page_Type=Scopes to display this information in a similar manner to Page_Type=Scope_Help.
The Scope_Help and Admin_Scope views/controllers have been removed. The updated scripts may need their license information etc. updating further?