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

Feature/search improvements #1967

Merged
merged 103 commits into from
Aug 28, 2023
Merged

Feature/search improvements #1967

merged 103 commits into from
Aug 28, 2023

Conversation

futa-ikeda
Copy link
Contributor

  • Ticket: []
  • Feature flag: n/a

Purpose

Summary of Changes

Screenshot(s)

Side Effects

QA Notes

futa-ikeda and others added 30 commits June 7, 2023 10:15
-   Ticket: [ENG-4450]
-   Feature flag: n/a

## Purpose
- Add new models needed for SHARE-powered search page

## Summary of Changes
- Add new models
  - `metadata-record-search`
  - `metadata-property-search`
  - `metadata-value-search`
  - `metadata-record`
  - `search-match`
- New `ShareAdapter` and `ShareSerializer` to be used by these new models
- New mirage endpoint for metadata-record-search (other endpoints coming later)
-   Ticket: [ENG-4465] [ENG-4466]
-   Feature flag: n/a

## Purpose
- Add logic to search page controller to handle active filters and list of filterable properties
- Add a component to handle fetching values in a filterable properties in the search page

## Summary of Changes
- Add a `filter-facet` component
  - takes care of fetching filterable property values
  - `See more` modal
-   Ticket: [ENG-4469]
-   Feature flag: n/a

## Purpose
- Add object type filter and sort dropdown to search page

## Summary of Changes
- Add tabs to filter by object type (All, Projects, Registrations, Preprints, Files, Users)
- Add dropdown to sort results by Relevance, Date modified/created ascending and descending
- Change model names to reflect more library-analogy based names
- Change how metadata properties are fetched from SHARE models
-   Ticket: [ENG-4470]
-   Feature flag: n/a

## Purpose
- reroute users to the new search page instead of registries discover
- Use OsfLink for navbar link to search page to avoid a full app reload
 
## Summary of Changes
- Change search behavior on registries landing page (osf.io/registries)
- Rewrite how osf-navbar handles "Search" button to use OsfLink
-   Ticket: [No ticket]
-   Feature flag: n/a

## Purpose
- Update SHAREAdapter to point to correct locations

