Skip to content

SS-1953 New field for keywords from controlled vocabularies#545

Merged
akochari merged 10 commits into
developfrom
ss-1953-controlled-vocab-keywords
Jun 17, 2026
Merged

SS-1953 New field for keywords from controlled vocabularies#545
akochari merged 10 commits into
developfrom
ss-1953-controlled-vocab-keywords

Conversation

@akochari

@akochari akochari commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Description

This addresses SS-1953. In this PR, I am adding a new JSON field to store info about keywords. User selects keywords from controlled vocabularies, we save the subject, vocabulary name (scheme), and keyword id (classification code). This is the field that also underlies the keywords displayed in the interface, used for filtering, sent to invenio.

Checklist

If you're unsure about any of the items below, don't hesitate to ask. We're here to help!
This is simply a reminder of what we are going to look for before merging your code.

  • This pull request is against develop branch (not applicable for hotfixes)
  • I have included a link to the issue on GitHub or JIRA (if any)
  • I have included migration files (if there are changes to the model classes)
  • I have added or updated unit and end2end tests or a manual test case to complement my changes
  • I have ran unit and end2end tests
  • I have updated the related documentation (if necessary)
  • I have added a reviewer for this pull request
  • I have added myself as an author for this pull request
  • In the case I have modified settings.py, then I have also updated the studio-settings-configmap.yaml file in serve-charts
  • In case your changes are large enough, did you deploy your changes to develop instance?

@akochari akochari requested a review from j-awada June 9, 2026 18:17
@akochari akochari self-assigned this Jun 9, 2026
@akochari akochari requested a review from a team as a code owner June 9, 2026 18:17
@akochari akochari added the enhancement Improvement of existing feature or request label Jun 9, 2026
@akochari akochari requested review from hamzaimran08 and removed request for a team and j-awada June 10, 2026 08:45

@hamzaimran08 hamzaimran08 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks great in general, just a couple of suggestions/questions

In templates/common/app_metadata.html should we change this

<dt class="col-sm-4">Tags</dt>
<dd class="col-sm-8">
    {% for tag in app.tags.all %}
  <a class="tag me-1 mb-1" onclick="searchByTag('{{ tag | title }}','card-keyword',this)">
    <span class="badge text-bg-primary badge-grape badge-ico" style="margin-right: -0.2rem;">
      <div class="fas fa-tag fa-sm me-1"></div>
      <span class="tag-name">{{ tag |title }}</span>
    </span>
  </a>
  {% endfor %}
</dd>

to

<dt class="col-sm-4">Subjects & keywords</dt>
<dd class="col-sm-8">
    {% for keyword in app.subjects_keywords %}
  <a class="tag me-1 mb-1" onclick="searchByTag('{{ keyword.subject | title }}','card-keyword',this)">
    <span class="badge text-bg-primary badge-grape badge-ico" style="margin-right: -0.2rem;">
      <div class="fas fa-tag fa-sm me-1"></div>
      <span class="tag-name">{{ keyword.subject |title }}</span>
    </span>
  </a>
  {% endfor %}
</dd>

Also, in app/helpers.py should we also change:

Line 392 to subjects_keywords instead of tags

Line 685-686 to

subjects_keywords_data = form.cleaned_data.get("subjects_keywords") if hasattr(form, "cleaned_data") else None
logger.debug(f"Background task: subjects_keywords data from form: {subjects_keywords_data}")

And Line 693 to "subjects_keywords": form.cleaned_data.get("subjects_keywords")

Comment thread apps/background_tasks/tasks/doi_provisioning.py Outdated
@akochari

Copy link
Copy Markdown
Collaborator Author

Thanks, Hamza. I now made all the changes.
The app_metadata.html is the old template which is not going to be used anymore but I made the change there too just in case we delay the rollout.

@hamzaimran08 hamzaimran08 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@akochari akochari merged commit 80d0efd into develop Jun 17, 2026
2 checks passed
@akochari akochari deleted the ss-1953-controlled-vocab-keywords branch June 17, 2026 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improvement of existing feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants