Skip to content

Commit

Permalink
Merge branch 'develop' into upstream/addon-services
Browse files Browse the repository at this point in the history
  • Loading branch information
brianjgeiger committed May 20, 2024
2 parents 513e06e + a0aaa10 commit b125353
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 13 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [24.04.0] - 2024-04-30
### Added
- Misc bug and a11y fixes

## [24.03.0] - 2024-02-26
### Added
- Integrate Cedar Embeddable Editor for adding and editing metadata
Expand Down
2 changes: 2 additions & 0 deletions app/models/preprint-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export default class PreprintProviderModel extends ProviderModel {
@attr('string') shareSource!: string;
@attr('string') preprintWord!: PreprintWord;

@attr('boolean', { defaultValue: true }) advertiseOnDiscoverPage!: boolean;

// Reviews settings
@attr('array') permissions!: ReviewPermissions[];
@attr('boolean', { allowNull: true }) reviewsCommentsPrivate!: boolean | null;
Expand Down
5 changes: 4 additions & 1 deletion app/preprints/index/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ export default class Preprints extends Route {
let brandedProviders = [];

if (this.theme.id === 'osf') {
const allProviders = await this.store.findAll('preprint-provider', { reload: true });
const allProviders = await this.store.query('preprint-provider', {
reload: true,
filter: { advertise_on_discover_page: true },
});
brandedProviders = allProviders.filter(item => item.id !== 'osf');
}

Expand Down
18 changes: 8 additions & 10 deletions app/preprints/index/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,14 @@
</p>
<div local-class='preprint-logos-container'>
{{#each this.model.brandedProviders as |provider| }}
{{#if (not-eq provider.id 'livedata') }}
<OsfLink
data-test-see-branded-providers-example
data-analytics-name='See Branded Providers Example'
@href={{concat '/preprints/' provider.id }}
title='{{provider.name}}'
local-class='provider-logo'
style={{html-safe (concat 'background-image: url(' provider.assets.wide_white ')' )}}
></OsfLink>
{{/if}}
<OsfLink
data-test-see-branded-providers-example
data-analytics-name='See Branded Providers Example'
@href={{concat '/preprints/' provider.id }}
title='{{provider.name}}'
local-class='provider-logo'
style={{html-safe (concat 'background-image: url(' provider.assets.wide_white ')' )}}
></OsfLink>
{{/each}}
</div>
<div local-class='preprint-contact-container'>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
tabindex='0'
id={{id}}
@icon='question-circle'
@ariaHidden={{false}}
aria-hidden='false'
aria-label={{this.helpText}}
...attributes
/>
<EmberPopover
Expand Down
12 changes: 12 additions & 0 deletions mirage/fixtures/preprint-providers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const preprintProviders: Array<Partial<PreprintProvider>> = [
{
id: 'osf',
name: 'Open Science Framework',
advertiseOnDiscoverPage: true,
preprintWord: 'preprint',
assets: randomAssets(1),
footerLinks: 'fake footer links',
Expand All @@ -25,6 +26,7 @@ const preprintProviders: Array<Partial<PreprintProvider>> = [
{
id: 'thesiscommons',
name: 'Thesis Commons',
advertiseOnDiscoverPage: true,
preprintWord: 'thesis',
assets: randomAssets(2),
// eslint-disable-next-line max-len
Expand All @@ -33,6 +35,7 @@ const preprintProviders: Array<Partial<PreprintProvider>> = [
{
id: 'preprintrxiv',
name: 'PreprintrXiv',
advertiseOnDiscoverPage: false,
preprintWord: 'preprint',
assets: randomAssets(3),
// eslint-disable-next-line max-len
Expand All @@ -43,6 +46,7 @@ const preprintProviders: Array<Partial<PreprintProvider>> = [
{
id: 'paperxiv',
name: 'PaperXiv',
advertiseOnDiscoverPage: true,
preprintWord: 'paper',
assets: randomAssets(4),
// eslint-disable-next-line max-len
Expand All @@ -51,6 +55,7 @@ const preprintProviders: Array<Partial<PreprintProvider>> = [
{
id: 'thesisrxiv',
name: 'ThesisrXiv',
advertiseOnDiscoverPage: true,
preprintWord: 'thesis',
assets: randomAssets(5),
// eslint-disable-next-line max-len
Expand All @@ -59,45 +64,52 @@ const preprintProviders: Array<Partial<PreprintProvider>> = [
{
id: 'workrxiv',
name: 'WorkrXiv',
advertiseOnDiscoverPage: true,
preprintWord: 'work',
assets: randomAssets(6),
footerLinks: 'fake footer links',
},
{
id: 'docrxiv',
name: 'DocrXiv',
advertiseOnDiscoverPage: true,
preprintWord: 'default',
assets: randomAssets(7),
footerLinks: 'fake footer links',
},
{
id: 'agrixiv',
name: 'AgriXiv',
advertiseOnDiscoverPage: true,
preprintWord: 'preprint',
assets: randomAssets(8),
reviewsWorkflow: PreprintProviderReviewsWorkFlow.POST_MODERATION,
},
{
id: 'biohackrxiv',
name: 'BioHackrXiv',
advertiseOnDiscoverPage: true,
preprintWord: 'preprint',
assets: randomAssets(9),
},
{
id: 'nutrixiv',
name: 'NutriXiv',
advertiseOnDiscoverPage: true,
preprintWord: 'preprint',
assets: randomAssets(10),
},
{
id: 'paleorxiv',
name: 'PaleoRrxiv',
advertiseOnDiscoverPage: true,
preprintWord: 'preprint',
assets: randomAssets(10, false),
},
{
id: 'sportrxiv',
name: 'Sport-Rxiv',
advertiseOnDiscoverPage: true,
preprintWord: 'paper',
assets: randomAssets(10),
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ember-osf-web",
"version": "24.03.0",
"version": "24.04.0",
"private": true,
"description": "Ember front-end for the Open Science Framework",
"homepage": "https://github.com/CenterForOpenScience/ember-osf-web#readme",
Expand Down
1 change: 1 addition & 0 deletions tests/acceptance/preprints/index-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ module('Acceptance | preprints | index', hooks => {
provider.update({
brand,
description: 'This is the description for OSF',
advertiseOnDiscoverPage: true,
});
this.provider = provider;
});
Expand Down

0 comments on commit b125353

Please sign in to comment.