Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENG-5882] Added new context to the Registration Draft Metadata page #2466

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
175 changes: 137 additions & 38 deletions lib/registries/addon/drafts/draft/metadata/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -10,56 +10,100 @@
<p local-class='HeadingParagraph'>
{{t 'registries.registration_metadata.metadata_page_description'}}
</p>
<hr>
<hr />
<form local-class='Metadata'>
<FormControls @changeset={{this.draftManager.metadataChangeset}} ...attributes as |form|>
<FormControls
@changeset={{this.draftManager.metadataChangeset}}
...attributes
as |form|
>
{{#let (unique-id 'title') as |titleFieldId|}}
<label local-class='Label' for={{titleFieldId}} id='title'>
<p local-class='DisplayText'>
{{t 'registries.registration_metadata.title'}}
<span local-class='Required'>*</span>
</p>
</label>
<form.text data-test-metadata-title local-class='SchemaBlockInput' @valuePath='title'
@onKeyUp={{perform this.draftManager.onMetadataInput}} @placeholder=' '
@uniqueID={{titleFieldId}} />
<p>
{{t 'registries.registration_metadata.title_context'}}
</p>
<form.text
data-test-metadata-title
local-class='SchemaBlockInput'
@valuePath='title'
@onKeyUp={{perform this.draftManager.onMetadataInput}}
@placeholder=' '
@uniqueID={{titleFieldId}}
/>
{{/let}}
{{#let (unique-id 'description') as |descriptionFieldId|}}
<label local-class='Label' for={{descriptionFieldId}} id='description'>
<label
local-class='Label'
for={{descriptionFieldId}}
id='description'
>
<p local-class='DisplayText'>
{{t 'registries.registration_metadata.description'}}
<span local-class='Required'>*</span>
</p>
</label>
<form.textarea data-test-metadata-description local-class='SchemaBlockLongText'
@valuePath='description' @onKeyUp={{perform this.draftManager.onMetadataInput}} @placeholder=' '
@uniqueID={{descriptionFieldId}} />
<p>
{{t
'registries.registration_metadata.description_context'
}}
</p>
<form.textarea
data-test-metadata-description
local-class='SchemaBlockLongText'
@valuePath='description'
@onKeyUp={{perform this.draftManager.onMetadataInput}}
@placeholder=' '
@uniqueID={{descriptionFieldId}}
/>
{{/let}}
{{#let (unique-id) 'contributors' as |contributorFieldId|}}
{{#if this.draftManager.currentUserIsAdmin}}
<div local-class='FlexContainer'>
<label local-class='label' for={{contributorFieldId}} id='contributors'>
<label
local-class='label'
for={{contributorFieldId}}
id='contributors'
>
{{#if this.showAddContributorWidget}}
{{t 'registries.registration_metadata.add_contributors.section_heading'}}
{{t
'registries.registration_metadata.add_contributors.section_heading'
}}
{{else}}
{{t 'registries.registration_metadata.contributors'}}
{{t
'registries.registration_metadata.contributors'
}}
{{/if}}
</label>
{{#if this.showAddContributorWidget}}
<Button
aria-label={{t 'registries.registration_metadata.add_contributors.done_add_new_button'}}
aria-label={{t
'registries.registration_metadata.add_contributors.done_add_new_button'
}}
local-class='ContributorButton'
@type='destroy'
{{on 'click' (action this.toggleAddContributorWidget)}}
{{on
'click'
(action this.toggleAddContributorWidget)
}}
>
<FaIcon @icon='times' />
</Button>
{{else}}
<Button
aria-label={{t 'registries.registration_metadata.add_contributors.add_new_button'}}
aria-label={{t
'registries.registration_metadata.add_contributors.add_new_button'
}}
local-class='ContributorButton'
@type='primary'
{{on 'click' (action this.toggleAddContributorWidget)}}
{{on
'click'
(action this.toggleAddContributorWidget)
}}
>
<FaIcon @icon='plus' />
</Button>
Expand All @@ -73,8 +117,14 @@
id={{contributorFieldId}}
/>
{{else}}
<label local-class='label' for={{contributorFieldId}} id='contributors'>
{{t 'registries.registration_metadata.contributors'}}
<label
local-class='label'
for={{contributorFieldId}}
id='contributors'
>
{{t
'registries.registration_metadata.contributors'
}}
</label>
<Contributors::Widget
@draftRegistration={{this.draftManager.draftRegistration}}
Expand All @@ -84,31 +134,53 @@
{{/if}}
{{/let}}
{{#unless this.hideCategories}}
<form.select data-test-metadata-category local-class='SchemaBlockDropdown' id='category'
@label={{t 'registries.registration_metadata.category'}} @valuePath='category'
@options={{this.categoryOptions}} @onchange={{perform this.draftManager.onMetadataInput}} as
|option|>
<form.select
data-test-metadata-category
local-class='SchemaBlockDropdown'
id='category'
@label={{t 'registries.registration_metadata.category'}}
@valuePath='category'
@options={{this.categoryOptions}}
@onchange={{perform this.draftManager.onMetadataInput}}
as |option|
>
<NodeCategory @category={{option}} />
</form.select>
{{/unless}}
<fieldset id='affiliated_institutions'>
<legend>
{{t 'registries.registration_metadata.affiliated_institutions'}}
{{t
'registries.registration_metadata.affiliated_institutions'
}}
</legend>
<p>
{{t
'registries.registration_metadata.affiliated_institutions_context'
}}
</p>
<Drafts::Draft::-Components::MetadataInstitutionsManager
@node={{this.draftManager.draftRegistration}} as |institutionsManager|>
<InstitutionSelectList @manager={{institutionsManager}} />
@node={{this.draftManager.draftRegistration}}
as |institutionsManager|
>
<InstitutionSelectList
@manager={{institutionsManager}}
/>
</Drafts::Draft::-Components::MetadataInstitutionsManager>
</fieldset>
<Drafts::Draft::-Components::Managers::LicensePickerManager @draftManager={{this.draftManager}} as
|licenseManager|>
<Drafts::Draft::-Components::Managers::LicensePickerManager
@draftManager={{this.draftManager}}
as |licenseManager|
>
<label for='license-select' id='license'>
<p local-class='DisplayText'>
{{t 'registries.registration_metadata.license'}}
<span local-class='Required'>*</span>
</p>
</label>
<RegistriesLicensePicker local-class='SchemaBlockDropdown' @manager={{licenseManager}} />
<RegistriesLicensePicker
local-class='SchemaBlockDropdown'
@manager={{licenseManager}}
/>
</Drafts::Draft::-Components::Managers::LicensePickerManager>
<fieldset id='subjects'>
<legend>
Expand All @@ -117,23 +189,50 @@
<span local-class='Required'>*</span>
</p>
</legend>
<Subjects::Manager @model={{this.draftManager.draftRegistration}}
@provider={{this.draftManager.provider}} @doesAutosave={{true}}
@metadataChangeset={{this.draftManager.metadataChangeset}} as |subjectsManager|>
<Subjects::Widget local-class='SubjectsField' @subjectsManager={{subjectsManager}} />
<ValidationErrors @changeset={{this.draftManager.metadataChangeset}} @key='subjects'
@isValidating={{subjectsManager.isSaving}} />
<p>
{{t
'registries.registration_metadata.subjects_context'
}}
</p>
<Subjects::Manager
@model={{this.draftManager.draftRegistration}}
@provider={{this.draftManager.provider}}
@doesAutosave={{true}}
@metadataChangeset={{this.draftManager.metadataChangeset}}
as |subjectsManager|
>
<Subjects::Widget
local-class='SubjectsField'
@subjectsManager={{subjectsManager}}
/>
<ValidationErrors
@changeset={{this.draftManager.metadataChangeset}}
@key='subjects'
@isValidating={{subjectsManager.isSaving}}
/>
</Subjects::Manager>
</fieldset>
{{#let (unique-id 'tags') as |tagsFieldId|}}
<label for={{tagsFieldId}} id='tags'>
{{t 'registries.registration_metadata.tags'}}
</label>
<Drafts::Draft::-Components::TagsManager @changeset={{this.draftManager.metadataChangeset}}
@onMetadataInput={{perform this.draftManager.onMetadataInput}} @valuePath='tags' as
|tagsManager|>
<p>
{{t 'registries.registration_metadata.tags_context'}}
</p>
<Drafts::Draft::-Components::TagsManager
@changeset={{this.draftManager.metadataChangeset}}
@onMetadataInput={{perform
this.draftManager.onMetadataInput
}}
@valuePath='tags'
as |tagsManager|
>
<div local-class='TagsContainer'>
<RegistriesTagsWidget data-test-metadata-tags id={{tagsFieldId}} @manager={{tagsManager}} />
<RegistriesTagsWidget
data-test-metadata-tags
id={{tagsFieldId}}
@manager={{tagsManager}}
/>
</div>
</Drafts::Draft::-Components::TagsManager>
{{/let}}
Expand Down
5 changes: 5 additions & 0 deletions translations/en-us.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1851,6 +1851,7 @@ registries:
add_license: 'Add license'
license_help_text: 'A license tells others how they can use your work in the future and only applies to the information and files submitted with the registration. For more information, see this <a href="https://help.osf.io/article/148-licensing" target="_blank" rel="noopener noreferrer">help guide</a>.'
affiliated_institutions: 'Affiliated institutions'
affiliated_institutions_context: 'This is a service provided by the OSF and is automatically applied to your registration. If you are not sure if your institution has signed up for this service, you can look for their name in this list.'
category: Category
choose_license: 'Choose a License'
citation: Citation
Expand All @@ -1860,6 +1861,7 @@ registries:
date_registered: 'Date registered'
embargo_end_date: 'Date embargo ends'
description: Description
description_context: 'Write a detailed description of your research project, including its purpose and any expected outcomes. This should give readers a comprehensive overview of your work.'
disciplines: Disciplines
edit_field: 'Edit {field}'
license: License
Expand All @@ -1886,8 +1888,11 @@ registries:
show_less: 'Show less'
show_more: 'Show more'
subjects: Subjects
subjects_context: 'Identify the main subject areas that your research pertains to. This helps categorize your work and makes it easier for others in your field to find and reference it.'
tags: Tags
tags_context: 'Enter specific keywords that describe the key elements and concepts of your research. These keywords will improve the discoverability of your registration in search results and databases.'
title: Title
title_context: 'Provide a concise and descriptive title for your registration that accurately reflects the main focus of your research. A clear and specific title will help others quickly understand the essence of your study.'
edit_description:
success: 'Description successfully updated.'
error: 'Unable to save description.'
Expand Down
Loading