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

Auto tagger release v2.2 #287

Merged
merged 102 commits into from
Aug 22, 2024
Merged

Conversation

cpefatimaabdillahi
Copy link
Collaborator

Hi @petrjasek,

As our last Pull Request had to be rolled back due to too many errors and insufficient time to troubleshoot between UAT and Production releases, we prepared this ahead of your next UAT release. Most of the changes are carried over from our previous PR, with an additional 3-4 items related to the NINJSV3 formatter.

The changes include:

Client:

  1. Translation in the fr_CA.po file
  2. Replace ampersands in headline, slugline, and extended headline
  • Introduced new variables: safeSlugline, safeHeadline, safeHeadlineExtended
  1. Replace "abstract" with "headline_extended"
  2. Add creator (string) and relevance (number)
  3. Pass story language to the server from the client
  4. Add aria-label to HTML elements
  5. Enable text wrapping in the search drop-down for longer terms

Server:

  1. Add article language to URLs
  2. Add relevance and creator to tags
  3. Add slugline, guid, env, and datetime to the semaphore XML payload
  4. Fix format_relevance in semaphore.py
  5. Replaced the old XML transformation logic with a more robust implementation in semaphore.py
  6. implement propagation of the highest relevance score from child tags to their parent tags semaphore.py

Environment:

  1. Replace search_parent_url with the new URL

Changes needed from Source Fabric as these files are outside of the superdesk-cp scope:

  1. Please update the scripts/core/superdesk-api.d.ts file in https://github.com/superdesk/superdesk-client-core/blob/e7409f91a0851f4efce9bb44412ad350a4e01cb3/scripts/core/superdesk-api.d.ts#L3703 so that we can add relevance and creator to ISubjects. This allows tags added via search using getExistingTags in https://github.com/canadianpress/superdesk-cp-2/blob/version20.11/client/extensions/auto-tagger/src/data-transformations.ts to return relevance and creator.
  2. For accessibility reasons, please rename "button" on the auto tagger widget to PIN / UNPIN.
  • The Auto-tagger widget currently has a button element without a value text. As a result, screen readers only announce it as a "button," which does not provide users with any context about its functionality. This makes it difficult for users relying on screen readers. Can we name the button Alt text as "Pin" or "Unpin"? Please see the screenshot.

cmuldur and others added 30 commits July 15, 2024 15:20
Match package.json to superdesk repo
@petrjasek petrjasek self-requested a review August 5, 2024 06:55
Copy link
Member

@petrjasek petrjasek left a comment

Choose a reason for hiding this comment

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

looks good, will make a PR with those client core changes

}
<div
className="auto-tagging-widget__autocomplete-item"
aria-label={`Item name ${_item.name}`}
Copy link
Member

Choose a reason for hiding this comment

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

you could also translate those via gettext if needed:

aria-label={gettext('Item name {{name}}', {name: _item.name})}

@cpefatimaabdillahi
Copy link
Collaborator Author

Thanks @petrjasek , please let us know if you have any questions regarding the core changes that were requested.

@petrjasek
Copy link
Member

can you pls check that PR @cpefatimaabdillahi if I got it right? superdesk/superdesk-client-core#4599

@cpefatimaabdillahi
Copy link
Collaborator Author

can you pls check that PR @cpefatimaabdillahi if I got it right? superdesk/superdesk-client-core#4599

Hi @petrjasek , the commits look fine however just an fyi, relevance and creator are not specific to AI subjects since even manually added tags/indexes will have both attributes with creator = "human" and a predetermined number for relevance.

@petrjasek
Copy link
Member

seems like you can do this ISubject change in the extension @cpefatimaabdillahi :
superdesk/superdesk-client-core#4599 (comment)

@cmuldur
Copy link
Contributor

cmuldur commented Aug 16, 2024

seems like you can do this ISubject change in the extension @cpefatimaabdillahi : superdesk/superdesk-client-core#4599 (comment)

Sounds good. Just added. @petrjasek

interface ISubject {
creator: string;
relevance: number;
Copy link
Member

Choose a reason for hiding this comment

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

I think you have to make them optional:

creator?: string;
relevance?: string;

Copy link
Contributor

Choose a reason for hiding this comment

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

Implemented @petrjasek

@petrjasek petrjasek marked this pull request as ready for review August 20, 2024 14:44
@petrjasek
Copy link
Member

can you add me write permissions to your fork? trying to fix the conflicts but it won't allow me to push there

@cmuldur
Copy link
Contributor

cmuldur commented Aug 20, 2024

can you add me write permissions to your fork? trying to fix the conflicts but it won't allow me to push there

Just sent a request @petrjasek. Although I can just resolve the conflict as well.
I'll just accept the development branch version.
Request link: https://github.com/canadianpress/superdesk-cp-2/invitations

@petrjasek petrjasek merged commit cb0b0dd into superdesk:develop Aug 22, 2024
4 of 5 checks passed
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.

4 participants