Skip to content
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

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

cdrini
Copy link
Collaborator

@cdrini cdrini commented Dec 6, 2019

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

  • It seems like edits which create a new role appear as "Adminstrator" edits on local?

Testing

  • Haven't done any "real" testing
  1. Got to e.g. http://localhost:8080/books/OL2058361M/The_wit_wisdom_of_Mark_Twain/edit
  2. Select "Add new" in the role/identifier/classifications select dropdown

Evidence

image
image

Stakeholders

@jdlrobson @hornc @seabelis @tfmorris

@cdrini cdrini added Needs: Feedback A proposed feature or bug resolution needs community feedback prior to forging ahead. [managed] State: Work In Progress This issue is being actively worked on. [managed] labels Dec 6, 2019
@cdrini
Copy link
Collaborator Author

cdrini commented Dec 6, 2019

@seabelis How useful would this feature be as a librarian? I know there was an issue recently about modifying the items in this list.

@cdrini
Copy link
Collaborator Author

cdrini commented Dec 10, 2019

@mekarpeles @hornc @seabelis @cdrini decided on call that this will be merged

@mekarpeles mekarpeles removed the State: Work In Progress This issue is being actively worked on. [managed] label Apr 10, 2020
@mekarpeles mekarpeles marked this pull request as draft April 10, 2020 23:23
@mekarpeles mekarpeles self-assigned this Apr 10, 2020
@mekarpeles mekarpeles changed the title WIP: Re-enable extending edition dropdowns as librarian only Re-enable extending edition dropdowns as librarian only Apr 10, 2020
At some point the option to create new roles, identifiers, or classifications was disabled. Bringing it back as a librarian feature.
@cdrini cdrini force-pushed the feature/expand-edition-dropdowns branch from 56bdf8e to 97bf252 Compare June 19, 2021 03:17
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.
@cdrini cdrini force-pushed the feature/expand-edition-dropdowns branch from 97bf252 to a9d82b6 Compare June 19, 2021 03:22
@cdrini cdrini removed the Needs: Feedback A proposed feature or bug resolution needs community feedback prior to forging ahead. [managed] label Jun 19, 2021
@cdrini cdrini marked this pull request as ready for review June 19, 2021 03:27
<!-- <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>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<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()):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$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);
Copy link
Collaborator

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.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the message were displayed, it would probably cause the content div to expand past the modal container:

Screenshot from 2021-07-12 20-17-08

It may be easier to display the error message to the right of the text input.

Copy link
Collaborator

@jimchamp jimchamp left a 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);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the message were displayed, it would probably cause the content div to expand past the modal container:

Screenshot from 2021-07-12 20-17-08

It may be easier to display the error message to the right of the text input.

Comment on lines +436 to +437
$if ctx.user and (ctx.user.is_admin() or ctx.user.is_librarian()):
<option>--- $_("Librarian Only")</option>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same notes as above.

Comment on lines +503 to +504
$if ctx.user and (ctx.user.is_admin() or ctx.user.is_librarian()):
<option>--- $_("Librarian Only")</option>
Copy link
Collaborator

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.

@jimchamp jimchamp added the Needs: Submitter Input Waiting on input from the creator of the issue/pr [managed] label Aug 30, 2021
@mekarpeles mekarpeles added the Priority: 2 Important, as time permits. [managed] label Sep 27, 2021
@cdrini cdrini added Priority: 3 Issues that we can consider at our leisure. [managed] and removed Priority: 2 Important, as time permits. [managed] labels Oct 18, 2021
@bicolino34
Copy link
Collaborator

@cdrini is this still work in progress?

@cdrini cdrini marked this pull request as draft October 19, 2023 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Submitter Input Waiting on input from the creator of the issue/pr [managed] Priority: 3 Issues that we can consider at our leisure. [managed]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants