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

[ENG-5028] [ENG-5919] Preprints Affiliation Project PR (FE) #2321

Merged
merged 52 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from 48 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
5202389
Added a new relationship for the affiliated institutions
bp-cos Jul 23, 2024
2961832
updates to the serializers
bp-cos Jul 23, 2024
8dec4a1
Updates to the component and initial tests
bp-cos Aug 5, 2024
02d061c
Added a trait
bp-cos Aug 5, 2024
1ea3279
Added more tests and updates
bp-cos Aug 7, 2024
513b301
Added more tests to the scenario
bp-cos Aug 7, 2024
179c4be
Updates to persist affiliated institutions
bp-cos Aug 8, 2024
5a58e8f
Fixed the tests
bp-cos Aug 9, 2024
05ee0f4
Added logic for mobile and to only display if there are affilitiated …
bp-cos Aug 9, 2024
40ace97
added functionality that all preprints are selected on create mode. A…
bp-cos Aug 9, 2024
b70e96f
Added a description for the institutional affiliations
bp-cos Aug 9, 2024
81f7846
Added a label for accessibility
bp-cos Aug 9, 2024
da35c74
add affiliated institution details to preprints
Aug 5, 2024
ff96e4a
add affiliated institution links and logs to the preprint detail page.
Aug 6, 2024
29ed5df
improve logo size and shape
Aug 6, 2024
9dd3886
update css to new techniques
Aug 6, 2024
7e29e06
make links open in new tab
Aug 6, 2024
243dd34
restrict image sizes
Aug 6, 2024
2894bc6
fix single quotes
Aug 7, 2024
b197b10
add tests for preprint affiliations and clean up css
Aug 7, 2024
34ecc44
Added some test fixes
bp-cos Aug 9, 2024
5ec6496
Add code for institutions preprint affiliations widget on reviews sec…
Aug 12, 2024
8616932
fix component to add title to css and conditional template
Aug 12, 2024
8dbde95
refactor to reviewsPage and fix linting error and tests
Aug 13, 2024
ffe35cc
make Institutional affiliations label disappear if no institutions
Aug 13, 2024
88922dd
add hover-text and simplify css
Aug 13, 2024
b4ea1dd
Updates to make affiliated institutions read-only and fixed a bug on …
bp-cos Aug 14, 2024
5eecaca
Fixed a test
bp-cos Aug 14, 2024
f582cc4
Updated the logic on selecting and persisting of affiliated institutions
bp-cos Aug 15, 2024
03f6291
Fixed the tests
bp-cos Aug 19, 2024
8610794
Added the ability to make the assertion page read-only for non-admins
bp-cos Aug 19, 2024
0ad91e5
Added the cancel button
bp-cos Aug 20, 2024
77a7797
add tooltip and make add contributor widget only visible to admins
Aug 21, 2024
cc924ef
Added a link test
bp-cos Aug 22, 2024
99fafbd
Fixed a missed translation on a cancel button for mobile
bp-cos Aug 23, 2024
a4dd64c
Fixed the initial issue with read/write users and updated the tests
bp-cos Sep 4, 2024
0c5e5d7
Added another test
bp-cos Sep 4, 2024
4a98031
Updated logic and tests to allow admin and write users access
bp-cos Sep 5, 2024
55e8597
Fixed a test with new mirage settings
bp-cos Sep 5, 2024
7227b3b
Added logic to fix a bug on preprint edit flow with affiliated instit…
bp-cos Sep 6, 2024
1af9112
allow write contribs to add affiliations
Sep 6, 2024
5a6de56
improve permission handling
Sep 9, 2024
a195c22
Updates to mirage to handle adding and removing affiliated institutions
bp-cos Sep 9, 2024
a7f75f7
reintroduce isAdmin
Sep 9, 2024
8df9357
[ENG-5919] Feature/preprints affiliations merged to development (#2319)
bp-cos Sep 10, 2024
cad9361
Merge branch 'develop' into upstream/preprints-affiliations
brianjgeiger Sep 11, 2024
3cbd25a
Don't double-add relationships
brianjgeiger Sep 11, 2024
b55d735
Merge pull request #2323 from brianjgeiger/feature/preprints-affiliat…
brianjgeiger Sep 11, 2024
9a3a11b
Removed the cancel button
bp-cos Sep 12, 2024
b813257
Merge remote-tracking branch 'upstream/develop' into feature/preprint…
cslzchen Sep 16, 2024
262e671
Fixed some typos
bp-cos Sep 17, 2024
55f9dec
Merge pull request #2332 from bp-cos/pr-update/eng-5919
brianjgeiger Sep 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions app/models/preprint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import AbstractNodeModel from 'ember-osf-web/models/abstract-node';
import CitationModel from 'ember-osf-web/models/citation';
import PreprintRequestModel from 'ember-osf-web/models/preprint-request';
import { ReviewsState } from 'ember-osf-web/models/provider';
import ReviewActionModel from 'ember-osf-web/models/review-action';
import InstitutionModel from 'ember-osf-web/models/institution';

import ContributorModel from './contributor';
import FileModel from './file';
Expand Down Expand Up @@ -81,6 +83,12 @@ export default class PreprintModel extends AbstractNodeModel {
@belongsTo('preprint-provider', { inverse: 'preprints' })
provider!: AsyncBelongsTo<PreprintProviderModel> & PreprintProviderModel;

@hasMany('institution')
affiliatedInstitutions!: AsyncHasMany<InstitutionModel>;

@hasMany('review-action')
reviewActions!: AsyncHasMany<ReviewActionModel>;

@hasMany('contributors', { inverse: 'preprint'})
contributors!: AsyncHasMany<ContributorModel> & ContributorModel;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
.osf-institution-link-flex {
img {
width: 35px;
height: 35px;
}

a {
padding-bottom: 5px;
}

.img-circle {
border-radius: 50%;
margin-right: 15px;
}

.img-responsive {
max-width: 100%;
}

.img-horizontal {
margin-top: 10px;
}

.link-horizontal {
display: inline;
}

.link-vertical {
display: block;
}

}

.title {
margin-top: 10px;
font-weight: bold;
font-size: 18px;
padding-bottom: 10px;
}

.content-container {
width: 100%;
margin-top: 20px;

h4 {
margin-top: 10px;
margin-bottom: 10px;
font-weight: bold;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{{#if @preprint.affiliatedInstitutions}}
<div local-class='content-container'>
<div local-class='title'>
{{t 'preprints.detail.affiliated_institutions'}}
</div>
<div local-class='osf-institution-link-flex'>
{{#each @preprint.affiliatedInstitutions as |institution|}}
<OsfLink @href={{institution.links.html}} @target='_blank' local-class='{{if @isReviewPage 'link-horizontal'}}{{unless @isReviewPage 'link-vertical'}}'>
<img
data-test-preprint-institution-list={{institution.id}}
local-class='img-circle img-responsive {{if @isReviewPage 'img-horizontal'}}'
src={{institution.logoRoundedUrl}}
alt={{institution.name}}
>
{{#if @isReviewPage}}
<EmberTooltip>
{{institution.name}}
</EmberTooltip>
{{else}}
{{institution.name}}
{{/if}}
</OsfLink>
{{/each}}
</div>
</div>
{{/if}}
Loading
Loading