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/preprint details page #2026

Closed
wants to merge 170 commits into from
Closed

Conversation

bp-cos
Copy link
Contributor

@bp-cos bp-cos commented Oct 10, 2023

  • Ticket: [ENG-4634, ENG-4635]
  • Feature flag: n/a

Purpose

Port the preprint details page from osf-preprints to osf-web

Summary of Changes

Rewrite of the osf-preprint components

Screenshot(s)

Desktop in OSF-Preprints
preprints - desktop - before

Desktop in OSF-Web
Preprints - desktop - after

Mobile in OSF-Preprints
preprints - mobile - before 1

preprints - mobile - before 2

preprints - mobile - before 3

preprints - mobile - before 4

Mobile in OSF-Web

preprints - mobile - after 1

preprints - mobile - after 2

preprints - mobile - after 3

**Tombstone Desktop **

Tombstone - desktop

**Tombstone Mobile **

Tombstone - mobile

** Rejected Desktop **

Rejected - Desktop

** Rejected Mobile **

Rejected - Mobile

** Approved - Author Assertions - Desktop **

Approved - Author Assertions - Desktop

** Approved - Author Assertions - Mobile **

Approved - Author Assertions - Mobile

The Preprint Doi is blank when

  • No preprintDoiUrl
  • the preprint is public
  • the provider does not have a reviewsWorkFlow
  • the preprint is publish

blank-doi

Side Effects

Massive testing

QA Notes

The preprint details page will need to be regressed

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.

Just some stragglers from the big merge commit that I see

app/adapters/index-property-search.ts Outdated Show resolved Hide resolved
app/models/index-property-search.ts Outdated Show resolved Hide resolved
app/models/index-value-search.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@adlius adlius 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 some questions.

app/models/file.ts Show resolved Hide resolved
app/models/preprint-provider.ts Outdated Show resolved Hide resolved
app/models/preprint-provider.ts Show resolved Hide resolved
app/models/preprint-provider.ts Outdated Show resolved Hide resolved
app/models/preprint.ts Outdated Show resolved Hide resolved
app/preprints/template.hbs Outdated Show resolved Hide resolved
app/router.ts Outdated Show resolved Hide resolved
app/router.ts Outdated Show resolved Hide resolved
app/serializers/index-property-search.ts Outdated Show resolved Hide resolved
app/styles/_preprint.scss Show resolved Hide resolved
Copy link
Contributor

@brianjgeiger brianjgeiger left a comment

Choose a reason for hiding this comment

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

Just some small things, but overall looks good. Yay for tests!

app/models/preprint-provider.ts Outdated Show resolved Hide resolved
app/models/preprint.ts Outdated Show resolved Hide resolved
app/models/preprint.ts Outdated Show resolved Hide resolved
app/models/provider.ts Outdated Show resolved Hide resolved
app/preprints/-components/plaudit-widget/component.ts Outdated Show resolved Hide resolved
mirage/factories/preprint-request-action.ts Show resolved Hide resolved
mirage/factories/preprint-request.ts Show resolved Hide resolved
mirage/serializers/preprint-request.ts Outdated Show resolved Hide resolved
mirage/serializers/preprint.ts Outdated Show resolved Hide resolved
app/models/preprint-provider.ts Show resolved Hide resolved
app/models/preprint-request-action.ts Outdated Show resolved Hide resolved
app/models/preprint-request.ts Outdated Show resolved Hide resolved
app/models/preprint.ts Outdated Show resolved Hide resolved
app/models/provider.ts Show resolved Hide resolved
app/preprints/detail/styles.scss Outdated Show resolved Hide resolved
app/preprints/detail/template.hbs Show resolved Hide resolved
mirage/config.ts Outdated Show resolved Hide resolved
mirage/config.ts Show resolved Hide resolved
futa-ikeda and others added 24 commits October 27, 2023 10:20
-   Ticket: [ENG-4450]
-   Feature flag: n/a

- Add new models needed for SHARE-powered search page

- 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

- 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

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

- Add object type filter and sort dropdown to search page

- 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: [No ticket]
-   Feature flag: n/a

- Update SHAREAdapter to point to correct locations

- 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

- Componentize search page for reuse in branded pages

- 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 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 <[email protected]>
* 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

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

- 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: [ENG-4535]
-   Feature flag: n/a

- 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

- 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

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

- 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: []
-   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
@bp-cos bp-cos force-pushed the feature/preprint-details-page branch from a3c175d to 4acbbc9 Compare October 27, 2023 16:53
@coveralls
Copy link

coveralls commented Oct 27, 2023

Pull Request Test Coverage Report for Build 6722584157

  • 109 of 265 (41.13%) changed or added relevant lines in 20 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-1.0%) to 69.624%

Changes Missing Coverage Covered Lines Changed/Added Lines %
app/models/preprint.ts 0 1 0.0%
app/preprints/-components/plaudit-widget/component.ts 0 1 0.0%
app/serializers/preprint-request-action.ts 0 1 0.0%
lib/osf-components/addon/components/file-renderer/component.ts 2 3 66.67%
app/preprints/-components/preprint-discipline/component.ts 0 2 0.0%
app/preprints/-components/preprint-doi/component.ts 0 2 0.0%
lib/osf-components/addon/components/sharing-icons/component.ts 0 2 0.0%
app/preprints/-components/preprint-license/component.ts 0 3 0.0%
app/preprints/index/route.ts 11 14 78.57%
app/resolve-guid/route.ts 2 5 40.0%
Files with Coverage Reduction New Missed Lines %
app/search/controller.ts 1 88.89%
Totals Coverage Status
Change from base Build 6642409593: -1.0%
Covered Lines: 6042
Relevant Lines: 8431

💛 - Coveralls

@adlius
Copy link
Contributor

adlius commented Nov 1, 2023

Temporarily closed to avoid percy runs. Will reopen later when things are stabilized.

@adlius adlius closed this Nov 1, 2023
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.

5 participants