Skip to content

Commit 9835159

Browse files
committed
Merge branch 'develop' into ember-24-lts
2 parents afaaddb + eeda12a commit 9835159

File tree

10 files changed

+78
-24
lines changed

10 files changed

+78
-24
lines changed

CHANGELOG.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,24 @@ 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+
## [21.5.0] - 2021-05-27
8+
### Fixed
9+
- registration Detail Page: longer license types spill out of bounds
10+
- unencode special characters in Registries Moderator Comments and Registries Custom Metadata
11+
- (deprecations) use jQuery in lieu of Ember.$()
12+
- (deprecations) use ember-copy in lieu of copy method and Copyable mixin
13+
14+
### Changed
15+
- (project-based registration) ensure only templates associated with OSF Registries is shown
16+
17+
### Added
18+
- (my-registrations page) text explaining how submitted/draft registrations are sorted
19+
20+
## [21.4.1] - 2021-05-26
21+
### Changed
22+
- hide registration state for anonymous VOLs
23+
- `reviewsState` to optional on the `registration` model
24+
725
## [21.4.0] - 2021-04-11
826
### Added
927
- user's `myRegistrations` page
@@ -1723,7 +1741,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
17231741
### Added
17241742
- Quick Files
17251743

1726-
[Unreleased]: https://github.com/CenterForOpenScience/ember-osf-web/compare/21.4.0...develop
1744+
[Unreleased]: https://github.com/CenterForOpenScience/ember-osf-web/compare/21.5.0...develop
1745+
[21.5.0]: https://github.com/CenterForOpenScience/ember-osf-web/releases/tag/21.5.0
1746+
[21.4.1]: https://github.com/CenterForOpenScience/ember-osf-web/releases/tag/21.4.1
17271747
[21.4.0]: https://github.com/CenterForOpenScience/ember-osf-web/releases/tag/21.4.0
17281748
[21.3.0]: https://github.com/CenterForOpenScience/ember-osf-web/releases/tag/21.3.0
17291749
[21.2.0]: https://github.com/CenterForOpenScience/ember-osf-web/releases/tag/21.2.0

