Skip to content

Commit 4077aee

Browse files
committed
Merge branch 'release/21.4.0'
2 parents 05150e5 + d3bc5bf commit 4077aee

File tree

36 files changed

+880
-187
lines changed

36 files changed

+880
-187
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ 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.4.0] - 2021-04-11
8+
### Added
9+
- user's `myRegistrations` page
10+
711
## [21.3.0] - 2021-04-23
812
### Added
913
- support for provider-specific (editable/read-only) registration metadata fields
@@ -1719,7 +1723,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
17191723
### Added
17201724
- Quick Files
17211725

1722-
[Unreleased]: https://github.com/CenterForOpenScience/ember-osf-web/compare/21.3.0...develop
1726+
[Unreleased]: https://github.com/CenterForOpenScience/ember-osf-web/compare/21.4.0...develop
1727+
[21.4.0]: https://github.com/CenterForOpenScience/ember-osf-web/releases/tag/21.4.0
17231728
[21.3.0]: https://github.com/CenterForOpenScience/ember-osf-web/releases/tag/21.3.0
17241729
[21.2.0]: https://github.com/CenterForOpenScience/ember-osf-web/releases/tag/21.2.0
17251730
[21.1.1]: https://github.com/CenterForOpenScience/ember-osf-web/releases/tag/21.1.1

