-
Notifications
You must be signed in to change notification settings - Fork 59
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
base: feature/b-and-i-25-01
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -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 = ''; | ||||||||||||||||||||
@tracked link = ''; | ||||||||||||||||||||
|
||||||||||||||||||||
get shouldShowTopValues() { | ||||||||||||||||||||
const { args: { property: { propertyPathKey } } } = this; | ||||||||||||||||||||
|
@@ -56,6 +60,13 @@ export default class FilterFacet extends Component<FilterFacetArgs> { | |||||||||||||||||||
@action | ||||||||||||||||||||
toggleFacet() { | ||||||||||||||||||||
if (this.shouldShowTopValues) { | ||||||||||||||||||||
const propertyPath = this.args.property.propertyPath || []; | ||||||||||||||||||||
this.hasDescription = propertyPath.length > 0 && | ||||||||||||||||||||
Array.isArray(propertyPath[0]?.description) && | ||||||||||||||||||||
propertyPath[0].description.length > 0; | ||||||||||||||||||||
this.description = propertyPath[0]?.description?.[0]?.['@value'] || ''; | ||||||||||||||||||||
this.link_text = propertyPath[0]?.link_text?.[0]?.['@value'] || ''; | ||||||||||||||||||||
this.link = propertyPath[0]?.link?.[0]?.['@value'] || ''; | ||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
|
||||||||||||||||||||
if (this.filterableValues.length === 0 && !taskFor(this.fetchFacetValues).lastComplete) { | ||||||||||||||||||||
taskFor(this.fetchFacetValues).perform(); | ||||||||||||||||||||
} | ||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,6 +64,16 @@ | |
</Button> | ||
</li> | ||
{{/if}} | ||
{{#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}} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
</ul> | ||
{{/if}} | ||
<OsfDialog | ||
|
@@ -76,7 +86,11 @@ | |
{{@property.displayLabel}} | ||
</dialog.heading> | ||
<dialog.main local-class='see-more-dialog'> | ||
{{t 'search.filter-facet.see-more-modal-text'}} | ||
{{#if (and this.hasDescription)}} | ||
{{ this.description }} <a href={{this.link}}> {{ this.link_text }} </a> | ||
{{else }} | ||
{{t 'search.filter-facet.see-more-modal-text'}} | ||
{{/if}} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Question: Does the Do we want the SHARE API only return "Only OSF Institutions member affiliations..." in the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I designed SHARE API to return On the ticket description, the context phrase is different from the current phrase on the Frontend ( |
||
<PowerSelect | ||
data-test-property-value-select | ||
@options={{this.modalValueOptions}} | ||
|
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed