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

[ENG-6102] Added context phrase to institutions filter modal on search pages #2514

Open
wants to merge 1 commit into
base: feature/b-and-i-25-01
Choose a base branch
from

Conversation

bodintsov
Copy link

  • Ticket: [https://openscience.atlassian.net/browse/ENG-6102]
  • Feature flag: n/a

Purpose

Added context phrase to institutions filter modal on search pages

Summary of Changes

TBD

Screenshot(s)

Знімок екрана 2025-02-21 о 18 07 49

Side Effects

TBD

QA Notes

TBD

@coveralls
Copy link

Pull Request Test Coverage Report for Build 13460664502

Details

  • 6 of 9 (66.67%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.01%) to 66.843%

Changes Missing Coverage Covered Lines Changed/Added Lines %
lib/osf-components/addon/components/search-page/filter-facet/component.ts 6 9 66.67%
Totals Coverage Status
Change from base Build 13059060187: 0.01%
Covered Lines: 7904
Relevant Lines: 11408

💛 - Coveralls

@brianjgeiger brianjgeiger changed the base branch from develop to feature/b-and-i-25-01 February 24, 2025 15:05
Copy link
Contributor

@futa-ikeda futa-ikeda left a comment

Choose a reason for hiding this comment

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

Some minor suggestions and a question. Looks good over all!

@@ -47,6 +47,10 @@ export default class FilterFacet extends Component<FilterFacetArgs> {
@tracked filterString = '';
@tracked hasMoreValueOptions = false;
@tracked nextPageCursor = '';
@tracked hasDescription = false;
@tracked description = '';
@tracked link_text = '';
Copy link
Contributor

Choose a reason for hiding this comment

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

Very minor suggetion: javascript names are typically camelCase

Copy link
Author

Choose a reason for hiding this comment

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

changed

Comment on lines +67 to +69
this.description = propertyPath[0]?.description?.[0]?.['@value'] || '';
this.link_text = propertyPath[0]?.link_text?.[0]?.['@value'] || '';
this.link = propertyPath[0]?.link?.[0]?.['@value'] || '';
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe these can be simplified a little bit by doing

Suggested change
this.description = propertyPath[0]?.description?.[0]?.['@value'] || '';
this.link_text = propertyPath[0]?.link_text?.[0]?.['@value'] || '';
this.link = propertyPath[0]?.link?.[0]?.['@value'] || '';
import { getSingleOsfmapValue } from 'ember-osf-web/packages/osfmap/jsonld';
...
this.description = getSingleOsfmapValue(propertyPath, ['description']) || '';
this.link_text = getSingleOsfmapValue(propertyPath, ['link_text') || '';
this.link = getSingleOsfmapValue(propertyPath, ['link']) || '';

Comment on lines +67 to +76
{{#if (and this.hasDescription (not this.collapsed))}}
<Button
data-analytics-name='See more filterable values {{@property.displayLabel}}'
data-test-see-more-filterable-values={{@property.displayLabel}}
@layout='fake-link'
{{on 'click' this.openSeeMoreModal}}
>
{{t 'search.filter-facet.see-more'}}
</Button>
{{/if}}
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure if this belongs here. Seems like something extra that was copy-pasted

Comment on lines +89 to +93
{{#if (and this.hasDescription)}}
{{ this.description }} <a href={{this.link}}> {{ this.link_text }} </a>
{{else }}
{{t 'search.filter-facet.see-more-modal-text'}}
{{/if}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Question: Does the PropertyPath.description field from the SHARE API return the entire phrase "Please select a filter to apply to your search. Only OSF Institutions member affiliations are discoverable."?

Do we want the SHARE API only return "Only OSF Institutions member affiliations..." in the PropertyPath.description field and the FE just shows "Please select a filter to apply to your search." no matter what?

Copy link
Author

@bodintsov bodintsov Feb 25, 2025

Choose a reason for hiding this comment

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

Yeah, I designed SHARE API to return description to return Please select an institution to apply to your search. Only OSF Institutions member affiliations are discoverable., linkText to return text that represents a link and link itselt.

On the ticket description, the context phrase is different from the current phrase on the Frontend (Please select a filter to apply to your search), so I added the part Please select an institution to apply to your search to the description from SHARE API. I can change the phrases that SHARE API returns if needed.

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