Skip to content

Commit c1bb889

Browse files
committed
Merge branch 'release/24.01.0'
2 parents 2dea2ec + 85290b1 commit c1bb889

File tree

20 files changed

+142
-15
lines changed

20 files changed

+142
-15
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7+
## [24.01.0] - 2024-01-05
8+
### Added
9+
- Support for Disease and Data Type CollectionProvider metadata
10+
- data-test-* tags for Preprints Selenium tests
11+
712
## [23.15.0] - 2023-11-10
813
### Added
914
- Preprint detail and landing page rewrite

app/models/collection-submission.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ export const choiceFields = tuple(
2121
'volume',
2222
'studyDesign',
2323
'schoolType',
24+
'dataType',
25+
'disease',
2426
);
2527

2628
export enum CollectionSubmissionReviewStates {
@@ -76,9 +78,11 @@ export default class CollectionSubmissionModel extends OsfModel.extend(Validatio
7678
@attr('string') programArea?: string;
7779
@attr('string') status?: string;
7880
@attr('string') volume?: string;
79-
@attr('string') reviewsState?: CollectionSubmissionReviewStates;
8081
@attr('string') studyDesign?: string; // custom field for Character Lab
8182
@attr('string') schoolType?: string; // custom field for Character Lab
83+
@attr('string') dataType?: string;
84+
@attr('string') disease?: string;
85+
@attr('string') reviewsState?: CollectionSubmissionReviewStates;
8286

8387
@belongsTo('collection') collection!: Collection;
8488
@belongsTo('node') guid!: Node;

app/models/collection.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ export type ChoicesFields =
1414
'statusChoices' |
1515
'volumeChoices' |
1616
'studyDesignChoices' |
17-
'schoolTypeChoices';
17+
'schoolTypeChoices' |
18+
'dataTypeChoices' |
19+
'diseaseChoices';
1820

1921
export const choicesFields = choiceFields.map(field => `${field}Choices`) as ChoicesFields[];
2022

@@ -32,6 +34,8 @@ export default class CollectionModel extends OsfModel {
3234
@attr('array') volumeChoices!: string[];
3335
@attr('array') studyDesignChoices!: string[]; // custom field for Character Lab
3436
@attr('array') schoolTypeChoices!: string[]; // custom field for Character Lab
37+
@attr('array') dataTypeChoices!: string[];
38+
@attr('array') diseaseChoices!: string[];
3539

3640
@belongsTo('collection-provider')
3741
provider!: AsyncBelongsTo<CollectionProviderModel> & CollectionProviderModel;
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<div>
22
<h4>{{t 'preprints.detail.disciplines'}}</h4>
3-
{{#each this.disciplineReduced as |subject|}}
4-
<span local-class='subject-preview'>{{subject.text}}</span>
5-
{{/each}}
3+
<span data-test-subjects>
4+
{{#each this.disciplineReduced as |subject|}}
5+
<span local-class='subject-preview'>{{subject.text}}</span>
6+
{{/each}}
7+
</span>
68
</div>

app/preprints/-components/preprint-status-banner/template.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
{{else}}
1313
<div>
1414
<FaIcon @icon='{{this.icon}}' @prefix='far' local-class='status-icon' aria-hidden='true'/>
15-
<strong>{{t this.status }}:</strong>
16-
<span>{{this.bannerContent}}</span>
15+
<strong data-test-status>{{t this.status }}:</strong>
16+
<span data-test-status-explanation>{{this.bannerContent}}</span>
1717
</div>
1818
{{#if (and this.reviewerComment (not this.submission.provider.reviewsCommentsPrivate))}}
1919
<div local-class='reviewer-feedback'>

app/preprints/-components/preprint-tag/template.hbs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
<div>
22
<h4>{{t 'preprints.detail.tags'}}</h4>
33
{{#if @preprint.tags.length}}
4-
{{#each @preprint.tags as |tag|}}
5-
<span local-class='badge'>{{tag}}</span>
6-
{{/each}}
4+
<span data-test-tags>
5+
{{#each @preprint.tags as |tag|}}
6+
<span local-class='badge'>{{tag}}</span>
7+
{{/each}}
8+
</span>
79
{{else}}
810
{{t 'preprints.detail.none'}}
911
{{/if}}

app/preprints/-components/preprint-tombstone/template.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<div local-class='withdrawn-container'>
22
{{#if @preprint.withdrawalJustification}}
3-
<div>
3+
<div data-test-withdrawal-justification>
44
<h4>{{t 'preprints.detail.reason_for_withdrawal'}}</h4>
5-
<p>
5+
<p data-test-justification>
66
{{@preprint.withdrawalJustification}}
77
</p>
88
</div>

app/preprints/detail/template.hbs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
local-class='preprints-details-page-container {{if this.isMobile 'mobile'}}'
66
{{with-branding this.model.brand}}
77
data-analytics-scope='preprints detail page'
8+
data-test-preprint-header
89
>
910
<div local-class='header-container'>
1011
<div local-class='preprint-title-container'>
11-
<h1>{{this.model.preprint.title}}</h1>
12+
<h1 data-test-preprint-title>{{this.model.preprint.title}}</h1>
1213
{{#unless this.model.preprint.isWithdrawn}}
1314
<div class='edit-preprint-button'>
1415
{{#if (and this.userIsContrib (not this.isPendingWithdrawal))}}
@@ -122,7 +123,14 @@
122123
</OsfLink>
123124
</div>
124125
<div>
125-
{{t 'preprints.detail.share.views'}}: {{this.model.preprint.apiMeta.metrics.views}} | {{t 'preprints.detail.share.downloads'}}: {{this.model.preprint.apiMeta.metrics.downloads}}
126+
<span data-test-view-count-label>
127+
{{t 'preprints.detail.share.views'}}:
128+
</span>
129+
<span data-test-view-count> {{this.model.preprint.apiMeta.metrics.views}} </span> |
130+
<span data-test-download-count-label>
131+
{{t 'preprints.detail.share.downloads'}}:
132+
</span>
133+
<span data-test-download-count>{{this.model.preprint.apiMeta.metrics.downloads}}</span>
126134
<EmberTooltip>
127135
{{t 'preprints.detail.share.metrics_disclaimer'}} {{moment-format this.metricsStartDate 'YYYY-MM-DD'}}
128136
</EmberTooltip>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{{#each @context.activeFilter as |item|}}
2+
<DiscoverPage::ActiveFilters::Filter
3+
@item={{item}}
4+
@text={{item}}
5+
@ariaLabel={{t 'collections.discover_page.active_filters.remove_data_type'}}
6+
@removeFilterItem={{action this.removeFilterItem item}}
7+
/>
8+
{{/each}}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{{#each @context.activeFilter as |item|}}
2+
<DiscoverPage::ActiveFilters::Filter
3+
@item={{item}}
4+
@text={{item}}
5+
@ariaLabel={{t 'collections.discover_page.active_filters.remove_disease'}}
6+
@removeFilterItem={{action this.removeFilterItem item}}
7+
/>
8+
{{/each}}

0 commit comments

Comments
 (0)