From a052c8ebe9554bf34ad5d1c1fff42b66c0d52ff1 Mon Sep 17 00:00:00 2001 From: futa-ikeda <51409893+futa-ikeda@users.noreply.github.com> Date: Tue, 20 Apr 2021 01:26:57 -0400 Subject: [PATCH 01/19] [My Registrations][ENG-2542] [ENG-2584] [ENG-1686] Show project's draft reg tab for all and update draft reg card (#1174) * Show project draft registration tab for all contribs and update draft reg card * Improve wording for registration provider label * Rearrange buttons, update delete button * remove unused class * fix test * UX consult feedback and match style with nodecards * Change reference to draftRegistration to be more consistent * remove comment Co-authored-by: Brian J. Geiger Co-authored-by: Yuhuai Liu --- app/guid-node/registrations/template.hbs | 6 +- .../components/delete-button/component.ts | 1 + .../components/delete-button/template.hbs | 5 +- .../draft-registration-card/styles.scss | 23 ++- .../draft-registration-card/template.hbs | 139 +++++++++--------- .../guid-node/registrations-test.ts | 107 ++++++++++++-- .../draft-registration-card/component-test.ts | 33 ++++- translations/en-us.yml | 1 + 8 files changed, 228 insertions(+), 87 deletions(-) diff --git a/app/guid-node/registrations/template.hbs b/app/guid-node/registrations/template.hbs index 906d3459ca2..c5798e2e84e 100644 --- a/app/guid-node/registrations/template.hbs +++ b/app/guid-node/registrations/template.hbs @@ -45,7 +45,7 @@ - {{#if this.node.userHasAdminPermission}} + {{#if this.node.userHasReadPermission}}

{{t 'node.registrations.no_drafts'}}

-

{{t 'node.registrations.start_new'}}

