Skip to content

Commit

Permalink
Updates for comments from PR
Browse files Browse the repository at this point in the history
  • Loading branch information
bp-cos committed Jul 28, 2023
1 parent d38cf95 commit afb5311
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 27 deletions.
4 changes: 3 additions & 1 deletion app/preprints/index/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Route from '@ember/routing/route';
import RouterService from '@ember/routing/router-service';
import { inject as service } from '@ember/service';
import Theme from 'ember-osf-web/services/theme';
import captureException from 'ember-osf-web/utils/capture-exception';

/**
* Loads all disciplines and preprint providers to the index page
Expand Down Expand Up @@ -38,7 +39,8 @@ export default class Preprints extends Route {
brandedProviders,
};

} catch (e) {
} catch (error) {
captureException(error);
this.router.transitionTo('not-found', 'preprints');
return null;
}
Expand Down
4 changes: 4 additions & 0 deletions app/preprints/index/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
background-color: var(--secondary-color);
color: var(--primary-color) !important;

&.osf {
background: url('images/default-brand/bg-dark.jpg');
}

a:not(:global(.btn)) {
color: var(--primary-color);
text-decoration: underline;
Expand Down
24 changes: 13 additions & 11 deletions app/preprints/index/template.hbs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{{page-title (t 'preprints.title')}}

<div local-class='preprints-page-container' {{with-branding (get-model this.theme.provider.brand) }}>
<div local-class='preprints-page-container' {{with-branding (get-model this.theme.provider.brand) }}
data-analytics-scope='preprints landing page'
>

{{!HEADER}}
<div local-class='preprint-header'>
<div local-class='preprint-header {{if this.isOsf 'osf'}}'>
<BrandedHeader
@translationParent='preprints'
@onSearch={{action this.onSearch}}
Expand All @@ -17,7 +19,7 @@
<div>
<OsfLink
data-test-poweredby-button
data-analytics-name='Preprints powered-by button'
data-analytics-name='powered-by button'
@href={{concat @host 'preprints'}}
>
{{t 'preprints.header.powered_by'}}
Expand All @@ -30,7 +32,7 @@
<div class='lead'>{{t 'preprints.header.or'}}</div>
<OsfLink
data-test-submit-button
data-analytics-name='Preprints submit button'
data-analytics-name='submit button'
local-class='btn-info'
class='btn btn-success btn-lg preprint-submit-button'
@href={{concat this.theme.pathPrefix 'submit'}}
Expand All @@ -40,7 +42,7 @@
<div local-class='example-container'>
<OsfLink
data-test-see-example
data-analytics-name='Preprints - See Example'
data-analytics-name='See Example'
@href={{concat '/content/' (if this.theme.provider.example this.theme.provider.example 'khbvy')}}
>
{{t 'preprints.header.example'}}
Expand All @@ -65,7 +67,7 @@
{{#if this.theme.provider.hasHighlightedSubjects}}
<OsfLink
data-test-see-example
data-analytics-name='Preprints - See Example'
data-analytics-name='See Example'
@href='/discover/'
>
{{t 'preprints.subjects.links.seeAllSubjects'}}
Expand Down Expand Up @@ -94,7 +96,7 @@
{{#if (not-eq provider.id 'livedata') }}
<OsfLink
data-test-see-example
data-analytics-name='Preprints - See Example'
data-analytics-name='See Example'
@href={{concat '/preprints/' provider.id }}
title='{{provider.name}}'
local-class='provider-logo'
Expand All @@ -112,9 +114,9 @@

<OsfLink
data-test-github-repo
data-analytics-name='Preprints - Index - Github Repo'
data-analytics-name='Github Repo'
local-class='links'
@href='https://github.com/CenterForOpenScience/ember-preprints'
@href='https://github.com/CenterForOpenScience/ember-osf-web'
>
{{t 'preprints.services.bottom.div.linkText1'}}
</OsfLink>
Expand All @@ -123,7 +125,7 @@

<OsfLink
data-test-public-roadmap
data-analytics-name='Preprints - Index - Public Roadmap'
data-analytics-name='Public Roadmap'
local-class='links'
@href='https://cos.io/our-products/product-roadmap/'
>
Expand All @@ -135,7 +137,7 @@
<div local-class='contact'>
<OsfLink
data-test-contact-link
data-analytics-name='Preprints - Index - Contact Email'
data-analytics-name='Contact Email'
class='btn btn-info btn-lg'
@href='mailto:[email protected]'
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
{{yield (hash row=(element ''))}}
</div>

<SearchHelpModal @isOpen={{this.showingHelp}} />
<SearchHelpModal @isOpen={{this.showingHelp}}
@onClose={{this.toggleHelp}}
/>

</div>
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Component from '@glimmer/component';
import { computed } from '@ember/object';
import SubjectModel from 'ember-osf-web/models/subject';

interface InputArgs {
Expand All @@ -14,8 +13,6 @@ interface PairModel {
export default class TaxonomyTopList extends Component<InputArgs> {
routerPrefix = 'http://localhost:4200';


@computed('args.list')
get sortedList() {
if (!this.args.list) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { inject as service } from '@ember/service';

interface InputArgs {
isOpen: false;
onClose: () => void;
}

export default class SearchHelpModal extends Component<InputArgs> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div id='ember-bootstrap-modal-container'>
<OsfDialog
@isOpen={{@isOpen}}
@onClose={{action (mut @isOpen) false}}
@onClose={{@onClose}}
as |dialog|
>
<dialog.heading data-test-search-help-modal-header>
Expand Down
16 changes: 8 additions & 8 deletions lib/registries/addon/discover/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
searchable=this.searchable
}}
</HeroOverlay>
{{#registries-discover-search
results=this.results
isLoading=this.doSearch.isIdle
searchOptions=this.searchOptions
additionalFilters=this.additionalFilters
provider=this.providerModel
<RegistriesDiscoverSearch
results={{this.results}}
isLoading={{this.doSearch.isIdle}}
searchOptions={{this.searchOptions}}
additionalFilters={{this.additionalFilters}}
provider={{this.providerModel}}
onSearchOptionsUpdated=(action this.onSearchOptionsUpdated)
as |discover|
}}
>
<div local-class='search-container {{if this.isMobile 'mobile'}}'>
<div local-class='search-options-container'>
{{#if this.searchOptions}}
Expand Down Expand Up @@ -104,5 +104,5 @@
</div>
</div>

{{/registries-discover-search}}
</RegistriesDiscoverSearch>
</RegistriesWrapper>
10 changes: 8 additions & 2 deletions mirage/scenarios/preprints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ function buildOSF(
currentUser: ModelInstance<User>,
) {
const osf = server.schema.preprintProviders.find('osf') as ModelInstance<PreprintProvider>;
const brand = server.create('brand');
const brand = server.create('brand', {
primaryColor: '#286090',
secondaryColor: '#fff',
});
const currentUserModerator = server.create('moderator',
{ id: currentUser.id, user: currentUser, provider: osf }, 'asAdmin');

Expand All @@ -43,7 +46,10 @@ function buildThesisCommons(
currentUser: ModelInstance<User>,
) {
const thesisCommons = server.schema.preprintProviders.find('thesiscommons') as ModelInstance<PreprintProvider>;
const brand = server.create('brand');
const brand = server.create('brand', {
primaryColor: '#721a0e',
secondaryColor: '#fec216',
});
const currentUserModerator = server.create('moderator',
{ id: currentUser.id, user: currentUser, provider: thesisCommons }, 'asAdmin');

Expand Down

0 comments on commit afb5311

Please sign in to comment.