-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Re-enable extending edition dropdowns as librarian only #2700
base: master
Are you sure you want to change the base?
Re-enable extending edition dropdowns as librarian only #2700
Conversation
@seabelis How useful would this feature be as a librarian? I know there was an issue recently about modifying the items in this list. |
@mekarpeles @hornc @seabelis @cdrini decided on call that this will be merged |
At some point the option to create new roles, identifiers, or classifications was disabled. Bringing it back as a librarian feature.
56bdf8e
to
97bf252
Compare
The JS had some random bugs/issues; potentially jquery update related? Or potentially always there. Not sure.
Librarian only feature, and librarians _should_ have permissions.
97bf252
to
a9d82b6
Compare
<!-- <option>---</option> --> | ||
<!-- <option value="__add__">$_("Add a new role")</option> --> | ||
$if ctx.user and (ctx.user.is_admin() or ctx.user.is_librarian()): | ||
<option>--- $_("Librarian Only")</option> |
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.
<option>--- $_("Librarian Only")</option> | |
<option disabled>--- $_("Librarian Only")</option> |
Prevents "--- Librarian Only" from being selected accidentally (probably not much of a concern).
@@ -208,8 +208,9 @@ | |||
$for role in edition_config.roles: | |||
<option>$role</option> | |||
|
|||
<!-- <option>---</option> --> | |||
<!-- <option value="__add__">$_("Add a new role")</option> --> | |||
$if ctx.user and (ctx.user.is_admin() or ctx.user.is_librarian()): |
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.
$if ctx.user and (ctx.user.is_admin() or ctx.user.is_librarian()): | |
$if is_privileged_user: |
$ is_privileged_user = ctx.user and (ctx.user.is_admin() or ctx.user.is_librarian()) |
This will DRY things up.
} | ||
|
||
function error(error_div, input, message) { | ||
$(error_div).show().html(message); |
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.
This isn't displaying the error message divs. These divs have classes hidden
and popalert
, which are both have display: none
.
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.
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.
The code seems to be working properly. My notes about disabling the "--- Librarians Only" option and the error message not being displayed may not be too big of an issue, as not all patrons will be interacting with this feature.
} | ||
|
||
function error(error_div, input, message) { | ||
$(error_div).show().html(message); |
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.
$if ctx.user and (ctx.user.is_admin() or ctx.user.is_librarian()): | ||
<option>--- $_("Librarian Only")</option> |
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.
Same notes as above.
$if ctx.user and (ctx.user.is_admin() or ctx.user.is_librarian()): | ||
<option>--- $_("Librarian Only")</option> |
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.
Again, same notes as above.
@cdrini is this still work in progress? |
Feature? At some point the option to create new roles, identifiers, or classifications was disabled. Bringing it back as a librarian feature.
The question is: Do we even want this? Or is it better to axe this feature (#2496)? This code has been dead for a loooong time. If we really need to, it looks like we can extend these select dropdowns by editing e.g. https://openlibrary.org/config/edition anyways.
Technical
Testing
Evidence
Stakeholders
@jdlrobson @hornc @seabelis @tfmorris