## Summary of Changes
- Update SHAREAdapter parent class to point use config variable for share-url
- Update SHAREAdapter parent class to point use api/v3 endpoints
- Update search-related adapters to point to singularized endpoint names (e.g. api/v3/index-card-search**es** -> api/v3/index-card-search
- Update mirage endpoints to reflect these changes
-   Ticket: [ENG-4568]
-   Feature flag: n/a

## Purpose
- Componentize search page for reuse in branded pages

## Summary of Changes
- Move logic and templating from search page route to `search-page` component
- No logic for branding and default query-params yet in this PR
* add institution search placeholder route

* modify route path

* modify route path

* change route name and path
* add brand relationship to preprint provider model (#1887)

* Remove unused services from search controller

* Use search-page component on preprint discover page

* Modifiy branded-navbar for preprints

* Error handling and theme resetting

* Branded preprint discover part 1

* Branded preprint discover part 2

* Test prerpint discover page

* Group CR feedback re: search-page component arguments

* Fix test

---------

Co-authored-by: Yuhuai Liu <yuhuai@cos.io>
* preliminary

* moar

* some more

* delete unused components

* remove top-level aggregate registries discover route

* remove top-level registries discover route cont.

* remove unused action and variable on registries application route

* remove aggregate registries discover page tests

* fix tests

* remove discover-test.ts

* CR followup
-   Ticket: [ENG-4574]
-   Feature flag: n/a

## Purpose
- Add appropriate page title to discover page
- Add appropriate analytics scope to discover page
- Make provider description now show html entities

## Summary of Changes
- Use `{{html-safe}}` when showing provider description
- Add `providerTitle` in preprint-provider model
  - Most branded providers should show their name with their preprint word (e.g. AfricaRxiv Preprints, MarXiv Papers), except Thesis Commons
  - If it's OSF, we just show "OSF Preprints"
- Add page-title and analytics scope using the new `providerTitle`
-   Ticket: https://openscience.atlassian.net/browse/ENG-4575
-   Git branch: feature/search-institutions-rewrite

## Purpose

The purpose of these changes is to implement the new search page component for the Institutions Discover page.

## Summary of Changes

-Used the new search-page component to re-implement the Institutions dashboard/discover page

-Added institution header with description and banner for desktop, logo and description for mobile

-Added logic for institution colors and default OSF colors when none provided

-Added an affiliated institution filter applied by default to SHARE queries
-   Ticket: [ENG-4535]
-   Feature flag: n/a

## Purpose
- Add search help feature
  - Basically a re-implementation of #1891 and #1877
  - Notable difference is moving the Popovers to the end of the file to avoid merge conflicts

## Summary of Changes
- Added EmberPopovers to the search-page component
- Added getters to search-page component to fetch EmberPopover targets dynamically
- Translations
- Tests
…rceType (#1915)

* change queryparam passed to SHARE when filtering by resourceType

* add types

* add some more types

* update tests
-   Ticket: []
-   Feature flag: n/a

## Purpose
- Only rely on `brand` relationship for setting preprint colors

## Summary of Changes
- Use `brand.primaryColor` for branded navbar background color
  - Add styling if the brand's primaryColor does not provide sufficient contrast with white text
 - Add special-case for BioHackrXiv to change navbar color to white (their primary color would be white, but that creates problems for `<Button>` behavior, so their primary is black instead)
- Use `brand.heroBackgroundImage` for hero banner background, as well as advisory board section when @brianpilati implements that page. Currently just a solid color
- Use `brand.navbarLogoImage` for navbar logo if `preprintProvider.assets.square_color_transparent` is not defined
- Update `<Button>` component to detect primary color and use white/black text depending on color contrast
-   Ticket: [ENG-4467]
-   Feature flag: n/a

## Purpose
- Add search result cards and secondary metadata components for the searchable OSF Object types
-   Ticket: []
-   Feature flag: n/a

## Purpose
- Remove possible failure point by not using preprintProvider.asset
- Add special casing to address nutrixiv's navbar color https://osf.io/preprints/nutrixiv/

## Summary of Changes
- Remove use of ThemeStyles from preprint (this set the navbar logo to use the preprintProvider.asset. square_color_transparent, when we want to just use the brand. topnavLogoImage going forward)
- Add special case for nutrixiv to use a white background similar to biohackrxiv
* add file-secondary-metadata

* add resource nature
* Merge conflicts.

Added starter Search Page component.

* Resolving merge conflicts.

Moved Search page to OSF components.

* Resolved merge conflicts.

Updated logic on Search component and controller.

* Move filter-facet under new search page component

* Test failures

* Resolving merge conflicts from rebase onto search-improvements.

[ENG-4535] Search help feature - componentized (#1891)

-   Ticket: https://openscience.atlassian.net/browse/ENG-4535
-   Git branch: feature/help-feature

The purpose of these changes is to provide the Search page with a three-part help tutorial introducing users to the new Search page's highlighted functionality.

1. The EmberPopover component was used to populate the tutorial's content and rendering.
2. Boolean values to show or hide tooltip were implemented for the TS logic. The individual panels of the tutorial will show or hide themselves based on their true/false values applied by the tutorial's button navigation.
3. CSS was applied to the popover to give it a more native OSF user interface.

* Updated debug logging of search events to data analytics scope and name.

* Re-adding link for analytics service.

* Removing link for analytics service.

* Updated debug logging of search events to data analytics scope and name.

* Resolving rebase differences.

* Resolving rebase differences.

* Resolving rebase differences.

* Resolving rebase differences.

* Updating mobile logic for tests and display.

* Updated analytics for new help structure.

* Updated location of analytics scope invocation.

* Moved data test selectors to the inner Ember popover div.

* Removed outer div scope for analytics.

---------

Co-authored-by: Futa Ikeda <futa.ikeda@gmail.com>
adlius and others added 23 commits August 17, 2023 15:11
* fix bugs

* fix

* fix typo

* fix registries index page query param when transition to search page

* Update the way we get contributor id. Remove registries discover route

* fix hasSupplementalResource badge

* redirect users to search page from registries discover page

* remove irrelevant tests. Fix othere tests.

* remove another test
… size (#1951)

* change ordering on files secondary card

* change ordering for registration secondary card

* change ordering f or preprints secondary card

* change ordering for project secondary card

* change page size
… link (#1952)

* add special casing

* make facet count take priority in width

* fix
* Add project/preprint supplements field as boolean fields

* Remove is-absent option from boolean filter fields
#1956)

* Reroute users to registries landing page instead of discover page for osf

* Update test
* Resolving merge conflicts.

* Updated styling for pagination, result type uppercase text transform.

* Resolving merge conflicts.

Fixed bug for left nav styling, removed institutions styling code for institutions release.

* Moved button styling for see more facet filters close button for styling scope.

* Updated help button index value selector to named local class selector.

* Updated button child selector to named local class selector.

* Updated margin for search count, removed capitalization for parent component reference.

* Moved scope of the sort option dropdown's styling to be within its local class selector.

* Updated sort dropdown div structure in template, updated styles for dropdown, removed unnecessary caret selector.

* Updated mobile stylings, added background color to main body, updated dimensions for tablet display, added local class selector for sort and type dropdowns, improved header layout to match mock-ups.

* Updated mobile selector for help button, added padding for longer text on mobile cards.

* Updated padding for left panel, updated result counter padding, font weight and size to match mock-ups.

* Improved layout for no results, one result, no properties, max height of pagination buttons, and topbar formatting.

* Updated stylings for browser client re-sizings between mobile and full-size desktop view, corrected styling for tablet view.

* Updated button styling for search button, updated background color to use variable name.

* Moved sort dropdown outside of nav element, removed unnecessary stylings for input wrapper.

* Updated sort dropdown styling to use align items property.

* Removed sidenav toggle styling, removed justify content property, updated to not use not selector for help button, added nowrap to prevent text wrapping on heading wrapper h1, updated sort by label dropdown div to have same pixel value as resource type, updated media query pixel allocation for dropdown toggle.

* Removed name field capitalization.

* Updated result card template for upstream changes.
* fix styling for open resources badges

* fix linting
* Add Withdrawn label to withdrawn things

* Align withdrawn label
* Add back isContainedBy to search-result-card

* Preserve whitespace for description field
@coveralls
Copy link

coveralls commented Aug 24, 2023

Pull Request Test Coverage Report for Build 6004797339

  • 230 of 368 (62.5%) changed or added relevant lines in 33 files are covered.
  • 63 unchanged lines in 8 files lost coverage.
  • Overall coverage decreased (-1.6%) to 70.83%

Changes Missing Coverage Covered Lines Changed/Added Lines %
app/adapters/index-card.ts 0 1 0.0%
app/home/-components/hero-banner/component.ts 0 1 0.0%
lib/osf-components/addon/components/editable-field/tags-manager/component.ts 0 1 0.0%
lib/osf-components/addon/components/tags-widget/component.ts 0 1 0.0%
lib/osf-components/addon/helpers/sufficient-contrast.ts 20 21 95.24%
lib/registries/addon/drafts/draft/-components/tags-manager/component.ts 0 1 0.0%
lib/registries/addon/index/controller.ts 0 1 0.0%
app/helpers/get-localized-property.ts 6 8 75.0%
app/services/theme.ts 1 3 33.33%
app/models/index-card.ts 9 12 75.0%
Files with Coverage Reduction New Missed Lines %
lib/registries/addon/discover/route.ts 1 50.0%
lib/registries/addon/services/share-search.ts 1 81.44%
lib/registries/addon/components/registries-discover-search/x-sidebar/component.ts 2 35.29%
lib/registries/addon/components/registries-header/component.ts 3 40.0%
lib/registries/addon/components/registries-search-result/component.ts 3 50.0%
lib/registries/addon/components/registries-provider-facet/component.ts 4 22.22%
lib/registries/addon/components/registries-registration-type-facet/component.ts 6 37.5%
lib/registries/addon/discover/controller.ts 43 35.67%
Totals Coverage Status
Change from base Build 5883248725: -1.6%
Covered Lines: 6017
Relevant Lines: 8264

💛 - Coveralls

futa-ikeda and others added 4 commits August 25, 2023 04:58
…tor (#1968)

* Upadated result container styles for secondary metadata container, added horizontal padding to type labels, removed excessive padding on bottom of open badges list, added top border between primary and secondary metadata containers.

* Updated data definition and term selector, removed unnecessary left margin.
…anel header (#1971)

* Corrected active and hover state for search topbar, reduced top margin for the left panel header.

* Added data test selectors for testing search page functionality.

* Updated spacing, height, and width of pagination buttons, updated translation strings for proper next and previous button text.

* Removed unnecessary elements and translations strings.

* Removed unnecessary styling.

* Updated last child selector to descendant only.
@adlius adlius merged commit e9c7912 into develop Aug 28, 2023
10 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.

None yet

5 participants