Skip to content

Commit d89c992

Browse files
authored
[ENG-4053] Update registration finalize modal text (#1666)
- Ticket: [ENG-4053] ## Purpose - Reword finalize registration modal ## Summary of Changes - Update translation file - Reworked modal text so there is no need to change text based on project-based or no-project registration
1 parent c24df73 commit d89c992

File tree

3 files changed

+14
-109
lines changed
  • lib/osf-components/addon/components/registries/finalize-registration-modal
  • tests/integration/components/registries/finalize-registration-modal
  • translations

3 files changed

+14
-109
lines changed

lib/osf-components/addon/components/registries/finalize-registration-modal/component.ts

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import Component from '@ember/component';
33
import { assert } from '@ember/debug';
44
import { action, computed } from '@ember/object';
55
import { inject as service } from '@ember/service';
6-
import config from 'ember-get-config';
76
import Intl from 'ember-intl/services/intl';
87
import moment from 'moment';
98

@@ -26,7 +25,6 @@ export default class FinalizeRegisrationModalComponent extends Component {
2625
makePublicOption = '';
2726
embargoRangeStartDate: Date = moment().add(3, 'days').toDate();
2827
embargoRangeEndDate: Date = moment().add(1460, 'days').toDate();
29-
learnMoreLink = config.helpLinks.linkToAProject;
3028

3129
didReceiveAttrs() {
3230
assert('finalize-registration-modal requires @manager!', Boolean(this.manager));
@@ -39,21 +37,13 @@ export default class FinalizeRegisrationModalComponent extends Component {
3937
}
4038
}
4139

42-
@computed('learnMoreLink', 'manager.draftManager.{draftRegistration.hasProject,reviewsWorkflow}')
40+
@computed('manager.draftManager.reviewsWorkflow')
4341
get noticeText() {
44-
const translationOptions = { learnMoreLink: this.learnMoreLink, htmlSafe: true };
45-
let translationString = '';
46-
47-
if (this.manager.draftManager.draftRegistration.hasProject) {
48-
translationString = this.manager.draftManager.reviewsWorkflow
49-
? 'withModerationFromProject'
50-
: 'noModerationFromProject';
51-
} else {
52-
translationString = this.manager.draftManager.reviewsWorkflow
53-
? 'withModerationNoProject'
54-
: 'noModerationNoProject';
55-
}
56-
return this.intl.t(`registries.finalizeRegistrationModal.notice.${translationString}`, translationOptions);
42+
const translationOptions = { htmlSafe: true };
43+
const translationString = this.manager.draftManager.reviewsWorkflow
44+
? 'registries.finalizeRegistrationModal.notice.withModeration'
45+
: 'registries.finalizeRegistrationModal.notice.noModeration';
46+
return this.intl.t(translationString, translationOptions);
5747
}
5848

5949
@computed('manager.{hasEmbargoEndDate,submittingRegistration}', 'makePublicOption')

tests/integration/components/registries/finalize-registration-modal/component-test.ts

Lines changed: 6 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ module('Integration | Component | finalize-registration-modal', hooks => {
110110
this.set('isOpen', false);
111111
});
112112

113-
test('almost done modal content: no moderation with project', async function(assert) {
113+
test('almost done modal content: no moderation', async function(assert) {
114114
this.store = this.owner.lookup('service:store');
115115
const noModerationProvider = server.create('registration-provider', { reviewsWorkflow: null });
116116
const node = server.create('node', 'currentUserAdmin');
@@ -142,17 +142,17 @@ module('Integration | Component | finalize-registration-modal', hooks => {
142142
// Click submit button
143143
await click('[data-test-submit-registration-button]');
144144

145-
const opts = { learnMoreLink: 'aaa.aa', htmlSafe: true };
145+
const opts = { htmlSafe: true };
146146
assert.dom('[data-test-finalize-main]').hasTextContaining(
147-
stripHtmlTags(t('registries.finalizeRegistrationModal.notice.noModerationFromProject', opts).toString()),
147+
stripHtmlTags(t('registries.finalizeRegistrationModal.notice.noModeration', opts).toString()),
148148
'modal shows warning',
149149
);
150150
assert.dom('[data-test-finalize-main]').doesNotHaveTextContaining(
151151
'A moderator must review and approve', 'modal does not mention moderation for unmoderated providers',
152152
);
153153
});
154154

155-
test('almost done modal content: with moderation with project', async function(assert) {
155+
test('almost done modal content: with moderation', async function(assert) {
156156
this.store = this.owner.lookup('service:store');
157157
const withModerationProvider = server.create('registration-provider');
158158
const node = server.create('node', 'currentUserAdmin');
@@ -188,92 +188,9 @@ module('Integration | Component | finalize-registration-modal', hooks => {
188188
// Click submit button
189189
await click('[data-test-submit-registration-button]');
190190

191-
const opts = { learnMoreLink: 'aaa.aa', htmlSafe: true };
191+
const opts = { htmlSafe: true };
192192
assert.dom('[data-test-finalize-main]').hasTextContaining(
193-
stripHtmlTags(t('registries.finalizeRegistrationModal.notice.withModerationFromProject', opts).toString()),
194-
'modal shows warning with moderation for moderated providers',
195-
);
196-
});
197-
198-
test('almost done modal content: no moderation no project', async function(assert) {
199-
this.store = this.owner.lookup('service:store');
200-
const noModerationProvider = server.create('registration-provider', { reviewsWorkflow: null });
201-
const noModRegistration = server.create(
202-
'registration',
203-
{ provider: noModerationProvider },
204-
);
205-
const draftRegistration = server.create('draft-registration', { hasProject: false });
206-
207-
const registrationModel = await this.store.findRecord('registration', noModRegistration.id);
208-
this.set('draftManager', {
209-
provider: noModerationProvider,
210-
draftRegistration,
211-
validateAllVisitedPages: () => { /* noop */ },
212-
});
213-
this.set('model', registrationModel);
214-
this.set('isOpen', true);
215-
await render(hbs`
216-
<Registries::FinalizeRegistrationModal::Manager
217-
@registration={{this.model}}
218-
@draftManager={{this.draftManager}}
219-
as |manager|
220-
>
221-
<Registries::FinalizeRegistrationModal @isOpen={{this.isOpen}} @manager={{manager}} />
222-
</Registries::FinalizeRegistrationModal::Manager>
223-
`);
224-
// Click immediate radio button
225-
await click('[data-test-immediate-button]');
226-
// Click submit button
227-
await click('[data-test-submit-registration-button]');
228-
229-
const opts = { learnMoreLink: 'aaa.aa', htmlSafe: true };
230-
assert.dom('[data-test-finalize-main]').hasTextContaining(
231-
stripHtmlTags(t('registries.finalizeRegistrationModal.notice.noModerationNoProject', opts).toString()),
232-
'modal shows warning',
233-
);
234-
assert.dom('[data-test-finalize-main]').doesNotHaveTextContaining(
235-
'A moderator must review and approve', 'modal does not mention moderation for unmoderated providers',
236-
);
237-
});
238-
239-
test('almost done modal content: with moderation no project', async function(assert) {
240-
this.store = this.owner.lookup('service:store');
241-
const withModerationProvider = server.create('registration-provider');
242-
const withModRegistration = server.create(
243-
'registration',
244-
{ provider: withModerationProvider },
245-
);
246-
const draftRegistration = server.create('draft-registration', { hasProject: false });
247-
248-
const registrationModel = await this.store.findRecord('registration', withModRegistration.id);
249-
this.set(
250-
'draftManager',
251-
{
252-
provider: withModerationProvider,
253-
reviewsWorkflow: 'pre-moderation',
254-
draftRegistration,
255-
validateAllVisitedPages: () => { /* noop */ },
256-
},
257-
);
258-
this.set('model', registrationModel);
259-
this.set('isOpen', true);
260-
await render(hbs`
261-
<Registries::FinalizeRegistrationModal::Manager
262-
@registration={{this.model}}
263-
@draftManager={{this.draftManager}}
264-
as |manager|
265-
>
266-
<Registries::FinalizeRegistrationModal @isOpen={{this.isOpen}} @manager={{manager}} />
267-
</Registries::FinalizeRegistrationModal::Manager>
268-
`);
269-
// Click immediate radio button
270-
await click('[data-test-immediate-button]');
271-
// Click submit button
272-
await click('[data-test-submit-registration-button]');
273-
274-
const opts = { learnMoreLink: 'aaa.aa', htmlSafe: true };
275-
assert.dom('[data-test-finalize-main]').hasTextContaining(
276-
stripHtmlTags(t('registries.finalizeRegistrationModal.notice.withModerationNoProject', opts).toString()),
193+
stripHtmlTags(t('registries.finalizeRegistrationModal.notice.withModeration', opts).toString()),
277194
'modal shows warning with moderation for moderated providers',
278195
);
279196
});

translations/en-us.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1546,10 +1546,8 @@ registries:
15461546
finalizeRegistrationModal:
15471547
title: 'Almost done...'
15481548
notice:
1549-
noModerationFromProject: 'Remember:<ul><li>Registrations cannot be modified or deleted once submitted.</li><li>Changes to any files (1) in the projects or components being registered, (2) uploaded or selected as prompt responses, including those connected through add-ons during archiving will result in archiving failure and loss of your registration timestamp. Please do not modify your files until after you have received email confirmation of archiving completion. If this registration has been archiving for more than 72 hours, please email <a href="mailto:support@osf.io">support@osf.io</a> for assistance.</li><li>The content and version history of Wiki and OSF Storage will be copied to the registration.</li><li>This project may contain links to other projects. These links will be copied into your registration, but the projects that they link to will not be registered. If you wish to register the linked projects, they must be registered separately. <a href="{learnMoreLink}" target="_blank" rel="noopener noreferrer">Learn more about links</a>.</li><li>Registrations are archived on Internet Archive and a link to the archived copy will be added to the registration metadata.</li></ul>'
1550-
withModerationFromProject: 'Remember:<ul><li>Registrations cannot be modified or deleted once submitted.</li><li>Changes to any files (1) in the projects or components being registered, (2) uploaded or selected as prompt responses, including those connected through add-ons during archiving will result in archiving failure and loss of your registration timestamp. Please do not modify your files until after you have received email confirmation of archiving completion. If this registration has been archiving for more than 72 hours, please email <a href="mailto:support@osf.io">support@osf.io</a> for assistance.</li><li>The content and version history of Wiki and OSF Storage will be copied to the registration.</li><li>This project may contain links to other projects. These links will be copied into your registration, but the projects that they link to will not be registered. If you wish to register the linked projects, they must be registered separately. <a href="{learnMoreLink}" target="_blank" rel="noopener noreferrer">Learn more about links</a>.</li><li>A moderator must review and approve your registration before it will be made public or embargoed.</li><li>Registrations are archived on Internet Archive and a link to the archived copy will be added to the registration metadata.</li></ul>'
1551-
noModerationNoProject: 'Remember:<ul><li>Registrations cannot be modified or deleted once submitted.</li><li>Changes to any files uploaded or selected as prompt responses will result in archiving failure and loss of your registration timestamp. If this registration has been archiving for more than 72 hours, email <a href="mailto:support@osf.io">support@osf.io</a> for assistance.</li><li>Registrations are archived on Internet Archive and a link to the archived copy will be added to the registration metadata.</li></ul>'
1552-
withModerationNoProject: 'Remember:<ul><li>Registrations cannot be modified or deleted once submitted.</li><li>Changes to any files uploaded or selected as prompt responses will result in archiving failure and loss of your registration timestamp. If this registration has been archiving for more than 72 hours, email <a href="mailto:support@osf.io">support@osf.io</a> for assistance.</li><li>A moderator must review and approve your registration before it will be made public or embargoed.</li><li>Registrations are archived on Internet Archive and a link to the archived copy will be added to the registration metadata.</li></ul>'
1549+
noModeration: 'Remember:<ul><li>Do not edit any files until the registration has completely archived.</li><li>This will be permanent and cannot be deleted once submitted.</li><li>This registration will be copied to Internet Archive as a backup.</li><li>Title and contributors cannot be updated once submitted.</li></ul>'
1550+
withModeration: 'Remember:<ul><li>Do not edit any files until the registration has completely archived.</li><li>This will be permanent and cannot be deleted once submitted.</li><li>This registration will be copied to Internet Archive as a backup.</li><li>Title and contributors cannot be updated once submitted.</li><li>A moderator will review your registration before it will made public or embargoed.</li></ul>'
15531551
immediateOption: 'Make registration public immediately'
15541552
embargoOption: 'Enter registration into embargo'
15551553

0 commit comments

Comments
 (0)