+ {{#if this.node.userHasAdminPermission}} +

{{t 'node.registrations.start_new'}}

+ {{/if}}

{{t 'node.registrations.learn_more' learnMoreLink='https://openscience.zendesk.com/hc/en-us/articles/360019930893' diff --git a/lib/osf-components/addon/components/delete-button/component.ts b/lib/osf-components/addon/components/delete-button/component.ts index 6852b8abdb9..0a323536aec 100644 --- a/lib/osf-components/addon/components/delete-button/component.ts +++ b/lib/osf-components/addon/components/delete-button/component.ts @@ -32,6 +32,7 @@ export default class DeleteButton extends Component { hardConfirm: boolean = defaultTo(this.hardConfirm, false); disabled: boolean = defaultTo(this.disabled, false); shouldStopPropagation = false; + icon: string = 'times'; buttonLabel: string = defaultTo( this.buttonLabel, this.intl.t('osf-components.delete-button.buttonLabel'), diff --git a/lib/osf-components/addon/components/delete-button/template.hbs b/lib/osf-components/addon/components/delete-button/template.hbs index da541ecb249..aa3ab865206 100644 --- a/lib/osf-components/addon/components/delete-button/template.hbs +++ b/lib/osf-components/addon/components/delete-button/template.hbs @@ -8,7 +8,7 @@ {{on 'click' this._show}} @disabled={{this.disabled}} > - {{fa-icon 'times' size='lg'}} + {{else if this.smallSecondary}} {{else}} diff --git a/lib/osf-components/addon/components/draft-registration-card/styles.scss b/lib/osf-components/addon/components/draft-registration-card/styles.scss index 930e844a3cc..3be52c6f926 100644 --- a/lib/osf-components/addon/components/draft-registration-card/styles.scss +++ b/lib/osf-components/addon/components/draft-registration-card/styles.scss @@ -1,4 +1,6 @@ .DraftRegistrationCard { + margin-bottom: 10px; + :global(.ember-content-placeholders-text__line) { height: 1em; } @@ -19,13 +21,16 @@ } .DraftRegistrationCard__body { - font-size: 18px; font-weight: 400; line-height: 1; - color: $color-text-gray-light; - small { - font-size: 75%; + dl { + margin-bottom: 10px; + } + + dt, + dd { + display: inline-block; } :global(.ember-content-placeholders-text) { @@ -33,6 +38,16 @@ } } +.DraftRegistrationCard__review { + margin-right: 10px; +} + +.DraftRegistrationCard__delete { + button { + padding: 6px 12px; + } +} + :global(.delete_draft_registration) { :global(.modal-header) { h4 { diff --git a/lib/osf-components/addon/components/draft-registration-card/template.hbs b/lib/osf-components/addon/components/draft-registration-card/template.hbs index 755d9cbe398..d639f3b2a8e 100644 --- a/lib/osf-components/addon/components/draft-registration-card/template.hbs +++ b/lib/osf-components/addon/components/draft-registration-card/template.hbs @@ -23,81 +23,86 @@

{{#if this.draftRegistration}} - -

- {{t 'osf-components.draft-registration-card.initiated_by'}} - {{this.draftRegistration.initiator.fullName}} -

-

- {{t 'osf-components.draft-registration-card.form_type'}} - {{this.draftRegistration.registrationSchema.name}} -

-

- {{t 'osf-components.draft-registration-card.started'}} - {{moment this.draftRegistration.datetimeInitiated}} -

-

- {{t 'osf-components.draft-registration-card.last_updated'}} - {{moment this.draftRegistration.datetimeUpdated}} -

-
+
+
+
+ {{t 'osf-components.draft-registration-card.initiated_by'}} +
+
+ {{this.draftRegistration.initiator.fullName}} +
+
+
+
+ {{t 'osf-components.draft-registration-card.form_type'}} +
+
+ {{this.draftRegistration.registrationSchema.name}} +
+
+
+
+ {{t 'osf-components.draft-registration-card.registry'}} +
+
+ {{this.draftRegistration.provider.name}} +
+
+
+
+ {{t 'osf-components.draft-registration-card.started'}} +
+
+ {{moment this.draftRegistration.datetimeInitiated}} +
+
+
+
+ {{t 'osf-components.draft-registration-card.last_updated'}} +
+
+ {{moment this.draftRegistration.datetimeUpdated}} +
+
+
- {{fa-icon 'pencil-alt'}} {{t 'general.edit'}} - - - {{fa-icon 'times'}} {{t 'general.delete'}} - - - -

{{t 'general.please_confirm'}}

-
- - {{t 'osf-components.draft-registration-card.delete_draft_confirm'}} - - - - {{t 'general.cancel'}} - - - {{t 'general.delete'}} - - -
-
-
- - {{t 'osf-components.draft-registration-card.review'}} + + {{#unless this.draftRegistration.currentUserIsReadOnly}} + + + + {{/unless}} +
+
+ {{#if this.draftRegistration.currentUserIsAdmin}} + + {{/if}}
{{else}} diff --git a/tests/acceptance/guid-node/registrations-test.ts b/tests/acceptance/guid-node/registrations-test.ts index 7601db2b0a1..02a0a45c0e1 100644 --- a/tests/acceptance/guid-node/registrations-test.ts +++ b/tests/acceptance/guid-node/registrations-test.ts @@ -33,6 +33,10 @@ module('Acceptance | guid-node/registrations', hooks => { assert.dom('[data-test-registrations-pane]').includesText( 'There have been no completed registrations of this project.', ); + + assert.dom('[data-test-registrations-container] a[href="#drafts"]').doesNotExist( + 'Logged out users cannot access draft registrations tab', + ); }); test('logged out, 1 registration', async assert => { @@ -57,10 +61,95 @@ module('Acceptance | guid-node/registrations', hooks => { assert.dom('[data-test-node-card-heading]').includesText(title); }); + test('logged in read-permission, 1 registration, 1 draft', async assert => { + server.create('user', 'loggedIn'); + const node = server.create('node', { id: 'decaf', currentUserPermissions: [Permission.Read] }); + server.create('registration', { + registeredFrom: node, + }); + server.create('draft-registration', { + branchedFrom: node, + }, 'currentUserIsReadOnly'); + + const url = `/${node.id}/registrations`; + + await visit(url); + + assert.equal(currentURL(), url, `We are on ${url}`); + + assert.dom('[data-test-new-registration-button]').doesNotExist( + 'read-permission contributors cannot start new registrations', + ); + + assert.dom('[data-test-node-card]').exists({ count: 1 }, 'One registration card shown'); + + assert.dom('[data-test-registrations-container] a[href="#drafts"]').exists( + 'read-permission contributors can see drafts tab', + ); + + await untrackedClick('[data-test-registrations-container] a[href="#drafts"]'); + + assert.dom('[data-test-registrations-pane]').isNotVisible(); + + assert.dom('[data-test-draft-registrations-pane]').isVisible(); + + assert.dom('[data-test-draft-registration-card]').exists({ count: 1 }, + 'One draft registration exists for this project.'); + assert.dom('[data-test-draft-card-edit]').doesNotExist('Read-only user cannot edit the draft'); + assert.dom('[data-test-draft-card-delete]').doesNotExist('Read-only user cannot delete the draft'); + assert.dom('[data-test-draft-card-review]').exists('Read-only user can review the draft'); + }); + + test('logged in write-permission, 1 registration, 1 draft registration', async assert => { + server.create('user', 'loggedIn'); + const node = server.create('node', { + id: 'decaf', + title: 'Test Title', + currentUserPermissions: [Permission.Write, Permission.Read], + }); + + server.create('registration', { + registeredFrom: node, + }); + server.create('draft-registration', { + branchedFrom: node, + }, 'currentUserIsReadAndWrite'); + + const url = `/${node.id}/registrations`; + + await visit(url); + + assert.equal(currentURL(), url, `We are on ${url}`); + + assert.dom('[data-test-new-registration-button]').doesNotExist( + 'write contributors cannot start new draft registrations', + ); + + assert.dom('[data-test-registrations-pane]').doesNotIncludeText( + 'There have been no completed registrations of this project.', + ); + + assert.dom('[data-test-node-card]').exists({ count: 1 }); + + await untrackedClick('[data-test-registrations-container] a[href="#drafts"]'); + + assert.dom('[data-test-registrations-pane]').isNotVisible(); + assert.dom('[data-test-draft-registrations-pane]').isVisible(); + + assert.dom('[data-test-draft-registrations-pane]').doesNotIncludeText( + 'There are no draft registrations of this project.', + ); + + assert.dom('[data-test-draft-registration-card]').exists({ count: 1 }); + assert.dom('[data-test-draft-card-edit]').exists('Write user can edit the draft'); + assert.dom('[data-test-draft-card-delete]').doesNotExist('Write user cannot delete the draft'); + assert.dom('[data-test-draft-card-review]').exists('Write user can review the draft'); + }); + test('logged in admin, no registrations', async assert => { server.create('user', 'loggedIn'); - const node = server.create('node', { id: 'decaf', currentUserPermissions: [Permission.Admin] }); + const node = server.create('node', { id: 'decaf' }, 'currentUserAdmin'); const url = `/${node.id}/registrations`; @@ -92,8 +181,7 @@ module('Acceptance | guid-node/registrations', hooks => { const node = server.create('node', { id: 'decaf', title: 'Test Title', - currentUserPermissions: [Permission.Admin], - }); + }, 'currentUserAdmin'); server.create('contributor', { node, users: contributorUser }); @@ -141,8 +229,7 @@ module('Acceptance | guid-node/registrations', hooks => { const node = server.create('node', { id: 'decaf', title: 'Test Title', - currentUserPermissions: [Permission.Admin], - }); + }, 'currentUserAdmin'); server.create('contributor', { node, users: contributorUser }); @@ -186,8 +273,7 @@ module('Acceptance | guid-node/registrations', hooks => { const node = server.create('node', { id: 'decaf', - currentUserPermissions: [Permission.Admin], - }); + }, 'currentUserAdmin'); server.loadFixtures('schema-blocks'); server.loadFixtures('registration-schemas'); @@ -238,8 +324,7 @@ module('Acceptance | guid-node/registrations', hooks => { const node = server.create('node', { id: 'decaf', - currentUserPermissions: [Permission.Admin], - }); + }, 'currentUserAdmin'); server.loadFixtures('schema-blocks'); server.loadFixtures('registration-schemas'); @@ -275,7 +360,7 @@ module('Acceptance | guid-node/registrations', hooks => { test('logged in admin, new registration', async assert => { server.create('user', 'loggedIn'); - const node = server.create('node', { id: 'decaf', currentUserPermissions: [Permission.Admin] }); + const node = server.create('node', { id: 'decaf' }, 'currentUserAdmin'); server.loadFixtures('schema-blocks'); server.loadFixtures('registration-schemas'); @@ -309,7 +394,7 @@ module('Acceptance | guid-node/registrations', hooks => { test('logged in admin, prereg challenge modal', async assert => { server.create('user', 'loggedIn'); - const node = server.create('node', { id: 'decaf', currentUserPermissions: [Permission.Admin] }); + const node = server.create('node', { id: 'decaf' }, 'currentUserAdmin'); server.loadFixtures('schema-blocks'); server.loadFixtures('registration-schemas'); diff --git a/tests/integration/components/draft-registration-card/component-test.ts b/tests/integration/components/draft-registration-card/component-test.ts index b252e3ee61b..74c28252a1d 100644 --- a/tests/integration/components/draft-registration-card/component-test.ts +++ b/tests/integration/components/draft-registration-card/component-test.ts @@ -21,13 +21,13 @@ module('Integration | Component | draft-registration-card', hooks => { server.loadFixtures('licenses'); }); - test('it renders draftRegistration', async function(this: TestContext, assert) { + test('it renders draftRegistration for admins', async function(this: TestContext, assert) { const user = server.create('user'); const draft = server.create('draft-registration', { id: 'pregc', initiator: user, registrationSchema: server.schema.registrationSchemas.find('prereg_challenge'), - }); + }, 'currentUserIsAdmin'); const draftRegistration = await this.store.findRecord('draft-registration', draft.id); this.set('draftRegistration', draftRegistration); @@ -37,6 +37,7 @@ module('Integration | Component | draft-registration-card', hooks => { + `${user.fullName}`; const formType = `${this.intl.t('osf-components.draft-registration-card.form_type')} ` + `${draftRegistration.registrationSchema.get('name')}`; + const providerName = 'OSF Registries'; const dateStarted = `${this.intl.t('osf-components.draft-registration-card.started')} ` + `${moment(draftRegistration.datetimeInitiated)}`; const dateUpdated = `${this.intl.t('osf-components.draft-registration-card.last_updated')} ` @@ -49,8 +50,36 @@ module('Integration | Component | draft-registration-card', hooks => { .hasText(draftRegistration.title); assert.dom('[data-test-initiated-by]').containsText(initiated); assert.dom('[data-test-form-type]').containsText(formType); + assert.dom('[data-test-provider-name]').containsText(providerName); assert.dom('[data-test-time-initiated]').containsText(dateStarted); assert.dom('[data-test-time-updated]').containsText(dateUpdated); + assert.dom('[data-test-draft-card-edit]').exists('Admins can edit draft'); + assert.dom('[data-test-draft-card-delete]').exists('Admins can delete draft'); + assert.dom('[data-test-draft-card-review]').exists('Admins can review draft'); + }); + + test('it renders draftRegistration for read-write users', async function(this: TestContext, assert) { + const draft = server.create('draft-registration', 'currentUserIsReadAndWrite'); + const draftRegistration = await this.store.findRecord('draft-registration', draft.id); + this.set('draftRegistration', draftRegistration); + + await render(hbs``); + + assert.dom('[data-test-draft-card-edit]').exists('Read-write users can edit draft'); + assert.dom('[data-test-draft-card-delete]').doesNotExist('Read-write users cannot delete draft'); + assert.dom('[data-test-draft-card-review]').exists('Read-write users can review draft'); + }); + + test('it renders draftRegistration for read-only users', async function(this: TestContext, assert) { + const draft = server.create('draft-registration', 'currentUserIsReadOnly'); + const draftRegistration = await this.store.findRecord('draft-registration', draft.id); + this.set('draftRegistration', draftRegistration); + + await render(hbs``); + + assert.dom('[data-test-draft-card-edit]').doesNotExist('Read-only users cannot edit draft'); + assert.dom('[data-test-draft-card-delete]').doesNotExist('Read-only users cannot delete draft'); + assert.dom('[data-test-draft-card-review]').exists('Read-only users can review draft'); }); test('placeholders appear without draftRegistration', async assert => { diff --git a/translations/en-us.yml b/translations/en-us.yml index 9123cd7374f..15cfcb75c26 100644 --- a/translations/en-us.yml +++ b/translations/en-us.yml @@ -1528,6 +1528,7 @@ osf-components: draft-registration-card: initiated_by: 'Initiated by:' form_type: 'Form:' + registry: 'Registry:' started: 'Started:' last_updated: 'Last updated:' review: Review From 7f3e6736f24d38fa440668457a9abfb835448b29 Mon Sep 17 00:00:00 2001 From: Yuhuai Liu Date: Tue, 20 Apr 2021 10:23:50 -0400 Subject: [PATCH 02/19] [My Registrations][ENG-528] Navbar links for My Registration page (#1171) * change links to buttons for mobile view * CR followup * CR follow up * aria-label * fix tests --- .../components/registries-navbar/template.hbs | 47 +++++++++++++++++-- .../registries-navbar/component-test.ts | 2 - 2 files changed, 42 insertions(+), 7 deletions(-) diff --git a/lib/registries/addon/components/registries-navbar/template.hbs b/lib/registries/addon/components/registries-navbar/template.hbs index 7d10ab5eb9b..4ef23d2517a 100644 --- a/lib/registries/addon/components/registries-navbar/template.hbs +++ b/lib/registries/addon/components/registries-navbar/template.hbs @@ -30,8 +30,8 @@ data-analytics-name='Toggle' @classNames={{local-class 'Service Dropdown'}} > - {{t 'general.OSF'}} - {{t 'general.services.registries'}} + {{t 'general.OSF'}} + {{t 'general.services.registries'}} {{nav.icon (if dropdown.isOpen 'caret-up' 'caret-down')}} @@ -62,24 +62,61 @@ {{t 'navbar.moderation'}} + + + {{/if}} {{#if this.showAddRegistrationButton}} {{t 'navbar.add_registration'}} + + + {{/if}} + + {{t 'navbar.my_registrations'}} + + + + { await click('[data-test-gravatar]'); await percySnapshot(assert); - assert.equal(visibleText('[data-test-service]'), `${t('general.OSF')}${t('general.services.registries')}`); - assert.dom('a[data-test-help-mobile]').isVisible(); assert.dom('a[data-test-donate-mobile]').isVisible(); }); From 7e727bd049370a77b5376a06f7f4a90409dafa92 Mon Sep 17 00:00:00 2001 From: Yuhuai Liu Date: Tue, 20 Apr 2021 13:36:24 -0400 Subject: [PATCH 03/19] [My Registrations][ENG-2627][ENG-2586] Add View button and tags (#1173) * add View button and tags * tests * moar tests * CR followup * fix test * fix tests * style changes * CR follow up * remove unused classes * make registered a label as well; removed registrationTitle * Update wording in draft card * fix test Co-authored-by: Brian J. Geiger Co-authored-by: Futa Ikeda --- .../addon/components/node-card/component.ts | 24 ----- .../addon/components/node-card/styles.scss | 21 ++-- .../addon/components/node-card/template.hbs | 99 ++++++++++++++----- .../guid-node/registrations-test.ts | 2 - .../components/node-card/component-test.ts | 73 +++++++++++--- translations/en-us.yml | 6 +- 6 files changed, 151 insertions(+), 74 deletions(-) diff --git a/lib/osf-components/addon/components/node-card/component.ts b/lib/osf-components/addon/components/node-card/component.ts index 5b3d5d8a9de..077aaec2bf9 100644 --- a/lib/osf-components/addon/components/node-card/component.ts +++ b/lib/osf-components/addon/components/node-card/component.ts @@ -7,7 +7,6 @@ import config from 'ember-get-config'; import { layout } from 'ember-osf-web/decorators/component'; import Node, { NodeType } from 'ember-osf-web/models/node'; import Registration from 'ember-osf-web/models/registration'; -import { Question } from 'ember-osf-web/models/registration-schema'; import Analytics from 'ember-osf-web/services/analytics'; import defaultTo from 'ember-osf-web/utils/default-to'; import pathJoin from 'ember-osf-web/utils/path-join'; @@ -31,29 +30,6 @@ export default class NodeCard extends Component { // Private properties searchUrl = pathJoin(baseURL, 'search'); - @computed('node', 'node.{isRegistration,registrationSchema,registeredMeta.@each}') - get registrationTitle(): string | undefined { - if (this.node && this.node.isRegistration) { - const registration = this.node as Registration; - const titleQuestion = registration.registrationSchema.get('schema') - && registration.registrationSchema.get('schema').pages.reduce( - (acc: Question, page) => (acc || page.questions.filter( - question => question.title === 'Title', - ).firstObject), - undefined, - ); - - if (titleQuestion && typeof registration.registeredMeta === 'object' - && titleQuestion.qid in registration.registeredMeta) { - const answer = registration.registeredMeta[titleQuestion.qid]; - if ('value' in answer) { - return answer.value as string; - } - } - } - return undefined; - } - @computed('readOnly', 'node', 'node.{nodeType,userHasWritePermission}') get showDropdown() { return !this.readOnly && this.node && this.node.nodeType === NodeType.Fork && this.node.userHasWritePermission; diff --git a/lib/osf-components/addon/components/node-card/styles.scss b/lib/osf-components/addon/components/node-card/styles.scss index 591aecda94b..4e04b53a200 100644 --- a/lib/osf-components/addon/components/node-card/styles.scss +++ b/lib/osf-components/addon/components/node-card/styles.scss @@ -1,3 +1,7 @@ +.NodeCard { + margin: 10px 0; +} + .NodeCard__heading { :global(.ember-content-placeholders-heading__title) { height: 1em; @@ -29,6 +33,15 @@ } } +.NodeCard__body dt, +dd { + display: inline-block; +} + +.NodeCard__body dl { + margin-bottom: 10px; +} + .NodeCard__dropdown { padding-left: 5px; @@ -59,10 +72,6 @@ } } -.NodeCard__authors { - font-weight: 500; -} - .NodeCard__description { font-weight: 300; text-overflow: ellipsis; @@ -73,8 +82,4 @@ .NodeCard__tags { margin-top: 2px; - - strong { - font-weight: 600; - } } diff --git a/lib/osf-components/addon/components/node-card/template.hbs b/lib/osf-components/addon/components/node-card/template.hbs index c7941f4ed86..3ee554fc7e3 100644 --- a/lib/osf-components/addon/components/node-card/template.hbs +++ b/lib/osf-components/addon/components/node-card/template.hbs @@ -1,6 +1,7 @@

@@ -95,37 +96,81 @@

{{#if @node}} -
- {{t (concat 'node_card.' @node.nodeType '.timestamp_label')}} {{moment-format @node.dateCreated 'YYYY-MM-DD h:mm A'}} -
- {{#if @node.isRegistration}} - {{#if this.registrationTitle}} -
- {{this.registrationTitle}} +
+
+ {{t (concat 'node_card.' @node.nodeType '.timestamp_label')}} +
+
+ {{moment-format @node.dateCreated 'YYYY-MM-DD h:mm A'}} +
+ {{#if @node.isRegistration}} +
+
+ {{t 'node_card.registration_template'}} +
+
+ {{@node.registrationSchema.name}} +
{{/if}} -
- {{@node.registrationSchema.name}} -
- {{/if}} -
- -
-
- {{@node.description}} -
- {{#if (and this.showTags @node.tags)}} -
- {{t 'node_card.tags'}} - + {{t 'node_card.contributors'}} + +
+ +
+
+
+ {{t 'node_card.description'}} +
+
+ {{@node.description}} +
- {{/if}} + {{#if (and this.showTags @node.tags)}} +
+
+ {{t 'node_card.tags'}} +
+
+ +
+
+ {{/if}} +
+ + + {{else}} diff --git a/tests/acceptance/guid-node/registrations-test.ts b/tests/acceptance/guid-node/registrations-test.ts index 02a0a45c0e1..0ead5e55dfd 100644 --- a/tests/acceptance/guid-node/registrations-test.ts +++ b/tests/acceptance/guid-node/registrations-test.ts @@ -211,8 +211,6 @@ module('Acceptance | guid-node/registrations', hooks => { assert.dom('[data-test-node-card-body]').includesText(registrationSchemaName); - assert.dom('[data-test-node-card-body]').includesText(registrationTitle); - await untrackedClick('[data-test-registrations-container] a[href="#drafts"]'); assert.dom('[data-test-registrations-pane]').isNotVisible(); diff --git a/tests/integration/components/node-card/component-test.ts b/tests/integration/components/node-card/component-test.ts index 6e6e0646af0..9e21fdccd1d 100644 --- a/tests/integration/components/node-card/component-test.ts +++ b/tests/integration/components/node-card/component-test.ts @@ -1,8 +1,8 @@ import { render } from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; import { setupMirage } from 'ember-cli-mirage/test-support'; +import { setupIntl, TestContext } from 'ember-intl/test-support'; import { setupRenderingTest } from 'ember-qunit'; -import { TestContext } from 'ember-test-helpers'; import { module, test } from 'qunit'; import { OsfLinkRouterStub } from '../../helpers/osf-link-router-stub'; @@ -10,23 +10,72 @@ import { OsfLinkRouterStub } from '../../helpers/osf-link-router-stub'; module('Integration | Component | node-card', hooks => { setupRenderingTest(hooks); setupMirage(hooks); + setupIntl(hooks); hooks.beforeEach(function(this: TestContext) { this.store = this.owner.lookup('service:store'); + this.intl = this.owner.lookup('service:intl'); }); - test('it renders', async function(assert) { + test('it renders', async function(this: TestContext, assert) { this.owner.register('service:router', OsfLinkRouterStub); - this.set('contributors', []); - const node = server.create('node', {}, 'withContributors'); - const project = await this.store.findRecord('node', node.id, { include: 'bibliographic_contributors' }); + const registration = server.create('registration', { + tags: ['a', 'b', 'c'], + description: 'Through the night', + }); + server.create('contributor', { node: registration, index: 0, bibliographic: true }); + server.create('contributor', { node: registration, index: 1, bibliographic: true }); + server.create('contributor', { node: registration, index: 2, bibliographic: true }); + const registrationModel = await this.store.findRecord( + 'registration', registration.id, { include: ['bibliographic_contributors'] }, + ); + this.set('node', registrationModel); - this.set('node', project); - this.set('contributors', project.bibliographicContributors); - this.set('delete', () => []); - - await render(hbs`{{node-card contributors=this.contributors node=this.node delete=this.delete}}`); - - assert.ok((this.element.textContent as string).trim()); + await render(hbs` + + `); + assert.dom('[data-test-node-title]').exists('Node title exists'); + assert.dom('[data-test-node-title]').hasText(registrationModel.title, 'Node title is corrent'); + assert.dom('[data-test-registration-template-label]').exists('Schema label exists'); + assert.dom('[data-test-registration-template-label]').hasText( + this.intl.t('node_card.registration_template'), 'Schema label is correct', + ); + assert.dom('[data-test-registration-template-name]').exists('Schema name exists'); + assert.dom('[data-test-registration-template-name]').hasTextContaining( + registration.registrationSchema.name, + 'Schema name is correct', + ); + assert.dom('[data-test-contributors-label]').exists('Contributors label exists'); + assert.dom('[data-test-contributors-label]').hasText( + this.intl.t('node_card.contributors'), + 'Contributors label is correct', + ); + for (const contributor of registration.contributors.models) { + assert.dom(`[data-test-contributor-name='${contributor.users.id}']`).exists('Contributor name exists'); + assert.dom(`[data-test-contributor-name='${contributor.users.id}']`).hasTextContaining( + contributor.users.familyName, + 'Contributor name is correct', + ); + } + assert.dom('[data-test-description-label]').exists('Description label exists'); + assert.dom('[data-test-description-label]').hasText( + this.intl.t('node_card.description'), + 'Description label is correct', + ); + assert.dom('[data-test-description]').hasTextContaining(registration.description, 'Description is correct'); + assert.dom('[data-test-tags-label]').exists('Tags label exists'); + assert.dom('[data-test-tags-label]').hasText( + this.intl.t('node_card.tags'), + 'Tags label is correct', + ); + for (const tag of registration.tags) { + assert.dom(`[data-test-tags-widget-tag='${tag}']`).exists('Tag exists'); + assert.dom(`[data-test-tags-widget-tag='${tag}']`).hasText(tag, 'Tag is correct'); + } + assert.dom(`[data-test-view-button='${registration.id}']`).exists('View button exists'); }); }); diff --git a/translations/en-us.yml b/translations/en-us.yml index 15cfcb75c26..1c58f6daa51 100644 --- a/translations/en-us.yml +++ b/translations/en-us.yml @@ -598,7 +598,11 @@ node_card: withdrawn: Withdrawn archiving: Archiving tags: 'Tags:' + registration_template: 'Registration template:' + contributors: 'Contributors:' + description: 'Description:' options: Options + view: 'View' forks: fork: Fork title: Forks @@ -1527,7 +1531,7 @@ routes: osf-components: draft-registration-card: initiated_by: 'Initiated by:' - form_type: 'Form:' + form_type: 'Registration template:' registry: 'Registry:' started: 'Started:' last_updated: 'Last updated:' From 21995c84fd6410767c62bd69a10d90f87ee734de Mon Sep 17 00:00:00 2001 From: Yuhuai Liu Date: Tue, 27 Apr 2021 10:51:07 -0400 Subject: [PATCH 04/19] [ENG-2277] My registrations page (#1180) * prelim * moar * more and more * and some more * styling fixes * add more padding between cards * make styling consistent * CR followup * moar styling fixes * fix draft-registration-card delete * fix tests * demo followup * more demo follow up * add moar tests for the node card * add tests for my-registrations-list component * modify weird tests --- .../draft-registration-card/template.hbs | 2 +- .../addon/components/node-card/styles.scss | 20 ++-- .../addon/components/node-card/template.hbs | 71 ++++++++------ .../my-registrations-list/drafts/styles.scss | 9 ++ .../my-registrations-list/drafts/template.hbs | 37 +++++++ .../registrations/styles.scss | 9 ++ .../registrations/template.hbs | 38 ++++++++ .../my-registrations-list/drafts/template.js | 1 + .../registrations/template.js | 1 + .../addon/my-registrations/controller.ts | 18 ++++ .../addon/my-registrations/styles.scss | 54 +++++++++++ .../addon/my-registrations/template.hbs | 41 +++++++- .../integration/discover/discover-test.ts | 2 +- .../components/node-card/component-test.ts | 29 +++++- .../my-registrations-list/component-test.ts | 96 +++++++++++++++++++ translations/en-us.yml | 13 ++- 16 files changed, 399 insertions(+), 42 deletions(-) create mode 100644 lib/osf-components/addon/components/registries/my-registrations-list/drafts/styles.scss create mode 100644 lib/osf-components/addon/components/registries/my-registrations-list/drafts/template.hbs create mode 100644 lib/osf-components/addon/components/registries/my-registrations-list/registrations/styles.scss create mode 100644 lib/osf-components/addon/components/registries/my-registrations-list/registrations/template.hbs create mode 100644 lib/osf-components/app/components/registries/my-registrations-list/drafts/template.js create mode 100644 lib/osf-components/app/components/registries/my-registrations-list/registrations/template.js create mode 100644 lib/registries/addon/my-registrations/controller.ts create mode 100644 lib/registries/addon/my-registrations/styles.scss create mode 100644 tests/integration/components/registries/my-registrations-list/component-test.ts diff --git a/lib/osf-components/addon/components/draft-registration-card/template.hbs b/lib/osf-components/addon/components/draft-registration-card/template.hbs index d639f3b2a8e..a329c52b850 100644 --- a/lib/osf-components/addon/components/draft-registration-card/template.hbs +++ b/lib/osf-components/addon/components/draft-registration-card/template.hbs @@ -97,7 +97,7 @@ data-test-draft-card-delete @smallSecondary={{true}} @icon='trash-alt' - @delete={{action this.delete}} + @delete={{action this.confirmDelete}} @modalTitle={{t 'general.please_confirm'}} @modalBody={{t 'osf-components.draft-registration-card.delete_draft_confirm'}} local-class='DraftRegistrationCard__delete' diff --git a/lib/osf-components/addon/components/node-card/styles.scss b/lib/osf-components/addon/components/node-card/styles.scss index 4e04b53a200..c353bff123b 100644 --- a/lib/osf-components/addon/components/node-card/styles.scss +++ b/lib/osf-components/addon/components/node-card/styles.scss @@ -34,14 +34,20 @@ } .NodeCard__body dt, -dd { +.NodeCard__body dd { display: inline-block; + max-width: 80%; + margin-right: 5px; } .NodeCard__body dl { margin-bottom: 10px; } +.NodeCard__body > dl > div { + display: flex; +} + .NodeCard__dropdown { padding-left: 5px; @@ -72,14 +78,12 @@ dd { } } +.NodeCard__tags { + margin-top: 2px; +} + .NodeCard__description { - font-weight: 300; text-overflow: ellipsis; - display: block; - white-space: nowrap; overflow: hidden; -} - -.NodeCard__tags { - margin-top: 2px; + white-space: nowrap; } diff --git a/lib/osf-components/addon/components/node-card/template.hbs b/lib/osf-components/addon/components/node-card/template.hbs index 3ee554fc7e3..4ebcf15bca9 100644 --- a/lib/osf-components/addon/components/node-card/template.hbs +++ b/lib/osf-components/addon/components/node-card/template.hbs @@ -4,7 +4,7 @@ local-class='NodeCard' >

- + {{#if @node}} {{#unless @node.public}} @@ -97,47 +97,60 @@
{{#if @node}}
-
- {{t (concat 'node_card.' @node.nodeType '.timestamp_label')}} -
-
- {{moment-format @node.dateCreated 'YYYY-MM-DD h:mm A'}} -
{{#if @node.isRegistration}} -
-
+
+
{{t 'node_card.registration_template'}}
{{@node.registrationSchema.name}}
+
+
+ {{t 'node_card.registry'}} +
+
+ {{@node.provider.name}} +
+
{{/if}} -
- {{t 'node_card.contributors'}} -
-
- -
-
+
+
+ {{t (concat 'node_card.' @node.nodeType '.timestamp_label')}} +
+
+ {{moment @node.dateCreated}} +
+
+
+
+ {{t 'node_card.last_updated'}} +
+
+ {{moment @node.dateModified}} +
+
+
+
+ {{t 'node_card.contributors'}} +
+
+ +
+
+
{{t 'node_card.description'}}
-
+
{{@node.description}}
diff --git a/lib/osf-components/addon/components/registries/my-registrations-list/drafts/styles.scss b/lib/osf-components/addon/components/registries/my-registrations-list/drafts/styles.scss new file mode 100644 index 00000000000..dd92ae8e202 --- /dev/null +++ b/lib/osf-components/addon/components/registries/my-registrations-list/drafts/styles.scss @@ -0,0 +1,9 @@ +.FlexContainer { + display: flex; + justify-content: center; +} + +.NoContentContainer { + padding-top: 100px; + text-align: center; +} diff --git a/lib/osf-components/addon/components/registries/my-registrations-list/drafts/template.hbs b/lib/osf-components/addon/components/registries/my-registrations-list/drafts/template.hbs new file mode 100644 index 00000000000..0aa6b8d2ba6 --- /dev/null +++ b/lib/osf-components/addon/components/registries/my-registrations-list/drafts/template.hbs @@ -0,0 +1,37 @@ + + + + {{#if draftRegistration}} + + {{else}} + {{placeholder.text lines=1}} + {{/if}} + + +
+

+ {{t 'registries.myRegistrationsList.noGeneral'}} +

+

+ {{t 'registries.myRegistrationsList.noDrafts'}} +

+ + + +
+
+
+
\ No newline at end of file diff --git a/lib/osf-components/addon/components/registries/my-registrations-list/registrations/styles.scss b/lib/osf-components/addon/components/registries/my-registrations-list/registrations/styles.scss new file mode 100644 index 00000000000..dd92ae8e202 --- /dev/null +++ b/lib/osf-components/addon/components/registries/my-registrations-list/registrations/styles.scss @@ -0,0 +1,9 @@ +.FlexContainer { + display: flex; + justify-content: center; +} + +.NoContentContainer { + padding-top: 100px; + text-align: center; +} diff --git a/lib/osf-components/addon/components/registries/my-registrations-list/registrations/template.hbs b/lib/osf-components/addon/components/registries/my-registrations-list/registrations/template.hbs new file mode 100644 index 00000000000..2de38f0144d --- /dev/null +++ b/lib/osf-components/addon/components/registries/my-registrations-list/registrations/template.hbs @@ -0,0 +1,38 @@ + + + + {{#if registration}} + + {{else}} + {{placeholder.text lines=1}} + {{/if}} + + +
+

+ {{t 'registries.myRegistrationsList.noGeneral'}} +

+

+ {{t 'registries.myRegistrationsList.noRegistrations'}} +

+ + + +
+
+
+
\ No newline at end of file diff --git a/lib/osf-components/app/components/registries/my-registrations-list/drafts/template.js b/lib/osf-components/app/components/registries/my-registrations-list/drafts/template.js new file mode 100644 index 00000000000..aee3f223be3 --- /dev/null +++ b/lib/osf-components/app/components/registries/my-registrations-list/drafts/template.js @@ -0,0 +1 @@ +export { default } from 'osf-components/components/registries/my-registrations-list/drafts/template'; diff --git a/lib/osf-components/app/components/registries/my-registrations-list/registrations/template.js b/lib/osf-components/app/components/registries/my-registrations-list/registrations/template.js new file mode 100644 index 00000000000..bcbe23c812e --- /dev/null +++ b/lib/osf-components/app/components/registries/my-registrations-list/registrations/template.js @@ -0,0 +1 @@ +export { default } from 'osf-components/components/registries/my-registrations-list/registrations/template'; diff --git a/lib/registries/addon/my-registrations/controller.ts b/lib/registries/addon/my-registrations/controller.ts new file mode 100644 index 00000000000..758d5924ecd --- /dev/null +++ b/lib/registries/addon/my-registrations/controller.ts @@ -0,0 +1,18 @@ +import Controller from '@ember/controller'; +import { inject as service } from '@ember/service'; + +import { action } from '@ember/object'; +import { tracked } from '@glimmer/tracking'; +import CurrentUserService from 'ember-osf-web/services/current-user'; + +export default class MyRegistrationsController extends Controller { + @service currentUser!: CurrentUserService; + + queryParams = ['tab']; + @tracked tab = 'submitted'; + + @action + changeTab(newTabId: string) { + this.tab = newTabId; + } +} diff --git a/lib/registries/addon/my-registrations/styles.scss b/lib/registries/addon/my-registrations/styles.scss new file mode 100644 index 00000000000..c58315a0fd8 --- /dev/null +++ b/lib/registries/addon/my-registrations/styles.scss @@ -0,0 +1,54 @@ +// stylelint-disable declaration-property-value-blacklist +// stylelint-disable selector-no-qualifying-type +.ContentBackground { + composes: ContentBackground from '../overview/styles.scss'; + + :global(.list-group-item) { + margin-bottom: 20px; + } + + :global(.media-desktop), + :global(.media-tablet), + :global(.media-mobile) { + margin-top: -38px; + } +} + +.Title { + composes: Title from '../drafts/draft/styles.scss'; + + min-height: 150px; +} + +.NavTabs { + ul { + margin-left: 15px; + } + + :global(a.nav-link) { + border: none; + color: #fff; + + &:hover { + border: none; + color: $color-text-gray; + background-color: #e4e4e4; + } + } + + :global(a.nav-link.active) { + border: none; + color: $color-text-gray; + background-color: #e4e4e4; + + &:focus { + border: none; + background-color: #e4e4e4; + } + + &:hover { + border: none; + background-color: #e4e4e4; + } + } +} diff --git a/lib/registries/addon/my-registrations/template.hbs b/lib/registries/addon/my-registrations/template.hbs index 35472c27d4f..f9756f2d172 100644 --- a/lib/registries/addon/my-registrations/template.hbs +++ b/lib/registries/addon/my-registrations/template.hbs @@ -1 +1,40 @@ -{{ outlet }} +{{title (t 'registries.my_registrations.header')}} + + + + + +
+

+ {{t 'registries.my_registrations.header'}} +

+
+
+
+ + {{#if this.currentUser.user}} + + + + + + + + + {{/if}} + +
+
\ No newline at end of file diff --git a/tests/engines/registries/integration/discover/discover-test.ts b/tests/engines/registries/integration/discover/discover-test.ts index 85306f7a6f9..1aa3b86ebe7 100644 --- a/tests/engines/registries/integration/discover/discover-test.ts +++ b/tests/engines/registries/integration/discover/discover-test.ts @@ -153,7 +153,7 @@ module('Registries | Integration | discover', hooks => { }); test('query parameters', async function(this: TestContext, assert: Assert) { - assert.expect(3 + (QueryParamTestCases.length * 6)); + assert.expect(1 + (QueryParamTestCases.length * 2)); const stub = sinon.stub(this.owner.lookup('service:share-search'), 'registrations').returns(emptyResults); // Initial load so we don't have to deal with the aggregations loading diff --git a/tests/integration/components/node-card/component-test.ts b/tests/integration/components/node-card/component-test.ts index 9e21fdccd1d..9ff07ebdf62 100644 --- a/tests/integration/components/node-card/component-test.ts +++ b/tests/integration/components/node-card/component-test.ts @@ -3,6 +3,7 @@ import { hbs } from 'ember-cli-htmlbars'; import { setupMirage } from 'ember-cli-mirage/test-support'; import { setupIntl, TestContext } from 'ember-intl/test-support'; import { setupRenderingTest } from 'ember-qunit'; +import moment from 'moment'; import { module, test } from 'qunit'; import { OsfLinkRouterStub } from '../../helpers/osf-link-router-stub'; @@ -49,6 +50,30 @@ module('Integration | Component | node-card', hooks => { registration.registrationSchema.name, 'Schema name is correct', ); + assert.dom('[data-test-registration-registry-label]').exists('Registry label exists'); + assert.dom('[data-test-registration-registry-label]').hasText( + this.intl.t('node_card.registry'), + 'Registry label is correct', + ); + assert.dom('[data-test-registration-registry-name]').exists('Registry name exists'); + assert.dom('[data-test-registration-registry-name]').hasText( + registration.provider.name, + ); + assert.dom('[data-test-created-timestamp-label]').exists('Created timestamp label exists'); + assert.dom('[data-test-created-timestamp-label]').hasText( + this.intl.t('node_card.registration.timestamp_label'), + 'Created timestamp label is correct', + ); + assert.dom('[data-test-created-timestamp-value]').exists('Created timestamp value exists'); + assert.dom('[data-test-created-timestamp-value]').hasText( + `${moment(registration.dateCreated)}`, + 'Created timestamp value is correct', + ); + assert.dom('[data-test-updated-timestamp-value]').exists('Updated timestamp value exists'); + assert.dom('[data-test-updated-timestamp-value]').hasText( + `${moment(registration.dateModified)}`, + 'Updated timestamp value is correct', + ); assert.dom('[data-test-contributors-label]').exists('Contributors label exists'); assert.dom('[data-test-contributors-label]').hasText( this.intl.t('node_card.contributors'), @@ -66,7 +91,9 @@ module('Integration | Component | node-card', hooks => { this.intl.t('node_card.description'), 'Description label is correct', ); - assert.dom('[data-test-description]').hasTextContaining(registration.description, 'Description is correct'); + assert.dom('[data-test-description]').hasTextContaining( + registration.description, 'Description is correct', + ); assert.dom('[data-test-tags-label]').exists('Tags label exists'); assert.dom('[data-test-tags-label]').hasText( this.intl.t('node_card.tags'), diff --git a/tests/integration/components/registries/my-registrations-list/component-test.ts b/tests/integration/components/registries/my-registrations-list/component-test.ts new file mode 100644 index 00000000000..576424fa582 --- /dev/null +++ b/tests/integration/components/registries/my-registrations-list/component-test.ts @@ -0,0 +1,96 @@ +import { click, render } from '@ember/test-helpers'; +import { hbs } from 'ember-cli-htmlbars'; +import { setupMirage } from 'ember-cli-mirage/test-support'; +import { setupIntl, TestContext } from 'ember-intl/test-support'; +import { OsfLinkRouterStub } from 'ember-osf-web/tests/integration/helpers/osf-link-router-stub'; +import { setupRenderingTest } from 'ember-qunit'; +import { module, test } from 'qunit'; + +module('Integration | Component | my-registrations-list', hooks => { + setupRenderingTest(hooks); + setupMirage(hooks); + setupIntl(hooks); + + hooks.beforeEach(async function(this: TestContext) { + this.store = this.owner.lookup('service:store'); + this.intl = this.owner.lookup('service:intl'); + this.owner.register('service:router', OsfLinkRouterStub); + }); + + test('draft list empty', async function(this: TestContext, assert) { + await render( + hbs``, + ); + assert.dom('[data-test-draft-list-no-general]').hasText( + this.intl.t('registries.myRegistrationsList.noGeneral'), + 'No items general message exists and correct', + ); + assert.dom('[data-test-draft-list-no-drafts]').hasText( + this.intl.t('registries.myRegistrationsList.noDrafts'), + 'Specifc no drafts message exists and correct', + ); + assert.dom('[data-test-add-new-button]').exists('Add new button exists'); + }); + + test('registration list empty', async function(this: TestContext, assert) { + const currentUser = server.create('user', { id: 'wraith' }); + const currentUserModel = await this.store.findRecord('user', currentUser.id); + this.set('user', currentUserModel); + this.owner.lookup('service:current-user').setProperties({ + user: currentUserModel, currentUserId: currentUserModel.id, + }); + await render( + hbs``, + ); + assert.dom('[data-test-draft-list-no-general]').hasText( + this.intl.t('registries.myRegistrationsList.noGeneral'), + 'No items general message exists and correct', + ); + assert.dom('[data-test-draft-list-no-registrations]').hasText( + this.intl.t('registries.myRegistrationsList.noRegistrations'), + 'Specifc no registrations message exists and correct', + ); + assert.dom('[data-test-add-new-button]').exists('Add new button exists'); + }); + + test('draft list renders and paginates', async function(this: TestContext, assert) { + const currentUser = server.create('user', { id: 'wraith' }); + const currentUserModel = await this.store.findRecord('user', currentUser.id); + this.owner.lookup('service:current-user').setProperties({ + user: currentUserModel, currentUserId: currentUserModel.id, + }); + server.createList('draft-registration', 11, { initiator: currentUser }); + await render( + hbs``, + ); + assert.dom('[data-test-draft-registration-card]').exists({ count: 10 }, 'First page shows 10 results'); + assert.dom('[data-test-next-page-button]').isEnabled('Next page exists'); + await click('[data-test-next-page-button]'); + assert.dom('[data-test-draft-registration-card]').exists({ count: 1 }, 'Second page shows 1 results'); + assert.dom('[data-test-next-page-button]').isDisabled('There is no next page'); + }); + + test('registrations list renders and paginates', async function(this: TestContext, assert) { + const currentUser = server.create('user', { id: 'wraith' }); + const currentUserModel = await this.store.findRecord('user', currentUser.id); + this.set('user', currentUserModel); + this.owner.lookup('service:current-user').setProperties({ + user: currentUserModel, currentUserId: currentUserModel.id, + }); + for (let i = 0; i < 11; i++) { + server.create('registration', { + contributors: [ + server.create('contributor', { users: currentUser }), + ], + }); + } + await render( + hbs``, + ); + assert.dom('[data-test-node-card]').exists({ count: 10 }, 'First page shows 10 results'); + assert.dom('[data-test-next-page-button]').isEnabled('Next page exists'); + await click('[data-test-next-page-button]'); + assert.dom('[data-test-node-card]').exists({ count: 1 }, 'Second page shows 1 results'); + assert.dom('[data-test-next-page-button]').isDisabled('There is no next page'); + }); +}); diff --git a/translations/en-us.yml b/translations/en-us.yml index 1c58f6daa51..c449f5c08a8 100644 --- a/translations/en-us.yml +++ b/translations/en-us.yml @@ -578,7 +578,7 @@ join_osf: node_card: generic: private_tooltip: 'This project is private' - timestamp_label: "" + timestamp_label: 'Created:' fork: private_tooltip: 'This fork is private' timestamp_label: 'Forked:' @@ -601,6 +601,8 @@ node_card: registration_template: 'Registration template:' contributors: 'Contributors:' description: 'Description:' + last_updated: 'Last updated:' + registry: 'Registry:' options: Options view: 'View' forks: @@ -1132,6 +1134,10 @@ registries: recent: title: 'Browse Registrations' more: 'See more' + my_registrations: + header: 'My Registrations' + drafts: 'Drafts' + submitted: 'Submitted' registration_metadata: add_description: 'Add description' add_contributors: @@ -1418,6 +1424,11 @@ registries: justificationForWithdrawal: 'Justification for Withdrawal' justificationForWithdrawalPlaceholder: 'Provide justification for withdrawal' noModeratorActions: 'No moderator decisions can be made at this time' + myRegistrationsList: + noGeneral: 'This page allows you to search and quickly access your registrations.' + noRegistrations: "You don't have any submitted registrations. Create one with the button below." + noDrafts: "You don't have any draft registrations. Create one with the button below." + createRegistration: 'Create a registration' meetings: index: meetings-list: From 7f27f92597a46d8d8d58ca1a9c33edd95da51144 Mon Sep 17 00:00:00 2001 From: futa-ikeda <51409893+futa-ikeda@users.noreply.github.com> Date: Tue, 27 Apr 2021 12:54:47 -0400 Subject: [PATCH 05/19] Update message in new registration creation modal (#1145) --- translations/en-us.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translations/en-us.yml b/translations/en-us.yml index c449f5c08a8..db88abb8e9d 100644 --- a/translations/en-us.yml +++ b/translations/en-us.yml @@ -624,7 +624,7 @@ node: registrations: new_registration_modal: title: Register - info: 'Registration creates a frozen version of the project. Your original project remains editable and will have the registration linked. Things to know about registration:
  • Registrations cannot be edited or deleted.
  • Withdrawing a registration removes its contents, but leaves behind basic metadata: title, contributors, date registered, date withdrawn, and justification (if provided).
  • Registrations can be public or embargoed for up to four years. Embargoed registrations will be made public automatically when the embargo expires.
Continue your registration by selecting a registration form:' + info: 'Registration creates a frozen version of the project. Your original project remains editable and will have the registration linked. Things to know about registration:
  • Registrations cannot be edited or deleted.
  • Withdrawing a registration removes its contents, but leaves behind basic metadata: title, contributors, date registered, date withdrawn, and justification (if provided).
  • Registrations can be public or embargoed for up to four years. Embargoed registrations will be made public automatically when the embargo expires.
  • Registrations are archived on Internet Archive and a link to the archived copy will be added to the registration metadata.
Continue your registration by selecting a registration form:' create: 'Create draft' prereg_modal: title: 'Preregistration Challenge' From 2780b7918f8deb919b0880571c79e0858b7633f3 Mon Sep 17 00:00:00 2001 From: futa-ikeda <51409893+futa-ikeda@users.noreply.github.com> Date: Tue, 27 Apr 2021 15:09:56 -0400 Subject: [PATCH 06/19] Revert "Update message in new registration creation modal (#1145)" This reverts commit 7f27f92597a46d8d8d58ca1a9c33edd95da51144. --- translations/en-us.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translations/en-us.yml b/translations/en-us.yml index db88abb8e9d..c449f5c08a8 100644 --- a/translations/en-us.yml +++ b/translations/en-us.yml @@ -624,7 +624,7 @@ node: registrations: new_registration_modal: title: Register - info: 'Registration creates a frozen version of the project. Your original project remains editable and will have the registration linked. Things to know about registration:
  • Registrations cannot be edited or deleted.
  • Withdrawing a registration removes its contents, but leaves behind basic metadata: title, contributors, date registered, date withdrawn, and justification (if provided).
  • Registrations can be public or embargoed for up to four years. Embargoed registrations will be made public automatically when the embargo expires.
  • Registrations are archived on Internet Archive and a link to the archived copy will be added to the registration metadata.
Continue your registration by selecting a registration form:' + info: 'Registration creates a frozen version of the project. Your original project remains editable and will have the registration linked. Things to know about registration:
  • Registrations cannot be edited or deleted.
  • Withdrawing a registration removes its contents, but leaves behind basic metadata: title, contributors, date registered, date withdrawn, and justification (if provided).
  • Registrations can be public or embargoed for up to four years. Embargoed registrations will be made public automatically when the embargo expires.
Continue your registration by selecting a registration form:' create: 'Create draft' prereg_modal: title: 'Preregistration Challenge' From ecc02e6ead4e5ca89fe7cb7ea7e030160b88e770 Mon Sep 17 00:00:00 2001 From: Fabrice Mizero Date: Wed, 28 Apr 2021 15:15:06 -0400 Subject: [PATCH 07/19] Bump app version to 21.4.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d4c9a6cfcb4..26bedef8591 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ember-osf-web", - "version": "21.3.0", + "version": "21.4.0", "description": "Ember front-end for the Open Science Framework", "license": "Apache-2.0", "author": "Center for Open Science ", From 77183ea19de2e82d13d511d1f4fc0262bfca67cc Mon Sep 17 00:00:00 2001 From: Yuhuai Liu Date: Thu, 29 Apr 2021 10:49:40 -0400 Subject: [PATCH 08/19] use requireAuth decorator (#1190) --- lib/registries/addon/my-registrations/route.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/registries/addon/my-registrations/route.ts b/lib/registries/addon/my-registrations/route.ts index 5d55195cabe..4dd8fd8e234 100644 --- a/lib/registries/addon/my-registrations/route.ts +++ b/lib/registries/addon/my-registrations/route.ts @@ -2,8 +2,10 @@ import Route from '@ember/routing/route'; import RouterService from '@ember/routing/router-service'; import { inject as service } from '@ember/service'; +import requireAuth from 'ember-osf-web/decorators/require-auth'; import Analytics from 'ember-osf-web/services/analytics'; +@requireAuth() export default class RegistriesMyRegistrationsRoute extends Route { @service analytics!: Analytics; @service router!: RouterService; From 219a5bd63b5f4f72d114d0a607a2902c69a86dc3 Mon Sep 17 00:00:00 2001 From: futa-ikeda <51409893+futa-ikeda@users.noreply.github.com> Date: Mon, 3 May 2021 14:40:22 -0400 Subject: [PATCH 09/19] [No ticket] Hide OSFRegistry in navbar for tablet (#1193) * Hide OSFRegistry in navbar for tablet * Fix broken test --- lib/registries/addon/components/registries-navbar/styles.scss | 1 + .../addon/components/registries-navbar/template.hbs | 4 ++-- .../components/registries-navbar/component-test.ts | 4 +++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/registries/addon/components/registries-navbar/styles.scss b/lib/registries/addon/components/registries-navbar/styles.scss index 436d1b98b84..11ca781aac8 100644 --- a/lib/registries/addon/components/registries-navbar/styles.scss +++ b/lib/registries/addon/components/registries-navbar/styles.scss @@ -52,6 +52,7 @@ } :global(.media-mobile) .HideOnMobile, +:global(.media-tablet) .HideOnTablet, :global(.media-desktop) .OnlyOnMobile, :global(.media-tablet) .OnlyOnMobile { display: none; diff --git a/lib/registries/addon/components/registries-navbar/template.hbs b/lib/registries/addon/components/registries-navbar/template.hbs index 4ef23d2517a..dd68c0c65c4 100644 --- a/lib/registries/addon/components/registries-navbar/template.hbs +++ b/lib/registries/addon/components/registries-navbar/template.hbs @@ -30,8 +30,8 @@ data-analytics-name='Toggle' @classNames={{local-class 'Service Dropdown'}} > - {{t 'general.OSF'}} - {{t 'general.services.registries'}} + {{t 'general.OSF'}} + {{t 'general.services.registries'}} {{nav.icon (if dropdown.isOpen 'caret-up' 'caret-down')}} diff --git a/tests/engines/registries/integration/components/registries-navbar/component-test.ts b/tests/engines/registries/integration/components/registries-navbar/component-test.ts index bbd4eec8ab1..cb76e8937e3 100644 --- a/tests/engines/registries/integration/components/registries-navbar/component-test.ts +++ b/tests/engines/registries/integration/components/registries-navbar/component-test.ts @@ -158,7 +158,9 @@ module('Registries | Integration | Component | registries-navbar', hooks => { await render(hbs``); await percySnapshot(assert); - assert.equal(visibleText('[data-test-service]'), `${t('general.OSF')}${t('general.services.registries')}`); + assert.dom('[data-test-service]').doesNotContainText( + `${t('general.OSF')}${t('general.services.registries')}`, 'Navbar text hidden on tablet view', + ); assert.dom('[data-test-search-bar-mobile]').isNotVisible('Mobile search bar is not visible on tablet'); assert.dom('a[data-test-help]').isVisible('Help button is visible'); From 08c4176293e39797e34402c61bdfab6b592b91bf Mon Sep 17 00:00:00 2001 From: futa-ikeda <51409893+futa-ikeda@users.noreply.github.com> Date: Mon, 3 May 2021 23:46:43 -0400 Subject: [PATCH 10/19] [No ticket] Only show top-level registrations on my-registrations (#1191) * Only show top-level registrations on my-registrations * Update how filtering for null is handled * Fix broad condition to check for null field in mirage * Clean up conditionals Co-authored-by: Brian J. Geiger Co-authored-by: Yuhuai Liu --- .../registrations/component.ts | 5 ++++ .../registrations/template.hbs | 1 + .../registrations/component.js | 1 + mirage/views/utils/index.ts | 6 ++-- .../my-registrations-list/component-test.ts | 29 +++++++++++++++++++ 5 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 lib/osf-components/addon/components/registries/my-registrations-list/registrations/component.ts create mode 100644 lib/osf-components/app/components/registries/my-registrations-list/registrations/component.js diff --git a/lib/osf-components/addon/components/registries/my-registrations-list/registrations/component.ts b/lib/osf-components/addon/components/registries/my-registrations-list/registrations/component.ts new file mode 100644 index 00000000000..d5a5c72c59b --- /dev/null +++ b/lib/osf-components/addon/components/registries/my-registrations-list/registrations/component.ts @@ -0,0 +1,5 @@ +import Component from '@glimmer/component'; + +export default class MyRegistrationsListRegistrationsComponent extends Component { + filter = { filter: { parent: null } }; +} diff --git a/lib/osf-components/addon/components/registries/my-registrations-list/registrations/template.hbs b/lib/osf-components/addon/components/registries/my-registrations-list/registrations/template.hbs index 2de38f0144d..ba0c76d44eb 100644 --- a/lib/osf-components/addon/components/registries/my-registrations-list/registrations/template.hbs +++ b/lib/osf-components/addon/components/registries/my-registrations-list/registrations/template.hbs @@ -3,6 +3,7 @@ @model={{@user}} @relationshipName='registrations' @usePlaceholders={{false}} + @query={{this.filter}} as |list| > diff --git a/lib/osf-components/app/components/registries/my-registrations-list/registrations/component.js b/lib/osf-components/app/components/registries/my-registrations-list/registrations/component.js new file mode 100644 index 00000000000..5f2b9a174c0 --- /dev/null +++ b/lib/osf-components/app/components/registries/my-registrations-list/registrations/component.js @@ -0,0 +1 @@ +export { default } from 'osf-components/components/registries/my-registrations-list/registrations/component'; diff --git a/mirage/views/utils/index.ts b/mirage/views/utils/index.ts index 98225c48516..1fc396e0402 100644 --- a/mirage/views/utils/index.ts +++ b/mirage/views/utils/index.ts @@ -43,8 +43,10 @@ export function filter(model: ModelInstance, request: Request) { if (field === 'id') { return compareIds(model.id, val, toOperator(operator)); } - if (model[`${field}Ids`] || model[`${field}Id`]) { - return compareIds(model[`${field}Ids`] || model[`${field}Id`], val, toOperator(operator)); + if (model[`${field}Ids`] || model[`${field}Id`] + || (model[`${field}Ids`] === null || model[`${field}Id`] === null) + ) { + return compareIds(model[`${field}Ids`] || model[`${field}Id`] || '', val, toOperator(operator)); } return compare(model[field], val, toOperator(operator)); }); diff --git a/tests/integration/components/registries/my-registrations-list/component-test.ts b/tests/integration/components/registries/my-registrations-list/component-test.ts index 576424fa582..9b1fe8f0818 100644 --- a/tests/integration/components/registries/my-registrations-list/component-test.ts +++ b/tests/integration/components/registries/my-registrations-list/component-test.ts @@ -93,4 +93,33 @@ module('Integration | Component | my-registrations-list', hooks => { assert.dom('[data-test-node-card]').exists({ count: 1 }, 'Second page shows 1 results'); assert.dom('[data-test-next-page-button]').isDisabled('There is no next page'); }); + + test('registrations list filters out child ', async function(this: TestContext, assert) { + const currentUser = server.create('user', { id: 'gibby' }); + const currentUserModel = await this.store.findRecord('user', currentUser.id); + this.set('user', currentUserModel); + this.owner.lookup('service:current-user').setProperties({ + user: currentUserModel, currentUserId: currentUserModel.id, + }); + const parent = server.create('registration', { + id: 'parnt', + title: 'this is the parent', + contributors: [ + server.create('contributor', { users: currentUser }), + ], + }); + server.create('registration', { + id: 'child', + title: 'this is the child', + parent, + contributors: [ + server.create('contributor', { users: currentUser }), + ], + }); + await render( + hbs``, + ); + assert.dom('[data-test-node-card]').exists({ count: 1 }, 'Only one registration is shown'); + assert.dom('[data-test-node-title]').containsText(parent.title, 'Only the parent registration is shown'); + }); }); From f9bc4e0d7e45b8717ffcae31148febb583053de9 Mon Sep 17 00:00:00 2001 From: Yuhuai Liu Date: Tue, 4 May 2021 10:28:35 -0400 Subject: [PATCH 11/19] add placeholder text for drafts with empty string as titles (#1197) --- .../addon/components/draft-registration-card/template.hbs | 6 +++++- translations/en-us.yml | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/osf-components/addon/components/draft-registration-card/template.hbs b/lib/osf-components/addon/components/draft-registration-card/template.hbs index a329c52b850..0b13730e9d0 100644 --- a/lib/osf-components/addon/components/draft-registration-card/template.hbs +++ b/lib/osf-components/addon/components/draft-registration-card/template.hbs @@ -10,7 +10,11 @@ @route='registries.drafts.draft' @models={{array this.draftRegistration.id}} > - {{this.draftRegistration.title}} + {{#if this.draftRegistration.title}} + {{this.draftRegistration.title}} + {{else}} + {{t 'osf-components.draft-registration-card.untitled_placeholder'}} + {{/if}} {{else}} diff --git a/translations/en-us.yml b/translations/en-us.yml index c449f5c08a8..5ab7a0f95e7 100644 --- a/translations/en-us.yml +++ b/translations/en-us.yml @@ -1547,6 +1547,7 @@ osf-components: started: 'Started:' last_updated: 'Last updated:' review: Review + untitled_placeholder: '(Untitled)' delete_draft_confirm: 'Are you sure you want to delete this draft registration?' copyable-text: copyToClipboard: 'Copy to clipboard' From 33632c61bcf714a7063976fda92214f84bf6e15e Mon Sep 17 00:00:00 2001 From: futa-ikeda <51409893+futa-ikeda@users.noreply.github.com> Date: Tue, 4 May 2021 10:50:02 -0400 Subject: [PATCH 12/19] [No ticket]Rearrange draft-registration-card to prevent visual bug on hover (#1192) * Rearrange draft-registration-card to prevent visual bug on hover * Remove unneeded changes * Remove leftover changes Co-authored-by: Yuhuai Liu Co-authored-by: Brian J. Geiger --- .../addon/components/draft-registration-card/styles.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/osf-components/addon/components/draft-registration-card/styles.scss b/lib/osf-components/addon/components/draft-registration-card/styles.scss index 3be52c6f926..87345d383e0 100644 --- a/lib/osf-components/addon/components/draft-registration-card/styles.scss +++ b/lib/osf-components/addon/components/draft-registration-card/styles.scss @@ -40,6 +40,10 @@ .DraftRegistrationCard__review { margin-right: 10px; + + &:hover { + text-decoration: none; + } } .DraftRegistrationCard__delete { From 4a128bdd9130e57fba217d680bd84ba248ac727f Mon Sep 17 00:00:00 2001 From: Yuhuai Liu Date: Tue, 4 May 2021 12:28:27 -0400 Subject: [PATCH 13/19] add embed query param to my-registration-list componenets (#1198) Co-authored-by: futa-ikeda <51409893+futa-ikeda@users.noreply.github.com> --- .../my-registrations-list/drafts/component.ts | 10 ++++++++++ .../my-registrations-list/drafts/template.hbs | 1 + .../my-registrations-list/registrations/component.ts | 11 ++++++++++- .../my-registrations-list/registrations/template.hbs | 2 +- .../my-registrations-list/drafts/component.js | 1 + 5 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 lib/osf-components/addon/components/registries/my-registrations-list/drafts/component.ts create mode 100644 lib/osf-components/app/components/registries/my-registrations-list/drafts/component.js diff --git a/lib/osf-components/addon/components/registries/my-registrations-list/drafts/component.ts b/lib/osf-components/addon/components/registries/my-registrations-list/drafts/component.ts new file mode 100644 index 00000000000..5ec181b9cce --- /dev/null +++ b/lib/osf-components/addon/components/registries/my-registrations-list/drafts/component.ts @@ -0,0 +1,10 @@ +import Component from '@glimmer/component'; + +export default class MyRegistrationsDraftListComponent extends Component { + queryParam = { + embed: [ + 'provider', + 'registration_schema', + ], + }; +} diff --git a/lib/osf-components/addon/components/registries/my-registrations-list/drafts/template.hbs b/lib/osf-components/addon/components/registries/my-registrations-list/drafts/template.hbs index 0aa6b8d2ba6..7d56f2ea9cc 100644 --- a/lib/osf-components/addon/components/registries/my-registrations-list/drafts/template.hbs +++ b/lib/osf-components/addon/components/registries/my-registrations-list/drafts/template.hbs @@ -2,6 +2,7 @@ diff --git a/lib/osf-components/addon/components/registries/my-registrations-list/registrations/component.ts b/lib/osf-components/addon/components/registries/my-registrations-list/registrations/component.ts index d5a5c72c59b..14131f7cb52 100644 --- a/lib/osf-components/addon/components/registries/my-registrations-list/registrations/component.ts +++ b/lib/osf-components/addon/components/registries/my-registrations-list/registrations/component.ts @@ -1,5 +1,14 @@ import Component from '@glimmer/component'; export default class MyRegistrationsListRegistrationsComponent extends Component { - filter = { filter: { parent: null } }; + queryParam = { + filter: { + parent: null, + }, + embed: [ + 'bibliographic_contributors', + 'provider', + 'registration_schema', + ], + }; } diff --git a/lib/osf-components/addon/components/registries/my-registrations-list/registrations/template.hbs b/lib/osf-components/addon/components/registries/my-registrations-list/registrations/template.hbs index ba0c76d44eb..1bd682ee39c 100644 --- a/lib/osf-components/addon/components/registries/my-registrations-list/registrations/template.hbs +++ b/lib/osf-components/addon/components/registries/my-registrations-list/registrations/template.hbs @@ -3,7 +3,7 @@ @model={{@user}} @relationshipName='registrations' @usePlaceholders={{false}} - @query={{this.filter}} + @query={{this.queryParam}} as |list| > diff --git a/lib/osf-components/app/components/registries/my-registrations-list/drafts/component.js b/lib/osf-components/app/components/registries/my-registrations-list/drafts/component.js new file mode 100644 index 00000000000..e8394d364f4 --- /dev/null +++ b/lib/osf-components/app/components/registries/my-registrations-list/drafts/component.js @@ -0,0 +1 @@ +export { default } from 'osf-components/components/registries/my-registrations-list/drafts/component'; From 14b1fb65c9dc294edb1a2f61aa0eddfafdb7b384 Mon Sep 17 00:00:00 2001 From: Yuhuai Liu Date: Tue, 4 May 2021 15:27:33 -0400 Subject: [PATCH 14/19] fix registries-state (#1194) Co-authored-by: futa-ikeda <51409893+futa-ikeda@users.noreply.github.com> Co-authored-by: Brian J. Geiger --- lib/registries/addon/components/registries-states/component.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/registries/addon/components/registries-states/component.ts b/lib/registries/addon/components/registries-states/component.ts index ca780bfb235..23247436791 100644 --- a/lib/registries/addon/components/registries-states/component.ts +++ b/lib/registries/addon/components/registries-states/component.ts @@ -55,8 +55,6 @@ export default class RegistriesStates extends Component { stateKey = 'pendingRegistrationApproval'; } else if (this.registration.pendingEmbargoApproval) { stateKey = 'pendingEmbargoApproval'; - } else if (!this.registration.userHasAdminPermission && !this.isModeratorMode) { - stateKey = RegistrationReviewStates.Accepted; } else { stateKey = camelize(this.registration.reviewsState); } From 7135e9e63b4f42fa95dc365fbece733bd692398b Mon Sep 17 00:00:00 2001 From: futa-ikeda <51409893+futa-ikeda@users.noreply.github.com> Date: Wed, 5 May 2021 10:03:49 -0400 Subject: [PATCH 15/19] Update styling for draft card button hover (#1199) Co-authored-by: Yuhuai Liu --- .../addon/components/draft-registration-card/styles.scss | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/osf-components/addon/components/draft-registration-card/styles.scss b/lib/osf-components/addon/components/draft-registration-card/styles.scss index 87345d383e0..7bd417fd44d 100644 --- a/lib/osf-components/addon/components/draft-registration-card/styles.scss +++ b/lib/osf-components/addon/components/draft-registration-card/styles.scss @@ -38,7 +38,8 @@ } } -.DraftRegistrationCard__review { +// stylelint-disable selector-no-qualifying-type +a.DraftRegistrationCard__review { margin-right: 10px; &:hover { @@ -46,6 +47,7 @@ } } +// stylelint-enable selector-no-qualifying-type .DraftRegistrationCard__delete { button { padding: 6px 12px; From a74f7ee3a28936f0a23bde10c3b7f59a35ffa83f Mon Sep 17 00:00:00 2001 From: Yuhuai Liu Date: Wed, 5 May 2021 14:05:06 -0400 Subject: [PATCH 16/19] embed initiators (#1200) Co-authored-by: Brian J. Geiger --- .../registries/my-registrations-list/drafts/component.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/osf-components/addon/components/registries/my-registrations-list/drafts/component.ts b/lib/osf-components/addon/components/registries/my-registrations-list/drafts/component.ts index 5ec181b9cce..6c32d7a69ac 100644 --- a/lib/osf-components/addon/components/registries/my-registrations-list/drafts/component.ts +++ b/lib/osf-components/addon/components/registries/my-registrations-list/drafts/component.ts @@ -5,6 +5,7 @@ export default class MyRegistrationsDraftListComponent extends Component { embed: [ 'provider', 'registration_schema', + 'initiator', ], }; } From 1951fb5104689653cbd515f93df515b4ccda22ae Mon Sep 17 00:00:00 2001 From: futa-ikeda <51409893+futa-ikeda@users.noreply.github.com> Date: Wed, 5 May 2021 16:27:24 -0400 Subject: [PATCH 17/19] fix misaligned buttons for safari (#1202) Co-authored-by: Yuhuai Liu --- .../addon/components/draft-registration-card/styles.scss | 4 ++++ .../addon/components/draft-registration-card/template.hbs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/osf-components/addon/components/draft-registration-card/styles.scss b/lib/osf-components/addon/components/draft-registration-card/styles.scss index 7bd417fd44d..18c7a85ec3f 100644 --- a/lib/osf-components/addon/components/draft-registration-card/styles.scss +++ b/lib/osf-components/addon/components/draft-registration-card/styles.scss @@ -48,6 +48,10 @@ a.DraftRegistrationCard__review { } // stylelint-enable selector-no-qualifying-type +.DraftRegistrationCard__edit { + vertical-align: bottom; +} + .DraftRegistrationCard__delete { button { padding: 6px 12px; diff --git a/lib/osf-components/addon/components/draft-registration-card/template.hbs b/lib/osf-components/addon/components/draft-registration-card/template.hbs index 0b13730e9d0..0e58020a039 100644 --- a/lib/osf-components/addon/components/draft-registration-card/template.hbs +++ b/lib/osf-components/addon/components/draft-registration-card/template.hbs @@ -89,7 +89,7 @@ @route='registries.drafts.draft' @models={{array this.draftRegistration.id}} > - From abf1525fe74302b5ca762e32fe7b16dcac9934f4 Mon Sep 17 00:00:00 2001 From: futa-ikeda <51409893+futa-ikeda@users.noreply.github.com> Date: Mon, 10 May 2021 13:32:46 -0400 Subject: [PATCH 18/19] [No ticket] Remove registration names for tablet (#1205) * Remove registration names for tablet * Update computed keys --- .../addon/components/registries-navbar/component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/registries/addon/components/registries-navbar/component.ts b/lib/registries/addon/components/registries-navbar/component.ts index 310bf24a2cb..c46a8659bd6 100644 --- a/lib/registries/addon/components/registries-navbar/component.ts +++ b/lib/registries/addon/components/registries-navbar/component.ts @@ -40,9 +40,9 @@ export default class RegistriesNavbar extends AuthBase { return this.provider ? this.provider.id : defaultProviderId; } - @computed('media.isMobile', 'provider.brand') + @computed('media.{isMobile,isTablet}', 'provider.brand') get shouldShowProviderName() { - return !this.media.isMobile && this.provider && this.provider.brand; + return !this.media.isMobile && !this.media.isTablet && this.provider && this.provider.brand; } @computed('provider.{allowSubmissions,id}') From d3bc5bfa42f81c2824b52305774444b5f195140d Mon Sep 17 00:00:00 2001 From: Fabrice Mizero Date: Tue, 11 May 2021 12:54:12 -0400 Subject: [PATCH 19/19] Update Changelog v21.4.0 --- CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 241ab01e688..fae0d788008 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [21.4.0] - 2021-04-11 +### Added +- user's `myRegistrations` page + ## [21.3.0] - 2021-04-23 ### Added - 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. ### Added - Quick Files -[Unreleased]: https://github.com/CenterForOpenScience/ember-osf-web/compare/21.3.0...develop +[Unreleased]: https://github.com/CenterForOpenScience/ember-osf-web/compare/21.4.0...develop +[21.4.0]: https://github.com/CenterForOpenScience/ember-osf-web/releases/tag/21.4.0 [21.3.0]: https://github.com/CenterForOpenScience/ember-osf-web/releases/tag/21.3.0 [21.2.0]: https://github.com/CenterForOpenScience/ember-osf-web/releases/tag/21.2.0 [21.1.1]: https://github.com/CenterForOpenScience/ember-osf-web/releases/tag/21.1.1