Skip to content

Commit

Permalink
Merge main to feature branch.
Browse files Browse the repository at this point in the history
  • Loading branch information
svogt0511 committed Jan 21, 2025
2 parents 3742928 + d9a6f23 commit e9f00d1
Show file tree
Hide file tree
Showing 38 changed files with 792 additions and 56 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- uses: actions/cache@v3
- uses: actions/cache@v4
id: cypress-cache
with:
path: |
Expand All @@ -38,7 +38,7 @@ jobs:
./node_modules/.bin/ember build --output-path="test_build" --environment=development
- name: Upload Test Build artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: test_build
path: test_build/
path: test_build/
4 changes: 2 additions & 2 deletions .github/workflows/cypress_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- uses: actions/cache@v3
- uses: actions/cache@v4
id: cypress-cache
with:
path: |
Expand All @@ -28,7 +28,7 @@ jobs:
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}

- name: Download Test Build artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: test_build
path: test_build/
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ember_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- uses: actions/cache@v3
- uses: actions/cache@v4
id: cypress-cache
with:
path: |
Expand All @@ -26,7 +26,7 @@ jobs:
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}

- name: Download Test Build artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: test_build
path: test_build/
Expand Down
2 changes: 2 additions & 0 deletions app/components/doi-alternate-identifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const alternateIdentifierTypeList = [
'ARK',
'arXiv',
'bibcode',
'CSTR',
'DOI',
'EAN13',
'EISSN',
Expand All @@ -20,6 +21,7 @@ const alternateIdentifierTypeList = [
'LSID',
'PMID',
'PURL',
'RRID',
'UPC',
'URL',
'URN',
Expand Down
4 changes: 2 additions & 2 deletions app/components/doi-contributor.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

<label for="contributorType" class="subtitle">Contributor Type</label>
<label for="contributorType" class="subtitle required-label">Contributor Type</label>
<div class="power-select-fragment" doi-contributor-type>
<@form.element @controlType="power-select" @value={{this.humanContributorType}} @helpText="The type of contributor of the resource." @options={{this.humanContributorTypes}} @formLayout="vertical" @selected={{this.humanContributorType}} @destination={{this.humanContributorType}} as |el|>
<el.control @onChange={{action "selectContributorTypeAction"}} @placeholder="Select Contributor Type" @disabled={{this.disabled}} @searchEnabled={{true}} />
Expand Down Expand Up @@ -35,7 +35,7 @@
</div>
{{/if}}

<div>
<div data-test-contributor-name>
<label for="name" class="subtitle required-label">Name{{if this.isReadonly ' (from Given Name and Family Name)'}}</label>
<div class="input-group">
<input type="text" class="form-control name-field" value={{this.fragment.name}} placeholder="Name" oninput={{action "updateName" value="target.value"}} readonly={{this.isReadonly}} data-test-name/>
Expand Down
1 change: 1 addition & 0 deletions app/components/doi-contributor.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const contributorTypes = [
'RightsHolder',
'Sponsor',
'Supervisor',
'Translator',
'WorkPackageLeader',
'Other'
];
Expand Down
4 changes: 2 additions & 2 deletions app/components/doi-contributors.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="form-group">
<label class="control-label col-md-3" data-test-contributors>Contributors</label>
<div class="form-group data-test-contributors">
<label class="control-label col-md-3">Contributors</label>
<div class="col-md-9">
<div class="label-vertical">The institution or person responsible for collecting, managing, distributing, or otherwise contributing to the development of the resource.</div>
{{#if this.showContributors}}
Expand Down
1 change: 1 addition & 0 deletions app/components/doi-date.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const dateTypesCompleteList = [
'Available',
'Copyrighted',
'Collected',
'Coverage',
'Created',
'Issued',
'Submitted',
Expand Down
4 changes: 3 additions & 1 deletion app/components/doi-funding-reference.hbs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<div data-test-funding-reference>
<div class="power-select-label">
<label for="funder-name" class="subtitle">Funder Name</label>
</div>
Expand Down Expand Up @@ -71,4 +72,5 @@
The URI leading to a page provided by the funder for more information about the award (grant). For example, <a target="_blank" rel="noopener noreferrer" href="https://www.moore.org/grants/list/GBMF3859.01">https://www.moore.org/grants/list/GBMF3859.01</a>.
</div>

<hr />
<hr />
</div>
4 changes: 2 additions & 2 deletions app/components/doi-funding-references.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="form-group">
<label class="control-label col-md-3" data-test-funding-references>Funding References</label>
<div class="form-group" data-test-funding-references>
<label class="control-label col-md-3">Funding References</label>
<div class="col-md-9 compact-select">
<div class="label-vertical">Information about financial support (funding) for the resource being registered.</div>
{{#if this.showFundingReferences}}
Expand Down
4 changes: 2 additions & 2 deletions app/components/doi-related-identifier.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

<div
class="help-block help-block-fragment related-identifier-field no-error {{unless this.fragment.relatedIdentifier 'no-success'}}">
Must be a globally unique identifier. Visit our support website for
<a target="_blank" rel="noopener noreferrer" href="https://support.datacite.org/docs/schema-optional-properties-v43#section-12-a-related-identifier-type"> the list of supported unique identifiers.</a>
Must be a globally unique identifier. Visit the DataCite Metadata Schema documentation for
<a target="_blank" rel="noopener noreferrer" href="https://datacite-metadata-schema.readthedocs.io/en/4/appendices/appendix-1/relatedIdentifierType"> the list of supported unique identifiers.</a>
</div>

<div class="power-select-label">
Expand Down
56 changes: 34 additions & 22 deletions app/components/doi-related-identifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,48 +9,51 @@ import { pascalCase } from 'pascal-case';
import { tracked } from '@glimmer/tracking';

const relationTypeList = [
'Cites',
'Is cited by',
'Compiles',
'Is compiled by',
'Continues',
'Cites',
'Is supplement to',
'Is supplemented by',
'Is continued by',
'Describes',
'Continues',
'Is described by',
'Documents',
'Is documented by',
'Is derived from',
'Is source of',
'Describes',
'Has metadata',
'Is metadata for',
'Has part',
'Is part of',
'Is supplemented by',
'Is supplement to',
'Obsoletes',
'Is obsoleted by',
'References',
'Is referenced by',
'Requires',
'Is required by',
'Reviews',
'Is reviewed by',
'Has version',
'Is version of',
'Is new version of',
'Is previous version of',
'Is part of',
'Has part',
'Is published in',
'Is referenced by',
'References',
'Is documented by',
'Documents',
'Is compiled by',
'Compiles',
'Is variant form of',
'Is original form of',
'Is identical to',
'Is reviewed by',
'Reviews',
'Is derived from',
'Is source of',
'Is required by',
'Requires',
'Is obsoleted by',
'Obsoletes',
'Is collected by',
'Collects'
'Collects',
'Is translation of',
'Has translation'
];

const relatedIdentifierTypeList = [
'ARK',
'arXiv',
'bibcode',
'CSTR',
'DOI',
'EAN13',
'EISSN',
Expand All @@ -63,6 +66,7 @@ const relatedIdentifierTypeList = [
'LSID',
'PMID',
'PURL',
'RRID',
'UPC',
'URL',
'URN',
Expand All @@ -71,6 +75,7 @@ const relatedIdentifierTypeList = [

const resourceTypeGeneralList = [
'Audiovisual',
'Award',
'Book',
'BookChapter',
'Collection',
Expand All @@ -91,6 +96,7 @@ const resourceTypeGeneralList = [
'PeerReview',
'PhysicalObject',
'Preprint',
'Project',
'Report',
'Service',
'Software',
Expand Down Expand Up @@ -160,6 +166,7 @@ export default class DoiRelatedIdentifier extends Component {
/^(?:(http|https):\/\/(dx.)?(doi.org|handle.test.datacite.org)?\/)(10\.\d{4,5}\/.+)/;
const bibcode = /\d{4}[A-Za-z\.\&]{5}[\w\.]{4}[ELPQ-Z\.][\d\.]{4}[A-Z]/;
const urn = /^urn:[a-z0-9][a-z0-9-]{0,31}:[a-z0-9()+,\-.:=@;$_!*'%/?#]/;
const rrid = /^RRID:[a-zA-Z]+.+$/;

switch (true) {
case isBlank(value):
Expand Down Expand Up @@ -211,6 +218,11 @@ export default class DoiRelatedIdentifier extends Component {
this.fragment.relatedIdentifierType = 'URN';
this.controlledIdentifierType = true;
break;
case rrid.test(value):
this.fragment.set('relatedIdentifier', value);
this.fragment.set('relatedIdentifierType', 'RRID');
this.set('controlledIdentifierType', true);
break;
case isISBN(value):
this.fragment.relatedIdentifier = value;
this.fragment.relatedIdentifierType = 'ISBN';
Expand Down
2 changes: 1 addition & 1 deletion app/components/doi-related-item-contributor.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
<label for="contributorType" class="subtitle">Contributor Type</label>
<div class="power-select-fragment" doi-related-item-contributor-type>
<@form.element @controlType="power-select" @value={{this.humanContributorType}} @helpText="The type of contributor of the resource." @options={{this.humanContributorTypes}} @formLayout="vertical" @selected={{this.humanContributorType}} @destination={{this.humanContributorType}} as |el|>
<el.control @allowClear={{true}} @onChange={{action "doSelectContributorType"}} @placeholder="Select Contributor Type" @disabled={{this.disabled}} @searchEnabled={{true}} />
<el.control @allowClear={{true}} @onChange={{action "selectContributorTypeAction"}} @placeholder="Select Contributor Type" @disabled={{this.disabled}} @searchEnabled={{true}} />
</@form.element>
</div>
3 changes: 2 additions & 1 deletion app/components/doi-related-item-contributor.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const contributorTypes = [
'RightsHolder',
'Sponsor',
'Supervisor',
'Translator',
'WorkPackageLeader',
'Other'
];
Expand Down Expand Up @@ -128,7 +129,7 @@ export default class DoiRelatedItemContributor extends Component {
}

@action
doSelectContributorType(contributorType) {
selectContributorTypeAction(contributorType) {
this.selectContributorType(contributorType);
}

Expand Down
7 changes: 3 additions & 4 deletions app/components/doi-related-item-identifier.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
<input type="text"
class="form-control related-item-identifier-field" placeholder="" value={{this.fragment.relatedItemIdentifier}} oninput={{action "updateRelatedItemIdentifierAction" value="target.value"}} data-test-related-item-identifier />

<div
class="help-block help-block-fragment related-item-identifier-field">
Must be a globally unique identifier. Visit our support website for
<a target="_blank" rel="noopener noreferrer" href="https://support.datacite.org/docs/schema-optional-properties-v43#section-12-a-related-identifier-type"> the list of supported unique identifiers.</a>
<div class="help-block help-block-fragment related-item-identifier-field">
Must be a globally unique identifier. Visit the DataCite Metadata Schema documentation for
<a target="_blank" rel="noopener noreferrer" href="https://datacite-metadata-schema.readthedocs.io/en/4/appendices/appendix-1/relatedIdentifierType"> the list of supported unique identifiers.</a>
</div>

<div class="power-select-label">
Expand Down
8 changes: 8 additions & 0 deletions app/components/doi-related-item-identifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const relatedItemIdentifierTypeList = [
'ARK',
'arXiv',
'bibcode',
'CSTR',
'DOI',
'EAN13',
'EISSN',
Expand All @@ -22,6 +23,7 @@ const relatedItemIdentifierTypeList = [
'LSID',
'PMID',
'PURL',
'RRID',
'UPC',
'URL',
'URN',
Expand Down Expand Up @@ -66,6 +68,7 @@ export default class DoiRelatedItemIdentifier extends Component {
/^(?:(http|https):\/\/(dx.)?(doi.org|handle.test.datacite.org)?\/)(10\.\d{4,5}\/.+)/;
const bibcode = /\d{4}[A-Za-z\.\&]{5}[\w\.]{4}[ELPQ-Z\.][\d\.]{4}[A-Z]/;
const urn = /^urn:[a-z0-9][a-z0-9-]{0,31}:[a-z0-9()+,\-.:=@;$_!*'%/?#]/;
const rrid = /^RRID:[a-zA-Z]+.+$/;

switch (true) {
case isBlank(value):
Expand Down Expand Up @@ -123,6 +126,11 @@ export default class DoiRelatedItemIdentifier extends Component {
this.fragment.relatedItemIdentifierType = 'URL';
this.controlledIdentifierType = true;
break;
case rrid.test(value):
this.fragment.set('relatedItemIdentifier', value);
this.fragment.set('relatedIdentifierType', 'RRID');
this.set('controlledIdentifierType', true);
break;
default:
// // Clears the relatedItemIdentifierType in case the user changes the relatedItemIdentifier after selecting it once before.
this.fragment.relatedItemIdentifier = value;
Expand Down
6 changes: 5 additions & 1 deletion app/components/doi-related-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,14 @@ const relationTypeList = [
'Is original form of',
'Is identical to',
'Is collected by',
'Collects'
'Collects',
'Is translation of',
'Has translation'
];

const relatedItemTypeList = [
'Audiovisual',
'Award',
'Book',
'BookChapter',
'Collection',
Expand All @@ -67,6 +70,7 @@ const relatedItemTypeList = [
'PeerReview',
'PhysicalObject',
'Preprint',
'Project',
'Report',
'Service',
'Software',
Expand Down
2 changes: 2 additions & 0 deletions app/components/doi-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { tracked } from '@glimmer/tracking';

const resourceTypeGeneralList = [
'Audiovisual',
'Award',
'Book',
'BookChapter',
'Collection',
Expand All @@ -26,6 +27,7 @@ const resourceTypeGeneralList = [
'PeerReview',
'PhysicalObject',
'Preprint',
'Project',
'Report',
'Service',
'Software',
Expand Down
2 changes: 1 addition & 1 deletion app/templates/dois/show/edit.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

<DoiState @class="required-nested-label" @model={{this.model}} @form={{form}} />

<div class="form-group required-nested-label {{if (v-get this.model 'url' 'isInvalid') 'has-error' 'has-feedback'}}">
<div class="form-group required-nested-label {{if (v-get this.model 'url' 'isInvalid') 'has-error' 'has-feedback'}}" data-test-doi-url>
<label class="control-label col-md-3">URL</label>
<div class="col-md-9 input-fragment">
<div class="label-vertical">The location of the landing page with more information about the resource.</div>
Expand Down
Loading

0 comments on commit e9f00d1

Please sign in to comment.