app/models/registration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export default class RegistrationModel extends NodeModel.extend(Validations) {
7979
@attr('fixstring') articleDoi!: string | null;
8080
@attr('object') registeredMeta!: RegistrationMetadata;
8181
@attr('registration-responses') registrationResponses!: RegistrationResponse;
82-
@attr('fixstring') reviewsState!: RegistrationReviewStates;
82+
@attr('fixstring') reviewsState?: RegistrationReviewStates;
8383
@attr('fixstring') iaUrl?: string;
8484
@attr('array') providerSpecificMetadata!: ProviderMetadata[];
8585

lib/registries/addon/components/make-decision-dropdown/component.ts

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,22 +50,30 @@ export default class MakeDecisionDropdown extends Component<Args> {
5050
};
5151

5252
get commentTextArea() {
53-
if ([RegistrationReviewStates.Pending, RegistrationReviewStates.PendingWithdraw]
54-
.includes(this.args.registration.reviewsState)) {
53+
if (this.args.registration.reviewsState) {
54+
if ([RegistrationReviewStates.Pending, RegistrationReviewStates.PendingWithdraw]
55+
.includes(this.args.registration.reviewsState)) {
56+
return {
57+
label: this.intl.t('registries.makeDecisionDropdown.additionalComment'),
58+
placeholder: this.intl.t('registries.makeDecisionDropdown.additionalCommentPlaceholder'),
59+
};
60+
}
61+
5562
return {
56-
label: this.intl.t('registries.makeDecisionDropdown.additionalComment'),
57-
placeholder: this.intl.t('registries.makeDecisionDropdown.additionalCommentPlaceholder'),
63+
label: this.intl.t('registries.makeDecisionDropdown.justificationForWithdrawal'),
64+
placeholder: this.intl.t('registries.makeDecisionDropdown.justificationForWithdrawalPlaceholder'),
5865
};
5966
}
60-
67+
// registration is viewed anonymously and this component should not be visible
6168
return {
62-
label: this.intl.t('registries.makeDecisionDropdown.justificationForWithdrawal'),
63-
placeholder: this.intl.t('registries.makeDecisionDropdown.justificationForWithdrawalPlaceholder'),
69+
label: '',
70+
placeholder: '',
6471
};
6572
}
6673

6774
get hasModeratorActions() {
68-
return ![
75+
return this.args.registration.reviewsState
76+
&& ![
6977
RegistrationReviewStates.Initial,
7078
RegistrationReviewStates.Withdrawn,
7179
RegistrationReviewStates.Rejected,

lib/registries/addon/components/registries-states/component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export default class RegistriesStates extends Component {
4949
)
5050
/* eslint-enable max-len */
5151
get stateText() {
52-
if (!this.registration) {
52+
if (!this.registration || !this.registration.reviewsState) {
5353
return undefined;
5454
}
5555
let stateKey;
@@ -75,6 +75,7 @@ export default class RegistriesStates extends Component {
7575
@computed('registration.{userHasAdminPermission,reviewsState}')
7676
get shouldOpenDropdownOnLoad() {
7777
return this.registration.userHasAdminPermission
78+
&& this.registration.reviewsState
7879
&& ![
7980
RegistrationReviewStates.Embargo,
8081
RegistrationReviewStates.Accepted,
@@ -96,6 +97,7 @@ export default class RegistriesStates extends Component {
9697
!this.registration.isRoot
9798
|| !this.registration.userHasAdminPermission
9899
|| this.isModeratorMode
100+
|| !this.registration.reviewsState
99101
|| !(
100102
[RegistrationReviewStates.Accepted, RegistrationReviewStates.Embargo].includes(
101103
this.registration.reviewsState,

lib/registries/addon/overview/-components/overview-topbar/template.hbs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
<div data-test-topbar-states>
2-
<RegistriesStates
3-
@registration={{@registration}}
4-
@isModeratorMode={{@isModeratorMode}}
5-
/>
6-
</div>
7-
{{#if @isModeratorMode}}
1+
{{#unless @registration.isAnonymous}}
2+
<div data-test-topbar-states>
3+
<RegistriesStates
4+
@registration={{@registration}}
5+
@isModeratorMode={{@isModeratorMode}}
6+
/>
7+
</div>
8+
{{/unless}}
9+
{{#if (and @isModeratorMode (not @registration.isAnonymous))}}
810
<MakeDecisionDropdown @registration={{@registration}} />
911
{{else}}
1012
<div data-test-topbar-share-bookmark-fork

mirage/serializers/application.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ export default class ApplicationSerializer<T extends Model> extends JSONAPISeria
5353
serialize(model: ModelInstance<T>, request: Request) {
5454
const json = super.serialize(model, request);
5555
json.data.links = this.buildNormalLinks(model);
56-
json.data.meta = {
56+
json.meta = {
5757
...this.buildApiMeta(model),
58-
...(json.data.meta || {}),
58+
...(json.meta || {}),
5959
};
6060
json.data.relationships = Object
6161
.entries(this.buildRelationships(model))

mirage/serializers/registration.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,4 +241,11 @@ export default class RegistrationSerializer extends ApplicationSerializer<Mirage
241241
}
242242
return relationships;
243243
}
244+
245+
buildApiMeta(model: ModelInstance<MirageRegistration>) {
246+
return {
247+
...super.buildApiMeta(model),
248+
...(model.attrs._anonymized ? { anonymous: true } : {}),
249+
};
250+
}
244251
}

mirage/views/registration.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,13 @@ export function registrationDetail(this: HandlerContext, schema: Schema, request
3333
errors: [{ detail: 'Not found.' }],
3434
});
3535
}
36+
const serializedRegistration = this.serialize(registration);
37+
const { data } = process(schema, request, this, [serializedRegistration.data]);
3638

37-
const { data } = process(schema, request, this, [this.serialize(registration).data]);
38-
39-
return { data: data[0] };
39+
return {
40+
data: data[0],
41+
meta: serializedRegistration.meta,
42+
};
4043
}
4144

4245
export function createNodeFromDraftNode(

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ember-osf-web",
3-
"version": "21.4.0",
3+
"version": "21.5.0",
44
"description": "Ember front-end for the Open Science Framework",
55
"license": "Apache-2.0",
66
"author": "Center for Open Science <support@cos.io>",

tests/engines/registries/acceptance/overview/topbar-test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,18 @@ module('Registries | Acceptance | overview.topbar', hooks => {
9696
assert.dom('[data-test-topbar-states]').doesNotExist();
9797
});
9898

99+
test('registration state is not visible in topbar when viewing registrations anonymously', async assert => {
100+
const anonymousReg = server.create('registration', {
101+
registrationSchema: server.schema.registrationSchemas.find('prereg_challenge'),
102+
}, 'anonymized');
103+
104+
await visit(`/${anonymousReg.id}/`);
105+
await percySnapshot(assert);
106+
107+
assert.dom('[data-test-topbar-share-bookmark-fork]').exists();
108+
assert.dom('[data-test-topbar-states]').doesNotExist();
109+
});
110+
99111
test('bookmarks work', async assert => {
100112
const reg = server.create('registration', {
101113
registrationSchema: server.schema.registrationSchemas.find('prereg_challenge'),

0 commit comments

Comments
 (0)