app/guid-node/registrations/template.hbs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
</NodeList>
4646
</div>
4747
</tab.pane>
48-
{{#if this.node.userHasAdminPermission}}
48+
{{#if this.node.userHasReadPermission}}
4949
<tab.pane
5050
data-analytics-scope='Drafts tab'
5151
@id='drafts'
@@ -69,7 +69,9 @@
6969

7070
<list.empty>
7171
<p>{{t 'node.registrations.no_drafts'}}</p>
72-
<p>{{t 'node.registrations.start_new'}}</p>
72+
{{#if this.node.userHasAdminPermission}}
73+
<p>{{t 'node.registrations.start_new'}}</p>
74+
{{/if}}
7375
<p>
7476
{{t 'node.registrations.learn_more'
7577
learnMoreLink='https://openscience.zendesk.com/hc/en-us/articles/360019930893'

lib/osf-components/addon/components/delete-button/component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export default class DeleteButton extends Component {
3232
hardConfirm: boolean = defaultTo(this.hardConfirm, false);
3333
disabled: boolean = defaultTo(this.disabled, false);
3434
shouldStopPropagation = false;
35+
icon: string = 'times';
3536
buttonLabel: string = defaultTo(
3637
this.buttonLabel,
3738
this.intl.t('osf-components.delete-button.buttonLabel'),

lib/osf-components/addon/components/delete-button/template.hbs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
{{on 'click' this._show}}
99
@disabled={{this.disabled}}
1010
>
11-
{{fa-icon 'times' size='lg'}}
11+
<FaIcon @icon={{this.icon}} />
1212
</Button>
1313
{{else if this.smallSecondary}}
1414
<Button
@@ -20,6 +20,9 @@
2020
@layout='small'
2121
{{on 'click' this._show}}
2222
>
23+
{{#if @icon}}
24+
<FaIcon @icon={{this.icon}} />
25+
{{/if}}
2326
{{this.buttonLabel}}
2427
</Button>
2528
{{else}}

lib/osf-components/addon/components/draft-registration-card/styles.scss

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.DraftRegistrationCard {
2+
margin-bottom: 10px;
3+
24
:global(.ember-content-placeholders-text__line) {
35
height: 1em;
46
}
@@ -19,20 +21,43 @@
1921
}
2022

2123
.DraftRegistrationCard__body {
22-
font-size: 18px;
2324
font-weight: 400;
2425
line-height: 1;
25-
color: $color-text-gray-light;
2626

27-
small {
28-
font-size: 75%;
27+
dl {
28+
margin-bottom: 10px;
29+
}
30+
31+
dt,
32+
dd {
33+
display: inline-block;
2934
}
3035

3136
:global(.ember-content-placeholders-text) {
3237
width: 33%;
3338
}
3439
}
3540

41+
// stylelint-disable selector-no-qualifying-type
42+
a.DraftRegistrationCard__review {
43+
margin-right: 10px;
44+
45+
&:hover {
46+
text-decoration: none;
47+
}
48+
}
49+
50+
// stylelint-enable selector-no-qualifying-type
51+
.DraftRegistrationCard__edit {
52+
vertical-align: bottom;
53+
}
54+
55+
.DraftRegistrationCard__delete {
56+
button {
57+
padding: 6px 12px;
58+
}
59+
}
60+
3661
:global(.delete_draft_registration) {
3762
:global(.modal-header) {
3863
h4 {

lib/osf-components/addon/components/draft-registration-card/template.hbs

Lines changed: 77 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010
@route='registries.drafts.draft'
1111
@models={{array this.draftRegistration.id}}
1212
>
13-
{{this.draftRegistration.title}}
13+
{{#if this.draftRegistration.title}}
14+
{{this.draftRegistration.title}}
15+
{{else}}
16+
{{t 'osf-components.draft-registration-card.untitled_placeholder'}}
17+
{{/if}}
1418
</OsfLink>
1519
{{else}}
1620
<ContentPlaceholders as |placeholder|>
@@ -23,81 +27,86 @@
2327
</h4>
2428
<section local-class='DraftRegistrationCard__body' data-test-draft-registration-card-body>
2529
{{#if this.draftRegistration}}
26-
<small>
27-
<p data-test-initiated-by>
28-
{{t 'osf-components.draft-registration-card.initiated_by'}}
29-
{{this.draftRegistration.initiator.fullName}}
30-
</p>
31-
<p data-test-form-type>
32-
{{t 'osf-components.draft-registration-card.form_type'}}
33-
{{this.draftRegistration.registrationSchema.name}}
34-
</p>
35-
<p data-test-time-initiated>
36-
{{t 'osf-components.draft-registration-card.started'}}
37-
{{moment this.draftRegistration.datetimeInitiated}}
38-
</p>
39-
<p data-test-time-updated>
40-
{{t 'osf-components.draft-registration-card.last_updated'}}
41-
{{moment this.draftRegistration.datetimeUpdated}}
42-
</p>
43-
</small>
30+
<dl>
31+
<div data-test-initiated-by>
32+
<dt>
33+
{{t 'osf-components.draft-registration-card.initiated_by'}}
34+
</dt>
35+
<dd>
36+
{{this.draftRegistration.initiator.fullName}}
37+
</dd>
38+
</div>
39+
<div data-test-form-type>
40+
<dt>
41+
{{t 'osf-components.draft-registration-card.form_type'}}
42+
</dt>
43+
<dd>
44+
{{this.draftRegistration.registrationSchema.name}}
45+
</dd>
46+
</div>
47+
<div data-test-provider-name>
48+
<dt data-test-provider-name>
49+
{{t 'osf-components.draft-registration-card.registry'}}
50+
</dt>
51+
<dd>
52+
{{this.draftRegistration.provider.name}}
53+
</dd>
54+
</div>
55+
<div data-test-time-initiated>
56+
<dt data-test-time-initiated>
57+
{{t 'osf-components.draft-registration-card.started'}}
58+
</dt>
59+
<dd>
60+
{{moment this.draftRegistration.datetimeInitiated}}
61+
</dd>
62+
</div>
63+
<div data-test-time-updated>
64+
<dt data-test-time-updated>
65+
{{t 'osf-components.draft-registration-card.last_updated'}}
66+
</dt>
67+
<dd>
68+
{{moment this.draftRegistration.datetimeUpdated}}
69+
</dd>
70+
</div>
71+
</dl>
4472
<div class='row'>
4573
<div class='col-md-10'>
4674
<OsfLink
47-
data-analytics-name='Edit'
48-
class='btn btn-default'
49-
@route='registries.drafts.draft'
50-
@models={{array @draftRegistration.id}}
51-
>
52-
{{fa-icon 'pencil-alt'}} {{t 'general.edit'}}
53-
</OsfLink>
54-
<OsfButton
55-
data-analytics-name='Delete'
56-
@type='default'
57-
@onClick={{action this.delete}}
58-
disabled={{not this.draftRegistration}}
59-
>
60-
{{fa-icon 'times'}} {{t 'general.delete'}}
61-
</OsfButton>
62-
<BsModal
63-
@open={{this.deleteModalOpen}}
64-
@onHidden={{action this.cancelDelete}}
65-
class='delete_draft_registration'
66-
as |modal|
67-
>
68-
<modal.header>
69-
<h4>{{t 'general.please_confirm'}}</h4>
70-
</modal.header>
71-
<modal.body>
72-
{{t 'osf-components.draft-registration-card.delete_draft_confirm'}}
73-
</modal.body>
74-
<modal.footer data-analytics-scope='Draft registrations delete modal'>
75-
<OsfButton
76-
data-analytics-name='Cancel delete'
77-
@onClick={{action modal.close}}
78-
@type='default'
79-
>
80-
{{t 'general.cancel'}}
81-
</OsfButton>
82-
<OsfButton
83-
data-analytics-name='Confirm delete'
84-
@onClick={{action this.confirmDelete}}
85-
@type='danger'
86-
>
87-
{{t 'general.delete'}}
88-
</OsfButton>
89-
</modal.footer>
90-
</BsModal>
91-
</div>
92-
<div class='col-md-1'>
93-
<OsfLink
75+
data-test-draft-card-review
9476
data-analytics-name='Review'
95-
class='btn btn-default'
77+
local-class='DraftRegistrationCard__review'
9678
@route='registries.drafts.draft.review'
9779
@models={{array this.draftRegistration.id}}
9880
>
99-
{{t 'osf-components.draft-registration-card.review'}}
81+
<Button>
82+
{{t 'osf-components.draft-registration-card.review'}}
83+
</Button>
10084
</OsfLink>
85+
{{#unless this.draftRegistration.currentUserIsReadOnly}}
86+
<OsfLink
87+
data-test-draft-card-edit
88+
data-analytics-name='Edit'
89+
@route='registries.drafts.draft'
90+
@models={{array this.draftRegistration.id}}
91+
>
92+
<Button local-class='DraftRegistrationCard__edit'>
93+
{{t 'general.edit'}}
94+
</Button>
95+
</OsfLink>
96+
{{/unless}}
97+
</div>
98+
<div class='col-md-1'>
99+
{{#if this.draftRegistration.currentUserIsAdmin}}
100+
<DeleteButton
101+
data-test-draft-card-delete
102+
@smallSecondary={{true}}
103+
@icon='trash-alt'
104+
@delete={{action this.confirmDelete}}
105+
@modalTitle={{t 'general.please_confirm'}}
106+
@modalBody={{t 'osf-components.draft-registration-card.delete_draft_confirm'}}
107+
local-class='DraftRegistrationCard__delete'
108+
/>
109+
{{/if}}
101110
</div>
102111
</div>
103112
{{else}}

lib/osf-components/addon/components/node-card/component.ts

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import config from 'ember-get-config';
77
import { layout } from 'ember-osf-web/decorators/component';
88
import Node, { NodeType } from 'ember-osf-web/models/node';
99
import Registration from 'ember-osf-web/models/registration';
10-
import { Question } from 'ember-osf-web/models/registration-schema';
1110
import Analytics from 'ember-osf-web/services/analytics';
1211
import defaultTo from 'ember-osf-web/utils/default-to';
1312
import pathJoin from 'ember-osf-web/utils/path-join';
@@ -31,29 +30,6 @@ export default class NodeCard extends Component {
3130
// Private properties
3231
searchUrl = pathJoin(baseURL, 'search');
3332

34-
@computed('node', 'node.{isRegistration,registrationSchema,registeredMeta.@each}')
35-
get registrationTitle(): string | undefined {
36-
if (this.node && this.node.isRegistration) {
37-
const registration = this.node as Registration;
38-
const titleQuestion = registration.registrationSchema.get('schema')
39-
&& registration.registrationSchema.get('schema').pages.reduce(
40-
(acc: Question, page) => (acc || page.questions.filter(
41-
question => question.title === 'Title',
42-
).firstObject),
43-
undefined,
44-
);
45-
46-
if (titleQuestion && typeof registration.registeredMeta === 'object'
47-
&& titleQuestion.qid in registration.registeredMeta) {
48-
const answer = registration.registeredMeta[titleQuestion.qid];
49-
if ('value' in answer) {
50-
return answer.value as string;
51-
}
52-
}
53-
}
54-
return undefined;
55-
}
56-
5733
@computed('readOnly', 'node', 'node.{nodeType,userHasWritePermission}')
5834
get showDropdown() {
5935
return !this.readOnly && this.node && this.node.nodeType === NodeType.Fork && this.node.userHasWritePermission;

lib/osf-components/addon/components/node-card/styles.scss

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
.NodeCard {
2+
margin: 10px 0;
3+
}
4+
15
.NodeCard__heading {
26
:global(.ember-content-placeholders-heading__title) {
37
height: 1em;
@@ -29,6 +33,21 @@
2933
}
3034
}
3135

36+
.NodeCard__body dt,
37+
.NodeCard__body dd {
38+
display: inline-block;
39+
max-width: 80%;
40+
margin-right: 5px;
41+
}
42+
43+
.NodeCard__body dl {
44+
margin-bottom: 10px;
45+
}
46+
47+
.NodeCard__body > dl > div {
48+
display: flex;
49+
}
50+
3251
.NodeCard__dropdown {
3352
padding-left: 5px;
3453

@@ -59,22 +78,12 @@
5978
}
6079
}
6180

62-
.NodeCard__authors {
63-
font-weight: 500;
81+
.NodeCard__tags {
82+
margin-top: 2px;
6483
}
6584

6685
.NodeCard__description {
67-
font-weight: 300;
6886
text-overflow: ellipsis;
69-
display: block;
70-
white-space: nowrap;
7187
overflow: hidden;
72-
}
73-
74-
.NodeCard__tags {
75-
margin-top: 2px;
76-
77-
strong {
78-
font-weight: 600;
79-
}
88+
white-space: nowrap;
8089
}

0 commit comments

Comments
 (0)