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

Categorization dashboard #114

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Categorization dashboard #114

wants to merge 2 commits into from

Conversation

JPrevost
Copy link
Member

@JPrevost JPrevost commented Oct 3, 2024

Why are these changes being introduced:

  • Our config was allowing Terms and SearchEvents to be created and
    edited in Administrate which is not intended
  • It will be convenient to have a mechansim in-app for authenticated
    users to look at our Categorizations prior to us building out custom
    reports/dashboards

Relevant ticket(s):

How does this address that need:

  • Restricts routes which is how Administrate determins which features
    to enable
  • Terms and SearchEvents cannot be created or edited in Administrate
  • This still allows admins to destroy a Term in case we determine it
    contains sensitive information. SearchEvents can only be destroyed by
    destroying the associated Term and relying on Rails to cleanup the
    relationship.
  • Adds a read-only administrate dashboard for Categorizations
  • Updates ability.rb to allow all authenticated users to view the
    dashboard

Document any side effects to this change:

This introduces minor changes to how Term and SearchEvents displays
througout the Dashboards. Overall I think this is an improvement, but
there may be edge cases where this change is not desired.

Developer

Ticket(s)

https://mitlibraries.atlassian.net/browse/TCO-###

Accessibility

  • ANDI or Wave has been run in accordance to our guide and
    all issues introduced by these changes have been resolved or opened
    as new issues (link to those issues in the Pull Request details above)
  • There are no accessibility implications to this change

Documentation

  • Project documentation has been updated, and yard output previewed
  • No documentation changes are needed

ENV

  • All new ENV is documented in README.
  • All new ENV has been added to Heroku Pipeline, Staging and Prod.
  • ENV has not changed.

Stakeholders

  • Stakeholder approval has been confirmed
  • Stakeholder approval is not needed

Dependencies and migrations

YES | NO dependencies are updated

YES | NO migrations are included

Reviewer

Code

  • I have confirmed that the code works as intended.
  • Any CodeClimate issues have been fixed or confirmed as
    added technical debt.

Documentation

  • The commit message is clear and follows our guidelines
    (not just this pull request message).
  • The documentation has been updated or is unnecessary.
  • New dependencies are appropriate or there were no changes.

Testing

  • There are appropriate tests covering any new functionality.
  • No additional test coverage is required.

Why are these changes being introduced:

* Our config was allowing Terms and SearchEvents to be created and
  edited in Administrate which is not intended

Relevant ticket(s):

* https://mitlibraries.atlassian.net/browse/TCO-92

How does this address that need:

* Restricts routes which is how Administrate determins which features
  to enable
* Terms and SearchEvents cannot be created or edited in Administrate
* This still allows admins to destroy a Term in case we determine it
  contains sensitive information. SearchEvents can only be destroyed by
  destroying the associated Term and relying on Rails to cleanup the
  relationship.
@mitlib mitlib temporarily deployed to tacos-api-pipeline-pr-114 October 3, 2024 14:09 Inactive
Why are these changes being introduced:

* It will be convenient to have a mechansim in-app for authenticated
  users to look at our Categorizations prior to us building out custom
  reports/dashboards

Relevant ticket(s):

* https://mitlibraries.atlassian.net/browse/TCO-93

How does this address that need:

* Adds a read-only administrate dashboard for Categorizations
* Updates ability.rb to allow all authenticated users to view the
  dashboard

Document any side effects to this change:

This introduces minor changes to how Term and SearchEvents displays
througout the Dashboards. Overall I think this is an improvement, but
there may be edge cases where this change is not desired.
Copy link
Member

@matt-bernhardt matt-bernhardt left a comment

Choose a reason for hiding this comment

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

This all looks okay to me. I've got one non-blocking request about the nav which non-admin users are shown, but if you'd rather not adopt that I'm happy to see this merge anyway.

My other comment, about field order for Categorizations, is me trying very hard not to micromanage an interface that I don't think will be used for long.

:shipit:

can :manage, :detector__suggested_resource
can :manage, Detector::SuggestedResource

# Allow all authenticated users to view the Categorization index and show dashboards
can %w[index show], :categorization
can :read, Categorization
Copy link
Member

Choose a reason for hiding this comment

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

I've confirmed that non-admin users can see the Categorizations dashboard via this, but I worry that the nav needs to be adjusted as well. Right now there's no nav link that calls out Categorizations, the user is required to click a "Suggested Resources" link and then they find the Categorizations option as a surprise bonus?

Could we either change the existing single link to something broader in scope, or include a link for Categorizations specifically?

# "Term ##{term.id}"
# end
def display_resource(term)
term.phrase
Copy link
Member

Choose a reason for hiding this comment

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

Good catch on this, makes the dashboard a lot more useful

confidence
detector_version
term
].freeze
Copy link
Member

Choose a reason for hiding this comment

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

I'm going to assume that we're going to be building a bespoke UI for this pretty soon, so am going to not suggest we customize this display at the moment. While the default alphabetical field order doesn't really make sense IMO, I don't think it's worth customizing at the moment if we're building a validation UI soon.

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

Successfully merging this pull request may close these issues.

3 participants