From dab7a2d9b88ba1316527879d609569eaebf7485e Mon Sep 17 00:00:00 2001 From: Cody Ross Date: Mon, 17 Oct 2022 14:24:27 -0400 Subject: [PATCH 001/106] Modifies the 'Name Identifier' and 'URL' help text. --- app/templates/components/doi-name-identifier.hbs | 4 ++-- app/templates/dois/show/edit.hbs | 2 +- app/templates/dois/show/modify.hbs | 2 +- app/templates/repositories/show/dois/new.hbs | 2 +- app/templates/repositories/show/dois/upload.hbs | 2 +- tests/integration/components/doi-contributor-test.js | 2 +- tests/integration/components/doi-creator-test.js | 2 +- tests/integration/components/doi-name-identifier-test.js | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/templates/components/doi-name-identifier.hbs b/app/templates/components/doi-name-identifier.hbs index 2136d5491..e22aeaeea 100644 --- a/app/templates/components/doi-name-identifier.hbs +++ b/app/templates/components/doi-name-identifier.hbs @@ -9,7 +9,7 @@
- Uniquely identifies an individual or legal entity, according to various schemas, e.g. ORCID, ROR or ISNI. - Use name identifier expressed as URL. The Given Name, Family Name and Name will automatically be filled out for ORCID and ROR identifiers. + Use name identifier expressed as URL. Uniquely identifies an individual or legal entity, according to various schemas, e.g. ORCID, ROR or ISNI. + The Given Name, Family Name, and Name will automatically be filled out for ORCID and ROR identifiers.
{{/if}} diff --git a/app/templates/dois/show/edit.hbs b/app/templates/dois/show/edit.hbs index 08250714c..03920b5fb 100644 --- a/app/templates/dois/show/edit.hbs +++ b/app/templates/dois/show/edit.hbs @@ -28,7 +28,7 @@
The location of the landing page with more information about the resource.
- +
diff --git a/app/templates/dois/show/modify.hbs b/app/templates/dois/show/modify.hbs index 3b9434c0e..69c60a769 100644 --- a/app/templates/dois/show/modify.hbs +++ b/app/templates/dois/show/modify.hbs @@ -23,7 +23,7 @@
The location of the landing page with more information about the resource.
- +
diff --git a/app/templates/repositories/show/dois/new.hbs b/app/templates/repositories/show/dois/new.hbs index 3721c7f55..a5a03a96b 100644 --- a/app/templates/repositories/show/dois/new.hbs +++ b/app/templates/repositories/show/dois/new.hbs @@ -20,7 +20,7 @@
The location of the landing page with more information about the resource.
- +
diff --git a/app/templates/repositories/show/dois/upload.hbs b/app/templates/repositories/show/dois/upload.hbs index 6a445908f..8a0190fd0 100644 --- a/app/templates/repositories/show/dois/upload.hbs +++ b/app/templates/repositories/show/dois/upload.hbs @@ -43,7 +43,7 @@ @controlType="text" @property="url" @placeholder="URL" - @helpText="Should be a https URL – within the allowed domain(s) of your repository if domain restrictions are enabled in the repository settings. Http and ftp are also supported." + @helpText="Should be a https URL — within the allowed domain(s) of your repository if domain restrictions are enabled in the repository settings. Http and ftp are also supported. For example http://example.org" @required={{false}} /> diff --git a/tests/integration/components/doi-contributor-test.js b/tests/integration/components/doi-contributor-test.js index 8eb2e612a..33e191383 100644 --- a/tests/integration/components/doi-contributor-test.js +++ b/tests/integration/components/doi-contributor-test.js @@ -14,6 +14,6 @@ module('Integration | Component | doi contributor', function(hooks) { await render(hbs`{{doi-contributor model=model fragment=contributor index=0}}`); - assert.dom('*').hasText('Contributor Type Name Identifier Uniquely identifies an individual or legal entity, according to various schemas, e.g. ORCID, ROR or ISNI. Use name identifier expressed as URL. The Given Name, Family Name and Name will automatically be filled out for ORCID and ROR identifiers. Add another name identifier Person Organization Unknown Given Name Family Name Name (from Given Name and Family Name) Affiliation Affiliation names and identifiers are provided by the Research Organization Registry (ROR). Add another affiliation'); + assert.dom('*').hasText('Contributor Type Name Identifier Use name identifier expressed as URL. Uniquely identifies an individual or legal entity, according to various schemas, e.g. ORCID, ROR or ISNI. The Given Name, Family Name, and Name will automatically be filled out for ORCID and ROR identifiers. Add another name identifier Person Organization Unknown Given Name Family Name Name (from Given Name and Family Name) Affiliation Affiliation names and identifiers are provided by the Research Organization Registry (ROR). Add another affiliation'); }); }); diff --git a/tests/integration/components/doi-creator-test.js b/tests/integration/components/doi-creator-test.js index 6e132d142..c6608c560 100644 --- a/tests/integration/components/doi-creator-test.js +++ b/tests/integration/components/doi-creator-test.js @@ -14,6 +14,6 @@ module('Integration | Component | doi creator', function(hooks) { await render(hbs`{{doi-creator model=model fragment=creator index=0}}`); - assert.dom('*').hasText('Name Identifier Uniquely identifies an individual or legal entity, according to various schemas, e.g. ORCID, ROR or ISNI. Use name identifier expressed as URL. The Given Name, Family Name and Name will automatically be filled out for ORCID and ROR identifiers. Add another name identifier Person Organization Unknown Given Name The personal or first name of the creator. Family Name The surname or last name of the creator. Name (from Given Name and Family Name) Affiliation Affiliation names and identifiers are provided by the Research Organization Registry (ROR). Add another affiliation'); + assert.dom('*').hasText('Name Identifier Use name identifier expressed as URL. Uniquely identifies an individual or legal entity, according to various schemas, e.g. ORCID, ROR or ISNI. The Given Name, Family Name, and Name will automatically be filled out for ORCID and ROR identifiers. Add another name identifier Person Organization Unknown Given Name The personal or first name of the creator. Family Name The surname or last name of the creator. Name (from Given Name and Family Name) Affiliation Affiliation names and identifiers are provided by the Research Organization Registry (ROR). Add another affiliation'); }); }); diff --git a/tests/integration/components/doi-name-identifier-test.js b/tests/integration/components/doi-name-identifier-test.js index 0bb4ab403..99d5878d1 100644 --- a/tests/integration/components/doi-name-identifier-test.js +++ b/tests/integration/components/doi-name-identifier-test.js @@ -9,6 +9,6 @@ module('Integration | Component | doi-name-identifier', function(hooks) { test('it renders', async function(assert) { await render(hbs`{{doi-name-identifier}}`); - assert.dom('*').hasText('Uniquely identifies an individual or legal entity, according to various schemas, e.g. ORCID, ROR or ISNI. Use name identifier expressed as URL. The Given Name, Family Name and Name will automatically be filled out for ORCID and ROR identifiers.'); + assert.dom('*').hasText('Use name identifier expressed as URL. Uniquely identifies an individual or legal entity, according to various schemas, e.g. ORCID, ROR or ISNI. The Given Name, Family Name, and Name will automatically be filled out for ORCID and ROR identifiers.'); }); }); From 5cf10780017136a571780b5ef2b04ae1e2247b5b Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Tue, 18 Oct 2022 11:22:50 -0400 Subject: [PATCH 002/106] Allow pull_rquest testing to be invoked with workflow_dispatch. --- .github/workflows/pull_request.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 1bfd27255..15d5f4a58 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -3,6 +3,7 @@ on: pull_request: branches: - main + workflow_dispatch: jobs: build: name: Build From 3eeb5ec3196c908a509dfb1203044f0910e5aefb Mon Sep 17 00:00:00 2001 From: Cody Ross Date: Mon, 17 Oct 2022 14:24:27 -0400 Subject: [PATCH 003/106] Modifies the 'Name Identifier' and 'URL' help text. --- app/templates/components/doi-name-identifier.hbs | 4 ++-- app/templates/dois/show/edit.hbs | 2 +- app/templates/dois/show/modify.hbs | 2 +- app/templates/repositories/show/dois/new.hbs | 2 +- app/templates/repositories/show/dois/upload.hbs | 2 +- tests/integration/components/doi-contributor-test.js | 2 +- tests/integration/components/doi-creator-test.js | 2 +- tests/integration/components/doi-name-identifier-test.js | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/templates/components/doi-name-identifier.hbs b/app/templates/components/doi-name-identifier.hbs index 2136d5491..e22aeaeea 100644 --- a/app/templates/components/doi-name-identifier.hbs +++ b/app/templates/components/doi-name-identifier.hbs @@ -9,7 +9,7 @@
- Uniquely identifies an individual or legal entity, according to various schemas, e.g. ORCID, ROR or ISNI. - Use name identifier expressed as URL. The Given Name, Family Name and Name will automatically be filled out for ORCID and ROR identifiers. + Use name identifier expressed as URL. Uniquely identifies an individual or legal entity, according to various schemas, e.g. ORCID, ROR or ISNI. + The Given Name, Family Name, and Name will automatically be filled out for ORCID and ROR identifiers.
{{/if}} diff --git a/app/templates/dois/show/edit.hbs b/app/templates/dois/show/edit.hbs index 08250714c..03920b5fb 100644 --- a/app/templates/dois/show/edit.hbs +++ b/app/templates/dois/show/edit.hbs @@ -28,7 +28,7 @@
The location of the landing page with more information about the resource.
- +
diff --git a/app/templates/dois/show/modify.hbs b/app/templates/dois/show/modify.hbs index 3b9434c0e..69c60a769 100644 --- a/app/templates/dois/show/modify.hbs +++ b/app/templates/dois/show/modify.hbs @@ -23,7 +23,7 @@
The location of the landing page with more information about the resource.
- +
diff --git a/app/templates/repositories/show/dois/new.hbs b/app/templates/repositories/show/dois/new.hbs index 3721c7f55..a5a03a96b 100644 --- a/app/templates/repositories/show/dois/new.hbs +++ b/app/templates/repositories/show/dois/new.hbs @@ -20,7 +20,7 @@
The location of the landing page with more information about the resource.
- +
diff --git a/app/templates/repositories/show/dois/upload.hbs b/app/templates/repositories/show/dois/upload.hbs index 6a445908f..8a0190fd0 100644 --- a/app/templates/repositories/show/dois/upload.hbs +++ b/app/templates/repositories/show/dois/upload.hbs @@ -43,7 +43,7 @@ @controlType="text" @property="url" @placeholder="URL" - @helpText="Should be a https URL – within the allowed domain(s) of your repository if domain restrictions are enabled in the repository settings. Http and ftp are also supported." + @helpText="Should be a https URL — within the allowed domain(s) of your repository if domain restrictions are enabled in the repository settings. Http and ftp are also supported. For example http://example.org" @required={{false}} /> diff --git a/tests/integration/components/doi-contributor-test.js b/tests/integration/components/doi-contributor-test.js index 8eb2e612a..33e191383 100644 --- a/tests/integration/components/doi-contributor-test.js +++ b/tests/integration/components/doi-contributor-test.js @@ -14,6 +14,6 @@ module('Integration | Component | doi contributor', function(hooks) { await render(hbs`{{doi-contributor model=model fragment=contributor index=0}}`); - assert.dom('*').hasText('Contributor Type Name Identifier Uniquely identifies an individual or legal entity, according to various schemas, e.g. ORCID, ROR or ISNI. Use name identifier expressed as URL. The Given Name, Family Name and Name will automatically be filled out for ORCID and ROR identifiers. Add another name identifier Person Organization Unknown Given Name Family Name Name (from Given Name and Family Name) Affiliation Affiliation names and identifiers are provided by the Research Organization Registry (ROR). Add another affiliation'); + assert.dom('*').hasText('Contributor Type Name Identifier Use name identifier expressed as URL. Uniquely identifies an individual or legal entity, according to various schemas, e.g. ORCID, ROR or ISNI. The Given Name, Family Name, and Name will automatically be filled out for ORCID and ROR identifiers. Add another name identifier Person Organization Unknown Given Name Family Name Name (from Given Name and Family Name) Affiliation Affiliation names and identifiers are provided by the Research Organization Registry (ROR). Add another affiliation'); }); }); diff --git a/tests/integration/components/doi-creator-test.js b/tests/integration/components/doi-creator-test.js index 6e132d142..c6608c560 100644 --- a/tests/integration/components/doi-creator-test.js +++ b/tests/integration/components/doi-creator-test.js @@ -14,6 +14,6 @@ module('Integration | Component | doi creator', function(hooks) { await render(hbs`{{doi-creator model=model fragment=creator index=0}}`); - assert.dom('*').hasText('Name Identifier Uniquely identifies an individual or legal entity, according to various schemas, e.g. ORCID, ROR or ISNI. Use name identifier expressed as URL. The Given Name, Family Name and Name will automatically be filled out for ORCID and ROR identifiers. Add another name identifier Person Organization Unknown Given Name The personal or first name of the creator. Family Name The surname or last name of the creator. Name (from Given Name and Family Name) Affiliation Affiliation names and identifiers are provided by the Research Organization Registry (ROR). Add another affiliation'); + assert.dom('*').hasText('Name Identifier Use name identifier expressed as URL. Uniquely identifies an individual or legal entity, according to various schemas, e.g. ORCID, ROR or ISNI. The Given Name, Family Name, and Name will automatically be filled out for ORCID and ROR identifiers. Add another name identifier Person Organization Unknown Given Name The personal or first name of the creator. Family Name The surname or last name of the creator. Name (from Given Name and Family Name) Affiliation Affiliation names and identifiers are provided by the Research Organization Registry (ROR). Add another affiliation'); }); }); diff --git a/tests/integration/components/doi-name-identifier-test.js b/tests/integration/components/doi-name-identifier-test.js index 0bb4ab403..99d5878d1 100644 --- a/tests/integration/components/doi-name-identifier-test.js +++ b/tests/integration/components/doi-name-identifier-test.js @@ -9,6 +9,6 @@ module('Integration | Component | doi-name-identifier', function(hooks) { test('it renders', async function(assert) { await render(hbs`{{doi-name-identifier}}`); - assert.dom('*').hasText('Uniquely identifies an individual or legal entity, according to various schemas, e.g. ORCID, ROR or ISNI. Use name identifier expressed as URL. The Given Name, Family Name and Name will automatically be filled out for ORCID and ROR identifiers.'); + assert.dom('*').hasText('Use name identifier expressed as URL. Uniquely identifies an individual or legal entity, according to various schemas, e.g. ORCID, ROR or ISNI. The Given Name, Family Name, and Name will automatically be filled out for ORCID and ROR identifiers.'); }); }); From 5083aa300627b59509f52dcf1521e72be8679a12 Mon Sep 17 00:00:00 2001 From: Bryceson Laing Date: Tue, 18 Oct 2022 15:42:43 -0700 Subject: [PATCH 004/106] Fabrica Improvements - task 2 (set info as index) --- app/router.js | 7 +- app/templates/components/index-header.hbs | 4 +- app/templates/index.hbs | 81 +---- app/templates/info.hbs | 12 - app/templates/providers/show.hbs | 4 +- app/templates/providers/show/index.hbs | 319 +------------------ app/templates/providers/show/info.hbs | 1 - app/templates/providers/show/settings.hbs | 318 ++++++++++++++++++ app/templates/repositories/show.hbs | 4 +- app/templates/repositories/show/index.hbs | 237 +------------- app/templates/repositories/show/info.hbs | 1 - app/templates/repositories/show/settings.hbs | 236 ++++++++++++++ app/templates/settings.hbs | 89 ++++++ app/templates/users/show.hbs | 4 +- app/templates/users/show/index.hbs | 24 +- app/templates/users/show/info.hbs | 20 -- app/templates/users/show/settings.hbs | 1 + 17 files changed, 683 insertions(+), 679 deletions(-) delete mode 100644 app/templates/info.hbs delete mode 100644 app/templates/providers/show/info.hbs create mode 100644 app/templates/providers/show/settings.hbs delete mode 100644 app/templates/repositories/show/info.hbs create mode 100644 app/templates/repositories/show/settings.hbs create mode 100644 app/templates/settings.hbs delete mode 100644 app/templates/users/show/info.hbs create mode 100644 app/templates/users/show/settings.hbs diff --git a/app/router.js b/app/router.js index 0bb5cf94e..302a4c6e2 100644 --- a/app/router.js +++ b/app/router.js @@ -13,7 +13,7 @@ Router.map(function () { this.route('edit'); this.route('change'); this.route('delete'); - this.route('info'); + this.route('settings'); this.route('dois'); this.route('prefixes', function () { this.route('show', { path: '/:prefix_id' }, function () { @@ -38,7 +38,7 @@ Router.map(function () { this.route('edit'); this.route('change'); this.route('delete'); - this.route('info'); + this.route('settings'); this.route('transfer-repository'); this.route('dois', function () { this.route('new'); @@ -69,6 +69,7 @@ Router.map(function () { this.route('users', function () { this.route('show', { path: '/:user_id' }, function () { this.route('info'); + this.route('settings'); this.route('dois'); }); }); @@ -81,7 +82,7 @@ Router.map(function () { }); this.route('edit'); this.route('change'); - this.route('info'); + this.route('settings'); this.route('about'); diff --git a/app/templates/components/index-header.hbs b/app/templates/components/index-header.hbs index 673d1ea9e..3e4c75da5 100644 --- a/app/templates/components/index-header.hbs +++ b/app/templates/components/index-header.hbs @@ -9,12 +9,12 @@ @fill={{false}} as |nav| > - + Info - + Settings diff --git a/app/templates/index.hbs b/app/templates/index.hbs index 5d1a46575..61a38eed3 100644 --- a/app/templates/index.hbs +++ b/app/templates/index.hbs @@ -4,85 +4,8 @@
-
- {{#if (can "read messages" model)}} -
-
- {{#each flashMessages.queue as |flash|}} - - {{/each}} -
-
- {{/if}} - -
-
- {{#if (can "update provider" model)}} -
-
-
-
- Set Password - Update Account -
-
-
-
- {{/if}} - - -
-
-
-
-
Account ID
- {{model.symbol}} - - {{#if model.rorId}} -
ROR ID
- {{model.rorId}} - {{/if}} - -
System Email
- {{model.systemEmail}} - - {{#if model.groupEmail}} -
Group Email
- {{model.groupEmail}} - {{/if}} - - {{#if model.website}} -
Website
- {{model.website}} - {{/if}} - - {{#if model.twitterHandle}} -
Twitter
- {{twitter-url model.twitterHandle}} - {{/if}} - - {{#if model.country}} -
Country
- {{model.country.name}} - {{/if}} - - {{#if model.description}} -
Description
- {{markdown-to-html model.description}} - {{/if}} - - {{#if (not model.hasPassword)}} -
Password
- has not been set - {{/if}} -
-
-
-
- - -
-
+ + {{else}} diff --git a/app/templates/info.hbs b/app/templates/info.hbs deleted file mode 100644 index 61a38eed3..000000000 --- a/app/templates/info.hbs +++ /dev/null @@ -1,12 +0,0 @@ -{{#if (can "read index")}} - - -
- - - -
-{{else}} - - -{{/if}} diff --git a/app/templates/providers/show.hbs b/app/templates/providers/show.hbs index 5a6ddff03..0de312c73 100644 --- a/app/templates/providers/show.hbs +++ b/app/templates/providers/show.hbs @@ -62,7 +62,7 @@ > @@ -71,7 +71,7 @@ diff --git a/app/templates/providers/show/index.hbs b/app/templates/providers/show/index.hbs index 3cc495b01..da01b2684 100644 --- a/app/templates/providers/show/index.hbs +++ b/app/templates/providers/show/index.hbs @@ -1,318 +1 @@ -
-
- {{#each flashMessages.queue as |flash|}} - - {{/each}} -
-
- -
-
- {{#if (can 'update provider' model)}} -
-
-
-
- - - Set Password - - - - Update - {{if - (eq model.memberType 'consortium_organization') - 'Organization' - 'Member' - }} - - {{#if (and (not admin) (can 'delete provider' model))}} - - - Delete - {{if - (eq model.memberType 'consortium_organization') - 'Organization' - 'Member' - }} - - {{/if}} -
-
-
-
- {{/if}} - -
-
-

- Organization Information -

-
-
- {{#if (not admin)}} -
- Member ID -
- {{model.symbol}} - {{/if}} - {{#if model.rorId}} -
- ROR ID -
- - {{model.rorId}} - - {{/if}} - {{#if (and (can 'create provider') model.salesforceId)}} -
- Salesforce ID -
- {{model.salesforceId}} - {{/if}} - {{#if (and (can 'token provider') model.globusUuid)}} -
- Globus UUID -
- {{model.globusUuid}} - {{/if}} - {{#if (not admin)}} -
- Member Type -
- {{titleize (humanize model.memberType)}} -
- Tax Status -
- {{titleize model.nonProfitStatus}} -
- Organization Name -
- {{model.name}} - {{/if}} - {{#if (eq model.memberType 'consortium_organization')}} -
- Consortium -
- {{model.consortium.name}} - {{/if}} -
- System Email -
- - {{model.systemEmail}} - - {{#if model.groupEmail}} -
- Group Email -
- - {{model.groupEmail}} - - {{/if}} - {{#if model.website}} -
- Website -
- - {{model.website}} - - {{/if}} - {{#if model.twitterHandle}} -
- Twitter -
- - {{twitter-url model.twitterHandle}} - - {{/if}} - {{#if model.country}} -
- Country -
- {{model.country.name}} - {{/if}} - {{#if model.description}} -
- Description -
- {{markdown-to-html model.description}} - {{/if}} - {{#if model.organizationType}} -
- Organization Type -
- {{titleize (humanize (underscore model.organizationType))}} - {{/if}} - {{#if model.focusArea}} -
- Focus Area -
- {{titleize (humanize (underscore model.focusArea))}} - {{/if}} - {{#if model.joined}} -
- Date joined -
- {{format-time model.joined year='numeric' month='long' day='numeric'}} - {{/if}} - {{#if (not model.hasPassword)}} -
- Password -
- - has not been set - - {{/if}} -
-
- {{#if (not-eq model.memberType 'developer')}} -

- Contact Information -

-
-
- {{#if (is-empty model.contacts)}} - - There are no contacts in your contacts list. Please - - add at least one contact - - . - - {{else}} - {{#if (not-eq model.memberType 'consortium_organization')}} -
- Voting Representative -
-
- {{#if model.votingContact.email}} - {{format-contact model.votingContact}} - {{else}} - - Please provide this information. - - {{/if}} -
- {{/if}} -
- Service Contact -
-
- {{#if model.serviceContact.email}} - {{format-contact model.serviceContact}} - {{else}} - - Please provide this information. - - {{/if}} -
- {{#if model.secondaryServiceContact.email}} -
- Secondary Service Contact -
-
- {{format-contact model.secondaryServiceContact}} -
- {{/if}} - {{#if model.technicalContact.email}} -
- Technical Contact -
-
- {{format-contact model.technicalContact}} -
- {{/if}} - {{#if model.secondaryTechnicalContact.email}} -
- Secondary Technical Contact -
-
- {{format-contact model.secondaryTechnicalContact}} -
- {{/if}} - {{#if (not-eq model.memberType 'consortium_organization')}} -
- Billing Contact -
-
- {{#if model.billingContact.email}} - {{format-contact model.billingContact}} - {{else}} - - Please provide this information. - - {{/if}} -
- {{#if model.secondaryBillingContact.email}} -
- Secondary Billing Contact -
-
- {{format-contact model.secondaryBillingContact}} -
- {{/if}} - {{/if}} - {{/if}} -
-
- {{/if}} - {{#if - (and - (not-eq model.memberType 'consortium_organization') - (not-eq model.memberType 'developer') - ) - }} -

- Billing Information -

-
-
- {{#if model.formattedBillingInformation}} - {{#if model.billingContact.familyName}} - {{model.billingContact.givenName}} - {{model.billingContact.familyName}} -
- {{/if}} - {{#if model.billingInformation.department}} - {{model.billingInformation.department}}
- {{/if}} - {{#if model.billingInformation.organization}} - {{model.billingInformation.organization}}
- {{else}} - {{model.name}}
- {{/if}} - {{#if model.formattedBillingInformation}} - {{#each model.formattedBillingInformation as |line|}} - {{line}}
- {{/each}} - {{/if}} - {{else}} - - Please provide this information. - - {{/if}} -
-
- {{/if}} -
-
\ No newline at end of file + \ No newline at end of file diff --git a/app/templates/providers/show/info.hbs b/app/templates/providers/show/info.hbs deleted file mode 100644 index 5c78444b4..000000000 --- a/app/templates/providers/show/info.hbs +++ /dev/null @@ -1 +0,0 @@ - diff --git a/app/templates/providers/show/settings.hbs b/app/templates/providers/show/settings.hbs new file mode 100644 index 000000000..3cc495b01 --- /dev/null +++ b/app/templates/providers/show/settings.hbs @@ -0,0 +1,318 @@ +
+
+ {{#each flashMessages.queue as |flash|}} + + {{/each}} +
+
+ +
+
+ {{#if (can 'update provider' model)}} +
+
+
+
+ + + Set Password + + + + Update + {{if + (eq model.memberType 'consortium_organization') + 'Organization' + 'Member' + }} + + {{#if (and (not admin) (can 'delete provider' model))}} + + + Delete + {{if + (eq model.memberType 'consortium_organization') + 'Organization' + 'Member' + }} + + {{/if}} +
+
+
+
+ {{/if}} + +
+
+

+ Organization Information +

+
+
+ {{#if (not admin)}} +
+ Member ID +
+ {{model.symbol}} + {{/if}} + {{#if model.rorId}} +
+ ROR ID +
+ + {{model.rorId}} + + {{/if}} + {{#if (and (can 'create provider') model.salesforceId)}} +
+ Salesforce ID +
+ {{model.salesforceId}} + {{/if}} + {{#if (and (can 'token provider') model.globusUuid)}} +
+ Globus UUID +
+ {{model.globusUuid}} + {{/if}} + {{#if (not admin)}} +
+ Member Type +
+ {{titleize (humanize model.memberType)}} +
+ Tax Status +
+ {{titleize model.nonProfitStatus}} +
+ Organization Name +
+ {{model.name}} + {{/if}} + {{#if (eq model.memberType 'consortium_organization')}} +
+ Consortium +
+ {{model.consortium.name}} + {{/if}} +
+ System Email +
+ + {{model.systemEmail}} + + {{#if model.groupEmail}} +
+ Group Email +
+ + {{model.groupEmail}} + + {{/if}} + {{#if model.website}} +
+ Website +
+ + {{model.website}} + + {{/if}} + {{#if model.twitterHandle}} +
+ Twitter +
+ + {{twitter-url model.twitterHandle}} + + {{/if}} + {{#if model.country}} +
+ Country +
+ {{model.country.name}} + {{/if}} + {{#if model.description}} +
+ Description +
+ {{markdown-to-html model.description}} + {{/if}} + {{#if model.organizationType}} +
+ Organization Type +
+ {{titleize (humanize (underscore model.organizationType))}} + {{/if}} + {{#if model.focusArea}} +
+ Focus Area +
+ {{titleize (humanize (underscore model.focusArea))}} + {{/if}} + {{#if model.joined}} +
+ Date joined +
+ {{format-time model.joined year='numeric' month='long' day='numeric'}} + {{/if}} + {{#if (not model.hasPassword)}} +
+ Password +
+ + has not been set + + {{/if}} +
+
+ {{#if (not-eq model.memberType 'developer')}} +

+ Contact Information +

+
+
+ {{#if (is-empty model.contacts)}} + + There are no contacts in your contacts list. Please + + add at least one contact + + . + + {{else}} + {{#if (not-eq model.memberType 'consortium_organization')}} +
+ Voting Representative +
+
+ {{#if model.votingContact.email}} + {{format-contact model.votingContact}} + {{else}} + + Please provide this information. + + {{/if}} +
+ {{/if}} +
+ Service Contact +
+
+ {{#if model.serviceContact.email}} + {{format-contact model.serviceContact}} + {{else}} + + Please provide this information. + + {{/if}} +
+ {{#if model.secondaryServiceContact.email}} +
+ Secondary Service Contact +
+
+ {{format-contact model.secondaryServiceContact}} +
+ {{/if}} + {{#if model.technicalContact.email}} +
+ Technical Contact +
+
+ {{format-contact model.technicalContact}} +
+ {{/if}} + {{#if model.secondaryTechnicalContact.email}} +
+ Secondary Technical Contact +
+
+ {{format-contact model.secondaryTechnicalContact}} +
+ {{/if}} + {{#if (not-eq model.memberType 'consortium_organization')}} +
+ Billing Contact +
+
+ {{#if model.billingContact.email}} + {{format-contact model.billingContact}} + {{else}} + + Please provide this information. + + {{/if}} +
+ {{#if model.secondaryBillingContact.email}} +
+ Secondary Billing Contact +
+
+ {{format-contact model.secondaryBillingContact}} +
+ {{/if}} + {{/if}} + {{/if}} +
+
+ {{/if}} + {{#if + (and + (not-eq model.memberType 'consortium_organization') + (not-eq model.memberType 'developer') + ) + }} +

+ Billing Information +

+
+
+ {{#if model.formattedBillingInformation}} + {{#if model.billingContact.familyName}} + {{model.billingContact.givenName}} + {{model.billingContact.familyName}} +
+ {{/if}} + {{#if model.billingInformation.department}} + {{model.billingInformation.department}}
+ {{/if}} + {{#if model.billingInformation.organization}} + {{model.billingInformation.organization}}
+ {{else}} + {{model.name}}
+ {{/if}} + {{#if model.formattedBillingInformation}} + {{#each model.formattedBillingInformation as |line|}} + {{line}}
+ {{/each}} + {{/if}} + {{else}} + + Please provide this information. + + {{/if}} +
+
+ {{/if}} +
+
\ No newline at end of file diff --git a/app/templates/repositories/show.hbs b/app/templates/repositories/show.hbs index ddebd4fcc..facc96265 100644 --- a/app/templates/repositories/show.hbs +++ b/app/templates/repositories/show.hbs @@ -78,7 +78,7 @@ > @@ -98,7 +98,7 @@ {{/if}} diff --git a/app/templates/repositories/show/index.hbs b/app/templates/repositories/show/index.hbs index 4620c286c..fefefa234 100644 --- a/app/templates/repositories/show/index.hbs +++ b/app/templates/repositories/show/index.hbs @@ -1,236 +1 @@ -
-
- {{#if (can 'update repository' model)}} -
-
-
-
- {{#if model.isActive}} - - - Set Password - - {{/if}} - {{#if (or (can 'delete repository' model) model.isActive)}} - - - Update - {{if (eq currentUser.uid model.id) 'Account' 'Repository'}} - - {{/if}} - {{#if (can 'delete repository' model)}} - - - Delete Repository - - {{/if}} - {{#if (and (can 'transfer repository' model) model.isActive)}} - - - Transfer - {{if media.isXl ' Repository'}} - - {{/if}} -
-
-
-
- {{/if}} - -
-
-
-
- {{#each flashMessages.queue as |flash|}} - - {{/each}} - {{#if (eq model.clientType 'periodical')}} - - Periodical - - {{/if}} -
- Repository ID - - - - The Repository ID is a unique identifier for each repository in DataCite. It must contain only upper case letters and numbers, and must start with the Member ID. - - -
- {{model.symbol}} - {{#if model.re3data}} -
- re3data Record - - - - re3data is a registry of research data repositories. - - -
- - {{model.re3data}} - - {{/if}} - {{#if (and (can 'create provider') model.salesforceId)}} -
- Salesforce ID -
- {{model.salesforceId}} - {{/if}} - {{#if (and (can 'token repository') model.globusUuid)}} -
- Globus UUID -
- {{model.globusUuid}} - {{/if}} - {{#if (or model.issn.issnl model.issn.electronic model.issn.print)}} -
- ISSN -
- {{#if model.issn.issnl}} - {{model.issn.issnl}}(ISSN-L)
- {{/if}} - {{#if model.issn.electronic}} - {{model.issn.electronic}}(electronic)
- {{/if}} - {{#if model.issn.print}} - {{model.issn.print}}(print)
- {{/if}} - {{/if}} - {{#if model.alternateName}} -
- Alternate Name -
- {{model.alternateName}} - {{/if}} - {{#if model.description}} -
- Description -
-

- {{markdown-to-html model.description}} -

- {{/if}} - {{#if (or model.serviceContact.name model.serviceContact.email)}} -
- Service Contact -
- {{#if model.serviceContact.name}} - {{model.serviceContact.name}}
- {{/if}} - {{#if model.serviceContact.email}} - - {{model.serviceContact.email}} - - {{/if}} - {{/if}} - {{#if model.systemEmail}} -
- System Email -
- - {{model.systemEmail}} - - {{/if}} - {{#if model.url}} -
- URL -
- - {{model.url}} - - {{/if}} - {{#if model.domainList}} -
- {{pluralize model.domainList.length 'Domain' without-count=true}} - - - - URLs for DOIs must use - {{#if (gt model.domainList.length 1)}} - one of these (sub-)domains - {{else}} - this (sub-)domain - {{/if}} - . - - -
- {{#each model.domainList as |domain|}} - {{domain}}
- {{/each}} - {{/if}} - {{#if model.language}} -
- Language -
- {{#each model.language as |lang|}} - {{format-language lang}} - {{#unless (eq lang model.language.lastObject)}} - , - {{/unless}} - {{/each}} - {{/if}} - {{#if model.repositoryType}} -
- Repository Type -
- {{#each model.repositoryType as |type|}} - {{titleize type}} - {{#unless (eq type model.repositoryType.lastObject)}} - , - {{/unless}} - {{/each}} - {{/if}} - {{#if model.certificate}} -
- Certificate -
-
- {{#each model.certificate as |cert|}} - {{cert}} - {{#unless (eq cert model.certificate.lastObject)}} - , - {{/unless}} - {{/each}} - {{/if}} - {{#if model.software}} -
- Software -
- {{model.software}} - {{/if}} - {{#if (not model.hasPassword)}} -
- Password -
- - has not been set - - {{/if}} -
-
-
-
\ No newline at end of file + \ No newline at end of file diff --git a/app/templates/repositories/show/info.hbs b/app/templates/repositories/show/info.hbs deleted file mode 100644 index 908981748..000000000 --- a/app/templates/repositories/show/info.hbs +++ /dev/null @@ -1 +0,0 @@ - diff --git a/app/templates/repositories/show/settings.hbs b/app/templates/repositories/show/settings.hbs new file mode 100644 index 000000000..4620c286c --- /dev/null +++ b/app/templates/repositories/show/settings.hbs @@ -0,0 +1,236 @@ +
+
+ {{#if (can 'update repository' model)}} +
+
+
+
+ {{#if model.isActive}} + + + Set Password + + {{/if}} + {{#if (or (can 'delete repository' model) model.isActive)}} + + + Update + {{if (eq currentUser.uid model.id) 'Account' 'Repository'}} + + {{/if}} + {{#if (can 'delete repository' model)}} + + + Delete Repository + + {{/if}} + {{#if (and (can 'transfer repository' model) model.isActive)}} + + + Transfer + {{if media.isXl ' Repository'}} + + {{/if}} +
+
+
+
+ {{/if}} + +
+
+
+
+ {{#each flashMessages.queue as |flash|}} + + {{/each}} + {{#if (eq model.clientType 'periodical')}} + + Periodical + + {{/if}} +
+ Repository ID + + + + The Repository ID is a unique identifier for each repository in DataCite. It must contain only upper case letters and numbers, and must start with the Member ID. + + +
+ {{model.symbol}} + {{#if model.re3data}} +
+ re3data Record + + + + re3data is a registry of research data repositories. + + +
+ + {{model.re3data}} + + {{/if}} + {{#if (and (can 'create provider') model.salesforceId)}} +
+ Salesforce ID +
+ {{model.salesforceId}} + {{/if}} + {{#if (and (can 'token repository') model.globusUuid)}} +
+ Globus UUID +
+ {{model.globusUuid}} + {{/if}} + {{#if (or model.issn.issnl model.issn.electronic model.issn.print)}} +
+ ISSN +
+ {{#if model.issn.issnl}} + {{model.issn.issnl}}(ISSN-L)
+ {{/if}} + {{#if model.issn.electronic}} + {{model.issn.electronic}}(electronic)
+ {{/if}} + {{#if model.issn.print}} + {{model.issn.print}}(print)
+ {{/if}} + {{/if}} + {{#if model.alternateName}} +
+ Alternate Name +
+ {{model.alternateName}} + {{/if}} + {{#if model.description}} +
+ Description +
+

+ {{markdown-to-html model.description}} +

+ {{/if}} + {{#if (or model.serviceContact.name model.serviceContact.email)}} +
+ Service Contact +
+ {{#if model.serviceContact.name}} + {{model.serviceContact.name}}
+ {{/if}} + {{#if model.serviceContact.email}} + + {{model.serviceContact.email}} + + {{/if}} + {{/if}} + {{#if model.systemEmail}} +
+ System Email +
+ + {{model.systemEmail}} + + {{/if}} + {{#if model.url}} +
+ URL +
+ + {{model.url}} + + {{/if}} + {{#if model.domainList}} +
+ {{pluralize model.domainList.length 'Domain' without-count=true}} + + + + URLs for DOIs must use + {{#if (gt model.domainList.length 1)}} + one of these (sub-)domains + {{else}} + this (sub-)domain + {{/if}} + . + + +
+ {{#each model.domainList as |domain|}} + {{domain}}
+ {{/each}} + {{/if}} + {{#if model.language}} +
+ Language +
+ {{#each model.language as |lang|}} + {{format-language lang}} + {{#unless (eq lang model.language.lastObject)}} + , + {{/unless}} + {{/each}} + {{/if}} + {{#if model.repositoryType}} +
+ Repository Type +
+ {{#each model.repositoryType as |type|}} + {{titleize type}} + {{#unless (eq type model.repositoryType.lastObject)}} + , + {{/unless}} + {{/each}} + {{/if}} + {{#if model.certificate}} +
+ Certificate +
+
+ {{#each model.certificate as |cert|}} + {{cert}} + {{#unless (eq cert model.certificate.lastObject)}} + , + {{/unless}} + {{/each}} + {{/if}} + {{#if model.software}} +
+ Software +
+ {{model.software}} + {{/if}} + {{#if (not model.hasPassword)}} +
+ Password +
+ + has not been set + + {{/if}} +
+
+
+
\ No newline at end of file diff --git a/app/templates/settings.hbs b/app/templates/settings.hbs new file mode 100644 index 000000000..5d1a46575 --- /dev/null +++ b/app/templates/settings.hbs @@ -0,0 +1,89 @@ +{{#if (can "read index")}} + + +
+ + +
+ {{#if (can "read messages" model)}} +
+
+ {{#each flashMessages.queue as |flash|}} + + {{/each}} +
+
+ {{/if}} + +
+
+ {{#if (can "update provider" model)}} +
+
+
+
+ Set Password + Update Account +
+
+
+
+ {{/if}} + + +
+
+
+
+
Account ID
+ {{model.symbol}} + + {{#if model.rorId}} +
ROR ID
+ {{model.rorId}} + {{/if}} + +
System Email
+ {{model.systemEmail}} + + {{#if model.groupEmail}} +
Group Email
+ {{model.groupEmail}} + {{/if}} + + {{#if model.website}} +
Website
+ {{model.website}} + {{/if}} + + {{#if model.twitterHandle}} +
Twitter
+ {{twitter-url model.twitterHandle}} + {{/if}} + + {{#if model.country}} +
Country
+ {{model.country.name}} + {{/if}} + + {{#if model.description}} +
Description
+ {{markdown-to-html model.description}} + {{/if}} + + {{#if (not model.hasPassword)}} +
Password
+ has not been set + {{/if}} +
+
+
+
+ + +
+
+{{else}} + + +{{/if}} diff --git a/app/templates/users/show.hbs b/app/templates/users/show.hbs index af2f31b15..ca260442f 100644 --- a/app/templates/users/show.hbs +++ b/app/templates/users/show.hbs @@ -22,10 +22,10 @@ @fill={{false}} as |nav| > - Info + Info - Settings + Settings DOIs diff --git a/app/templates/users/show/index.hbs b/app/templates/users/show/index.hbs index 2f4766059..e42c7b533 100644 --- a/app/templates/users/show/index.hbs +++ b/app/templates/users/show/index.hbs @@ -1 +1,23 @@ - +
+
+ + +
+
+ + + +
+ {{#if (can "read messages" model)}} +
+
+ {{#each flashMessages.queue as |flash|}} + + {{/each}} +
+
+ {{/if}} +
\ No newline at end of file diff --git a/app/templates/users/show/info.hbs b/app/templates/users/show/info.hbs deleted file mode 100644 index 6c4244da1..000000000 --- a/app/templates/users/show/info.hbs +++ /dev/null @@ -1,20 +0,0 @@ -
-
- - -
-
- - - -
- {{#if (can "read messages" model)}} -
-
- {{#each flashMessages.queue as |flash|}} - - {{/each}} -
-
- {{/if}} -
diff --git a/app/templates/users/show/settings.hbs b/app/templates/users/show/settings.hbs new file mode 100644 index 000000000..2f4766059 --- /dev/null +++ b/app/templates/users/show/settings.hbs @@ -0,0 +1 @@ + From d7b9e26496ae50677406fbd07c26a3eeebb55c0f Mon Sep 17 00:00:00 2001 From: Bryceson Laing Date: Tue, 18 Oct 2022 16:08:35 -0700 Subject: [PATCH 005/106] Fabrica Improvements - task 2 (added user role) --- app/components/user-role.js | 14 ++++++++++++++ app/templates/components/index-info.hbs | 1 + app/templates/components/provider-info.hbs | 1 + app/templates/components/repository-info.hbs | 1 + app/templates/components/user-role.hbs | 4 ++++ app/templates/users/show/index.hbs | 1 + 6 files changed, 22 insertions(+) create mode 100644 app/components/user-role.js create mode 100644 app/templates/components/user-role.hbs diff --git a/app/components/user-role.js b/app/components/user-role.js new file mode 100644 index 000000000..598a1aec7 --- /dev/null +++ b/app/components/user-role.js @@ -0,0 +1,14 @@ +import Component from '@ember/component'; +import { inject as service } from '@ember/service'; + +export default Component.extend({ + currentUser: service(), + + init(...args) { + this._super(...args); + }, + + didReceiveAttrs() { + this._super(...arguments); + } +}); diff --git a/app/templates/components/index-info.hbs b/app/templates/components/index-info.hbs index cc224b0ed..31647dce6 100644 --- a/app/templates/components/index-info.hbs +++ b/app/templates/components/index-info.hbs @@ -8,6 +8,7 @@ {{/if}} +
diff --git a/app/templates/components/provider-info.hbs b/app/templates/components/provider-info.hbs index e3b31be36..120a8fcda 100644 --- a/app/templates/components/provider-info.hbs +++ b/app/templates/components/provider-info.hbs @@ -1,4 +1,5 @@
+
{{#if (eq model.memberType 'consortium')}} +
diff --git a/app/templates/components/user-role.hbs b/app/templates/components/user-role.hbs new file mode 100644 index 000000000..ce14e6a95 --- /dev/null +++ b/app/templates/components/user-role.hbs @@ -0,0 +1,4 @@ +
+ Role:
+ {{currentUser.roleName}} +
\ No newline at end of file diff --git a/app/templates/users/show/index.hbs b/app/templates/users/show/index.hbs index e42c7b533..b65ad73b1 100644 --- a/app/templates/users/show/index.hbs +++ b/app/templates/users/show/index.hbs @@ -1,4 +1,5 @@
+
From a6eca2fe10787d0143e1712bfcb8370c928302ae Mon Sep 17 00:00:00 2001 From: Cody Ross Date: Wed, 19 Oct 2022 11:39:56 -0400 Subject: [PATCH 006/106] Allows variable placeholder text in model-search template and changes placeholder text for search input in doi-list. --- app/templates/components/doi-list.hbs | 2 +- app/templates/components/model-search.hbs | 2 +- cypress/integration/client_admin/doi.test.ts | 2 +- cypress/integration/consortium_admin/doi.test.ts | 2 +- cypress/integration/organization_admin/doi.test.ts | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/templates/components/doi-list.hbs b/app/templates/components/doi-list.hbs index c3c1735d3..487d8817a 100644 --- a/app/templates/components/doi-list.hbs +++ b/app/templates/components/doi-list.hbs @@ -679,7 +679,7 @@
{{#if searchable}} - + {{/if}} {{#if model}} {{#each model as |doi|}} diff --git a/app/templates/components/model-search.hbs b/app/templates/components/model-search.hbs index 888114172..1f2eaaad8 100644 --- a/app/templates/components/model-search.hbs +++ b/app/templates/components/model-search.hbs @@ -4,7 +4,7 @@ @name="query" @value={{query}} class="form-control" - placeholder="Type to search..." + placeholder={{if placeholder placeholder "Type to search..."}} @escape-press={{action 'clear'}} @enter={{action 'doSearch'}} /> diff --git a/cypress/integration/client_admin/doi.test.ts b/cypress/integration/client_admin/doi.test.ts index 62dbf75bb..3564e78db 100644 --- a/cypress/integration/client_admin/doi.test.ts +++ b/cypress/integration/client_admin/doi.test.ts @@ -62,7 +62,7 @@ describe('ACCEPTANCE: CLIENT_ADMIN | DOIS', () => { // Has search form cy.get('form #search').within(($searchBar) => { cy.get('input[name="query"]') - .and('have.attr', 'placeholder').should('match', /Type\s*to\s*search.../i); + .and('have.attr', 'placeholder').should('match', /Type\sto\ssearch\.\sFor\sexample\s10\.4121\/17185607\.v1/i); cy.get('button').contains(/Search/i); }); }); diff --git a/cypress/integration/consortium_admin/doi.test.ts b/cypress/integration/consortium_admin/doi.test.ts index bd1812202..c32476647 100644 --- a/cypress/integration/consortium_admin/doi.test.ts +++ b/cypress/integration/consortium_admin/doi.test.ts @@ -56,7 +56,7 @@ describe('ACCEPTANCE: CONSORTIUM_ADMIN | DOIS', () => { // Has search form cy.get('form #search').within(($searchBar) => { cy.get('input[name="query"]') - .and('have.attr', 'placeholder').should('match', /Type\s*to\s*search.../i); + .and('have.attr', 'placeholder').should('match', /Type\sto\ssearch\.\sFor\sexample\s10\.4121\/17185607\.v1/i); cy.get('button').contains(/Search/i); }); diff --git a/cypress/integration/organization_admin/doi.test.ts b/cypress/integration/organization_admin/doi.test.ts index 9f847d54f..0c3614e3b 100644 --- a/cypress/integration/organization_admin/doi.test.ts +++ b/cypress/integration/organization_admin/doi.test.ts @@ -55,7 +55,7 @@ describe('ACCEPTANCE: ORGANIZATION_ADMIN | DOIS', () => { // Has search form cy.get('form #search').within(($searchBar) => { cy.get('input[name="query"]') - .and('have.attr', 'placeholder').should('match', /Type\s*to\s*search.../i); + .and('have.attr', 'placeholder').should('match', /Type\sto\ssearch\.\sFor\sexample\s10\.4121\/17185607\.v1/i); cy.get('button').contains(/Search/i); }); From 9e886b8a2abb61e62537917ce3ef1e185a07a5e7 Mon Sep 17 00:00:00 2001 From: Cody Ross Date: Wed, 19 Oct 2022 12:46:28 -0400 Subject: [PATCH 007/106] Updates to cypress tests for URL and Name Identifier text. --- app/templates/components/doi-name-identifier.hbs | 5 +---- cypress/integration/client_admin/doi.test.ts | 4 ++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/templates/components/doi-name-identifier.hbs b/app/templates/components/doi-name-identifier.hbs index e22aeaeea..019d63a7c 100644 --- a/app/templates/components/doi-name-identifier.hbs +++ b/app/templates/components/doi-name-identifier.hbs @@ -8,8 +8,5 @@ {{else}} -
- Use name identifier expressed as URL. Uniquely identifies an individual or legal entity, according to various schemas, e.g. ORCID, ROR or ISNI. - The Given Name, Family Name, and Name will automatically be filled out for ORCID and ROR identifiers. -
+
Use name identifier expressed as URL. Uniquely identifies an individual or legal entity, according to various schemas, e.g. ORCID, ROR or ISNI. The Given Name, Family Name, and Name will automatically be filled out for ORCID and ROR identifiers.
{{/if}} diff --git a/cypress/integration/client_admin/doi.test.ts b/cypress/integration/client_admin/doi.test.ts index 3564e78db..d3a526bec 100644 --- a/cypress/integration/client_admin/doi.test.ts +++ b/cypress/integration/client_admin/doi.test.ts @@ -77,9 +77,11 @@ describe('ACCEPTANCE: CLIENT_ADMIN | DOIS', () => { // Leave state at 'draft'. // Set 'url'. + cy.get("#url-help").should('be.visible').should('have.text', 'Should be a https URL — within the allowed domain(s) of your repository if domain restrictions are enabled in the repository settings. Http and ftp are also supported. For example http://example.org') cy.get('input#url-field').should('be.visible').type('https://example.org', { force: true }); // Set creator. + cy.get('.help-block.name-identifier-field').should('be.visible').should('have.text','Use name identifier expressed as URL. Uniquely identifies an individual or legal entity, according to various schemas, e.g. ORCID, ROR or ISNI. The Given Name, Family Name, and Name will automatically be filled out for ORCID and ROR identifiers.') cy.get('input[data-test-name]').should('be.visible').type('Miller, Elizabeth', { force: true }); cy.get('#toggle-creators').should('be.visible').click({ force: true }).then(($toggle) => { cy.get('#toggle-creators').contains('Show 1 creator'); @@ -134,6 +136,7 @@ describe('ACCEPTANCE: CLIENT_ADMIN | DOIS', () => { // Set contributor. cy.get('#add-contributor').click({ force: true }).then(($subform) => { + cy.get('.help-block.name-identifier-field').should('be.visible').should('have.text','Use name identifier expressed as URL. Uniquely identifies an individual or legal entity, according to various schemas, e.g. ORCID, ROR or ISNI. The Given Name, Family Name, and Name will automatically be filled out for ORCID and ROR identifiers.') // Causes the aria dropdown to be populated and displayed so that selection can be made. cy.get('[doi-contributor] div[role="button"]').click({ force: true }).then(($dropdown) => { // Makes the selection from the dropdown. @@ -244,6 +247,7 @@ describe('ACCEPTANCE: CLIENT_ADMIN | DOIS', () => { // Set 'url'. cy.wait(waitTime); + cy.get("#url-help").should('be.visible').should('have.text', 'Should be a https URL — within the allowed domain(s) of your repository if domain restrictions are enabled in the repository settings. Http and ftp are also supported. For example http://example.org') cy.get('input#url-field').should('be.visible').type('https://example.org', { force: true }) .clickOutside(); cy.get('#url').should('have.class', 'has-success'); From c6e22f456e629dec9c1ae1880437a3cf61b8e899 Mon Sep 17 00:00:00 2001 From: Cody Ross Date: Wed, 19 Oct 2022 16:29:55 -0400 Subject: [PATCH 008/106] Fixes test flakiness with search input. --- cypress/integration/staff_admin/prefix.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cypress/integration/staff_admin/prefix.test.ts b/cypress/integration/staff_admin/prefix.test.ts index effff8979..50a274fb8 100644 --- a/cypress/integration/staff_admin/prefix.test.ts +++ b/cypress/integration/staff_admin/prefix.test.ts @@ -20,8 +20,9 @@ describe('Admin: Prefix', () => { cy.location().should((loc) => { expect(loc.pathname).to.eq('/prefixes'); }); + cy.wait(waitTime2); cy.get('input[name="query"]') - .type('10.5438{enter}') + .type('10.5438{enter}', {waitForAnimations: true}) .get('[data-test-prefix]') .should('contain', '10.5438'); From 07e8d9dc4e9f130485db7c50346d7cb5e2a90f6c Mon Sep 17 00:00:00 2001 From: Bryceson Laing Date: Wed, 12 Oct 2022 11:29:10 -0700 Subject: [PATCH 009/106] Fabrica Improvements - task 3 (added new logo) --- app/index.html | 1 + app/styles/app.css | 1 + app/styles/header.css | 4 ++++ app/templates/components/application-header.hbs | 2 +- ember-cli-build.js | 3 +++ public/assets/images/fabrica-logo.svg | 1 + 6 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 app/styles/header.css create mode 100644 public/assets/images/fabrica-logo.svg diff --git a/app/index.html b/app/index.html index 9d4d64bf9..f320f817f 100644 --- a/app/index.html +++ b/app/index.html @@ -18,6 +18,7 @@ + {{content-for "head-footer"}} diff --git a/app/styles/app.css b/app/styles/app.css index e69de29bb..8899fa508 100644 --- a/app/styles/app.css +++ b/app/styles/app.css @@ -0,0 +1 @@ +@import 'header.css'; diff --git a/app/styles/header.css b/app/styles/header.css new file mode 100644 index 000000000..6b68973fc --- /dev/null +++ b/app/styles/header.css @@ -0,0 +1,4 @@ +.fabrica-logo { + height: 200; + margin-top: -18px; +} \ No newline at end of file diff --git a/app/templates/components/application-header.hbs b/app/templates/components/application-header.hbs index ee3caf2b0..3e404fd2d 100644 --- a/app/templates/components/application-header.hbs +++ b/app/templates/components/application-header.hbs @@ -8,7 +8,7 @@ diff --git a/ember-cli-build.js b/ember-cli-build.js index bea179b05..f9d9af210 100644 --- a/ember-cli-build.js +++ b/ember-cli-build.js @@ -7,6 +7,9 @@ module.exports = function (defaults) { const pkg = require('./package.json'); let app = new EmberApp(defaults, { + minifyCSS: { + options: { processImport: true } + }, 'ember-cli-babel': { includePolyfill: true }, diff --git a/public/assets/images/fabrica-logo.svg b/public/assets/images/fabrica-logo.svg new file mode 100644 index 000000000..8cb736711 --- /dev/null +++ b/public/assets/images/fabrica-logo.svg @@ -0,0 +1 @@ +DataCite-Logos \ No newline at end of file From fac6584b1e6d525dd7cb35520a3855236d73b67f Mon Sep 17 00:00:00 2001 From: Bryceson Laing Date: Thu, 13 Oct 2022 16:27:14 -0700 Subject: [PATCH 010/106] Fabrica Improvements - task 3 (nav buttons bg) --- app/styles/header.css | 27 ++++++++++++++++++- .../components/application-header.hbs | 10 +++---- 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/app/styles/header.css b/app/styles/header.css index 6b68973fc..7e5a9ed03 100644 --- a/app/styles/header.css +++ b/app/styles/header.css @@ -1,4 +1,29 @@ .fabrica-logo { - height: 200; + height: 50; margin-top: -18px; +} + +.navbar-right { + border-bottom-left-radius: 30px; + border-bottom-right-radius: 30px; +} + +.navbar-lead { + background-color: #243B54; +} + +.navbar-user { + background-color: #00B1E2; +} + +.navbar-button { + color: white !important; +} + +.navbar-button:hover, .navbar-button:focus { + color: #3498db !important; +} + +.navbar-transparent { + padding-top: 0; } \ No newline at end of file diff --git a/app/templates/components/application-header.hbs b/app/templates/components/application-header.hbs index 3e404fd2d..da5b907d1 100644 --- a/app/templates/components/application-header.hbs +++ b/app/templates/components/application-header.hbs @@ -8,25 +8,25 @@ - + - + About - + Support {{#if user}} {{#if session.isAuthenticated}} - + {{#if currentUser.isUser}} {{currentUser.name}} {{else}} From 14573dd8c43569b0381c520156212935753911ba Mon Sep 17 00:00:00 2001 From: Bryceson Laing Date: Tue, 18 Oct 2022 15:17:49 -0700 Subject: [PATCH 011/106] Fabrica Improvements - task 3 (updated tests) --- cypress/integration/anonymous/admin.test.ts | 7 +++++++ cypress/integration/anonymous/anonymous.test.ts | 9 ++++++++- cypress/integration/anonymous/doi.test.ts | 2 ++ cypress/integration/anonymous/provider.test.ts | 5 +++++ cypress/integration/anonymous/repository.test.ts | 4 ++++ cypress/integration/client_admin/doi.test.ts | 4 ++++ cypress/integration/client_admin/info.test.ts | 4 ++++ cypress/integration/client_admin/prefixes.test.ts | 4 ++++ cypress/integration/client_admin/settings.test.ts | 5 +++++ cypress/integration/consortium_admin/contact.test.ts | 4 ++++ cypress/integration/consortium_admin/doi.test.ts | 6 +++++- cypress/integration/consortium_admin/info.test.ts | 4 ++++ .../integration/consortium_admin/organizations.test.ts | 4 ++++ cypress/integration/consortium_admin/prefixes.test.ts | 4 ++++ .../integration/consortium_admin/repositories.test.ts | 4 ++++ cypress/integration/consortium_admin/settings.test.ts | 7 ++++++- cypress/integration/organization_admin/contact.test.ts | 6 ++++++ cypress/integration/organization_admin/info.test.ts | 4 ++++ cypress/integration/organization_admin/prefixes.test.ts | 4 ++++ .../integration/organization_admin/repositories.test.ts | 4 ++++ cypress/integration/organization_admin/settings.test.ts | 7 ++++++- cypress/integration/staff_admin/admin.test.ts | 8 ++++++++ cypress/integration/staff_admin/info.test.ts | 4 ++++ cypress/integration/staff_admin/prefix.test.ts | 4 ++++ cypress/integration/staff_admin/settings.test.ts | 7 ++++++- 25 files changed, 120 insertions(+), 5 deletions(-) diff --git a/cypress/integration/anonymous/admin.test.ts b/cypress/integration/anonymous/admin.test.ts index 7dbeafa4f..40e91c6be 100644 --- a/cypress/integration/anonymous/admin.test.ts +++ b/cypress/integration/anonymous/admin.test.ts @@ -4,6 +4,7 @@ describe('ACCEPTANCE: ANONYMOUS | NO ADMIN ACCESS', function () { it('is not logged in', function () { cy.visit('/') cy.get('a#sign-in').should('exist'); + cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(0, 177, 226)'); }) it('visiting homepage', function () { @@ -11,6 +12,7 @@ describe('ACCEPTANCE: ANONYMOUS | NO ADMIN ACCESS', function () { cy.url().should('eq', Cypress.config('baseUrl') + '/') cy.get('div.motto h1').contains(site_title); cy.get('a#sign-in').should('exist'); + cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(0, 177, 226)'); }) // the following pages require authentication. Redirects to homepage otherwise. @@ -19,6 +21,7 @@ describe('ACCEPTANCE: ANONYMOUS | NO ADMIN ACCESS', function () { cy.url().should('eq', Cypress.config('baseUrl') + '/') cy.get('div.motto h1').contains(site_title); cy.get('a#sign-in').should('exist'); + cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(0, 177, 226)'); }) it('visiting providers', function () { @@ -26,6 +29,7 @@ describe('ACCEPTANCE: ANONYMOUS | NO ADMIN ACCESS', function () { cy.url().should('eq', Cypress.config('baseUrl') + '/') cy.get('div.motto h1').contains(site_title); cy.get('a#sign-in').should('exist'); + cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(0, 177, 226)'); }) it('visiting repositories', function () { @@ -33,6 +37,7 @@ describe('ACCEPTANCE: ANONYMOUS | NO ADMIN ACCESS', function () { cy.url().should('eq', Cypress.config('baseUrl') + '/') cy.get('div.motto h1').contains(site_title); cy.get('a#sign-in').should('exist'); + cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(0, 177, 226)'); }) it('visiting prefixes', function () { @@ -40,12 +45,14 @@ describe('ACCEPTANCE: ANONYMOUS | NO ADMIN ACCESS', function () { cy.url().should('eq', Cypress.config('baseUrl') + '/') cy.get('div.motto h1').contains(site_title); cy.get('a#sign-in').should('exist'); + cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(0, 177, 226)'); }) it('visiting prefix 10.80225', function () { cy.visit('/prefix/10.80225') cy.get('div.alert-warning').should('contain', 'The page was not found.'); cy.get('a#sign-in').should('exist'); + cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(0, 177, 226)'); }) }) diff --git a/cypress/integration/anonymous/anonymous.test.ts b/cypress/integration/anonymous/anonymous.test.ts index 85b5ed2ce..63277b622 100644 --- a/cypress/integration/anonymous/anonymous.test.ts +++ b/cypress/integration/anonymous/anonymous.test.ts @@ -5,13 +5,14 @@ describe('ACCEPTANCE: ANONYMOUS - AVAILABLE PAGES', () => { beforeEach(() => { cy.setCookie('_consent', 'true'); }); - const site_title = new RegExp('Datacite.*Fabrica', 'i') + const site_title = new RegExp('Datacite.*Fabrica', 'i'); describe('Homepage', () => { it('Header', () => { cy.visit('/'); cy.get('div.motto h1').contains(site_title); cy.get('a#sign-in').should('exist'); + cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(0, 177, 226)'); }); }); @@ -20,6 +21,12 @@ describe('ACCEPTANCE: ANONYMOUS - AVAILABLE PAGES', () => { cy.visit('/about'); cy.get('h3.member').contains('About'); cy.get('a#sign-in').should('exist'); + cy.get('img.fabrica-logo').should('exist').should('have.attr', 'src').should('include', 'fabrica-logo.svg'); + cy.get('ul.navbar-nav').should( + 'have.css', + 'background-color', + 'rgb(0, 177, 226)' + ); }); // it('Version', () => { diff --git a/cypress/integration/anonymous/doi.test.ts b/cypress/integration/anonymous/doi.test.ts index de37a1459..4d3011cf0 100644 --- a/cypress/integration/anonymous/doi.test.ts +++ b/cypress/integration/anonymous/doi.test.ts @@ -15,5 +15,7 @@ describe('ACCEPTANCE: ANONYMOUS - DOI', () => { cy.get('a#sign-in').should('exist'); cy.get('h2.work').contains('10.80225/da52-7919'); + cy.get('img.fabrica-logo').should('exist').should('have.attr', 'src').should('include', 'fabrica-logo.svg'); + cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(0, 177, 226)'); }); }); diff --git a/cypress/integration/anonymous/provider.test.ts b/cypress/integration/anonymous/provider.test.ts index 0ab10de9a..4df91a0f4 100644 --- a/cypress/integration/anonymous/provider.test.ts +++ b/cypress/integration/anonymous/provider.test.ts @@ -16,6 +16,7 @@ describe('ACCEPTANCE: ANONYMOUS - PROVIDER', () => { cy.get('a#sign-in').should('exist'); cy.get('div.motto h1').contains(site_title); + cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(0, 177, 226)'); }); it('visiting provider TIB info', () => { @@ -26,6 +27,7 @@ describe('ACCEPTANCE: ANONYMOUS - PROVIDER', () => { cy.get('a#sign-in').should('exist'); cy.get('div.motto h1').contains(site_title); + cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(0, 177, 226)'); }); it('visiting provider TIB repositories', () => { @@ -36,6 +38,7 @@ describe('ACCEPTANCE: ANONYMOUS - PROVIDER', () => { cy.get('a#sign-in').should('exist'); cy.get('div.motto h1').contains(site_title); + cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(0, 177, 226)'); }); it('visiting provider TIB prefixes', () => { @@ -46,6 +49,7 @@ describe('ACCEPTANCE: ANONYMOUS - PROVIDER', () => { cy.get('a#sign-in').should('exist'); cy.get('div.motto h1').contains(site_title); + cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(0, 177, 226)'); }); it('visiting provider TIB dois', () => { @@ -56,5 +60,6 @@ describe('ACCEPTANCE: ANONYMOUS - PROVIDER', () => { cy.get('a#sign-in').should('exist'); cy.get('div.motto h1').contains(site_title); + cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(0, 177, 226)'); }); }); diff --git a/cypress/integration/anonymous/repository.test.ts b/cypress/integration/anonymous/repository.test.ts index 27b79c8b4..92ff5e13d 100644 --- a/cypress/integration/anonymous/repository.test.ts +++ b/cypress/integration/anonymous/repository.test.ts @@ -17,6 +17,7 @@ describe('Anonymous: Repository', () => { cy.get('a#sign-in').should('exist'); cy.get('div.motto h1').contains(site_title); + cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(0, 177, 226)'); }); it('visiting repository AWI info', () => { @@ -27,6 +28,7 @@ describe('Anonymous: Repository', () => { cy.get('a#sign-in').should('exist'); cy.get('div.motto h1').contains(site_title); + cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(0, 177, 226)'); }); it('visiting repository AWI prefixes', () => { @@ -37,6 +39,7 @@ describe('Anonymous: Repository', () => { cy.get('a#sign-in').should('exist'); cy.get('div.motto h1').contains(site_title); + cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(0, 177, 226)'); }); it('visiting repository AWI dois', () => { @@ -47,5 +50,6 @@ describe('Anonymous: Repository', () => { cy.get('a#sign-in').should('exist'); cy.get('div.motto h1').contains(site_title); + cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(0, 177, 226)'); }); }); diff --git a/cypress/integration/client_admin/doi.test.ts b/cypress/integration/client_admin/doi.test.ts index d3a526bec..7a84217f4 100644 --- a/cypress/integration/client_admin/doi.test.ts +++ b/cypress/integration/client_admin/doi.test.ts @@ -31,6 +31,10 @@ describe('ACCEPTANCE: CLIENT_ADMIN | DOIS', () => { cy.visit('/repositories/datacite.test/dois'); cy.url().should('include', '/repositories/datacite.test/dois').then (() => { + // Has Fabrica logo and correct navbar color + cy.get('img.fabrica-logo').should('exist').should('have.attr', 'src').should('include', 'fabrica-logo.svg'); + cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(0, 177, 226)'); + // Has upper right user profile link. cy.get('h2.work').contains('DataCite Test Repository'); cy.get('a#account_menu_link').should('contain', 'DATACITE.TEST'); diff --git a/cypress/integration/client_admin/info.test.ts b/cypress/integration/client_admin/info.test.ts index 8184e4f5c..1ded37e4d 100644 --- a/cypress/integration/client_admin/info.test.ts +++ b/cypress/integration/client_admin/info.test.ts @@ -19,6 +19,10 @@ describe('ACCEPTANCE: CLIENT_ADMIN | INFO', () => { cy.visit('/repositories/datacite.test/info'); cy.url().should('include', '/repositories/datacite.test/info').then(() => { + // Has Fabrica logo and correct navbar color + cy.get('img.fabrica-logo').should('exist').should('have.attr', 'src').should('include', 'fabrica-logo.svg'); + cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(0, 177, 226)'); + cy.get('h2.work').contains('DataCite Test Repository'); cy.get('a#account_menu_link').should('contain', 'DATACITE.TEST'); diff --git a/cypress/integration/client_admin/prefixes.test.ts b/cypress/integration/client_admin/prefixes.test.ts index efbc2bbec..3d581a08d 100644 --- a/cypress/integration/client_admin/prefixes.test.ts +++ b/cypress/integration/client_admin/prefixes.test.ts @@ -26,6 +26,10 @@ describe('ACCEPTANCE: CLIENT_ADMIN | PREFIXES', () => { cy.visit('/repositories/datacite.test/prefixes'); cy.url().should('include', '/repositories/datacite.test/prefixes').then(() => { + // Has Fabrica logo and correct navbar color + cy.get('img.fabrica-logo').should('exist').should('have.attr', 'src').should('include', 'fabrica-logo.svg'); + cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(0, 177, 226)'); + // Has upper right user profile link. cy.get('h2.work').contains('DataCite Test Repository'); cy.get('a#account_menu_link').should('contain', 'DATACITE.TEST'); diff --git a/cypress/integration/client_admin/settings.test.ts b/cypress/integration/client_admin/settings.test.ts index 6d0af4123..a37f0c107 100644 --- a/cypress/integration/client_admin/settings.test.ts +++ b/cypress/integration/client_admin/settings.test.ts @@ -22,6 +22,11 @@ describe('ACCEPTANCE: CLIENT_ADMIN | SETTINGS', () => { it('is logged in to homepage', () => { cy.visit('/'); cy.url().should('include', '/repositories/datacite.test').then (() => { + + // Has Fabrica logo and correct navbar color + cy.get('img.fabrica-logo').should('exist').should('have.attr', 'src').should('include', 'fabrica-logo.svg'); + cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(0, 177, 226)'); + cy.get('h2.work').contains('DataCite Test Repository'); cy.get('a#account_menu_link').should('contain', 'DATACITE.TEST'); diff --git a/cypress/integration/consortium_admin/contact.test.ts b/cypress/integration/consortium_admin/contact.test.ts index 22988fb90..9eb3128b2 100644 --- a/cypress/integration/consortium_admin/contact.test.ts +++ b/cypress/integration/consortium_admin/contact.test.ts @@ -33,6 +33,10 @@ describe('ACCEPTANCE: CONSORTIUM_ADMIN | CONTACTS', () => { cy.url().should('include', '/providers/dc/contacts') cy.wait(waitTime); + // Has Fabrica logo and correct navbar color + cy.get('img.fabrica-logo').should('exist').should('have.attr', 'src').should('include', 'fabrica-logo.svg'); + cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(36, 59, 84)'); + cy.get('h2.work').contains('DataCite Consortium'); cy.get('li a.nav-link.active').contains('Contacts'); cy.get('div#search').should('exist'); diff --git a/cypress/integration/consortium_admin/doi.test.ts b/cypress/integration/consortium_admin/doi.test.ts index c32476647..4b4624693 100644 --- a/cypress/integration/consortium_admin/doi.test.ts +++ b/cypress/integration/consortium_admin/doi.test.ts @@ -29,7 +29,11 @@ describe('ACCEPTANCE: CONSORTIUM_ADMIN | DOIS', () => { // Check for page elements. it('is logged in to dois page', () => { cy.visit('/providers/dc/dois'); - cy.url().should('include', '/providers/dc/dois').then (() => { + cy.url().should('include', '/providers/dc/dois').then(() => { + + // Has Fabrica logo and correct navbar color + cy.get('img.fabrica-logo').should('exist').should('have.attr', 'src').should('include', 'fabrica-logo.svg'); + cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(36, 59, 84)'); // Has upper right user profile link. cy.get('h2.work').contains('DataCite Consortium'); diff --git a/cypress/integration/consortium_admin/info.test.ts b/cypress/integration/consortium_admin/info.test.ts index 706807ead..cddd0854f 100644 --- a/cypress/integration/consortium_admin/info.test.ts +++ b/cypress/integration/consortium_admin/info.test.ts @@ -19,6 +19,10 @@ describe('ACCEPTANCE: CONSORTIUM_ADMIN | INFO', () => { cy.visit('/providers/dc/info'); cy.url().should('include', '/providers/dc/info').then(() => { + // Has Fabrica logo and correct navbar color + cy.get('img.fabrica-logo').should('exist').should('have.attr', 'src').should('include', 'fabrica-logo.svg'); + cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(36, 59, 84)'); + cy.get('h2.work').contains('DataCite Consortium'); cy.get('a#account_menu_link').should('contain', 'DC'); diff --git a/cypress/integration/consortium_admin/organizations.test.ts b/cypress/integration/consortium_admin/organizations.test.ts index ef8b648cf..069c76e6c 100644 --- a/cypress/integration/consortium_admin/organizations.test.ts +++ b/cypress/integration/consortium_admin/organizations.test.ts @@ -26,6 +26,10 @@ describe('ACCEPTANCE: CONSORTIUM_ADMIN | CONSORTIUM ORGANIZATIONS', () => { cy.visit('/providers/dc/organizations'); cy.url().should('include', '/providers/dc/organizations').then(() => { + // Has Fabrica logo and correct navbar color + cy.get('img.fabrica-logo').should('exist').should('have.attr', 'src').should('include', 'fabrica-logo.svg'); + cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(36, 59, 84)'); + // Has upper right user profile link. cy.get('h2.work').contains('DataCite Consortium'); cy.get('a#account_menu_link').should('contain', 'DC'); diff --git a/cypress/integration/consortium_admin/prefixes.test.ts b/cypress/integration/consortium_admin/prefixes.test.ts index ab41fe06f..03091aaf4 100644 --- a/cypress/integration/consortium_admin/prefixes.test.ts +++ b/cypress/integration/consortium_admin/prefixes.test.ts @@ -26,6 +26,10 @@ describe('ACCEPTANCE: CONSORTIUM_ADMIN | PREFIXES', () => { cy.visit('/providers/dc/prefixes'); cy.url().should('include', '/providers/dc/prefixes').then(() => { + // Has Fabrica logo and correct navbar color + cy.get('img.fabrica-logo').should('exist').should('have.attr', 'src').should('include', 'fabrica-logo.svg'); + cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(36, 59, 84)'); + // Has upper right user profile link. cy.get('h2.work').contains('DataCite Consortium'); cy.get('a#account_menu_link').should('contain', 'DC'); diff --git a/cypress/integration/consortium_admin/repositories.test.ts b/cypress/integration/consortium_admin/repositories.test.ts index efb6725fa..e8ae8bac8 100644 --- a/cypress/integration/consortium_admin/repositories.test.ts +++ b/cypress/integration/consortium_admin/repositories.test.ts @@ -26,6 +26,10 @@ describe('ACCEPTANCE: CONSORTIUM_ADMIN | REPOSITORIES', () => { cy.visit('/providers/dc/repositories'); cy.url().should('include', '/providers/dc/repositories').then(() => { + // Has Fabrica logo and correct navbar color + cy.get('img.fabrica-logo').should('exist').should('have.attr', 'src').should('include', 'fabrica-logo.svg'); + cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(36, 59, 84)'); + // Has upper right user profile link. cy.get('h2.work').contains('DataCite Consortium'); cy.get('a#account_menu_link').should('contain', 'DC'); diff --git a/cypress/integration/consortium_admin/settings.test.ts b/cypress/integration/consortium_admin/settings.test.ts index 9184df9e5..d9d8c6e22 100644 --- a/cypress/integration/consortium_admin/settings.test.ts +++ b/cypress/integration/consortium_admin/settings.test.ts @@ -21,7 +21,12 @@ describe('ACCEPTANCE: CONSORTIUM_ADMIN | SETTINGS', () => { it('is logged in to homepage', () => { cy.visit('/providers/dc'); - cy.url().should('include', '/providers/dc').then (() => { + cy.url().should('include', '/providers/dc').then(() => { + + // Has Fabrica logo and correct navbar color + cy.get('img.fabrica-logo').should('exist').should('have.attr', 'src').should('include', 'fabrica-logo.svg'); + cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(36, 59, 84)'); + cy.get('h2.work').contains('DataCite Consortium'); cy.get('a#account_menu_link').should('contain', 'DC'); diff --git a/cypress/integration/organization_admin/contact.test.ts b/cypress/integration/organization_admin/contact.test.ts index f23ef3715..510f7d300 100644 --- a/cypress/integration/organization_admin/contact.test.ts +++ b/cypress/integration/organization_admin/contact.test.ts @@ -33,6 +33,12 @@ describe('ACCEPTANCE: ORGANIZATION_ADMIN | CONTACTS', () => { cy.location().should((loc) => { expect(loc.pathname).to.eq('/providers/datacite/contacts'); }); + + // Has Fabrica logo and correct navbar color + cy.get('img.fabrica-logo').should('exist').should('have.attr', 'src').should('include', 'fabrica-logo.svg'); + cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(0, 177, 226)'); + + cy.get('h2.work').contains('DataCite'); cy.get('li a.nav-link.active').contains('Contacts'); cy.get('div#search').should('exist'); diff --git a/cypress/integration/organization_admin/info.test.ts b/cypress/integration/organization_admin/info.test.ts index b76bceaa5..eeb4f115d 100644 --- a/cypress/integration/organization_admin/info.test.ts +++ b/cypress/integration/organization_admin/info.test.ts @@ -19,6 +19,10 @@ describe('ACCEPTANCE: ORGANIZATION_ADMIN | INFO', () => { cy.visit('/providers/datacite/info'); cy.url().should('include', '/providers/datacite/info').then(() => { + // Has Fabrica logo and correct navbar color + cy.get('img.fabrica-logo').should('exist').should('have.attr', 'src').should('include', 'fabrica-logo.svg'); + cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(0, 177, 226)'); + cy.get('h2.work').contains('DataCite'); cy.get('a#account_menu_link').should('contain', 'DATACITE'); diff --git a/cypress/integration/organization_admin/prefixes.test.ts b/cypress/integration/organization_admin/prefixes.test.ts index dc32290d2..52afece2a 100644 --- a/cypress/integration/organization_admin/prefixes.test.ts +++ b/cypress/integration/organization_admin/prefixes.test.ts @@ -25,6 +25,10 @@ describe('ACCEPTANCE: ORGANIZATION_ADMIN | PREFIXES', () => { it('is logged in to prefixes page', () => { cy.visit('/providers/datacite/prefixes'); cy.url().should('include', '/providers/datacite/prefixes').then(() => { + + // Has Fabrica logo and correct navbar color + cy.get('img.fabrica-logo').should('exist').should('have.attr', 'src').should('include', 'fabrica-logo.svg'); + cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(0, 177, 226)'); // Has upper right user profile link. cy.get('h2.work').contains('DataCite'); diff --git a/cypress/integration/organization_admin/repositories.test.ts b/cypress/integration/organization_admin/repositories.test.ts index 4f679d5ca..94991ff29 100644 --- a/cypress/integration/organization_admin/repositories.test.ts +++ b/cypress/integration/organization_admin/repositories.test.ts @@ -26,6 +26,10 @@ describe('ACCEPTANCE: ORGANIZATION_ADMIN | REPOSITORIES', () => { cy.visit('/providers/datacite/repositories'); cy.url().should('include', '/providers/datacite/repositories').then(() => { + // Has Fabrica logo and correct navbar color + cy.get('img.fabrica-logo').should('exist').should('have.attr', 'src').should('include', 'fabrica-logo.svg'); + cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(0, 177, 226)'); + // Has upper right user profile link. cy.get('h2.work').contains('DataCite'); cy.get('a#account_menu_link').should('contain', 'DATACITE'); diff --git a/cypress/integration/organization_admin/settings.test.ts b/cypress/integration/organization_admin/settings.test.ts index 1fbe7da21..917fa04fc 100644 --- a/cypress/integration/organization_admin/settings.test.ts +++ b/cypress/integration/organization_admin/settings.test.ts @@ -21,7 +21,12 @@ describe('ACCEPTANCE: ORGANIZATION_ADMIN | SETTINGS', () => { it('is logged in to homepage', () => { cy.visit('/providers/datacite'); - cy.url().should('include', '/providers/datacite').then (() => { + cy.url().should('include', '/providers/datacite').then(() => { + + // Has Fabrica logo and correct navbar color + cy.get('img.fabrica-logo').should('exist').should('have.attr', 'src').should('include', 'fabrica-logo.svg'); + cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(0, 177, 226)'); + cy.get('h2.work').contains('DataCite'); cy.get('a#account_menu_link').should('contain', 'DATACITE'); diff --git a/cypress/integration/staff_admin/admin.test.ts b/cypress/integration/staff_admin/admin.test.ts index 94a7a0796..1f8282ff7 100644 --- a/cypress/integration/staff_admin/admin.test.ts +++ b/cypress/integration/staff_admin/admin.test.ts @@ -21,6 +21,10 @@ describe('Admin: Admin', () => { expect(loc.pathname).to.eq('/'); }); cy.get('a#account_menu_link').contains('ADMIN'); + + // Has Fabrica logo and correct navbar color + cy.get('img.fabrica-logo').should('exist').should('have.attr', 'src').should('include', 'fabrica-logo.svg'); + cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(36, 59, 84)'); }); it('editing admin form', () => { @@ -54,6 +58,10 @@ describe('Admin: Admin', () => { cy.visit('/'); cy.get('h2.work').contains('DataCite'); cy.get('li a.nav-link.active').contains('Settings'); + + // Has Fabrica logo and correct navbar color + cy.get('img.fabrica-logo').should('exist').should('have.attr', 'src').should('include', 'fabrica-logo.svg'); + cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(36, 59, 84)'); }); it('visiting info', () => { diff --git a/cypress/integration/staff_admin/info.test.ts b/cypress/integration/staff_admin/info.test.ts index 3d04200a6..f37d50d46 100644 --- a/cypress/integration/staff_admin/info.test.ts +++ b/cypress/integration/staff_admin/info.test.ts @@ -19,6 +19,10 @@ describe('ACCEPTANCE: STAFF_ADMIN | INFO', () => { cy.visit('/info'); cy.url().should('include', '/info').then(() => { + // Has Fabrica logo and correct navbar color + cy.get('img.fabrica-logo').should('exist').should('have.attr', 'src').should('include', 'fabrica-logo.svg'); + cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(36, 59, 84)'); + cy.get('h2.work').contains('DataCite'); cy.get('a#account_menu_link').should('contain', 'ADMIN'); diff --git a/cypress/integration/staff_admin/prefix.test.ts b/cypress/integration/staff_admin/prefix.test.ts index 50a274fb8..732ac538f 100644 --- a/cypress/integration/staff_admin/prefix.test.ts +++ b/cypress/integration/staff_admin/prefix.test.ts @@ -25,6 +25,10 @@ describe('Admin: Prefix', () => { .type('10.5438{enter}', {waitForAnimations: true}) .get('[data-test-prefix]') .should('contain', '10.5438'); + + // Has Fabrica logo and correct navbar color + cy.get('img.fabrica-logo').should('exist').should('have.attr', 'src').should('include', 'fabrica-logo.svg'); + cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(36, 59, 84)'); cy.get('h2.work').contains('DataCite'); cy.get('li a.nav-link.active').contains('Prefixes'); diff --git a/cypress/integration/staff_admin/settings.test.ts b/cypress/integration/staff_admin/settings.test.ts index 0e79051a0..0a969408d 100644 --- a/cypress/integration/staff_admin/settings.test.ts +++ b/cypress/integration/staff_admin/settings.test.ts @@ -21,7 +21,12 @@ describe('ACCEPTANCE: STAFF_ADMIN | SETTINGS', () => { it('is logged in to homepage', () => { cy.visit('/'); - cy.url().should('include', '/').then (() => { + cy.url().should('include', '/').then(() => { + + // Has Fabrica logo and correct navbar color + cy.get('img.fabrica-logo').should('exist').should('have.attr', 'src').should('include', 'fabrica-logo.svg'); + cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(36, 59, 84)'); + cy.get('h2.work').contains('DataCite'); cy.get('a#account_menu_link').should('contain', 'ADMIN'); From e15b5d52b0aa6eed2709ae797987c2ceff127984 Mon Sep 17 00:00:00 2001 From: Bryceson Laing Date: Fri, 21 Oct 2022 12:54:26 -0700 Subject: [PATCH 012/106] Fabrica Improvements - task 3 (fixed PR comments) --- app/components/application-header.js | 18 ++++++++++++++++++ app/styles/header.css | 18 +++++++++--------- .../components/application-header.hbs | 12 +++++++----- cypress/integration/anonymous/admin.test.ts | 7 ------- .../integration/anonymous/anonymous.test.ts | 6 ------ cypress/integration/anonymous/doi.test.ts | 1 - cypress/integration/anonymous/provider.test.ts | 5 ----- .../integration/anonymous/repository.test.ts | 4 ---- cypress/integration/client_admin/doi.test.ts | 3 +-- cypress/integration/client_admin/info.test.ts | 3 +-- .../integration/client_admin/prefixes.test.ts | 3 +-- .../integration/client_admin/settings.test.ts | 3 +-- cypress/integration/staff_admin/admin.test.ts | 8 -------- cypress/integration/staff_admin/info.test.ts | 4 ---- cypress/integration/staff_admin/prefix.test.ts | 4 ---- .../integration/staff_admin/settings.test.ts | 6 +----- 16 files changed, 39 insertions(+), 66 deletions(-) diff --git a/app/components/application-header.js b/app/components/application-header.js index e3e342097..3e3387333 100644 --- a/app/components/application-header.js +++ b/app/components/application-header.js @@ -14,6 +14,9 @@ export default Component.extend({ title: null, home: '/', user: true, + showLogo: true, + navBgColor: '', + navButtonColor: '', init(...args) { this._super(...args); @@ -59,6 +62,21 @@ export default Component.extend({ } else { this.set('settings', null); } + + let route = this.router.currentRouteName; + console.log(route); + if (route === 'index' || route === 'sign-in' || route === '404') { + this.showLogo = false; + } + + let role = this.currentUser.get('roleName'); + if (role === 'Member') { + this.set('navBgColor', 'navbar-member'); + this.set('navButtonColor', 'navbar-button-member'); + } else if (role === 'Consortium') { + this.set('navBgColor', 'navbar-consortium'); + this.set('navButtonColor', 'navbar-button-consortium'); + } }, actions: { diff --git a/app/styles/header.css b/app/styles/header.css index 7e5a9ed03..eeb5e398e 100644 --- a/app/styles/header.css +++ b/app/styles/header.css @@ -8,22 +8,22 @@ border-bottom-right-radius: 30px; } -.navbar-lead { - background-color: #243B54; +.navbar-member { + background-color: #00B1E2; } -.navbar-user { - background-color: #00B1E2; +.navbar-consortium { + background-color: #243B54; } -.navbar-button { +.navbar-button-member, .navbar-button-consortium { color: white !important; } -.navbar-button:hover, .navbar-button:focus { - color: #3498db !important; +.navbar-button-member:hover, .navbar-button-member:focus { + color: #243B54 !important; } -.navbar-transparent { - padding-top: 0; +.navbar-button-consortium:hover, .navbar-button-consortium:focus { + color: #00B1E2 !important; } \ No newline at end of file diff --git a/app/templates/components/application-header.hbs b/app/templates/components/application-header.hbs index da5b907d1..faaeb7404 100644 --- a/app/templates/components/application-header.hbs +++ b/app/templates/components/application-header.hbs @@ -8,25 +8,27 @@ - + - + About - + Support {{#if user}} {{#if session.isAuthenticated}} - + {{#if currentUser.isUser}} {{currentUser.name}} {{else}} diff --git a/cypress/integration/anonymous/admin.test.ts b/cypress/integration/anonymous/admin.test.ts index 40e91c6be..7dbeafa4f 100644 --- a/cypress/integration/anonymous/admin.test.ts +++ b/cypress/integration/anonymous/admin.test.ts @@ -4,7 +4,6 @@ describe('ACCEPTANCE: ANONYMOUS | NO ADMIN ACCESS', function () { it('is not logged in', function () { cy.visit('/') cy.get('a#sign-in').should('exist'); - cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(0, 177, 226)'); }) it('visiting homepage', function () { @@ -12,7 +11,6 @@ describe('ACCEPTANCE: ANONYMOUS | NO ADMIN ACCESS', function () { cy.url().should('eq', Cypress.config('baseUrl') + '/') cy.get('div.motto h1').contains(site_title); cy.get('a#sign-in').should('exist'); - cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(0, 177, 226)'); }) // the following pages require authentication. Redirects to homepage otherwise. @@ -21,7 +19,6 @@ describe('ACCEPTANCE: ANONYMOUS | NO ADMIN ACCESS', function () { cy.url().should('eq', Cypress.config('baseUrl') + '/') cy.get('div.motto h1').contains(site_title); cy.get('a#sign-in').should('exist'); - cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(0, 177, 226)'); }) it('visiting providers', function () { @@ -29,7 +26,6 @@ describe('ACCEPTANCE: ANONYMOUS | NO ADMIN ACCESS', function () { cy.url().should('eq', Cypress.config('baseUrl') + '/') cy.get('div.motto h1').contains(site_title); cy.get('a#sign-in').should('exist'); - cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(0, 177, 226)'); }) it('visiting repositories', function () { @@ -37,7 +33,6 @@ describe('ACCEPTANCE: ANONYMOUS | NO ADMIN ACCESS', function () { cy.url().should('eq', Cypress.config('baseUrl') + '/') cy.get('div.motto h1').contains(site_title); cy.get('a#sign-in').should('exist'); - cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(0, 177, 226)'); }) it('visiting prefixes', function () { @@ -45,14 +40,12 @@ describe('ACCEPTANCE: ANONYMOUS | NO ADMIN ACCESS', function () { cy.url().should('eq', Cypress.config('baseUrl') + '/') cy.get('div.motto h1').contains(site_title); cy.get('a#sign-in').should('exist'); - cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(0, 177, 226)'); }) it('visiting prefix 10.80225', function () { cy.visit('/prefix/10.80225') cy.get('div.alert-warning').should('contain', 'The page was not found.'); cy.get('a#sign-in').should('exist'); - cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(0, 177, 226)'); }) }) diff --git a/cypress/integration/anonymous/anonymous.test.ts b/cypress/integration/anonymous/anonymous.test.ts index 63277b622..88b820dcc 100644 --- a/cypress/integration/anonymous/anonymous.test.ts +++ b/cypress/integration/anonymous/anonymous.test.ts @@ -12,7 +12,6 @@ describe('ACCEPTANCE: ANONYMOUS - AVAILABLE PAGES', () => { cy.visit('/'); cy.get('div.motto h1').contains(site_title); cy.get('a#sign-in').should('exist'); - cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(0, 177, 226)'); }); }); @@ -22,11 +21,6 @@ describe('ACCEPTANCE: ANONYMOUS - AVAILABLE PAGES', () => { cy.get('h3.member').contains('About'); cy.get('a#sign-in').should('exist'); cy.get('img.fabrica-logo').should('exist').should('have.attr', 'src').should('include', 'fabrica-logo.svg'); - cy.get('ul.navbar-nav').should( - 'have.css', - 'background-color', - 'rgb(0, 177, 226)' - ); }); // it('Version', () => { diff --git a/cypress/integration/anonymous/doi.test.ts b/cypress/integration/anonymous/doi.test.ts index 4d3011cf0..670210b5a 100644 --- a/cypress/integration/anonymous/doi.test.ts +++ b/cypress/integration/anonymous/doi.test.ts @@ -16,6 +16,5 @@ describe('ACCEPTANCE: ANONYMOUS - DOI', () => { cy.get('h2.work').contains('10.80225/da52-7919'); cy.get('img.fabrica-logo').should('exist').should('have.attr', 'src').should('include', 'fabrica-logo.svg'); - cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(0, 177, 226)'); }); }); diff --git a/cypress/integration/anonymous/provider.test.ts b/cypress/integration/anonymous/provider.test.ts index 4df91a0f4..0ab10de9a 100644 --- a/cypress/integration/anonymous/provider.test.ts +++ b/cypress/integration/anonymous/provider.test.ts @@ -16,7 +16,6 @@ describe('ACCEPTANCE: ANONYMOUS - PROVIDER', () => { cy.get('a#sign-in').should('exist'); cy.get('div.motto h1').contains(site_title); - cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(0, 177, 226)'); }); it('visiting provider TIB info', () => { @@ -27,7 +26,6 @@ describe('ACCEPTANCE: ANONYMOUS - PROVIDER', () => { cy.get('a#sign-in').should('exist'); cy.get('div.motto h1').contains(site_title); - cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(0, 177, 226)'); }); it('visiting provider TIB repositories', () => { @@ -38,7 +36,6 @@ describe('ACCEPTANCE: ANONYMOUS - PROVIDER', () => { cy.get('a#sign-in').should('exist'); cy.get('div.motto h1').contains(site_title); - cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(0, 177, 226)'); }); it('visiting provider TIB prefixes', () => { @@ -49,7 +46,6 @@ describe('ACCEPTANCE: ANONYMOUS - PROVIDER', () => { cy.get('a#sign-in').should('exist'); cy.get('div.motto h1').contains(site_title); - cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(0, 177, 226)'); }); it('visiting provider TIB dois', () => { @@ -60,6 +56,5 @@ describe('ACCEPTANCE: ANONYMOUS - PROVIDER', () => { cy.get('a#sign-in').should('exist'); cy.get('div.motto h1').contains(site_title); - cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(0, 177, 226)'); }); }); diff --git a/cypress/integration/anonymous/repository.test.ts b/cypress/integration/anonymous/repository.test.ts index 92ff5e13d..27b79c8b4 100644 --- a/cypress/integration/anonymous/repository.test.ts +++ b/cypress/integration/anonymous/repository.test.ts @@ -17,7 +17,6 @@ describe('Anonymous: Repository', () => { cy.get('a#sign-in').should('exist'); cy.get('div.motto h1').contains(site_title); - cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(0, 177, 226)'); }); it('visiting repository AWI info', () => { @@ -28,7 +27,6 @@ describe('Anonymous: Repository', () => { cy.get('a#sign-in').should('exist'); cy.get('div.motto h1').contains(site_title); - cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(0, 177, 226)'); }); it('visiting repository AWI prefixes', () => { @@ -39,7 +37,6 @@ describe('Anonymous: Repository', () => { cy.get('a#sign-in').should('exist'); cy.get('div.motto h1').contains(site_title); - cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(0, 177, 226)'); }); it('visiting repository AWI dois', () => { @@ -50,6 +47,5 @@ describe('Anonymous: Repository', () => { cy.get('a#sign-in').should('exist'); cy.get('div.motto h1').contains(site_title); - cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(0, 177, 226)'); }); }); diff --git a/cypress/integration/client_admin/doi.test.ts b/cypress/integration/client_admin/doi.test.ts index 7a84217f4..e69b53c40 100644 --- a/cypress/integration/client_admin/doi.test.ts +++ b/cypress/integration/client_admin/doi.test.ts @@ -31,9 +31,8 @@ describe('ACCEPTANCE: CLIENT_ADMIN | DOIS', () => { cy.visit('/repositories/datacite.test/dois'); cy.url().should('include', '/repositories/datacite.test/dois').then (() => { - // Has Fabrica logo and correct navbar color + // Has Fabrica logo cy.get('img.fabrica-logo').should('exist').should('have.attr', 'src').should('include', 'fabrica-logo.svg'); - cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(0, 177, 226)'); // Has upper right user profile link. cy.get('h2.work').contains('DataCite Test Repository'); diff --git a/cypress/integration/client_admin/info.test.ts b/cypress/integration/client_admin/info.test.ts index 1ded37e4d..41e0d2d7e 100644 --- a/cypress/integration/client_admin/info.test.ts +++ b/cypress/integration/client_admin/info.test.ts @@ -19,9 +19,8 @@ describe('ACCEPTANCE: CLIENT_ADMIN | INFO', () => { cy.visit('/repositories/datacite.test/info'); cy.url().should('include', '/repositories/datacite.test/info').then(() => { - // Has Fabrica logo and correct navbar color + // Has Fabrica logo cy.get('img.fabrica-logo').should('exist').should('have.attr', 'src').should('include', 'fabrica-logo.svg'); - cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(0, 177, 226)'); cy.get('h2.work').contains('DataCite Test Repository'); cy.get('a#account_menu_link').should('contain', 'DATACITE.TEST'); diff --git a/cypress/integration/client_admin/prefixes.test.ts b/cypress/integration/client_admin/prefixes.test.ts index 3d581a08d..1a5187319 100644 --- a/cypress/integration/client_admin/prefixes.test.ts +++ b/cypress/integration/client_admin/prefixes.test.ts @@ -26,9 +26,8 @@ describe('ACCEPTANCE: CLIENT_ADMIN | PREFIXES', () => { cy.visit('/repositories/datacite.test/prefixes'); cy.url().should('include', '/repositories/datacite.test/prefixes').then(() => { - // Has Fabrica logo and correct navbar color + // Has Fabrica logo cy.get('img.fabrica-logo').should('exist').should('have.attr', 'src').should('include', 'fabrica-logo.svg'); - cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(0, 177, 226)'); // Has upper right user profile link. cy.get('h2.work').contains('DataCite Test Repository'); diff --git a/cypress/integration/client_admin/settings.test.ts b/cypress/integration/client_admin/settings.test.ts index a37f0c107..d1c0de146 100644 --- a/cypress/integration/client_admin/settings.test.ts +++ b/cypress/integration/client_admin/settings.test.ts @@ -23,9 +23,8 @@ describe('ACCEPTANCE: CLIENT_ADMIN | SETTINGS', () => { cy.visit('/'); cy.url().should('include', '/repositories/datacite.test').then (() => { - // Has Fabrica logo and correct navbar color + // Has Fabrica logo cy.get('img.fabrica-logo').should('exist').should('have.attr', 'src').should('include', 'fabrica-logo.svg'); - cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(0, 177, 226)'); cy.get('h2.work').contains('DataCite Test Repository'); cy.get('a#account_menu_link').should('contain', 'DATACITE.TEST'); diff --git a/cypress/integration/staff_admin/admin.test.ts b/cypress/integration/staff_admin/admin.test.ts index 1f8282ff7..94a7a0796 100644 --- a/cypress/integration/staff_admin/admin.test.ts +++ b/cypress/integration/staff_admin/admin.test.ts @@ -21,10 +21,6 @@ describe('Admin: Admin', () => { expect(loc.pathname).to.eq('/'); }); cy.get('a#account_menu_link').contains('ADMIN'); - - // Has Fabrica logo and correct navbar color - cy.get('img.fabrica-logo').should('exist').should('have.attr', 'src').should('include', 'fabrica-logo.svg'); - cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(36, 59, 84)'); }); it('editing admin form', () => { @@ -58,10 +54,6 @@ describe('Admin: Admin', () => { cy.visit('/'); cy.get('h2.work').contains('DataCite'); cy.get('li a.nav-link.active').contains('Settings'); - - // Has Fabrica logo and correct navbar color - cy.get('img.fabrica-logo').should('exist').should('have.attr', 'src').should('include', 'fabrica-logo.svg'); - cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(36, 59, 84)'); }); it('visiting info', () => { diff --git a/cypress/integration/staff_admin/info.test.ts b/cypress/integration/staff_admin/info.test.ts index f37d50d46..3d04200a6 100644 --- a/cypress/integration/staff_admin/info.test.ts +++ b/cypress/integration/staff_admin/info.test.ts @@ -19,10 +19,6 @@ describe('ACCEPTANCE: STAFF_ADMIN | INFO', () => { cy.visit('/info'); cy.url().should('include', '/info').then(() => { - // Has Fabrica logo and correct navbar color - cy.get('img.fabrica-logo').should('exist').should('have.attr', 'src').should('include', 'fabrica-logo.svg'); - cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(36, 59, 84)'); - cy.get('h2.work').contains('DataCite'); cy.get('a#account_menu_link').should('contain', 'ADMIN'); diff --git a/cypress/integration/staff_admin/prefix.test.ts b/cypress/integration/staff_admin/prefix.test.ts index 732ac538f..50a274fb8 100644 --- a/cypress/integration/staff_admin/prefix.test.ts +++ b/cypress/integration/staff_admin/prefix.test.ts @@ -25,10 +25,6 @@ describe('Admin: Prefix', () => { .type('10.5438{enter}', {waitForAnimations: true}) .get('[data-test-prefix]') .should('contain', '10.5438'); - - // Has Fabrica logo and correct navbar color - cy.get('img.fabrica-logo').should('exist').should('have.attr', 'src').should('include', 'fabrica-logo.svg'); - cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(36, 59, 84)'); cy.get('h2.work').contains('DataCite'); cy.get('li a.nav-link.active').contains('Prefixes'); diff --git a/cypress/integration/staff_admin/settings.test.ts b/cypress/integration/staff_admin/settings.test.ts index 0a969408d..7798751b8 100644 --- a/cypress/integration/staff_admin/settings.test.ts +++ b/cypress/integration/staff_admin/settings.test.ts @@ -21,11 +21,7 @@ describe('ACCEPTANCE: STAFF_ADMIN | SETTINGS', () => { it('is logged in to homepage', () => { cy.visit('/'); - cy.url().should('include', '/').then(() => { - - // Has Fabrica logo and correct navbar color - cy.get('img.fabrica-logo').should('exist').should('have.attr', 'src').should('include', 'fabrica-logo.svg'); - cy.get('ul.navbar-nav').should('have.css', 'background-color', 'rgb(36, 59, 84)'); + cy.url().should('include', '/').then (() => { cy.get('h2.work').contains('DataCite'); cy.get('a#account_menu_link').should('contain', 'ADMIN'); From 50eb6939fdcfa22a47fcc008ff3fe47804f54882 Mon Sep 17 00:00:00 2001 From: Bryceson Laing Date: Tue, 25 Oct 2022 16:08:07 -0700 Subject: [PATCH 013/106] Fabrica Improvements - task 2 (right align graphs) --- app/components/bar-chart.js | 2 ++ app/templates/components/index-info.hbs | 4 ++-- app/templates/components/provider-info.hbs | 4 +++- app/templates/components/repository-info.hbs | 4 ++-- app/templates/components/user-role.hbs | 2 +- app/templates/users/show/index.hbs | 2 +- 6 files changed, 11 insertions(+), 7 deletions(-) diff --git a/app/components/bar-chart.js b/app/components/bar-chart.js index 078a4c4e4..f4a818dad 100644 --- a/app/components/bar-chart.js +++ b/app/components/bar-chart.js @@ -13,6 +13,8 @@ import { A } from '@ember/array'; export default Component.extend({ tagName: 'div', classNames: ['col-lg-3', 'col-md-4'], + classNameBindings: ['offset:col-lg-offset-3'], + offset: false, data: null, count: computed('data', 'summarize', 'currentYear', function () { if (this.data) { diff --git a/app/templates/components/index-info.hbs b/app/templates/components/index-info.hbs index 31647dce6..5b120e48f 100644 --- a/app/templates/components/index-info.hbs +++ b/app/templates/components/index-info.hbs @@ -1,7 +1,7 @@
{{#if (can "read messages" model)}}
-
+
{{#each flashMessages.queue as |flash|}} {{/each}} @@ -10,7 +10,7 @@ {{/if}}
- +
diff --git a/app/templates/components/provider-info.hbs b/app/templates/components/provider-info.hbs index 120a8fcda..90432a3a3 100644 --- a/app/templates/components/provider-info.hbs +++ b/app/templates/components/provider-info.hbs @@ -7,6 +7,7 @@ @label="Organization" @model={{model}} @link="providers.show.organizations" + @offset={{true}} /> {{/if}} {{#if @@ -20,6 +21,7 @@ @label="Repository" @model={{model}} @link="providers.show.repositories" + @offset={{if (not-eq model.memberType 'consortium') true}} /> {{#if (can 'read messages' model)}}
-
+
{{#each flashMessages.queue as |flash|}} {{/each}} diff --git a/app/templates/components/repository-info.hbs b/app/templates/components/repository-info.hbs index e5a159dd7..759bc6724 100644 --- a/app/templates/components/repository-info.hbs +++ b/app/templates/components/repository-info.hbs @@ -1,12 +1,12 @@
- +
{{#if (can "read messages" model)}}
-
+
{{#each flashMessages.queue as |flash|}} {{/each}} diff --git a/app/templates/components/user-role.hbs b/app/templates/components/user-role.hbs index ce14e6a95..fda4347c7 100644 --- a/app/templates/components/user-role.hbs +++ b/app/templates/components/user-role.hbs @@ -1,4 +1,4 @@ -
+
Role:
{{currentUser.roleName}}
\ No newline at end of file diff --git a/app/templates/users/show/index.hbs b/app/templates/users/show/index.hbs index b65ad73b1..6d8bf0f30 100644 --- a/app/templates/users/show/index.hbs +++ b/app/templates/users/show/index.hbs @@ -1,7 +1,7 @@
- +
From c33da4bedc9bf6ca1365c9544b1819bb46a21e43 Mon Sep 17 00:00:00 2001 From: Bryceson Laing Date: Tue, 25 Oct 2022 18:28:02 -0700 Subject: [PATCH 014/106] Fabrica Improvements - task 2 (updated tests) --- app/routes/index.js | 6 +- app/routes/settings.js | 36 +++++ cypress/integration/anonymous/admin.test.ts | 4 +- .../integration/anonymous/provider.test.ts | 4 +- .../integration/anonymous/repository.test.ts | 4 +- cypress/integration/client_admin/doi.test.ts | 4 +- cypress/integration/client_admin/info.test.ts | 107 +++++++++++++- .../integration/client_admin/prefixes.test.ts | 4 +- .../integration/client_admin/settings.test.ts | 105 +------------- .../integration/consortium_admin/info.test.ts | 136 +++++++++++++++++- .../consortium_admin/settings.test.ts | 136 +----------------- .../organization_admin/info.test.ts | 123 +++++++++++++++- .../organization_admin/settings.test.ts | 122 +--------------- cypress/integration/staff_admin/admin.test.ts | 10 +- cypress/integration/staff_admin/info.test.ts | 123 +++++++++++++++- .../integration/staff_admin/settings.test.ts | 123 +--------------- cypress/integration/ui/login.test.ts | 6 +- 17 files changed, 545 insertions(+), 508 deletions(-) create mode 100644 app/routes/settings.js diff --git a/app/routes/index.js b/app/routes/index.js index 31daa0286..0f89b71ba 100644 --- a/app/routes/index.js +++ b/app/routes/index.js @@ -5,6 +5,7 @@ import { w } from '@ember/string'; export default Route.extend({ can: service(), currentUser: service(), + flashMessages: service(), prefixes: service(), model() { @@ -12,13 +13,14 @@ export default Route.extend({ let self = this; return this.store .findRecord('provider', 'admin') - .then(function (model) { - return model; + .then(function (admin) { + return admin; }) .catch(function (reason) { console.debug(reason); self.get('flashMessages').warning(reason); + self.transitionTo('index'); }); } }, diff --git a/app/routes/settings.js b/app/routes/settings.js new file mode 100644 index 000000000..7c2a21752 --- /dev/null +++ b/app/routes/settings.js @@ -0,0 +1,36 @@ +import Route from '@ember/routing/route'; +import { inject as service } from '@ember/service'; + +export default Route.extend({ + can: service(), + currentUser: service(), + prefixes: service(), + + model() { + if (this.can.can('read index')) { + let self = this; + return this.store + .findRecord('provider', 'admin') + .then(function (model) { + return model; + }) + .catch(function (reason) { + console.debug(reason); + + self.get('flashMessages').warning(reason); + }); + } + }, + + afterModel() { + if (this.can.cannot('read index') && this.currentUser) { + this.transitionTo('index'); + } + }, + + actions: { + queryParamsDidChange() { + this.refresh(); + } + } +}); diff --git a/cypress/integration/anonymous/admin.test.ts b/cypress/integration/anonymous/admin.test.ts index 7dbeafa4f..2955254c8 100644 --- a/cypress/integration/anonymous/admin.test.ts +++ b/cypress/integration/anonymous/admin.test.ts @@ -14,8 +14,8 @@ describe('ACCEPTANCE: ANONYMOUS | NO ADMIN ACCESS', function () { }) // the following pages require authentication. Redirects to homepage otherwise. - it('visiting info', function () { - cy.visit('/info') + it('visiting settings', function () { + cy.visit('/settings') cy.url().should('eq', Cypress.config('baseUrl') + '/') cy.get('div.motto h1').contains(site_title); cy.get('a#sign-in').should('exist'); diff --git a/cypress/integration/anonymous/provider.test.ts b/cypress/integration/anonymous/provider.test.ts index 0ab10de9a..1e20e0faf 100644 --- a/cypress/integration/anonymous/provider.test.ts +++ b/cypress/integration/anonymous/provider.test.ts @@ -18,8 +18,8 @@ describe('ACCEPTANCE: ANONYMOUS - PROVIDER', () => { cy.get('div.motto h1').contains(site_title); }); - it('visiting provider TIB info', () => { - cy.visit('/providers/tib/info'); + it('visiting provider TIB settings', () => { + cy.visit('/providers/tib/settings'); cy.location().should((loc) => { expect(loc.pathname).to.eq('/'); }); diff --git a/cypress/integration/anonymous/repository.test.ts b/cypress/integration/anonymous/repository.test.ts index 27b79c8b4..e3566307c 100644 --- a/cypress/integration/anonymous/repository.test.ts +++ b/cypress/integration/anonymous/repository.test.ts @@ -19,8 +19,8 @@ describe('Anonymous: Repository', () => { cy.get('div.motto h1').contains(site_title); }); - it('visiting repository AWI info', () => { - cy.visit('/repositories/tib.awi/info'); + it('visiting repository AWI settings', () => { + cy.visit('/repositories/tib.awi/settings'); cy.location().should((loc) => { expect(loc.pathname).to.eq('/'); }); diff --git a/cypress/integration/client_admin/doi.test.ts b/cypress/integration/client_admin/doi.test.ts index 62dbf75bb..7ef8d6303 100644 --- a/cypress/integration/client_admin/doi.test.ts +++ b/cypress/integration/client_admin/doi.test.ts @@ -37,9 +37,9 @@ describe('ACCEPTANCE: CLIENT_ADMIN | DOIS', () => { // Has tabs with correct one activated. cy.get('ul.nav-tabs li a').contains(/Info/i) - .and('have.attr', 'href').and('include', '/repositories/datacite.test/info'); - cy.get('ul.nav-tabs li a').contains(/Settings/i) .and('have.attr', 'href').and('include', '/repositories/datacite.test'); + cy.get('ul.nav-tabs li a').contains(/Settings/i) + .and('have.attr', 'href').and('include', '/repositories/datacite.test/settings'); cy.get('ul.nav-tabs li a').contains(/Prefixes/i) .and('have.attr', 'href').and('include', '/repositories/datacite.test/prefixes'); cy.get('ul.nav-tabs li.active a').contains(/DOIs/i) diff --git a/cypress/integration/client_admin/info.test.ts b/cypress/integration/client_admin/info.test.ts index 8184e4f5c..09af0d001 100644 --- a/cypress/integration/client_admin/info.test.ts +++ b/cypress/integration/client_admin/info.test.ts @@ -1,6 +1,11 @@ /// /* eslint-disable no-undef */ +function escapeRE(string) { + //return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string + return string.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); +} + describe('ACCEPTANCE: CLIENT_ADMIN | INFO', () => { const waitTime = 1000; const waitTime2 = 2000; @@ -15,17 +20,17 @@ describe('ACCEPTANCE: CLIENT_ADMIN | INFO', () => { cy.wait(waitTime2); }); - it('is logged in to info page', () => { - cy.visit('/repositories/datacite.test/info'); - cy.url().should('include', '/repositories/datacite.test/info').then(() => { + it('is logged in to homepage', () => { + cy.visit('/'); + cy.url().should('include', '/repositories/datacite.test').then(() => { cy.get('h2.work').contains('DataCite Test Repository'); cy.get('a#account_menu_link').should('contain', 'DATACITE.TEST'); cy.get('ul.nav-tabs li.active a').contains(/Info/i) - .and('have.attr', 'href').and('include', '/repositories/datacite.test/info'); - cy.get('ul.nav-tabs li a').contains(/Settings/i) .and('have.attr', 'href').and('include', '/repositories/datacite.test'); + cy.get('ul.nav-tabs li a').contains(/Settings/i) + .and('have.attr', 'href').and('include', '/repositories/datacite.test/settings'); cy.get('ul.nav-tabs li a').contains(/Prefixes/i) .and('have.attr', 'href').and('include', '/repositories/datacite.test/prefixes'); cy.get('ul.nav-tabs li a').contains(/DOIs/i) @@ -39,4 +44,94 @@ describe('ACCEPTANCE: CLIENT_ADMIN | INFO', () => { }); }); }); -}); + + it('/settings redirects to homepage', () => { + cy.visit('/settings'); + cy.url().should('include', '/repositories/datacite.test').then (() => { + cy.get('a#account_menu_link').should('contain', 'DATACITE.TEST'); + }); + }); + + it('/prefixes redirects to homepage', () => { + cy.visit('/prefixes'); + cy.url().should('include', '/repositories/datacite.test').then (() => { + cy.get('h2.work').contains('DataCite Test Repository'); + cy.get('a#account_menu_link').should('contain', 'DATACITE.TEST'); + }); + }); + + it('/dois redirects to homepage', () => { + cy.visit('/dois'); + cy.url().should('include', '/repositories/datacite.test').then (() => { + cy.get('h2.work').contains('DataCite Test Repository'); + cy.get('a#account_menu_link').should('contain', 'DATACITE.TEST'); + }); + }); + + it('has password settings page', () => { + cy.visit('/repositories/datacite.test/change').then (() => { + cy.url().should('include', '/repositories/datacite.test/change'); + cy.get('h2.work').contains('DataCite Test Repository'); + cy.get('a#account_menu_link').should('contain', 'DATACITE.TEST'); + + cy.get('h3').contains(/Set Password/i); + + cy.get('form').within(($form) => { + cy.get('input#password-input-field').should('be.visible'); + cy.get('input#confirm-password-input-field').should('be.visible'); + cy.get('button[type=submit]').should('be.visible'); + cy.get('button#cancel').should('be.visible'); + + cy.get('button#cancel').click({force:true}); + }); + }); + + cy.on("url:changed", (newUrl) => { + expect(newUrl).to.contain("/repositories/datacite.test") + }) + }); + + // TBD - Could do more testing here. Only cursory testing for + // presence of field objects. No testing of form behavior yet. + it('has repository settings page', () => { + cy.visit('/repositories/datacite.test/edit'); + cy.url().should('include', '/repositories/datacite.test/edit').then(() => { + + cy.get('h2.work').contains('DataCite Test Repository'); + cy.get('a#account_menu_link').should('contain', 'DATACITE.TEST'); + + cy.get('form').within(($form) => { + cy.get('#repository-id').should('be.visible'); + cy.get('#client-type').should('be.visible'); + cy.get('#re3data').should('be.visible'); + cy.get('#name').should('be.visible'); + cy.get('#name-field').should('be.visible'); + cy.get('#alternate-name').should('be.visible'); + cy.get('#system-email').should('be.visible'); + cy.get('#service-contact-given-name').should('be.visible'); + cy.get('#service-contact-family-name').should('be.visible'); + cy.get('#service-contact-email').should('be.visible'); + cy.get('#description').should('be.visible'); + cy.get('#url').should('be.visible'); + cy.get('#language').should('be.visible'); + cy.get('#software').should('be.visible'); + cy.get('#domains').should('be.visible'); + cy.get('#repository-type').should('be.visible'); + cy.get('#certificate').should('be.visible'); + cy.get('.alert.opt-in').contains(/The contacts entered may receive notifications/i) + .within(() => { + cy.get('a[href*="privacy.html"]').should('be.visible'); + } + ); + cy.get('button#update-repository').should('be.visible'); + cy.get('button').contains(/Cancel/i).should('be.visible'); + + cy.get('button').contains(/Cancel/i).click({force:true}); + }) + }); + + cy.on("url:changed", (newUrl) => { + expect(newUrl).to.contain("/repositories/datacite.test"); + }); + }); +}); \ No newline at end of file diff --git a/cypress/integration/client_admin/prefixes.test.ts b/cypress/integration/client_admin/prefixes.test.ts index efbc2bbec..427664860 100644 --- a/cypress/integration/client_admin/prefixes.test.ts +++ b/cypress/integration/client_admin/prefixes.test.ts @@ -32,9 +32,9 @@ describe('ACCEPTANCE: CLIENT_ADMIN | PREFIXES', () => { // Has tabs with correct one activated. cy.get('ul.nav-tabs li a').contains(/Info/i) - .and('have.attr', 'href').and('include', '/repositories/datacite.test/info'); - cy.get('ul.nav-tabs li a').contains(/Settings/i) .and('have.attr', 'href').and('include', '/repositories/datacite.test'); + cy.get('ul.nav-tabs li a').contains(/Settings/i) + .and('have.attr', 'href').and('include', '/repositories/datacite.test/settings'); cy.get('ul.nav-tabs li.active a').contains(/Prefixes/i) .and('have.attr', 'href').and('include', '/repositories/datacite.test/prefixes'); cy.get('ul.nav-tabs li a').contains(/DOIs/i) diff --git a/cypress/integration/client_admin/settings.test.ts b/cypress/integration/client_admin/settings.test.ts index 6d0af4123..755a4ebda 100644 --- a/cypress/integration/client_admin/settings.test.ts +++ b/cypress/integration/client_admin/settings.test.ts @@ -1,11 +1,6 @@ /// /* eslint-disable no-undef */ -function escapeRE(string) { - //return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string - return string.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); -} - describe('ACCEPTANCE: CLIENT_ADMIN | SETTINGS', () => { const waitTime = 1000; const waitTime2 = 2000; @@ -19,16 +14,16 @@ describe('ACCEPTANCE: CLIENT_ADMIN | SETTINGS', () => { Cypress.Cookies.preserveOnce('_fabrica', '_jwt', '_consent'); cy.wait(waitTime2); }); - it('is logged in to homepage', () => { - cy.visit('/'); - cy.url().should('include', '/repositories/datacite.test').then (() => { + it('is logged in to settings page', () => { + cy.visit('/repositories/datacite.test/settings'); + cy.url().should('include', '/repositories/datacite.test/settings').then (() => { cy.get('h2.work').contains('DataCite Test Repository'); cy.get('a#account_menu_link').should('contain', 'DATACITE.TEST'); cy.get('ul.nav-tabs li a').contains(/Info/i) - .and('have.attr', 'href').and('include', '/repositories/datacite.test/info'); - cy.get('ul.nav-tabs li.active a').contains(/Settings/i) .and('have.attr', 'href').and('include', '/repositories/datacite.test'); + cy.get('ul.nav-tabs li.active a').contains(/Settings/i) + .and('have.attr', 'href').and('include', '/repositories/datacite.test/settings'); cy.get('ul.nav-tabs li a').contains(/Prefixes/i) .and('have.attr', 'href').and('include', '/repositories/datacite.test/prefixes'); cy.get('ul.nav-tabs li a').contains(/DOIs/i) @@ -55,94 +50,4 @@ describe('ACCEPTANCE: CLIENT_ADMIN | SETTINGS', () => { cy.get('h5').contains(/Domain/i); }); }); }); - - it('/info redirects to homepage', () => { - cy.visit('/info'); - cy.url().should('include', '/repositories/datacite.test').then (() => { - cy.get('a#account_menu_link').should('contain', 'DATACITE.TEST'); - }); - }); - - it('/prefixes redirects to homepage', () => { - cy.visit('/prefixes'); - cy.url().should('include', '/repositories/datacite.test').then (() => { - cy.get('h2.work').contains('DataCite Test Repository'); - cy.get('a#account_menu_link').should('contain', 'DATACITE.TEST'); - }); - }); - - it('/dois redirects to homepage', () => { - cy.visit('/dois'); - cy.url().should('include', '/repositories/datacite.test').then (() => { - cy.get('h2.work').contains('DataCite Test Repository'); - cy.get('a#account_menu_link').should('contain', 'DATACITE.TEST'); - }); - }); - - it('has password settings page', () => { - cy.visit('/repositories/datacite.test/change').then (() => { - cy.url().should('include', '/repositories/datacite.test/change'); - cy.get('h2.work').contains('DataCite Test Repository'); - cy.get('a#account_menu_link').should('contain', 'DATACITE.TEST'); - - cy.get('h3').contains(/Set Password/i); - - cy.get('form').within(($form) => { - cy.get('input#password-input-field').should('be.visible'); - cy.get('input#confirm-password-input-field').should('be.visible'); - cy.get('button[type=submit]').should('be.visible'); - cy.get('button#cancel').should('be.visible'); - - cy.get('button#cancel').click({force:true}); - }); - }); - - cy.on("url:changed", (newUrl) => { - expect(newUrl).to.contain("/repositories/datacite.test") - }) - }); - - // TBD - Could do more testing here. Only cursory testing for - // presence of field objects. No testing of form behavior yet. - it('has repository settings page', () => { - cy.visit('/repositories/datacite.test/edit'); - cy.url().should('include', '/repositories/datacite.test/edit').then(() => { - - cy.get('h2.work').contains('DataCite Test Repository'); - cy.get('a#account_menu_link').should('contain', 'DATACITE.TEST'); - - cy.get('form').within(($form) => { - cy.get('#repository-id').should('be.visible'); - cy.get('#client-type').should('be.visible'); - cy.get('#re3data').should('be.visible'); - cy.get('#name').should('be.visible'); - cy.get('#name-field').should('be.visible'); - cy.get('#alternate-name').should('be.visible'); - cy.get('#system-email').should('be.visible'); - cy.get('#service-contact-given-name').should('be.visible'); - cy.get('#service-contact-family-name').should('be.visible'); - cy.get('#service-contact-email').should('be.visible'); - cy.get('#description').should('be.visible'); - cy.get('#url').should('be.visible'); - cy.get('#language').should('be.visible'); - cy.get('#software').should('be.visible'); - cy.get('#domains').should('be.visible'); - cy.get('#repository-type').should('be.visible'); - cy.get('#certificate').should('be.visible'); - cy.get('.alert.opt-in').contains(/The contacts entered may receive notifications/i) - .within(() => { - cy.get('a[href*="privacy.html"]').should('be.visible'); - } - ); - cy.get('button#update-repository').should('be.visible'); - cy.get('button').contains(/Cancel/i).should('be.visible'); - - cy.get('button').contains(/Cancel/i).click({force:true}); - }) - }); - - cy.on("url:changed", (newUrl) => { - expect(newUrl).to.contain("/repositories/datacite.test"); - }); - }); }); \ No newline at end of file diff --git a/cypress/integration/consortium_admin/info.test.ts b/cypress/integration/consortium_admin/info.test.ts index 706807ead..a3d9b0779 100644 --- a/cypress/integration/consortium_admin/info.test.ts +++ b/cypress/integration/consortium_admin/info.test.ts @@ -1,6 +1,10 @@ /// /* eslint-disable no-undef */ +function escapeRE(string) { + return string.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); +} + describe('ACCEPTANCE: CONSORTIUM_ADMIN | INFO', () => { const waitTime = 1000; const waitTime2 = 2000; @@ -15,17 +19,17 @@ describe('ACCEPTANCE: CONSORTIUM_ADMIN | INFO', () => { cy.wait(waitTime2); }); - it('is logged in to info page', () => { - cy.visit('/providers/dc/info'); - cy.url().should('include', '/providers/dc/info').then(() => { + it('is logged in to homepage', () => { + cy.visit('/providers/dc/'); + cy.url().should('include', '/providers/dc/').then(() => { cy.get('h2.work').contains('DataCite Consortium'); cy.get('a#account_menu_link').should('contain', 'DC'); cy.get('ul.nav-tabs li.active a').contains(/Info/i) - .and('have.attr', 'href').and('include', '/providers/dc/info'); - cy.get('ul.nav-tabs li a').contains(/Settings/i) .and('have.attr', 'href').and('include', '/providers/dc'); + cy.get('ul.nav-tabs li a').contains(/Settings/i) + .and('have.attr', 'href').and('include', '/providers/dc/settings'); cy.get('ul.nav-tabs li a').contains(/Consortium Organizations/i) .and('have.attr', 'href').and('include', '/providers/dc/organizations'); cy.get('ul.nav-tabs li a').contains(/Contacts/i) @@ -59,4 +63,126 @@ describe('ACCEPTANCE: CONSORTIUM_ADMIN | INFO', () => { }); }); }); + + it('/settings redirects to homepage', () => { + cy.visit('/settings'); + cy.url().should('include', '/providers/dc').then (() => { + cy.get('a#account_menu_link').should('contain', 'DC'); + }); + }); + + it('/providers redirects to homepage', () => { + cy.visit('/providers'); + cy.url().should('include', '/providers/dc').then (() => { + cy.get('a#account_menu_link').should('contain', 'DC'); + }); + }); + + it('/contacts redirects to homepage', () => { + cy.visit('/contacts'); + cy.url().should('include', '/providers/dc').then (() => { + cy.get('a#account_menu_link').should('contain', 'DC'); + }); + }); + + it('/repositories redirects to homepage', () => { + cy.visit('/repositories'); + cy.url().should('include', '/providers/dc').then (() => { + cy.get('a#account_menu_link').should('contain', 'DC'); + }); + }); + + it('/prefixes redirects to homepage', () => { + cy.visit('/prefixes'); + cy.url().should('include', '/providers/dc').then (() => { + cy.get('a#account_menu_link').should('contain', 'DC'); + }); + }); + + it('/dois redirects to homepage', () => { + cy.visit('/dois'); + cy.url().should('include', '/providers/dc').then (() => { + cy.get('a#account_menu_link').should('contain', 'DC'); + }); + }); + + it('has password settings page', () => { + cy.visit('/providers/dc/change'); + cy.url().should('include', '/providers/dc/change').then (() => { + + cy.get('h2.work').contains('DataCite Consortium'); + cy.get('a#account_menu_link').should('contain', 'DC'); + + cy.get('h3').contains(/Set Password/i); + + cy.get('form').within(($form) => { + cy.get('input#password-input-field').should('be.visible'); + cy.get('input#confirm-password-input-field').should('be.visible'); + cy.get('button[type=submit]').should('be.visible'); + cy.get('button').contains(/Cancel/i).should('be.visible'); + + cy.get('button').contains(/Cancel/i).click({force: true}) + }); + }); + + cy.on("url:changed", (newUrl) => { + expect(newUrl).to.contain("/providers/dc"); + }); + }); + + // TBD - Could do more testing here. Only cursory testing for + // presence of field objects. No testing of form behavior yet. + it('has a member settings page', () => { + cy.visit('/providers/dc/edit'); + cy.url().should('include', '/providers/dc/edit').then(() => { + + cy.get('h2.work').contains('DataCite Consortium'); + cy.get('a#account_menu_link').should('contain', 'DC'); + + cy.get('h3.edit').contains(/Update\s*Member/); + + cy.get('form').within(($form) => { + cy.get('h3.member-results').contains('Organization Information'); + cy.get('#member-id').should('be.visible'); + cy.get('#ror-id').should('be.visible'); + cy.get('#name').should('be.visible'); + cy.get('#display-name').should('be.visible'); + cy.get('#system-email').should('be.visible'); + cy.get('#group-email').should('be.visible'); + cy.get('#website').should('be.visible'); + cy.get('#twitter-handle').should('be.visible'); + cy.get('#organization-type').should('be.visible'); + cy.get('#focus-area').should('be.visible'); + cy.get('#description').should('be.visible'); + cy.get('#upload-file').contains(/Upload\s*Logo/); + + cy.get('h3.member-results').contains('Contact Information'); + cy.get('.alert-info').contains(/Contacts are created.*and then assigned roles here./i ) + cy.get('#voting-contact').should('be.visible'); + cy.get('#service-contact').should('be.visible'); + cy.get('#secondary-service-contact').should('be.visible'); + cy.get('#technical-contact').should('be.visible'); + cy.get('#secondary-technical-contact').should('be.visible'); + cy.get('#billing-contact').should('be.visible'); + cy.get('#secondary-billing-contact').should('be.visible'); + + cy.get('h3.member-results').contains('Billing Information'); + cy.get('#billing-information-department').should('be.visible'); + cy.get('#billing-information-organization').should('be.visible'); + cy.get('#billing-information-street').should('be.visible'); + cy.get('#billing-information-city').should('be.visible'); + cy.get('#billing-information-postcode').should('be.visible'); + cy.get('#billing-information-country').should('be.visible'); + cy.get('.alert-warning').contains(/The contacts entered may receive notifications/i ) + cy.get('button#update-provider').should('be.visible'); + cy.get('button').contains(/Cancel/i).should('be.visible'); + + cy.get('button').contains(/Cancel/i).should('be.visible').click({force: true}); + }) + }); + + cy.on("url:changed", (newUrl) => { + expect(newUrl).to.contain("/providers/dc"); + }); + }); }); diff --git a/cypress/integration/consortium_admin/settings.test.ts b/cypress/integration/consortium_admin/settings.test.ts index 9184df9e5..a6c15f8de 100644 --- a/cypress/integration/consortium_admin/settings.test.ts +++ b/cypress/integration/consortium_admin/settings.test.ts @@ -1,10 +1,6 @@ /// /* eslint-disable no-undef */ -function escapeRE(string) { - return string.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); -} - describe('ACCEPTANCE: CONSORTIUM_ADMIN | SETTINGS', () => { const waitTime = 1000; const waitTime2 = 2000; @@ -19,16 +15,16 @@ describe('ACCEPTANCE: CONSORTIUM_ADMIN | SETTINGS', () => { cy.wait(waitTime2); }); - it('is logged in to homepage', () => { - cy.visit('/providers/dc'); - cy.url().should('include', '/providers/dc').then (() => { + it('is logged in to settings page', () => { + cy.visit('/providers/dc/settings'); + cy.url().should('include', '/providers/dc/settings').then (() => { cy.get('h2.work').contains('DataCite Consortium'); cy.get('a#account_menu_link').should('contain', 'DC'); cy.get('ul.nav-tabs li a').contains(/Info/i) - .and('have.attr', 'href').and('include', '/providers/dc/info'); - cy.get('ul.nav-tabs li.active a').contains(/Settings/i) .and('have.attr', 'href').and('include', '/providers/dc'); + cy.get('ul.nav-tabs li.active a').contains(/Settings/i) + .and('have.attr', 'href').and('include', '/providers/dc/settings'); cy.get('ul.nav-tabs li a').contains(/Consortium Organizations/i) .and('have.attr', 'href').and('include', '/providers/dc/organizations'); cy.get('ul.nav-tabs li a').contains(/Contacts/i) @@ -90,126 +86,4 @@ describe('ACCEPTANCE: CONSORTIUM_ADMIN | SETTINGS', () => { cy.get('.icon-warning').contains(/Please provide this information./); }); }); - - it('/info redirects to homepage', () => { - cy.visit('/info'); - cy.url().should('include', '/providers/dc').then (() => { - cy.get('a#account_menu_link').should('contain', 'DC'); - }); - }); - - it('/providers redirects to homepage', () => { - cy.visit('/providers'); - cy.url().should('include', '/providers/dc').then (() => { - cy.get('a#account_menu_link').should('contain', 'DC'); - }); - }); - - it('/contacts redirects to homepage', () => { - cy.visit('/contacts'); - cy.url().should('include', '/providers/dc').then (() => { - cy.get('a#account_menu_link').should('contain', 'DC'); - }); - }); - - it('/repositories redirects to homepage', () => { - cy.visit('/repositories'); - cy.url().should('include', '/providers/dc').then (() => { - cy.get('a#account_menu_link').should('contain', 'DC'); - }); - }); - - it('/prefixes redirects to homepage', () => { - cy.visit('/prefixes'); - cy.url().should('include', '/providers/dc').then (() => { - cy.get('a#account_menu_link').should('contain', 'DC'); - }); - }); - - it('/dois redirects to homepage', () => { - cy.visit('/dois'); - cy.url().should('include', '/providers/dc').then (() => { - cy.get('a#account_menu_link').should('contain', 'DC'); - }); - }); - - it('has password settings page', () => { - cy.visit('/providers/dc/change'); - cy.url().should('include', '/providers/dc/change').then (() => { - - cy.get('h2.work').contains('DataCite Consortium'); - cy.get('a#account_menu_link').should('contain', 'DC'); - - cy.get('h3').contains(/Set Password/i); - - cy.get('form').within(($form) => { - cy.get('input#password-input-field').should('be.visible'); - cy.get('input#confirm-password-input-field').should('be.visible'); - cy.get('button[type=submit]').should('be.visible'); - cy.get('button').contains(/Cancel/i).should('be.visible'); - - cy.get('button').contains(/Cancel/i).click({force: true}) - }); - }); - - cy.on("url:changed", (newUrl) => { - expect(newUrl).to.contain("/providers/dc"); - }); - }); - - // TBD - Could do more testing here. Only cursory testing for - // presence of field objects. No testing of form behavior yet. - it('has a member settings page', () => { - cy.visit('/providers/dc/edit'); - cy.url().should('include', '/providers/dc/edit').then(() => { - - cy.get('h2.work').contains('DataCite Consortium'); - cy.get('a#account_menu_link').should('contain', 'DC'); - - cy.get('h3.edit').contains(/Update\s*Member/); - - cy.get('form').within(($form) => { - cy.get('h3.member-results').contains('Organization Information'); - cy.get('#member-id').should('be.visible'); - cy.get('#ror-id').should('be.visible'); - cy.get('#name').should('be.visible'); - cy.get('#display-name').should('be.visible'); - cy.get('#system-email').should('be.visible'); - cy.get('#group-email').should('be.visible'); - cy.get('#website').should('be.visible'); - cy.get('#twitter-handle').should('be.visible'); - cy.get('#organization-type').should('be.visible'); - cy.get('#focus-area').should('be.visible'); - cy.get('#description').should('be.visible'); - cy.get('#upload-file').contains(/Upload\s*Logo/); - - cy.get('h3.member-results').contains('Contact Information'); - cy.get('.alert-info').contains(/Contacts are created.*and then assigned roles here./i ) - cy.get('#voting-contact').should('be.visible'); - cy.get('#service-contact').should('be.visible'); - cy.get('#secondary-service-contact').should('be.visible'); - cy.get('#technical-contact').should('be.visible'); - cy.get('#secondary-technical-contact').should('be.visible'); - cy.get('#billing-contact').should('be.visible'); - cy.get('#secondary-billing-contact').should('be.visible'); - - cy.get('h3.member-results').contains('Billing Information'); - cy.get('#billing-information-department').should('be.visible'); - cy.get('#billing-information-organization').should('be.visible'); - cy.get('#billing-information-street').should('be.visible'); - cy.get('#billing-information-city').should('be.visible'); - cy.get('#billing-information-postcode').should('be.visible'); - cy.get('#billing-information-country').should('be.visible'); - cy.get('.alert-warning').contains(/The contacts entered may receive notifications/i ) - cy.get('button#update-provider').should('be.visible'); - cy.get('button').contains(/Cancel/i).should('be.visible'); - - cy.get('button').contains(/Cancel/i).should('be.visible').click({force: true}); - }) - }); - - cy.on("url:changed", (newUrl) => { - expect(newUrl).to.contain("/providers/dc"); - }); - }); }); \ No newline at end of file diff --git a/cypress/integration/organization_admin/info.test.ts b/cypress/integration/organization_admin/info.test.ts index b76bceaa5..647824f76 100644 --- a/cypress/integration/organization_admin/info.test.ts +++ b/cypress/integration/organization_admin/info.test.ts @@ -1,6 +1,10 @@ /// /* eslint-disable no-undef */ +function escapeRE(string) { + return string.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); +} + describe('ACCEPTANCE: ORGANIZATION_ADMIN | INFO', () => { const waitTime = 1000; const waitTime2 = 2000; @@ -15,17 +19,17 @@ describe('ACCEPTANCE: ORGANIZATION_ADMIN | INFO', () => { cy.wait(waitTime2); }); - it('is logged in to info page', () => { - cy.visit('/providers/datacite/info'); - cy.url().should('include', '/providers/datacite/info').then(() => { + it('is logged in to homepage', () => { + cy.visit('/providers/datacite'); + cy.url().should('include', '/providers/datacite').then(() => { cy.get('h2.work').contains('DataCite'); cy.get('a#account_menu_link').should('contain', 'DATACITE'); cy.get('ul.nav-tabs li.active a').contains(/Info/i) - .and('have.attr', 'href').and('include', '/providers/datacite/info'); - cy.get('ul.nav-tabs li a').contains(/Settings/i) .and('have.attr', 'href').and('include', '/providers/datacite'); + cy.get('ul.nav-tabs li a').contains(/Settings/i) + .and('have.attr', 'href').and('include', '/providers/datacite/settings'); cy.get('ul.nav-tabs li a').contains(/Contacts/i) .and('have.attr', 'href').and('include', '/providers/datacite/contacts'); cy.get('ul.nav-tabs li a').contains(/Repositories/i) @@ -50,4 +54,111 @@ describe('ACCEPTANCE: ORGANIZATION_ADMIN | INFO', () => { }); }); }); -}); + + it('/settings redirects to homepage', () => { + cy.visit('/settings'); + cy.url().should('include', '/providers/datacite').then (() => { + cy.get('a#account_menu_link').should('contain', 'DATACITE'); + }); + }); + + it('/contacts redirects to homepage', () => { + cy.visit('/contacts'); + cy.url().should('include', '/providers/datacite').then (() => { + cy.get('a#account_menu_link').should('contain', 'DATACITE'); + }); + }); + + it('/repositories redirects to homepage', () => { + cy.visit('/repositories'); + cy.url().should('include', '/providers/datacite').then (() => { + cy.get('a#account_menu_link').should('contain', 'DATACITE'); + }); + }); + + it('/prefixes redirects to homepage', () => { + cy.visit('/prefixes'); + cy.url().should('include', '/providers/datacite').then (() => { + cy.get('a#account_menu_link').should('contain', 'DATACITE'); + }); + }); + + it('/dois redirects to homepage', () => { + cy.visit('/dois'); + cy.url().should('include', '/providers/datacite').then (() => { + cy.get('a#account_menu_link').should('contain', 'DATACITE'); + }); + }); + + it('has password settings page', () => { + cy.visit('/providers/datacite/change'); + cy.url().should('include', '/providers/datacite/change').then (() => { + + cy.get('h2.work').contains('DataCite'); + cy.get('a#account_menu_link').should('contain', 'DATACITE'); + + cy.get('h3').contains(/Set Password/i); + + cy.get('form').within(($form) => { + cy.get('input#password-input-field').should('be.visible'); + cy.get('input#confirm-password-input-field').should('be.visible'); + cy.get('button[type=submit]').should('be.visible'); + cy.get('button').contains(/Cancel/i).should('be.visible') + + cy.get('button').contains(/Cancel/i).click({force: true}); + }); + }) + + cy.on("url:changed", (newUrl) => { + expect(newUrl).to.contain("/providers/datacite"); + }); + }); + + // TBD - Could do more testing here. Only cursory testing for + // presence of field objects. No testing of form behavior yet. + it('has an organization settings page', () => { + cy.visit('/providers/datacite/edit'); + cy.url().should('include', '/providers/datacite/edit').then(() => { + + cy.get('h2.work').contains('DataCite'); + cy.get('a#account_menu_link').should('contain', 'DATACITE'); + + cy.get('h3.edit').contains(/Update\s*Organization/); + + cy.get('form').within(($form) => { + cy.get('h3.member-results').contains('Organization Information'); + cy.get('#member-id').should('be.visible'); + cy.get('#ror-id').should('be.visible'); + cy.get('#name').should('be.visible'); + cy.get('#display-name').should('be.visible'); + cy.get('#system-email').should('be.visible'); + cy.get('#group-email').should('be.visible'); + cy.get('#website').should('be.visible'); + cy.get('#twitter-handle').should('be.visible'); + cy.get('#country').should('be.visible'); + cy.get('#organization-type').should('be.visible'); + cy.get('#focus-area').should('be.visible'); + cy.get('#description').should('be.visible'); + + cy.get('h3.member-results').contains('Contact Information'); + cy.get('.alert-info').contains(/Contacts are created.*and then assigned roles here./i ) + cy.get('#service-contact').should('be.visible'); + cy.get('#secondary-service-contact').should('be.visible'); + cy.get('#technical-contact').should('be.visible'); + cy.get('#secondary-technical-contact').should('be.visible'); + cy.get('.alert-warning').contains(/The contacts entered may receive notifications/i) + .within(() => { + cy.get('a[href*="privacy.html"]').should('be.visible'); + } + ); + cy.get('button#update-provider').should('be.visible'); + cy.get('button').contains(/Cancel/i).should('be.visible'); + + cy.get('button').contains(/Cancel/i).click({force: true}); + }) + }); + cy.on("url:changed", (newUrl) => { + expect(newUrl).to.contain("/providers/datacite"); + }); + }); +}); \ No newline at end of file diff --git a/cypress/integration/organization_admin/settings.test.ts b/cypress/integration/organization_admin/settings.test.ts index 1fbe7da21..9e991bc5c 100644 --- a/cypress/integration/organization_admin/settings.test.ts +++ b/cypress/integration/organization_admin/settings.test.ts @@ -1,10 +1,6 @@ /// /* eslint-disable no-undef */ -function escapeRE(string) { - return string.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); -} - describe('ACCEPTANCE: ORGANIZATION_ADMIN | SETTINGS', () => { const waitTime = 1000; const waitTime2 = 2000; @@ -19,16 +15,16 @@ describe('ACCEPTANCE: ORGANIZATION_ADMIN | SETTINGS', () => { cy.wait(waitTime2); }); - it('is logged in to homepage', () => { - cy.visit('/providers/datacite'); - cy.url().should('include', '/providers/datacite').then (() => { + it('is logged in to settings page', () => { + cy.visit('/providers/datacite/settings'); + cy.url().should('include', '/providers/datacite/settings').then (() => { cy.get('h2.work').contains('DataCite'); cy.get('a#account_menu_link').should('contain', 'DATACITE'); cy.get('ul.nav-tabs li a').contains(/Info/i) - .and('have.attr', 'href').and('include', '/providers/datacite/info'); - cy.get('ul.nav-tabs li.active a').contains(/Settings/i) .and('have.attr', 'href').and('include', '/providers/datacite'); + cy.get('ul.nav-tabs li.active a').contains(/Settings/i) + .and('have.attr', 'href').and('include', '/providers/datacite/settings'); cy.get('ul.nav-tabs li a').contains(/Contacts/i) .and('have.attr', 'href').and('include', '/providers/datacite/contacts'); cy.get('ul.nav-tabs li a').contains(/Repositories/i) @@ -95,112 +91,4 @@ describe('ACCEPTANCE: ORGANIZATION_ADMIN | SETTINGS', () => { }); }); }); - - it('/info redirects to homepage', () => { - cy.visit('/info'); - cy.url().should('include', '/providers/datacite').then (() => { - cy.get('a#account_menu_link').should('contain', 'DATACITE'); - }); - }); - - it('/contacts redirects to homepage', () => { - cy.visit('/contacts'); - cy.url().should('include', '/providers/datacite').then (() => { - cy.get('a#account_menu_link').should('contain', 'DATACITE'); - }); - }); - - it('/repositories redirects to homepage', () => { - cy.visit('/repositories'); - cy.url().should('include', '/providers/datacite').then (() => { - cy.get('a#account_menu_link').should('contain', 'DATACITE'); - }); - }); - - it('/prefixes redirects to homepage', () => { - cy.visit('/prefixes'); - cy.url().should('include', '/providers/datacite').then (() => { - cy.get('a#account_menu_link').should('contain', 'DATACITE'); - }); - }); - - it('/dois redirects to homepage', () => { - cy.visit('/dois'); - cy.url().should('include', '/providers/datacite').then (() => { - cy.get('a#account_menu_link').should('contain', 'DATACITE'); - }); - }); - - it('has password settings page', () => { - cy.visit('/providers/datacite/change'); - cy.url().should('include', '/providers/datacite/change').then (() => { - - cy.get('h2.work').contains('DataCite'); - cy.get('a#account_menu_link').should('contain', 'DATACITE'); - - cy.get('h3').contains(/Set Password/i); - - cy.get('form').within(($form) => { - cy.get('input#password-input-field').should('be.visible'); - cy.get('input#confirm-password-input-field').should('be.visible'); - cy.get('button[type=submit]').should('be.visible'); - cy.get('button').contains(/Cancel/i).should('be.visible') - - cy.get('button').contains(/Cancel/i).click({force: true}); - }); - }) - - cy.on("url:changed", (newUrl) => { - expect(newUrl).to.contain("/providers/datacite"); - }); - }); - - // TBD - Could do more testing here. Only cursory testing for - // presence of field objects. No testing of form behavior yet. - it('has an organization settings page', () => { - cy.visit('/providers/datacite/edit'); - cy.url().should('include', '/providers/datacite/edit').then(() => { - - cy.get('h2.work').contains('DataCite'); - cy.get('a#account_menu_link').should('contain', 'DATACITE'); - - cy.get('h3.edit').contains(/Update\s*Organization/); - - cy.get('form').within(($form) => { - cy.get('h3.member-results').contains('Organization Information'); - cy.get('#member-id').should('be.visible'); - cy.get('#ror-id').should('be.visible'); - cy.get('#name').should('be.visible'); - cy.get('#display-name').should('be.visible'); - cy.get('#system-email').should('be.visible'); - cy.get('#group-email').should('be.visible'); - cy.get('#website').should('be.visible'); - cy.get('#twitter-handle').should('be.visible'); - cy.get('#country').should('be.visible'); - cy.get('#organization-type').should('be.visible'); - cy.get('#focus-area').should('be.visible'); - cy.get('#description').should('be.visible'); - - cy.get('h3.member-results').contains('Contact Information'); - cy.get('.alert-info').contains(/Contacts are created.*and then assigned roles here./i ) - cy.get('#service-contact').should('be.visible'); - cy.get('#secondary-service-contact').should('be.visible'); - cy.get('#technical-contact').should('be.visible'); - cy.get('#secondary-technical-contact').should('be.visible'); - cy.get('.alert-warning').contains(/The contacts entered may receive notifications/i) - .within(() => { - cy.get('a[href*="privacy.html"]').should('be.visible'); - } - ); - cy.get('button#update-provider').should('be.visible'); - cy.get('button').contains(/Cancel/i).should('be.visible'); - - cy.get('button').contains(/Cancel/i).click({force: true}); - }) - }); - - cy.on("url:changed", (newUrl) => { - expect(newUrl).to.contain("/providers/datacite"); - }); - }); }); \ No newline at end of file diff --git a/cypress/integration/staff_admin/admin.test.ts b/cypress/integration/staff_admin/admin.test.ts index 94a7a0796..af39fb9a0 100644 --- a/cypress/integration/staff_admin/admin.test.ts +++ b/cypress/integration/staff_admin/admin.test.ts @@ -53,16 +53,16 @@ describe('Admin: Admin', () => { it('visiting homepage', () => { cy.visit('/'); cy.get('h2.work').contains('DataCite'); - cy.get('li a.nav-link.active').contains('Settings'); + cy.get('li a.nav-link.active').contains('Info'); }); - it('visiting info', () => { - cy.visit('/info'); + it('visiting settings', () => { + cy.visit('/settings'); cy.location().should((loc) => { - expect(loc.pathname).to.eq('/info'); + expect(loc.pathname).to.eq('/settings'); }); cy.get('h2.work').contains('DataCite'); - cy.get('li a.nav-link.active').contains('Info'); + cy.get('li a.nav-link.active').contains('Settings'); }); it('visiting members', () => { diff --git a/cypress/integration/staff_admin/info.test.ts b/cypress/integration/staff_admin/info.test.ts index 3d04200a6..7ff0b34bf 100644 --- a/cypress/integration/staff_admin/info.test.ts +++ b/cypress/integration/staff_admin/info.test.ts @@ -1,6 +1,10 @@ /// /* eslint-disable no-undef */ +function escapeRE(string) { + return string.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); +} + describe('ACCEPTANCE: STAFF_ADMIN | INFO', () => { const waitTime = 1000; const waitTime2 = 2000; @@ -16,16 +20,16 @@ describe('ACCEPTANCE: STAFF_ADMIN | INFO', () => { }); it('is logged in to info page', () => { - cy.visit('/info'); - cy.url().should('include', '/info').then(() => { + cy.visit('/'); + cy.url().should('include', '/').then(() => { cy.get('h2.work').contains('DataCite'); cy.get('a#account_menu_link').should('contain', 'ADMIN'); cy.get('ul.nav-tabs li.active a').contains(/Info/i) - .and('have.attr', 'href').and('include', '/info'); - cy.get('ul.nav-tabs li a').contains(/Settings/i) .and('have.attr', 'href').and('include', '/'); + cy.get('ul.nav-tabs li a').contains(/Settings/i) + .and('have.attr', 'href').and('include', '/settings'); cy.get('ul.nav-tabs li a').contains(/Members/i) .and('have.attr', 'href').and('include', '/providers'); cy.get('ul.nav-tabs li a').contains(/Contacts/i) @@ -61,4 +65,113 @@ describe('ACCEPTANCE: STAFF_ADMIN | INFO', () => { }); }); }); -}); + + it('/settings - no redirect', () => { + cy.visit('/settings'); + cy.url().should('include', '/settings').then (() => { + cy.get('h2.work').contains('DataCite'); + cy.get('a#account_menu_link').should('contain', 'ADMIN'); + }); + }); + + it('/providers - no redirect', () => { + cy.visit('/providers'); + cy.url().should('include', '/providers').then (() => { + cy.get('h2.work').contains('DataCite'); + cy.get('a#account_menu_link').should('contain', 'ADMIN'); + }); + }); + + it('/contacts - no redirect', () => { + cy.visit('/contacts'); + cy.url().should('include', '/contacts').then (() => { + cy.get('h2.work').contains('DataCite'); + cy.get('a#account_menu_link').should('contain', 'ADMIN'); + }); + }); + + it('/users - no redirect', () => { + cy.visit('/users'); + cy.url().should('include', '/users').then (() => { + cy.get('h2.work').contains('DataCite'); + cy.get('a#account_menu_link').should('contain', 'ADMIN'); + }); + }); + + it('/repositories - no redirect', () => { + cy.visit('/repositories'); + cy.url().should('include', '/repositories').then (() => { + cy.get('h2.work').contains('DataCite'); + cy.get('a#account_menu_link').should('contain', 'ADMIN'); + }); + }); + + it('/prefixes - no redirect', () => { + cy.visit('/prefixes'); + cy.url().should('include', '/prefixes').then (() => { + cy.get('h2.work').contains('DataCite'); + cy.get('a#account_menu_link').should('contain', 'ADMIN'); + }); + }); + + it('/dois - no redirect', () => { + cy.visit('/dois'); + cy.url().should('include', '/dois').then (() => { + cy.get('h2.work').contains('DataCite'); + cy.get('a#account_menu_link').should('contain', 'ADMIN'); + }); + }); + + it('has password settings page', () => { + cy.visit('/change'); + cy.url().should('include', '/change').then (() => { + + cy.get('h2.work').contains('DataCite'); + cy.get('a#account_menu_link').should('contain', 'ADMIN'); + + cy.get('h3').contains(/Set Password/i); + + cy.get('form').within(($form) => { + cy.get('input#password-input-field').should('be.visible'); + cy.get('input#confirm-password-input-field').should('be.visible'); + cy.get('button[type=submit]').should('be.visible'); + cy.get('button').contains(/Cancel/i).should('be.visible'); + + cy.get('button').contains(/Cancel/i).click({force:true}); + }); + }); + + cy.on("url:changed", (newUrl) => { + expect(newUrl).to.contain("/"); + }); + }); + + // TBD - Could do more testing here. Only cursory testing for + // presence of field objects. No testing of form behavior yet. + it('has an account settings page', () => { + cy.visit('/edit'); + cy.url().should('include', '/edit').then(() => { + + cy.get('h2.work').contains('DataCite'); + cy.get('a#account_menu_link').should('contain', 'ADMIN'); + + cy.get('form').within(($form) => { + cy.get('#member-id').should('be.visible'); + cy.get('#ror-id').should('be.visible'); + cy.get('#system-email').should('be.visible'); + cy.get('#website').should('be.visible'); + cy.get('#twitter-handle').should('be.visible'); + cy.get('#description').should('be.visible'); + cy.get('#country').should('be.visible'); + cy.get('button#update-provider').should('be.visible'); + cy.get('button').contains(/Cancel/i).should('be.visible'); + + cy.get('button').contains(/Cancel/i).click({force:true}); + }); + }); + + cy.on("url:changed", (newUrl) => { + expect(newUrl).to.contain("/"); + }); + }); +}); \ No newline at end of file diff --git a/cypress/integration/staff_admin/settings.test.ts b/cypress/integration/staff_admin/settings.test.ts index 0e79051a0..daf2147e8 100644 --- a/cypress/integration/staff_admin/settings.test.ts +++ b/cypress/integration/staff_admin/settings.test.ts @@ -1,10 +1,6 @@ /// /* eslint-disable no-undef */ -function escapeRE(string) { - return string.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); -} - describe('ACCEPTANCE: STAFF_ADMIN | SETTINGS', () => { const waitTime = 1000; const waitTime2 = 2000; @@ -19,16 +15,16 @@ describe('ACCEPTANCE: STAFF_ADMIN | SETTINGS', () => { cy.wait(waitTime2); }); - it('is logged in to homepage', () => { - cy.visit('/'); - cy.url().should('include', '/').then (() => { + it('is logged in to settings page', () => { + cy.visit('/settings'); + cy.url().should('include', '/settings').then (() => { cy.get('h2.work').contains('DataCite'); cy.get('a#account_menu_link').should('contain', 'ADMIN'); cy.get('ul.nav-tabs li a').contains(/Info/i) - .and('have.attr', 'href').and('include', '/info'); - cy.get('ul.nav-tabs li.active a').contains(/Settings/i) .and('have.attr', 'href').and('include', '/'); + cy.get('ul.nav-tabs li.active a').contains(/Settings/i) + .and('have.attr', 'href').and('include', '/settings'); cy.get('ul.nav-tabs li a').contains(/Members/i) .and('have.attr', 'href').and('include', '/providers'); cy.get('ul.nav-tabs li a').contains(/Contacts/i) @@ -66,113 +62,4 @@ describe('ACCEPTANCE: STAFF_ADMIN | SETTINGS', () => { }); }); }); - - it('/info - no redirect', () => { - cy.visit('/info'); - cy.url().should('include', '/info').then (() => { - cy.get('h2.work').contains('DataCite'); - cy.get('a#account_menu_link').should('contain', 'ADMIN'); - }); - }); - - it('/providers - no redirect', () => { - cy.visit('/providers'); - cy.url().should('include', '/providers').then (() => { - cy.get('h2.work').contains('DataCite'); - cy.get('a#account_menu_link').should('contain', 'ADMIN'); - }); - }); - - it('/contacts - no redirect', () => { - cy.visit('/contacts'); - cy.url().should('include', '/contacts').then (() => { - cy.get('h2.work').contains('DataCite'); - cy.get('a#account_menu_link').should('contain', 'ADMIN'); - }); - }); - - it('/users - no redirect', () => { - cy.visit('/users'); - cy.url().should('include', '/users').then (() => { - cy.get('h2.work').contains('DataCite'); - cy.get('a#account_menu_link').should('contain', 'ADMIN'); - }); - }); - - it('/repositories - no redirect', () => { - cy.visit('/repositories'); - cy.url().should('include', '/repositories').then (() => { - cy.get('h2.work').contains('DataCite'); - cy.get('a#account_menu_link').should('contain', 'ADMIN'); - }); - }); - - it('/prefixes - no redirect', () => { - cy.visit('/prefixes'); - cy.url().should('include', '/prefixes').then (() => { - cy.get('h2.work').contains('DataCite'); - cy.get('a#account_menu_link').should('contain', 'ADMIN'); - }); - }); - - it('/dois - no redirect', () => { - cy.visit('/dois'); - cy.url().should('include', '/dois').then (() => { - cy.get('h2.work').contains('DataCite'); - cy.get('a#account_menu_link').should('contain', 'ADMIN'); - }); - }); - - it('has password settings page', () => { - cy.visit('/change'); - cy.url().should('include', '/change').then (() => { - - cy.get('h2.work').contains('DataCite'); - cy.get('a#account_menu_link').should('contain', 'ADMIN'); - - cy.get('h3').contains(/Set Password/i); - - cy.get('form').within(($form) => { - cy.get('input#password-input-field').should('be.visible'); - cy.get('input#confirm-password-input-field').should('be.visible'); - cy.get('button[type=submit]').should('be.visible'); - cy.get('button').contains(/Cancel/i).should('be.visible'); - - cy.get('button').contains(/Cancel/i).click({force:true}); - }); - }); - - cy.on("url:changed", (newUrl) => { - expect(newUrl).to.contain("/"); - }); - }); - - // TBD - Could do more testing here. Only cursory testing for - // presence of field objects. No testing of form behavior yet. - it('has an account settings page', () => { - cy.visit('/edit'); - cy.url().should('include', '/edit').then(() => { - - cy.get('h2.work').contains('DataCite'); - cy.get('a#account_menu_link').should('contain', 'ADMIN'); - - cy.get('form').within(($form) => { - cy.get('#member-id').should('be.visible'); - cy.get('#ror-id').should('be.visible'); - cy.get('#system-email').should('be.visible'); - cy.get('#website').should('be.visible'); - cy.get('#twitter-handle').should('be.visible'); - cy.get('#description').should('be.visible'); - cy.get('#country').should('be.visible'); - cy.get('button#update-provider').should('be.visible'); - cy.get('button').contains(/Cancel/i).should('be.visible'); - - cy.get('button').contains(/Cancel/i).click({force:true}); - }); - }); - - cy.on("url:changed", (newUrl) => { - expect(newUrl).to.contain("/"); - }); - }); }); \ No newline at end of file diff --git a/cypress/integration/ui/login.test.ts b/cypress/integration/ui/login.test.ts index d284e14d5..b9d58b28e 100644 --- a/cypress/integration/ui/login.test.ts +++ b/cypress/integration/ui/login.test.ts @@ -44,14 +44,14 @@ describe('ACCEPTANCE: UI | LOGIN', function () { cy.url().should('include', '/sign-in') }) - it('redirects to account SETTINGS tab on success', function () { + it('redirects to account INFO tab on success', function () { cy.get('input#account-field').type(username) cy.get('input#password-field').type(password, { log: false }) cy.get('div.register-card form').submit() - // we should be redirected to SETTINGS for this account + // we should be redirected to INFO for this account cy.url().should('include', '/repositories/datacite.test') - cy.contains('ul.nav-tabs li.active a', "Settings") + cy.contains('ul.nav-tabs li.active a', "Info") // account link should have our username cy.get('#account_menu_link').contains(new RegExp(username, 'i')) From 1bed37754f66555559e31a3124d5301a087510f0 Mon Sep 17 00:00:00 2001 From: Bryceson Laing Date: Wed, 26 Oct 2022 06:22:08 -0700 Subject: [PATCH 015/106] Fabrica Improvements - task 2 (updated tests) --- tests/integration/components/index-info-test.js | 2 +- tests/integration/components/provider-info-test.js | 2 +- tests/integration/components/repository-info-test.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/integration/components/index-info-test.js b/tests/integration/components/index-info-test.js index b976794be..2ee47ae13 100644 --- a/tests/integration/components/index-info-test.js +++ b/tests/integration/components/index-info-test.js @@ -16,7 +16,7 @@ module('Integration | Component | index-info', function (hooks) { assert .dom(this.element) .hasText( - `Members by year 0 ${startDate+endDate} Repositories by year 0 ${startDate+endDate} DOIs by year 0 in ${currentYear.toString()} ${startDate+endDate}` + `Role: Members by year 0 ${startDate+endDate} Repositories by year 0 ${startDate+endDate} DOIs by year 0 in ${currentYear.toString()} ${startDate+endDate}` ); }); }); diff --git a/tests/integration/components/provider-info-test.js b/tests/integration/components/provider-info-test.js index 40036736c..c052f92b0 100644 --- a/tests/integration/components/provider-info-test.js +++ b/tests/integration/components/provider-info-test.js @@ -16,7 +16,7 @@ module('Integration | Component | provider-info', function (hooks) { assert .dom(this.element) .hasText( - `Repositories by year 0 20122022 DOIs by year 0 in ${currentYear} ${startDate+endDate}` + `Role: Repositories by year 0 20122022 DOIs by year 0 in ${currentYear} ${startDate+endDate}` ); }); }); diff --git a/tests/integration/components/repository-info-test.js b/tests/integration/components/repository-info-test.js index 1b6d41af6..05ddf8025 100644 --- a/tests/integration/components/repository-info-test.js +++ b/tests/integration/components/repository-info-test.js @@ -13,6 +13,6 @@ module('Integration | Component | repository-info', function (hooks) { let startDate = (currentYear - 10).toString(); let endDate = currentYear.toString(); - assert.dom(this.element).hasText(`DOIs by year 0 in ${currentYear} ${startDate+endDate}`); + assert.dom(this.element).hasText(`Role: DOIs by year 0 in ${currentYear} ${startDate+endDate}`); }); }); From 418025a187cee9662d403c2bc33d96f7e6591bc5 Mon Sep 17 00:00:00 2001 From: Cody Ross Date: Wed, 26 Oct 2022 16:06:11 -0400 Subject: [PATCH 016/106] Moves clientTypeList and softwareList to repository model file. Adds values to softwareList. --- app/components/repository-show.js | 16 +--------------- .../providers/show/repositories/new.js | 17 +---------------- app/controllers/repositories/show/edit.js | 16 +--------------- app/models/repository.js | 18 ++++++++++++++++++ 4 files changed, 21 insertions(+), 46 deletions(-) diff --git a/app/components/repository-show.js b/app/components/repository-show.js index e82cfeb01..f7da2ced3 100644 --- a/app/components/repository-show.js +++ b/app/components/repository-show.js @@ -6,21 +6,7 @@ import fetch from 'fetch'; import ENV from 'bracco/config/environment'; import { capitalize } from '@ember/string'; import langs from 'langs'; - -const clientTypeList = ['repository', 'periodical']; -const softwareList = [ - 'CKAN', - 'Dataverse', - 'DSpace', - 'EPrints', - 'Fedora', - 'Invenio', - 'Islandora', - 'Nesstar', - 'Open Journal Systems (OJS)', - 'Samvera', - 'Other' -]; +import { clientTypeList, softwareList } from 'bracco/models/repository' export default Component.extend({ currentUser: service(), diff --git a/app/controllers/providers/show/repositories/new.js b/app/controllers/providers/show/repositories/new.js index 51dd7964a..e252ebc93 100644 --- a/app/controllers/providers/show/repositories/new.js +++ b/app/controllers/providers/show/repositories/new.js @@ -5,22 +5,7 @@ import { capitalize } from '@ember/string'; import langs from 'langs'; import { A } from '@ember/array'; import prefix from 'bracco/abilities/prefix'; - -const clientTypeList = ['repository', 'periodical']; -const softwareList = [ - 'CKAN', - 'Dataverse', - 'DSpace', - 'EPrints', - 'Fedora', - 'Invenio', - 'Islandora', - 'Nesstar', - 'Open Journal Systems (OJS)', - 'Opus', - 'Samvera', - 'Other' -]; +import { clientTypeList, softwareList } from 'bracco/models/repository' export default Controller.extend({ store: service(), diff --git a/app/controllers/repositories/show/edit.js b/app/controllers/repositories/show/edit.js index 516ecbe1e..a3a233b48 100644 --- a/app/controllers/repositories/show/edit.js +++ b/app/controllers/repositories/show/edit.js @@ -3,21 +3,7 @@ import { inject as service } from '@ember/service'; import { A } from '@ember/array'; import { capitalize } from '@ember/string'; import langs from 'langs'; - -const clientTypeList = ['repository', 'periodical']; -const softwareList = [ - 'CKAN', - 'Dataverse', - 'DSpace', - 'EPrints', - 'Fedora', - 'Invenio', - 'Islandora', - 'Nesstar', - 'Open Journal Systems (OJS)', - 'Samvera', - 'Other' -]; +import { clientTypeList, softwareList } from 'bracco/models/repository' export default Controller.extend({ currentUser: service(), diff --git a/app/models/repository.js b/app/models/repository.js index 353f99ecc..4fc1ded13 100644 --- a/app/models/repository.js +++ b/app/models/repository.js @@ -5,6 +5,24 @@ import { array, fragment } from 'ember-data-model-fragments/attributes'; import { validator, buildValidations } from 'ember-cp-validations'; import isEmpty from 'bracco/utils/is-empty'; +export const clientTypeList = ['repository', 'periodical']; +export const softwareList = [ + 'CKAN', + 'Dataverse', + 'DSpace', + 'EPrints', + 'Fedora', + 'Invenio', + 'Islandora', + 'Nesstar', + 'Open Journal Systems (OJS)', + 'Samvera', + 'OPUS', + 'Pubman', + 'MyCoRe', + 'Other' +]; + const Validations = buildValidations({ symbol: [ validator('presence', true), From b87cdff0e912aef2535c584b171ddade975a3415 Mon Sep 17 00:00:00 2001 From: Cody Ross Date: Wed, 26 Oct 2022 16:07:54 -0400 Subject: [PATCH 017/106] Moves organizationTypeList, memberTypeList, focusAreaList and nonProfitStatusList to provider model file. Adds value to organizationTypeList. --- app/controllers/providers/new.js | 31 +------------------ app/controllers/providers/show/edit.js | 31 +------------------ .../providers/show/organizations/new.js | 31 +------------------ app/models/provider.js | 30 ++++++++++++++++++ 4 files changed, 33 insertions(+), 90 deletions(-) diff --git a/app/controllers/providers/new.js b/app/controllers/providers/new.js index 6f11e7218..c159e00b2 100644 --- a/app/controllers/providers/new.js +++ b/app/controllers/providers/new.js @@ -4,6 +4,7 @@ import { computed } from '@ember/object'; import { w } from '@ember/string'; import countryList from 'iso-3166-country-list'; import ENV from 'bracco/config/environment'; +import { organizationTypeList, memberTypeList, focusAreaList, nonProfitStatusList } from 'bracco/models/provider'; // states and provinces use iso-3166-2 codes // TODO add Brazil, India, Ireland, Italy, Mexico, all supported in Salesforce @@ -130,36 +131,6 @@ const stateListAustralia = [ { code: 'AU-NT', name: 'Northern Territory' } ]; -const organizationTypeList = [ - 'researchInstitution', - 'academicInstitution', - 'governmentAgency', - 'nationalInstitution', - 'professionalSociety', - 'publisher', - 'serviceProvider', - 'other' -]; -const memberTypeList = [ - 'consortium', - 'consortium_organization', - 'contractual_member', - 'direct_member', - 'member_only', - 'developer' -]; -const focusAreaList = [ - 'naturalSciences', - 'engineeringAndTechnology', - 'medicalAndHealthSciences', - 'agriculturalSciences', - 'socialSciences', - 'humanities', - 'general' -]; - -const nonProfitStatusList = ['non-profit', 'for-profit']; - export default Controller.extend({ store: service(), features: service(), diff --git a/app/controllers/providers/show/edit.js b/app/controllers/providers/show/edit.js index 1d12ec6c9..c236759db 100644 --- a/app/controllers/providers/show/edit.js +++ b/app/controllers/providers/show/edit.js @@ -5,6 +5,7 @@ import { w } from '@ember/string'; import countryList from 'iso-3166-country-list'; import FileReader from 'ember-file-upload/system/file-reader'; import ENV from 'bracco/config/environment'; +import { organizationTypeList, memberTypeList, focusAreaList, nonProfitStatusList } from 'bracco/models/provider'; // states and provinces use iso-3166-2 codes const stateList = [ @@ -130,36 +131,6 @@ const stateListAustralia = [ { code: 'AU-NT', name: 'Northern Territory' } ]; -const organizationTypeList = [ - 'researchInstitution', - 'academicInstitution', - 'governmentAgency', - 'nationalInstitution', - 'professionalSociety', - 'publisher', - 'serviceProvider', - 'other' -]; -const memberTypeList = [ - 'consortium', - 'consortium_organization', - 'contractual_member', - 'direct_member', - 'member_only', - 'developer' -]; -const focusAreaList = [ - 'naturalSciences', - 'engineeringAndTechnology', - 'medicalAndHealthSciences', - 'agriculturalSciences', - 'socialSciences', - 'humanities', - 'general' -]; - -const nonProfitStatusList = ['non-profit', 'for-profit']; - export default Controller.extend({ store: service(), features: service(), diff --git a/app/controllers/providers/show/organizations/new.js b/app/controllers/providers/show/organizations/new.js index fa1ec5070..09f03220b 100644 --- a/app/controllers/providers/show/organizations/new.js +++ b/app/controllers/providers/show/organizations/new.js @@ -1,36 +1,7 @@ import Controller from '@ember/controller'; import { inject as service } from '@ember/service'; import countryList from 'iso-3166-country-list'; - -const organizationTypeList = [ - 'researchInstitution', - 'academicInstitution', - 'governmentAgency', - 'nationalInstitution', - 'professionalSociety', - 'publisher', - 'serviceProvider', - 'other' -]; -const memberTypeList = [ - 'consortium', - 'consortium_organization', - 'contractual_member', - 'direct_member', - 'member_only', - 'registration_agency' -]; -const focusAreaList = [ - 'naturalSciences', - 'engineeringAndTechnology', - 'medicalAndHealthSciences', - 'agriculturalSciences', - 'socialSciences', - 'humanities', - 'general' -]; - -const nonProfitStatusList = ['non-profit', 'for-profit']; +import { organizationTypeList, memberTypeList, focusAreaList, nonProfitStatusList } from 'bracco/models/provider'; export default Controller.extend({ store: service(), diff --git a/app/models/provider.js b/app/models/provider.js index b1fb64de7..46760fa1a 100644 --- a/app/models/provider.js +++ b/app/models/provider.js @@ -9,6 +9,36 @@ import { fragment } from 'ember-data-model-fragments/attributes'; import addressFormatter from '@fragaria/address-formatter'; import ENV from 'bracco/config/environment'; +export const organizationTypeList = [ + 'researchInstitution', + 'academicInstitution', + 'governmentAgency', + 'nationalInstitution', + 'professionalSociety', + 'publisher', + 'serviceProvider', + 'internationalOrganization', + 'other' +]; +export const memberTypeList = [ + 'consortium', + 'consortium_organization', + 'contractual_member', + 'direct_member', + 'member_only', + 'registration_agency' +]; +export const focusAreaList = [ + 'naturalSciences', + 'engineeringAndTechnology', + 'medicalAndHealthSciences', + 'agriculturalSciences', + 'socialSciences', + 'humanities', + 'general' +]; +export const nonProfitStatusList = ['non-profit', 'for-profit']; + const Validations = buildValidations({ symbol: [ validator('presence', true), From 10b269081b62a6852144a68cc77d2bc2f20694a6 Mon Sep 17 00:00:00 2001 From: Cody Ross Date: Mon, 31 Oct 2022 14:07:11 -0400 Subject: [PATCH 018/106] Alphabatizes softwareList. --- app/models/repository.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/repository.js b/app/models/repository.js index 4fc1ded13..2838eb281 100644 --- a/app/models/repository.js +++ b/app/models/repository.js @@ -8,18 +8,18 @@ import isEmpty from 'bracco/utils/is-empty'; export const clientTypeList = ['repository', 'periodical']; export const softwareList = [ 'CKAN', - 'Dataverse', 'DSpace', + 'Dataverse', 'EPrints', 'Fedora', 'Invenio', 'Islandora', + 'MyCoRe', 'Nesstar', - 'Open Journal Systems (OJS)', - 'Samvera', 'OPUS', + 'Open Journal Systems (OJS)', 'Pubman', - 'MyCoRe', + 'Samvera', 'Other' ]; From aabda4fb064387b24c95a595ae1a66c77ef924ff Mon Sep 17 00:00:00 2001 From: Cody Ross Date: Mon, 31 Oct 2022 14:13:23 -0400 Subject: [PATCH 019/106] Alphabatizes organizationTypeList. --- app/models/provider.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/provider.js b/app/models/provider.js index 46760fa1a..2ef3cfb54 100644 --- a/app/models/provider.js +++ b/app/models/provider.js @@ -13,11 +13,11 @@ export const organizationTypeList = [ 'researchInstitution', 'academicInstitution', 'governmentAgency', + 'internationalOrganization', 'nationalInstitution', 'professionalSociety', 'publisher', 'serviceProvider', - 'internationalOrganization', 'other' ]; export const memberTypeList = [ From 442519178c295c033e117bc11b99ef47df001d63 Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Tue, 9 Aug 2022 17:15:47 -0400 Subject: [PATCH 020/106] Fabrica Improvements - task 1 (create doi button). --- app/components/create-doi-button.js | 14 +++++++ .../components/create-doi-button.hbs | 38 +++++++++++++++++++ app/templates/repositories/show/index.hbs | 14 ++++++- 3 files changed, 65 insertions(+), 1 deletion(-) create mode 100755 app/components/create-doi-button.js create mode 100755 app/templates/components/create-doi-button.hbs diff --git a/app/components/create-doi-button.js b/app/components/create-doi-button.js new file mode 100755 index 000000000..d9a391e9c --- /dev/null +++ b/app/components/create-doi-button.js @@ -0,0 +1,14 @@ +import Component from '@ember/component'; +import { inject as service } from '@ember/service'; + +export default Component.extend({ + currentUser: service(), + + classNames: [ 'panel', 'facets', 'add' ], + + didReceiveAttrs() { + this._super(...arguments); + + this.set('currentUser', this.currentUser); + }, +}); diff --git a/app/templates/components/create-doi-button.hbs b/app/templates/components/create-doi-button.hbs new file mode 100755 index 000000000..20c73e7a4 --- /dev/null +++ b/app/templates/components/create-doi-button.hbs @@ -0,0 +1,38 @@ + + +
+
+ + Create DOI + + + + DOI Form + + + File Upload + + + +
+
diff --git a/app/templates/repositories/show/index.hbs b/app/templates/repositories/show/index.hbs index fefefa234..f1a549fd5 100644 --- a/app/templates/repositories/show/index.hbs +++ b/app/templates/repositories/show/index.hbs @@ -1 +1,13 @@ - \ No newline at end of file +
+
+ {{#if (can 'update repository' model)}} + {{#if (and (or eq currentUser.role_id 'staff_admin' eq currentUser.role_id 'client_admin') model.isActive) }} + + {{/if}} + {{/if}} +
+
+ +
div> +
+ From 6e3c4eb26a94ad35dd1070f3d95f898055cc7ced Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Thu, 11 Aug 2022 17:51:19 -0400 Subject: [PATCH 021/106] Fabrica Improvements - task 1 (create doi button). --- app/components/create-doi-button.js | 3 +- app/styles/app.css | 1 + app/styles/create-doi-button.css | 33 ++++++++++++++++++ .../components/create-doi-button.hbs | 34 +++---------------- app/templates/repositories/show/index.hbs | 12 ++++--- .../repositories/show/prefixes/index.hbs | 10 +++++- 6 files changed, 56 insertions(+), 37 deletions(-) create mode 100755 app/styles/create-doi-button.css diff --git a/app/components/create-doi-button.js b/app/components/create-doi-button.js index d9a391e9c..ed676cc76 100755 --- a/app/components/create-doi-button.js +++ b/app/components/create-doi-button.js @@ -4,7 +4,8 @@ import { inject as service } from '@ember/service'; export default Component.extend({ currentUser: service(), - classNames: [ 'panel', 'facets', 'add' ], + //classNames: [ 'panel', 'facets' ], + classNames: [], didReceiveAttrs() { this._super(...arguments); diff --git a/app/styles/app.css b/app/styles/app.css index 8899fa508..2aba9331a 100644 --- a/app/styles/app.css +++ b/app/styles/app.css @@ -1 +1,2 @@ @import 'header.css'; +@import 'create-doi-button.css'; diff --git a/app/styles/create-doi-button.css b/app/styles/create-doi-button.css new file mode 100755 index 000000000..887b5ea3f --- /dev/null +++ b/app/styles/create-doi-button.css @@ -0,0 +1,33 @@ +.create-doi-button { + z-index: 1; + position: relative; +} + +.create-doi-button ul.dropdown-menu.show { + margin-top: 5px; +} + +.create-doi-button ul.dropdown-menu.show a { + width: 100%; + color: #e67e22; +} + +.create-doi-button ul.dropdown-menu.show a:hover { + background-color: rgb(128, 128, 128, .1); +} + +.create-doi-button button.btn { + border-radius: 26px; +} + +.panel.facets.add-25 { + margin-top: .25em; +} + +.panel.facets.add-50 { + margin-top: .50em; +} + +.panel.facets.add-75 { + margin-top: .75em; +} \ No newline at end of file diff --git a/app/templates/components/create-doi-button.hbs b/app/templates/components/create-doi-button.hbs index 20c73e7a4..097df7664 100755 --- a/app/templates/components/create-doi-button.hbs +++ b/app/templates/components/create-doi-button.hbs @@ -1,38 +1,12 @@ - - -
-
- Create DOI - + Create DOI + DOI Form - File Upload + File Upload - -
-
+ \ No newline at end of file diff --git a/app/templates/repositories/show/index.hbs b/app/templates/repositories/show/index.hbs index f1a549fd5..5203b6e91 100644 --- a/app/templates/repositories/show/index.hbs +++ b/app/templates/repositories/show/index.hbs @@ -1,13 +1,15 @@
- {{#if (can 'update repository' model)}} - {{#if (and (or eq currentUser.role_id 'staff_admin' eq currentUser.role_id 'client_admin') model.isActive) }} - - {{/if}} + {{#if (and (can 'create doi') model.isActive)}} +
+
+ +
+
{{/if}}
-
div> +
diff --git a/app/templates/repositories/show/prefixes/index.hbs b/app/templates/repositories/show/prefixes/index.hbs index 2d5981b50..6bba6ba0c 100644 --- a/app/templates/repositories/show/prefixes/index.hbs +++ b/app/templates/repositories/show/prefixes/index.hbs @@ -1,6 +1,14 @@
- {{#if (and (can 'write index') model.repository.isActive)}} + {{#if (and (can 'create doi') model.repository.isActive)}}
+
+ +
+
+ {{/if}} + + {{#if (and (can 'write index') model.repository.isActive)}} +
From 4be47b0f86635c7d1513e9bc0b4ac6e747885e63 Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Fri, 12 Aug 2022 14:40:39 -0400 Subject: [PATCH 022/106] Fabrica Improvements - task 1 (create doi button). --- app/templates/components/doi-list.hbs | 60 ++++++++----------- app/templates/repositories/show/index.hbs | 35 ++++++++++- .../repositories/show/prefixes/index.hbs | 21 ++++++- 3 files changed, 78 insertions(+), 38 deletions(-) diff --git a/app/templates/components/doi-list.hbs b/app/templates/components/doi-list.hbs index 487d8817a..e5a75ac4e 100644 --- a/app/templates/components/doi-list.hbs +++ b/app/templates/components/doi-list.hbs @@ -1,9 +1,8 @@
{{#if (and - (eq link 'repositories.show.dois') - (gt repository.meta.prefixCount 0) repository.isActive + (gt repository.meta.prefixCount 0) (or (can 'create doi' model) (can 'upload doi' model) @@ -13,38 +12,26 @@ }}
- {{#if repository.isActive}} + +
+
+ {{else}} +
+
+ {{#if (eq repository.meta.prefixCount 0)}} + + Can't create DOI without a prefix. + + {{/if}} +
+
+ {{/if}} + + {{#if (and (can 'move doi' repository) (gt model.length 0))}} +
+
- {{#if (gt repository.meta.prefixCount 0)}} - {{#if (can 'create doi' model)}} - - - Create - {{if media.isXl ' DOI'}} - (Form) - - {{/if}} - {{#if (can 'upload doi' model)}} - - - Create - {{if media.isXl ' DOI'}} - (File Upload) - - {{/if}} - {{/if}} - {{#if (and (can 'move doi' repository) (gt model.length 0))}} - {{/if}}
- {{/if}}
{{else}} @@ -66,12 +51,13 @@
{{#if (eq repository.meta.prefixCount 0)}} - Can't create DOI without a prefix. + No DOIs available to transfer. {{/if}}
{{/if}} + {{#if (and (can 'viewState doi') (or model.meta.states model.query.state))}}
@@ -310,6 +296,8 @@
{{/if}} + + {{#if (and (not (is-empty model.content)) @@ -677,6 +665,8 @@
{{/if}}
+ +
{{#if searchable}} diff --git a/app/templates/repositories/show/index.hbs b/app/templates/repositories/show/index.hbs index 5203b6e91..da6ea9ed1 100644 --- a/app/templates/repositories/show/index.hbs +++ b/app/templates/repositories/show/index.hbs @@ -1,7 +1,38 @@
- {{#if (and (can 'create doi') model.isActive)}} -
+ {{#if (can 'update repository' model)}} + + {{#if + (and + model.isActive + (or + (can 'create doi' model) + (can 'upload doi' model) + ) + ) + }} + {{#if + (gt model.meta.prefixCount 0) + }} +
+
+ +
+
+ {{else}} +
+
+ {{#if (eq model.meta.prefixCount 0)}} + + Can't create DOI without a prefix. + + {{/if}} +
+
+ {{/if}} + {{/if}} + +
diff --git a/app/templates/repositories/show/prefixes/index.hbs b/app/templates/repositories/show/prefixes/index.hbs index 6bba6ba0c..f6e870aab 100644 --- a/app/templates/repositories/show/prefixes/index.hbs +++ b/app/templates/repositories/show/prefixes/index.hbs @@ -1,10 +1,29 @@
- {{#if (and (can 'create doi') model.repository.isActive)}} + {{#if + (and + model.repository.isActive + (gt model.repository.meta.prefixCount 0) + (or + (can 'create doi' model) + (can 'upload doi' model) + ) + ) + }}
+ {{else}} +
+
+ {{#if (eq model.repository.meta.prefixCount 0)}} + + Can't create DOI without a prefix. + + {{/if}} +
+
{{/if}} {{#if (and (can 'write index') model.repository.isActive)}} From 52e3bc0282e1d43e3ffb741e9fe6ca25484883bd Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Thu, 13 Oct 2022 14:06:00 -0400 Subject: [PATCH 023/106] Fabrica Improvements - task 1 (create doi button). --- app/templates/components/doi-list.hbs | 102 ++++++++++--------- cypress/integration/client_admin/doi.test.ts | 46 ++++++--- 2 files changed, 87 insertions(+), 61 deletions(-) diff --git a/app/templates/components/doi-list.hbs b/app/templates/components/doi-list.hbs index e5a75ac4e..010a706f1 100644 --- a/app/templates/components/doi-list.hbs +++ b/app/templates/components/doi-list.hbs @@ -1,61 +1,65 @@
{{#if - (and - repository.isActive - (gt repository.meta.prefixCount 0) - (or - (can 'create doi' model) - (can 'upload doi' model) - (can 'move doi' repository) - ) - ) + (eq link 'repositories.show.dois') }} -
-
- + {{#if + (and + repository.isActive + (gt repository.meta.prefixCount 0) + (or + (can 'create doi' model) + (can 'upload doi' model) + (can 'move doi' repository) + ) + ) + }} +
+
+ +
-
- {{else}} -
-
- {{#if (eq repository.meta.prefixCount 0)}} - - Can't create DOI without a prefix. - - {{/if}} + {{else}} +
+
+ {{#if (eq repository.meta.prefixCount 0)}} + + Can't create DOI without a prefix. + + {{/if}} +
-
- {{/if}} + {{/if}} - {{#if (and (can 'move doi' repository) (gt model.length 0))}} -
-
-
-
- - - Transfer - {{if media.isXl ' DOIs'}} - + {{#if (and (can 'move doi' repository) (gt model.length 0))}} +
+
+
+
+ + + Transfer + {{if media.isXl ' DOIs'}} + +
-
+
-
- {{else}} -
-
- {{#if (eq repository.meta.prefixCount 0)}} - - No DOIs available to transfer. - - {{/if}} + {{else}} +
+
+ {{#if (eq repository.meta.prefixCount 0)}} + + No DOIs available to transfer. + + {{/if}} +
-
+ {{/if}} {{/if}} {{#if (and (can 'viewState doi') (or model.meta.states model.query.state))}} diff --git a/cypress/integration/client_admin/doi.test.ts b/cypress/integration/client_admin/doi.test.ts index 12ef96e51..441d42279 100644 --- a/cypress/integration/client_admin/doi.test.ts +++ b/cypress/integration/client_admin/doi.test.ts @@ -6,6 +6,21 @@ function escapeRE(string) { return string.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); } +/* +ember-bootstrap-dropdown-bs3-popper.dropdown-menu + +describe('Tutorialspoint Test', function () { + // test case + it('Scenario 1', function (){ + // launch URL + cy.visit("https://www.amazon.com/"); + // show hidden element with invoke + cy.get('#nav-flyout-ya-signin').invoke('show'); + //click hidden element + cy.contains('Sign').click(); + }); +*/ + describe('ACCEPTANCE: CLIENT_ADMIN | DOIS', () => { const waitTime = 1000; const waitTime2 = 2000; @@ -27,7 +42,7 @@ describe('ACCEPTANCE: CLIENT_ADMIN | DOIS', () => { // cy.log('TBD - CLEAN UP RESOURCES AFTER TEST'); }); - it('is logged in to dois page', () => { + it.only('is logged in to dois page', () => { cy.visit('/repositories/datacite.test/dois'); cy.url().should('include', '/repositories/datacite.test/dois').then (() => { @@ -49,19 +64,26 @@ describe('ACCEPTANCE: CLIENT_ADMIN | DOIS', () => { .and('have.attr', 'href').and('include', '/repositories/datacite.test/dois'); // Has left sidebar buttons. - cy.get('.btn-toolbar').within(($btnToolbar) => { - cy.get('.btn-group-vertical a#new-doi').contains(/Create\s*\(Form\)/i) - .and('have.attr', 'href').and('include', '/repositories/datacite.test/dois/new'); - cy.get('.btn-group-vertical a#upload-doi').contains(/Create\s*\(File Upload\)/i) - .and('have.attr', 'href').and('include', '/repositories/datacite.test/dois/upload'); + cy.get('div.col-md-3').should('be.visible').within(($sidebar) => { + //cy.get('.create-doi-button .dropdown-toggle').should('be.visible').click().then(() => { + //cy.get('ul.dropdown-menu').should('be.visible'); + //}); + cy.get('ember-bootstrap-dropdown-bs3-popper.dropdown-menu').invoke('show'); + /* + cy.get('.btn-group-vertical a#new-doi').contains(/Create\s*\(Form\)/i) + .and('have.attr', 'href').and('include', '/repositories/datacite.test/dois/new'); + cy.get('.btn-group-vertical a#upload-doi').contains(/Create\s*\(File Upload\)/i) + .and('have.attr', 'href').and('include', '/repositories/datacite.test/dois/upload'); + */ + //}); + + // Has left sidebar facets. + cy.get('.facets h4').contains(/Resource\s*Type/i); + cy.get('.facets h4').contains(/Year\s*created/i); + cy.get('.facets h4').contains(/Prefix/i); + cy.get('.facets h4').contains(/Schema\s*Version/i); }); - // Has left sidebar facets. - cy.get('.facets h4').contains(/Resource\s*Type/i); - cy.get('.facets h4').contains(/Year\s*created/i); - cy.get('.facets h4').contains(/Prefix/i); - cy.get('.facets h4').contains(/Schema\s*Version/i); - // Has search form cy.get('form #search').within(($searchBar) => { cy.get('input[name="query"]') From 09607cbf9c3c8f2d5c5077be2cfb4d2e349bc2f2 Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Thu, 20 Oct 2022 18:32:11 -0400 Subject: [PATCH 024/106] Fabrica Improvements - task 1 (create doi button). --- app/styles/create-doi-button.css | 17 +++++++++++++---- app/templates/components/create-doi-button.hbs | 2 +- app/templates/repositories/show/index.hbs | 2 +- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/app/styles/create-doi-button.css b/app/styles/create-doi-button.css index 887b5ea3f..d65b3a12f 100755 --- a/app/styles/create-doi-button.css +++ b/app/styles/create-doi-button.css @@ -1,6 +1,14 @@ -.create-doi-button { - z-index: 1; - position: relative; +.btn-group-vertical { + margin-left: 5px; +} + +.create-doi-button button { + font-size: 16px; +} + +/* Otherwise drop-down menu falls behind other objects. */ +.create-doi-button .ember-bootstrap-dropdown-bs3-popper { + z-index: 10000; } .create-doi-button ul.dropdown-menu.show { @@ -10,6 +18,7 @@ .create-doi-button ul.dropdown-menu.show a { width: 100%; color: #e67e22; + font-size: 16px !important; } .create-doi-button ul.dropdown-menu.show a:hover { @@ -30,4 +39,4 @@ .panel.facets.add-75 { margin-top: .75em; -} \ No newline at end of file +} diff --git a/app/templates/components/create-doi-button.hbs b/app/templates/components/create-doi-button.hbs index 097df7664..ddf3f02f3 100755 --- a/app/templates/components/create-doi-button.hbs +++ b/app/templates/components/create-doi-button.hbs @@ -9,4 +9,4 @@ File Upload - \ No newline at end of file + diff --git a/app/templates/repositories/show/index.hbs b/app/templates/repositories/show/index.hbs index da6ea9ed1..4bb66f7f4 100644 --- a/app/templates/repositories/show/index.hbs +++ b/app/templates/repositories/show/index.hbs @@ -16,7 +16,7 @@ }}
- +
{{else}} From 117dd1349f03d920ac4d630ff0ad59d5e46ef840 Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Fri, 21 Oct 2022 21:19:02 -0400 Subject: [PATCH 025/106] Fabrica Improvements - task 1 (create doi button - fix miscalculated privileges for prefixes tab)). --- app/abilities/doi.js | 4 ++-- app/templates/components/repository-info.hbs | 5 +++++ app/templates/repositories/show/prefixes/index.hbs | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/abilities/doi.js b/app/abilities/doi.js index 3b1bfd321..ee72107f2 100644 --- a/app/abilities/doi.js +++ b/app/abilities/doi.js @@ -114,7 +114,7 @@ export default Ability.extend({ ), canCreate: computed( 'currentUser.{role_id,client_id}', - 'model.{id,query.client-id}', + 'model.{id,query.client-id,repository.id}', function () { switch (this.get('currentUser.role_id')) { case 'staff_admin': @@ -122,7 +122,7 @@ export default Ability.extend({ case 'client_admin': return ( this.get('currentUser.client_id') === - this.get('model.query.client-id') || this.get('model.id') + this.get('model.query.client-id') || this.get('model.id') || this.get('model.repository.id') ); default: return false; diff --git a/app/templates/components/repository-info.hbs b/app/templates/components/repository-info.hbs index 759bc6724..653fdb59e 100644 --- a/app/templates/components/repository-info.hbs +++ b/app/templates/components/repository-info.hbs @@ -1,7 +1,12 @@
+<<<<<<< HEAD +======= + {{!-- Need to override component classes due to addition of a sidebar. --}} + +>>>>>>> Fabrica Improvements - task 1 (create doi button - fix miscalculated privileges for prefixes tab)).
{{#if (can "read messages" model)}} diff --git a/app/templates/repositories/show/prefixes/index.hbs b/app/templates/repositories/show/prefixes/index.hbs index f6e870aab..8f41cd431 100644 --- a/app/templates/repositories/show/prefixes/index.hbs +++ b/app/templates/repositories/show/prefixes/index.hbs @@ -6,6 +6,7 @@ (or (can 'create doi' model) (can 'upload doi' model) + (can 'move doi' repository) ) ) }} From 6e302f5b0d5462a915ebf6591fc40294abd3ed7e Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Fri, 21 Oct 2022 21:21:36 -0400 Subject: [PATCH 026/106] Fabrica Improvements - task 1 (create doi button - testing)). --- cypress/integration/client_admin/doi.test.ts | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/cypress/integration/client_admin/doi.test.ts b/cypress/integration/client_admin/doi.test.ts index 441d42279..f13bf58e2 100644 --- a/cypress/integration/client_admin/doi.test.ts +++ b/cypress/integration/client_admin/doi.test.ts @@ -65,17 +65,14 @@ describe('ACCEPTANCE: CLIENT_ADMIN | DOIS', () => { // Has left sidebar buttons. cy.get('div.col-md-3').should('be.visible').within(($sidebar) => { - //cy.get('.create-doi-button .dropdown-toggle').should('be.visible').click().then(() => { - //cy.get('ul.dropdown-menu').should('be.visible'); - //}); - cy.get('ember-bootstrap-dropdown-bs3-popper.dropdown-menu').invoke('show'); - /* - cy.get('.btn-group-vertical a#new-doi').contains(/Create\s*\(Form\)/i) - .and('have.attr', 'href').and('include', '/repositories/datacite.test/dois/new'); - cy.get('.btn-group-vertical a#upload-doi').contains(/Create\s*\(File Upload\)/i) - .and('have.attr', 'href').and('include', '/repositories/datacite.test/dois/upload'); - */ - //}); + + // Create DOI button - would like to do more testing but seems impossible in Cypress. + cy.get('.create-doi-button').contains(/Create DOI/i); + cy.get('.create-doi-button button.dropdown-toggle').click({ force: true }).then(($obj) => { + //cy.get('.create-doi-button ul.dropdown-menu') + //cy.get('.create-doi-button ul.dropdown-menu ul li a').contains(/DOI\s*Form/i); + //cy.get('.create-doi-button ul.dropdown-menu ul li a').contains(/File\s*Upload/i); + }); // Has left sidebar facets. cy.get('.facets h4').contains(/Resource\s*Type/i); From 457e697bad48fd622d443e8a8df6b869e5c37d87 Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Fri, 21 Oct 2022 22:44:47 -0400 Subject: [PATCH 027/106] Fabrica Improvements - task 1 (create doi button - testing)). --- app/templates/components/doi-list.hbs | 1 - app/templates/repositories/show/prefixes/index.hbs | 1 - 2 files changed, 2 deletions(-) diff --git a/app/templates/components/doi-list.hbs b/app/templates/components/doi-list.hbs index 010a706f1..3a4863c1d 100644 --- a/app/templates/components/doi-list.hbs +++ b/app/templates/components/doi-list.hbs @@ -9,7 +9,6 @@ (or (can 'create doi' model) (can 'upload doi' model) - (can 'move doi' repository) ) ) }} diff --git a/app/templates/repositories/show/prefixes/index.hbs b/app/templates/repositories/show/prefixes/index.hbs index 8f41cd431..f6e870aab 100644 --- a/app/templates/repositories/show/prefixes/index.hbs +++ b/app/templates/repositories/show/prefixes/index.hbs @@ -6,7 +6,6 @@ (or (can 'create doi' model) (can 'upload doi' model) - (can 'move doi' repository) ) ) }} From 899de5fbe0a4cde8544f0718c5d5518a38df7eef Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Mon, 24 Oct 2022 11:07:35 -0400 Subject: [PATCH 028/106] Fabrica Improvements - task 1 (create doi button - testing)). --- cypress/integration/client_admin/doi.test.ts | 30 +++++-------------- cypress/integration/client_admin/info.test.ts | 11 +++++++ .../integration/client_admin/prefixes.test.ts | 11 +++++++ .../integration/client_admin/settings.test.ts | 12 ++++++++ .../integration/staff_admin/contact.test.ts | 3 ++ cypress/integration/staff_admin/info.test.ts | 3 ++ .../integration/staff_admin/prefix.test.ts | 6 ++-- .../integration/staff_admin/settings.test.ts | 3 ++ 8 files changed, 54 insertions(+), 25 deletions(-) diff --git a/cypress/integration/client_admin/doi.test.ts b/cypress/integration/client_admin/doi.test.ts index f13bf58e2..e90a9ee00 100644 --- a/cypress/integration/client_admin/doi.test.ts +++ b/cypress/integration/client_admin/doi.test.ts @@ -6,21 +6,6 @@ function escapeRE(string) { return string.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); } -/* -ember-bootstrap-dropdown-bs3-popper.dropdown-menu - -describe('Tutorialspoint Test', function () { - // test case - it('Scenario 1', function (){ - // launch URL - cy.visit("https://www.amazon.com/"); - // show hidden element with invoke - cy.get('#nav-flyout-ya-signin').invoke('show'); - //click hidden element - cy.contains('Sign').click(); - }); -*/ - describe('ACCEPTANCE: CLIENT_ADMIN | DOIS', () => { const waitTime = 1000; const waitTime2 = 2000; @@ -42,7 +27,7 @@ describe('ACCEPTANCE: CLIENT_ADMIN | DOIS', () => { // cy.log('TBD - CLEAN UP RESOURCES AFTER TEST'); }); - it.only('is logged in to dois page', () => { + it('is logged in to dois page', () => { cy.visit('/repositories/datacite.test/dois'); cy.url().should('include', '/repositories/datacite.test/dois').then (() => { @@ -65,7 +50,6 @@ describe('ACCEPTANCE: CLIENT_ADMIN | DOIS', () => { // Has left sidebar buttons. cy.get('div.col-md-3').should('be.visible').within(($sidebar) => { - // Create DOI button - would like to do more testing but seems impossible in Cypress. cy.get('.create-doi-button').contains(/Create DOI/i); cy.get('.create-doi-button button.dropdown-toggle').click({ force: true }).then(($obj) => { @@ -73,14 +57,14 @@ describe('ACCEPTANCE: CLIENT_ADMIN | DOIS', () => { //cy.get('.create-doi-button ul.dropdown-menu ul li a').contains(/DOI\s*Form/i); //cy.get('.create-doi-button ul.dropdown-menu ul li a').contains(/File\s*Upload/i); }); - - // Has left sidebar facets. - cy.get('.facets h4').contains(/Resource\s*Type/i); - cy.get('.facets h4').contains(/Year\s*created/i); - cy.get('.facets h4').contains(/Prefix/i); - cy.get('.facets h4').contains(/Schema\s*Version/i); }); + // Has left sidebar facets. + cy.get('.facets h4').contains(/Resource\s*Type/i); + cy.get('.facets h4').contains(/Year\s*created/i); + cy.get('.facets h4').contains(/Prefix/i); + cy.get('.facets h4').contains(/Schema\s*Version/i); + // Has search form cy.get('form #search').within(($searchBar) => { cy.get('input[name="query"]') diff --git a/cypress/integration/client_admin/info.test.ts b/cypress/integration/client_admin/info.test.ts index e66b24ca9..c4300be4c 100644 --- a/cypress/integration/client_admin/info.test.ts +++ b/cypress/integration/client_admin/info.test.ts @@ -45,6 +45,17 @@ describe('ACCEPTANCE: CLIENT_ADMIN | INFO', () => { .and('include', '/repositories/datacite.test/dois'); cy.get('#chart-doi'); }); + + // Has left sidebar buttons. + cy.get('div.col-md-3').should('be.visible').within(($sidebar) => { + // Create DOI button - would like to do more testing but seems impossible in Cypress. + cy.get('.create-doi-button').contains(/Create DOI/i); + cy.get('.create-doi-button button.dropdown-toggle').click({ force: true }).then(($obj) => { + //cy.get('.create-doi-button ul.dropdown-menu') + //cy.get('.create-doi-button ul.dropdown-menu ul li a').contains(/DOI\s*Form/i); + //cy.get('.create-doi-button ul.dropdown-menu ul li a').contains(/File\s*Upload/i); + }); + }); }); }); diff --git a/cypress/integration/client_admin/prefixes.test.ts b/cypress/integration/client_admin/prefixes.test.ts index 01e23fcca..40f177e46 100644 --- a/cypress/integration/client_admin/prefixes.test.ts +++ b/cypress/integration/client_admin/prefixes.test.ts @@ -46,6 +46,17 @@ describe('ACCEPTANCE: CLIENT_ADMIN | PREFIXES', () => { // Has left sidebar message box. // cy.get('div.alert').contains(/Please ask DataCite Staff if you want to add a prefix./i); + // Has left sidebar buttons. + cy.get('div.col-md-3').should('be.visible').within(($sidebar) => { + // Create DOI button - would like to do more testing but seems impossible in Cypress. + cy.get('.create-doi-button').contains(/Create DOI/i); + cy.get('.create-doi-button button.dropdown-toggle').click({ force: true }).then(($obj) => { + //cy.get('.create-doi-button ul.dropdown-menu') + //cy.get('.create-doi-button ul.dropdown-menu ul li a').contains(/DOI\s*Form/i); + //cy.get('.create-doi-button ul.dropdown-menu ul li a').contains(/File\s*Upload/i); + }); + }); + // Has left sidebar facets. cy.get('.facets h4').contains(/Year\s*created/i); diff --git a/cypress/integration/client_admin/settings.test.ts b/cypress/integration/client_admin/settings.test.ts index 69a9dc38b..dc2de5e09 100644 --- a/cypress/integration/client_admin/settings.test.ts +++ b/cypress/integration/client_admin/settings.test.ts @@ -34,6 +34,18 @@ describe('ACCEPTANCE: CLIENT_ADMIN | SETTINGS', () => { cy.get('ul.nav-tabs li a').contains(/DOIs/i) .and('have.attr', 'href').and('include', '/repositories/datacite.test/dois'); + // Has left sidebar buttons. + cy.get('div.col-md-3').should('be.visible').within(($sidebar) => { + + // Create DOI button - would like to do more testing but seems impossible in Cypress. + cy.get('.create-doi-button').contains(/Create DOI/i); + cy.get('.create-doi-button button.dropdown-toggle').click({ force: true }).then(($obj) => { + //cy.get('.create-doi-button ul.dropdown-menu') + //cy.get('.create-doi-button ul.dropdown-menu ul li a').contains(/DOI\s*Form/i); + //cy.get('.create-doi-button ul.dropdown-menu ul li a').contains(/File\s*Upload/i); + }); + }); + cy.get('.btn-toolbar').within(($btnToolbar) => { cy.get('.btn-group-vertical a#set-password-repository').contains(/Set\s*Password/i) .and('have.attr', 'href').and('include', '/repositories/datacite.test/change'); diff --git a/cypress/integration/staff_admin/contact.test.ts b/cypress/integration/staff_admin/contact.test.ts index 0bccbab01..d82c7423a 100644 --- a/cypress/integration/staff_admin/contact.test.ts +++ b/cypress/integration/staff_admin/contact.test.ts @@ -61,6 +61,9 @@ describe('ACCEPTANCE: STAFF_ADMIN | CONTACTS', () => { //cy.get('div.panel.facets').should('exist'); cy.get('a#add-contact').should('not.exist'); + + // Create DOI button - would like to do more testing but seems impossible in Cypress. + cy.get('.create-doi-button').should('not.exist'); }); }); }); diff --git a/cypress/integration/staff_admin/info.test.ts b/cypress/integration/staff_admin/info.test.ts index 7ff0b34bf..dc8dad4d9 100644 --- a/cypress/integration/staff_admin/info.test.ts +++ b/cypress/integration/staff_admin/info.test.ts @@ -63,6 +63,9 @@ describe('ACCEPTANCE: STAFF_ADMIN | INFO', () => { .and('include', '/dois'); cy.get('#chart-doi'); }); + + // Create DOI button - would like to do more testing but seems impossible in Cypress. + cy.get('.create-doi-button').should('not.exist'); }); }); diff --git a/cypress/integration/staff_admin/prefix.test.ts b/cypress/integration/staff_admin/prefix.test.ts index 50a274fb8..535add329 100644 --- a/cypress/integration/staff_admin/prefix.test.ts +++ b/cypress/integration/staff_admin/prefix.test.ts @@ -31,8 +31,10 @@ describe('Admin: Prefix', () => { cy.get('div#search').should('exist'); cy.get('div.panel.facets').should('exist'); - // THIS BUTTON WAS REMOVED: - // cy.get('a#add-prefixes').contains('Add Prefixes'); + cy.get('a#add-prefixes').contains('Add Prefixes'); + + // Create DOI button - would like to do more testing but seems impossible in Cypress. + cy.get('.create-doi-button').should('not.exist'); }); it('filter prefixes', () => { diff --git a/cypress/integration/staff_admin/settings.test.ts b/cypress/integration/staff_admin/settings.test.ts index 840cc5b56..35905902d 100644 --- a/cypress/integration/staff_admin/settings.test.ts +++ b/cypress/integration/staff_admin/settings.test.ts @@ -46,6 +46,9 @@ describe('ACCEPTANCE: STAFF_ADMIN | SETTINGS', () => { .and('have.attr', 'href').and('include', '/edit'); }); + // Create DOI button - would like to do more testing but seems impossible in Cypress. + cy.get('.create-doi-button').should('not.exist'); + cy.get('.metadata').within(($metadata) => { cy.get('h5').contains(/Record\s*created/i); cy.get('h5').contains(/Record\s*last\s*modified/i); From 83b78a0eb00ba954ea520c7bf30d19c5404da933 Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Mon, 24 Oct 2022 11:28:50 -0400 Subject: [PATCH 029/106] Fabrica Improvements - task 1 (create doi button - testing)). --- .../staff_admin/repositories.test.ts | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100755 cypress/integration/staff_admin/repositories.test.ts diff --git a/cypress/integration/staff_admin/repositories.test.ts b/cypress/integration/staff_admin/repositories.test.ts new file mode 100755 index 000000000..5a7476999 --- /dev/null +++ b/cypress/integration/staff_admin/repositories.test.ts @@ -0,0 +1,77 @@ +/// +/* eslint-disable no-undef */ + +describe('Admin: Repositories Tabs', () => { + const waitTime = 1000; + const waitTime2 = 2000; + + before(function () { + cy.login(Cypress.env('staff_admin_username'), Cypress.env('staff_admin_password')); + cy.setCookie('_consent', 'true'); + }) + + beforeEach(() => { + Cypress.Cookies.preserveOnce('_fabrica', '_jwt', '_consent'); + cy.wait(waitTime2); + }); + + // ASSUMING DATACITE.TEST EXISTS: + it('check repositories tabs for required components - assumes datacite.test exists', () => { + cy.visit('/repositories/datacite.test'); + cy.wait(waitTime2); + + // Has left sidebar with create doi button. + cy.get('div.col-md-3').should('be.visible').within(($sidebar) => { + // Create DOI button - would like to do more testing but seems impossible in Cypress. + cy.get('.create-doi-button').contains(/Create DOI/i); + cy.get('.create-doi-button button.dropdown-toggle').click({ force: true }).then(($obj) => { + //cy.get('.create-doi-button ul.dropdown-menu') + //cy.get('.create-doi-button ul.dropdown-menu ul li a').contains(/DOI\s*Form/i); + //cy.get('.create-doi-button ul.dropdown-menu ul li a').contains(/File\s*Upload/i); + }); + }); + + cy.visit('/repositories/datacite.test/info'); + cy.wait(waitTime2); + + // Has left sidebar with create doi button. + cy.get('div.col-md-3').should('be.visible').within(($sidebar) => { + // Create DOI button - would like to do more testing but seems impossible in Cypress. + cy.get('.create-doi-button').contains(/Create DOI/i); + cy.get('.create-doi-button button.dropdown-toggle').click({ force: true }).then(($obj) => { + //cy.get('.create-doi-button ul.dropdown-menu') + //cy.get('.create-doi-button ul.dropdown-menu ul li a').contains(/DOI\s*Form/i); + //cy.get('.create-doi-button ul.dropdown-menu ul li a').contains(/File\s*Upload/i); + }); + }); + + cy.visit('/repositories/datacite.test/prefixes'); + cy.wait(waitTime2); + + // Has left sidebar with create doi button. + cy.get('div.col-md-3').should('be.visible').within(($sidebar) => { + // Create DOI button - would like to do more testing but seems impossible in Cypress. + cy.get('.create-doi-button').contains(/Create DOI/i); + cy.get('.create-doi-button button.dropdown-toggle').click({ force: true }).then(($obj) => { + //cy.get('.create-doi-button ul.dropdown-menu') + //cy.get('.create-doi-button ul.dropdown-menu ul li a').contains(/DOI\s*Form/i); + //cy.get('.create-doi-button ul.dropdown-menu ul li a').contains(/File\s*Upload/i); + }); + }); + + cy.visit('/repositories/datacite.test/dois'); + cy.wait(waitTime2); + + // Has left sidebar with create doi button. + cy.get('div.col-md-3').should('be.visible').within(($sidebar) => { + // Create DOI button - would like to do more testing but seems impossible in Cypress. + cy.get('.create-doi-button').contains(/Create DOI/i); + cy.get('.create-doi-button button.dropdown-toggle').click({ force: true }).then(($obj) => { + //cy.get('.create-doi-button ul.dropdown-menu') + //cy.get('.create-doi-button ul.dropdown-menu ul li a').contains(/DOI\s*Form/i); + //cy.get('.create-doi-button ul.dropdown-menu ul li a').contains(/File\s*Upload/i); + }); + }); + }); + }); + \ No newline at end of file From 853f78c819925f406d5191020af9aa14c61c412b Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Mon, 24 Oct 2022 11:56:32 -0400 Subject: [PATCH 030/106] Fabrica Improvements - task 1 (create doi button - testing)). --- .../organization_admin/contact.test.ts | 3 ++ .../organization_admin/doi.test.ts | 3 ++ .../organization_admin/info.test.ts | 3 ++ .../organization_admin/prefixes.test.ts | 3 ++ .../organization_admin/repositories.test.ts | 32 ++++++++++++++++++- .../organization_admin/settings.test.ts | 3 ++ .../integration/staff_admin/contact.test.ts | 2 +- cypress/integration/staff_admin/info.test.ts | 2 +- .../integration/staff_admin/prefix.test.ts | 2 +- .../integration/staff_admin/settings.test.ts | 2 +- 10 files changed, 50 insertions(+), 5 deletions(-) diff --git a/cypress/integration/organization_admin/contact.test.ts b/cypress/integration/organization_admin/contact.test.ts index 510f7d300..bddd191c9 100644 --- a/cypress/integration/organization_admin/contact.test.ts +++ b/cypress/integration/organization_admin/contact.test.ts @@ -71,6 +71,9 @@ describe('ACCEPTANCE: ORGANIZATION_ADMIN | CONTACTS', () => { .get('[data-test-contact]') .should('contain', family_name); }); + + // Create DOI button + cy.get('.create-doi-button').should('not.exist'); }); }); diff --git a/cypress/integration/organization_admin/doi.test.ts b/cypress/integration/organization_admin/doi.test.ts index 0c3614e3b..444c69063 100644 --- a/cypress/integration/organization_admin/doi.test.ts +++ b/cypress/integration/organization_admin/doi.test.ts @@ -72,6 +72,9 @@ describe('ACCEPTANCE: ORGANIZATION_ADMIN | DOIS', () => { cy.get('#content').within(($content) => { cy.get('[data-test-doi]').its('length').should('be.gte', 1); }); + + // Create DOI button + cy.get('.create-doi-button').should('not.exist'); }); }); }); diff --git a/cypress/integration/organization_admin/info.test.ts b/cypress/integration/organization_admin/info.test.ts index 6d75c461b..995c644fc 100644 --- a/cypress/integration/organization_admin/info.test.ts +++ b/cypress/integration/organization_admin/info.test.ts @@ -56,6 +56,9 @@ describe('ACCEPTANCE: ORGANIZATION_ADMIN | INFO', () => { .and('include', '/providers/datacite/dois'); cy.get('#chart-doi'); }); + + // Create DOI button + cy.get('.create-doi-button').should('not.exist'); }); }); diff --git a/cypress/integration/organization_admin/prefixes.test.ts b/cypress/integration/organization_admin/prefixes.test.ts index 52afece2a..5fd364a2d 100644 --- a/cypress/integration/organization_admin/prefixes.test.ts +++ b/cypress/integration/organization_admin/prefixes.test.ts @@ -65,6 +65,9 @@ describe('ACCEPTANCE: ORGANIZATION_ADMIN | PREFIXES', () => { cy.get('#content').within(($content) => { cy.get('[data-test-prefix]').its('length').should('be.gte', 1); }); + + // Create DOI button + cy.get('.create-doi-button').should('not.exist'); }); }); }); diff --git a/cypress/integration/organization_admin/repositories.test.ts b/cypress/integration/organization_admin/repositories.test.ts index 94991ff29..17340992b 100644 --- a/cypress/integration/organization_admin/repositories.test.ts +++ b/cypress/integration/organization_admin/repositories.test.ts @@ -69,12 +69,15 @@ describe('ACCEPTANCE: ORGANIZATION_ADMIN | REPOSITORIES', () => { cy.get('#content').within(($content) => { cy.get('[data-test-repository]').its('length').should('be.gte', 1); }); + + // Create DOI button + cy.get('.create-doi-button').should('not.exist'); }); }); // TBD - Could do more testing here. Only cursory testing for // presence of field objects. No testing of form behavior yet. - it.only('has an add repository page', () => { + it('has an add repository page', () => { cy.visit('/providers/datacite/repositories/new'); cy.url().should('include', '/providers/datacite/repositories/new').then(() => { @@ -140,4 +143,31 @@ describe('ACCEPTANCE: ORGANIZATION_ADMIN | REPOSITORIES', () => { }) }) }); + + // ASSUMING DATACITE.TEST EXISTS: + it('check repositories tabs for required components - assumes datacite.test exists', () => { + cy.visit('/repositories/datacite.test'); + cy.wait(waitTime2); + + // Create DOI button + cy.get('.create-doi-button').should('not.exist'); + + cy.visit('/repositories/datacite.test/info'); + cy.wait(waitTime2); + + // Create DOI button + cy.get('.create-doi-button').should('not.exist'); + + cy.visit('/repositories/datacite.test/prefixes'); + cy.wait(waitTime2); + + // Create DOI button + cy.get('.create-doi-button').should('not.exist'); + + cy.visit('/repositories/datacite.test/dois'); + cy.wait(waitTime2); + + // Create DOI button + cy.get('.create-doi-button').should('not.exist'); + }); }); diff --git a/cypress/integration/organization_admin/settings.test.ts b/cypress/integration/organization_admin/settings.test.ts index 6e3cd40cd..8663a6a14 100644 --- a/cypress/integration/organization_admin/settings.test.ts +++ b/cypress/integration/organization_admin/settings.test.ts @@ -94,6 +94,9 @@ describe('ACCEPTANCE: ORGANIZATION_ADMIN | SETTINGS', () => { // cy.get('[cy-data="secondary-technical"] a').contains(/John\s*Doe/i).and('have.attr', 'href').and('include', 'mailto:John.Doe7426@example.org'); cy.get('[cy-data="secondary-technical"] a').contains(/John\s*Doe/i).and('have.attr', 'href').and('contain', 'mailto:John.Doe'); }); + + // Create DOI button + cy.get('.create-doi-button').should('not.exist'); }); }); }); \ No newline at end of file diff --git a/cypress/integration/staff_admin/contact.test.ts b/cypress/integration/staff_admin/contact.test.ts index d82c7423a..af141e6e8 100644 --- a/cypress/integration/staff_admin/contact.test.ts +++ b/cypress/integration/staff_admin/contact.test.ts @@ -62,7 +62,7 @@ describe('ACCEPTANCE: STAFF_ADMIN | CONTACTS', () => { cy.get('a#add-contact').should('not.exist'); - // Create DOI button - would like to do more testing but seems impossible in Cypress. + // Create DOI button cy.get('.create-doi-button').should('not.exist'); }); }); diff --git a/cypress/integration/staff_admin/info.test.ts b/cypress/integration/staff_admin/info.test.ts index dc8dad4d9..a0f219480 100644 --- a/cypress/integration/staff_admin/info.test.ts +++ b/cypress/integration/staff_admin/info.test.ts @@ -64,7 +64,7 @@ describe('ACCEPTANCE: STAFF_ADMIN | INFO', () => { cy.get('#chart-doi'); }); - // Create DOI button - would like to do more testing but seems impossible in Cypress. + // Create DOI button cy.get('.create-doi-button').should('not.exist'); }); }); diff --git a/cypress/integration/staff_admin/prefix.test.ts b/cypress/integration/staff_admin/prefix.test.ts index 535add329..8fa4f3c99 100644 --- a/cypress/integration/staff_admin/prefix.test.ts +++ b/cypress/integration/staff_admin/prefix.test.ts @@ -33,7 +33,7 @@ describe('Admin: Prefix', () => { cy.get('a#add-prefixes').contains('Add Prefixes'); - // Create DOI button - would like to do more testing but seems impossible in Cypress. + // Create DOI button cy.get('.create-doi-button').should('not.exist'); }); diff --git a/cypress/integration/staff_admin/settings.test.ts b/cypress/integration/staff_admin/settings.test.ts index 35905902d..6e1b48403 100644 --- a/cypress/integration/staff_admin/settings.test.ts +++ b/cypress/integration/staff_admin/settings.test.ts @@ -46,7 +46,7 @@ describe('ACCEPTANCE: STAFF_ADMIN | SETTINGS', () => { .and('have.attr', 'href').and('include', '/edit'); }); - // Create DOI button - would like to do more testing but seems impossible in Cypress. + // Create DOI button cy.get('.create-doi-button').should('not.exist'); cy.get('.metadata').within(($metadata) => { From ca1a4d10faef55cccea5591a8866edbb8583d104 Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Mon, 24 Oct 2022 12:10:50 -0400 Subject: [PATCH 031/106] Fabrica Improvements - task 1 (create doi button - testing)). --- .../consortium_admin/contact.test.ts | 3 ++ .../integration/consortium_admin/doi.test.ts | 3 ++ .../integration/consortium_admin/info.test.ts | 3 ++ .../consortium_admin/organizations.test.ts | 3 ++ .../consortium_admin/repositories.test.ts | 30 +++++++++++++++++++ .../consortium_admin/settings.test.ts | 3 ++ 6 files changed, 45 insertions(+) diff --git a/cypress/integration/consortium_admin/contact.test.ts b/cypress/integration/consortium_admin/contact.test.ts index 9eb3128b2..93909724a 100644 --- a/cypress/integration/consortium_admin/contact.test.ts +++ b/cypress/integration/consortium_admin/contact.test.ts @@ -43,6 +43,9 @@ describe('ACCEPTANCE: CONSORTIUM_ADMIN | CONTACTS', () => { cy.get('div.panel.facets').should('exist'); cy.get('a#add-contact').contains('Add Contact'); + + // Create DOI button + cy.get('.create-doi-button').should('not.exist'); }); it('search contacts', () => { diff --git a/cypress/integration/consortium_admin/doi.test.ts b/cypress/integration/consortium_admin/doi.test.ts index 4b4624693..ac43d091c 100644 --- a/cypress/integration/consortium_admin/doi.test.ts +++ b/cypress/integration/consortium_admin/doi.test.ts @@ -77,6 +77,9 @@ describe('ACCEPTANCE: CONSORTIUM_ADMIN | DOIS', () => { cy.get('#content').within(($content) => { cy.get('[data-test-doi]').its('length').should('be.gte', 1); }); + + // Create DOI button + cy.get('.create-doi-button').should('not.exist'); }); }); }); diff --git a/cypress/integration/consortium_admin/info.test.ts b/cypress/integration/consortium_admin/info.test.ts index c94a3dd2a..5b7a3a00f 100644 --- a/cypress/integration/consortium_admin/info.test.ts +++ b/cypress/integration/consortium_admin/info.test.ts @@ -65,6 +65,9 @@ describe('ACCEPTANCE: CONSORTIUM_ADMIN | INFO', () => { .and('include', '/providers/dc/dois'); cy.get('#chart-doi'); }); + + // Create DOI button + cy.get('.create-doi-button').should('not.exist'); }); }); diff --git a/cypress/integration/consortium_admin/organizations.test.ts b/cypress/integration/consortium_admin/organizations.test.ts index 069c76e6c..6f4bae211 100644 --- a/cypress/integration/consortium_admin/organizations.test.ts +++ b/cypress/integration/consortium_admin/organizations.test.ts @@ -67,6 +67,9 @@ describe('ACCEPTANCE: CONSORTIUM_ADMIN | CONSORTIUM ORGANIZATIONS', () => { cy.get('#content').within(($content) => { cy.get('[data-test-organization]').its('length').should('be.gte', 1); }); + + // Create DOI button + cy.get('.create-doi-button').should('not.exist'); }); }); diff --git a/cypress/integration/consortium_admin/repositories.test.ts b/cypress/integration/consortium_admin/repositories.test.ts index e8ae8bac8..1b8c245f5 100644 --- a/cypress/integration/consortium_admin/repositories.test.ts +++ b/cypress/integration/consortium_admin/repositories.test.ts @@ -67,6 +67,36 @@ describe('ACCEPTANCE: CONSORTIUM_ADMIN | REPOSITORIES', () => { cy.get('#content').within(($content) => { cy.get('[data-test-repository]').its('length').should('be.gte', 1); }); + + // Create DOI button + cy.get('.create-doi-button').should('not.exist'); }); }); + + // ASSUMING DATACITE.TEST EXISTS: + it('check repositories tabs for required components - assumes datacite.test exists', () => { + cy.visit('/repositories/datacite.test'); + cy.wait(waitTime2); + + // Create DOI button + cy.get('.create-doi-button').should('not.exist'); + + cy.visit('/repositories/datacite.test/info'); + cy.wait(waitTime2); + + // Create DOI button + cy.get('.create-doi-button').should('not.exist'); + + cy.visit('/repositories/datacite.test/prefixes'); + cy.wait(waitTime2); + + // Create DOI button + cy.get('.create-doi-button').should('not.exist'); + + cy.visit('/repositories/datacite.test/dois'); + cy.wait(waitTime2); + + // Create DOI button + cy.get('.create-doi-button').should('not.exist'); + }); }); diff --git a/cypress/integration/consortium_admin/settings.test.ts b/cypress/integration/consortium_admin/settings.test.ts index 78dd3f53a..74c6d0ca9 100644 --- a/cypress/integration/consortium_admin/settings.test.ts +++ b/cypress/integration/consortium_admin/settings.test.ts @@ -89,6 +89,9 @@ describe('ACCEPTANCE: CONSORTIUM_ADMIN | SETTINGS', () => { cy.get('h3.member-results').contains('Billing Information'); cy.get('.icon-warning').contains(/Please provide this information./); + + // Create DOI button + cy.get('.create-doi-button').should('not.exist'); }); }); }); \ No newline at end of file From ae2551340ca7d086ecd18b6d4e5c8816cdfbd3f7 Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Mon, 24 Oct 2022 12:22:29 -0400 Subject: [PATCH 032/106] Fabrica Improvements - task 1 (create doi button - testing)). --- app/templates/components/repository-info.hbs | 5 --- cypress/integration/anonymous/admin.test.ts | 3 ++ .../integration/anonymous/anonymous.test.ts | 3 ++ cypress/integration/anonymous/doi.test.ts | 3 ++ .../integration/anonymous/provider.test.ts | 34 +++++++++++++------ .../integration/anonymous/repository.test.ts | 29 +++++++++++----- .../consortium_admin/prefixes.test.ts | 3 ++ 7 files changed, 57 insertions(+), 23 deletions(-) diff --git a/app/templates/components/repository-info.hbs b/app/templates/components/repository-info.hbs index 653fdb59e..759bc6724 100644 --- a/app/templates/components/repository-info.hbs +++ b/app/templates/components/repository-info.hbs @@ -1,12 +1,7 @@
-<<<<<<< HEAD -======= - {{!-- Need to override component classes due to addition of a sidebar. --}} - ->>>>>>> Fabrica Improvements - task 1 (create doi button - fix miscalculated privileges for prefixes tab)).
{{#if (can "read messages" model)}} diff --git a/cypress/integration/anonymous/admin.test.ts b/cypress/integration/anonymous/admin.test.ts index 2955254c8..03b0c3b1f 100644 --- a/cypress/integration/anonymous/admin.test.ts +++ b/cypress/integration/anonymous/admin.test.ts @@ -11,6 +11,9 @@ describe('ACCEPTANCE: ANONYMOUS | NO ADMIN ACCESS', function () { cy.url().should('eq', Cypress.config('baseUrl') + '/') cy.get('div.motto h1').contains(site_title); cy.get('a#sign-in').should('exist'); + + // Create DOI button + cy.get('.create-doi-button').should('not.exist'); }) // the following pages require authentication. Redirects to homepage otherwise. diff --git a/cypress/integration/anonymous/anonymous.test.ts b/cypress/integration/anonymous/anonymous.test.ts index 88b820dcc..eeef00323 100644 --- a/cypress/integration/anonymous/anonymous.test.ts +++ b/cypress/integration/anonymous/anonymous.test.ts @@ -12,6 +12,9 @@ describe('ACCEPTANCE: ANONYMOUS - AVAILABLE PAGES', () => { cy.visit('/'); cy.get('div.motto h1').contains(site_title); cy.get('a#sign-in').should('exist'); + + // Create DOI button + cy.get('.create-doi-button').should('not.exist'); }); }); diff --git a/cypress/integration/anonymous/doi.test.ts b/cypress/integration/anonymous/doi.test.ts index 670210b5a..b387b6588 100644 --- a/cypress/integration/anonymous/doi.test.ts +++ b/cypress/integration/anonymous/doi.test.ts @@ -16,5 +16,8 @@ describe('ACCEPTANCE: ANONYMOUS - DOI', () => { cy.get('h2.work').contains('10.80225/da52-7919'); cy.get('img.fabrica-logo').should('exist').should('have.attr', 'src').should('include', 'fabrica-logo.svg'); + + // Create DOI button + cy.get('.create-doi-button').should('not.exist'); }); }); diff --git a/cypress/integration/anonymous/provider.test.ts b/cypress/integration/anonymous/provider.test.ts index 1e20e0faf..4ff3b8502 100644 --- a/cypress/integration/anonymous/provider.test.ts +++ b/cypress/integration/anonymous/provider.test.ts @@ -8,8 +8,21 @@ describe('ACCEPTANCE: ANONYMOUS - PROVIDER', () => { const site_title = new RegExp('Datacite.*Fabrica', 'i') // the following pages require authentication. Redirects to homepage otherwise - it('visiting provider TIB', () => { - cy.visit('/providers/tib'); + it('visiting home page - testing for required elements', () => { + cy.visit('/'); + cy.location().should((loc) => { + expect(loc.pathname).to.eq('/'); + }); + cy.get('a#sign-in').should('exist'); + + cy.get('div.motto h1').contains(site_title); + + // Create DOI button + cy.get('.create-doi-button').should('not.exist'); + }); + + it('visiting provider DATACITE', () => { + cy.visit('/providers/datacite'); cy.location().should((loc) => { expect(loc.pathname).to.eq('/'); }); @@ -18,8 +31,9 @@ describe('ACCEPTANCE: ANONYMOUS - PROVIDER', () => { cy.get('div.motto h1').contains(site_title); }); - it('visiting provider TIB settings', () => { - cy.visit('/providers/tib/settings'); + + it('visiting provider DATACITE settings', () => { + cy.visit('/providers/datacite/settings'); cy.location().should((loc) => { expect(loc.pathname).to.eq('/'); }); @@ -28,8 +42,8 @@ describe('ACCEPTANCE: ANONYMOUS - PROVIDER', () => { cy.get('div.motto h1').contains(site_title); }); - it('visiting provider TIB repositories', () => { - cy.visit('/providers/tib/repositories'); + it('visiting provider DATACITE repositories', () => { + cy.visit('/providers/datacite/repositories'); cy.location().should((loc) => { expect(loc.pathname).to.eq('/'); }); @@ -38,8 +52,8 @@ describe('ACCEPTANCE: ANONYMOUS - PROVIDER', () => { cy.get('div.motto h1').contains(site_title); }); - it('visiting provider TIB prefixes', () => { - cy.visit('/providers/tib/prefixes'); + it('visiting provider DATACITE prefixes', () => { + cy.visit('/providers/datacite/prefixes'); cy.location().should((loc) => { expect(loc.pathname).to.eq('/'); }); @@ -48,8 +62,8 @@ describe('ACCEPTANCE: ANONYMOUS - PROVIDER', () => { cy.get('div.motto h1').contains(site_title); }); - it('visiting provider TIB dois', () => { - cy.visit('/providers/tib/dois'); + it('visiting provider DATACITE dois', () => { + cy.visit('/providers/datacite/dois'); cy.location().should((loc) => { expect(loc.pathname).to.eq('/'); }); diff --git a/cypress/integration/anonymous/repository.test.ts b/cypress/integration/anonymous/repository.test.ts index e3566307c..ce03b67e3 100644 --- a/cypress/integration/anonymous/repository.test.ts +++ b/cypress/integration/anonymous/repository.test.ts @@ -7,10 +7,23 @@ describe('Anonymous: Repository', () => { }); const site_title = new RegExp('Datacite.*Fabrica', 'i') + // the following pages require authentication. Redirects to homepage otherwise + it('visiting home page - testing for required elements', () => { + cy.visit('/'); + cy.location().should((loc) => { + expect(loc.pathname).to.eq('/'); + }); + cy.get('a#sign-in').should('exist'); + + cy.get('div.motto h1').contains(site_title); + + // Create DOI button + cy.get('.create-doi-button').should('not.exist'); + }); // the following pages require authentication. Redirects to homepage otherwise - it('visiting repository AWI', () => { - cy.visit('/repositories/tib.awi'); + it('visiting repository DATACITE.TEST', () => { + cy.visit('/repositories/datacite.test'); cy.location().should((loc) => { expect(loc.pathname).to.eq('/'); }); @@ -19,8 +32,8 @@ describe('Anonymous: Repository', () => { cy.get('div.motto h1').contains(site_title); }); - it('visiting repository AWI settings', () => { - cy.visit('/repositories/tib.awi/settings'); + it('visiting repository DATACITE.TEST settings', () => { + cy.visit('/repositories/datacite.test/settings'); cy.location().should((loc) => { expect(loc.pathname).to.eq('/'); }); @@ -29,8 +42,8 @@ describe('Anonymous: Repository', () => { cy.get('div.motto h1').contains(site_title); }); - it('visiting repository AWI prefixes', () => { - cy.visit('/repositories/tib.awi/prefixes'); + it('visiting repository DATACITE.TEST prefixes', () => { + cy.visit('/repositories/datacite.test/prefixes'); cy.location().should((loc) => { expect(loc.pathname).to.eq('/'); }); @@ -39,8 +52,8 @@ describe('Anonymous: Repository', () => { cy.get('div.motto h1').contains(site_title); }); - it('visiting repository AWI dois', () => { - cy.visit('/repositories/tib.awi/dois'); + it('visiting repository DATACITE.TEST dois', () => { + cy.visit('/repositories/datacite.test/dois'); cy.location().should((loc) => { expect(loc.pathname).to.eq('/'); }); diff --git a/cypress/integration/consortium_admin/prefixes.test.ts b/cypress/integration/consortium_admin/prefixes.test.ts index 03091aaf4..0685ddf78 100644 --- a/cypress/integration/consortium_admin/prefixes.test.ts +++ b/cypress/integration/consortium_admin/prefixes.test.ts @@ -66,6 +66,9 @@ describe('ACCEPTANCE: CONSORTIUM_ADMIN | PREFIXES', () => { cy.get('#content').within(($content) => { cy.get('[data-test-prefix]').its('length').should('be.gte', 1); }); + + // Create DOI button + cy.get('.create-doi-button').should('not.exist'); }); }); }); From 0d85f236dbfa8d8bf88ae00505fda89aae9f21d4 Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Thu, 27 Oct 2022 13:43:47 -0400 Subject: [PATCH 033/106] Fabrica Improvements - task 1 (create-doi-button styles) --- app/components/create-doi-button.js | 1 - app/styles/app.css | 2 +- .../{create-doi-button.css => local.css} | 32 +++++++------------ .../components/create-doi-button.hbs | 22 +++++++------ 4 files changed, 24 insertions(+), 33 deletions(-) rename app/styles/{create-doi-button.css => local.css} (62%) diff --git a/app/components/create-doi-button.js b/app/components/create-doi-button.js index ed676cc76..43912acf8 100755 --- a/app/components/create-doi-button.js +++ b/app/components/create-doi-button.js @@ -4,7 +4,6 @@ import { inject as service } from '@ember/service'; export default Component.extend({ currentUser: service(), - //classNames: [ 'panel', 'facets' ], classNames: [], didReceiveAttrs() { diff --git a/app/styles/app.css b/app/styles/app.css index 2aba9331a..2e4008496 100644 --- a/app/styles/app.css +++ b/app/styles/app.css @@ -1,2 +1,2 @@ @import 'header.css'; -@import 'create-doi-button.css'; +@import 'local.css'; diff --git a/app/styles/create-doi-button.css b/app/styles/local.css similarity index 62% rename from app/styles/create-doi-button.css rename to app/styles/local.css index d65b3a12f..e3d43fb50 100755 --- a/app/styles/create-doi-button.css +++ b/app/styles/local.css @@ -1,10 +1,9 @@ -.btn-group-vertical { - margin-left: 5px; -} +/* + Overrides to shared css/scss/sass styles pulled from: + https://datacite.org/stylesheets/doi.css?version=3.9.43 +*/ -.create-doi-button button { - font-size: 16px; -} +/* create-doi-button */ /* Otherwise drop-down menu falls behind other objects. */ .create-doi-button .ember-bootstrap-dropdown-bs3-popper { @@ -12,31 +11,22 @@ } .create-doi-button ul.dropdown-menu.show { - margin-top: 5px; + margin-top: -2px; + margin-left: 10px; } .create-doi-button ul.dropdown-menu.show a { width: 100%; color: #e67e22; font-size: 16px !important; + padding-left: 5px; } .create-doi-button ul.dropdown-menu.show a:hover { background-color: rgb(128, 128, 128, .1); } -.create-doi-button button.btn { - border-radius: 26px; -} - -.panel.facets.add-25 { - margin-top: .25em; -} - -.panel.facets.add-50 { - margin-top: .50em; -} - -.panel.facets.add-75 { - margin-top: .75em; +/* To make a left sidebar button line up with the others. */ +.btn-group-vertical { + margin-left: 5px; } diff --git a/app/templates/components/create-doi-button.hbs b/app/templates/components/create-doi-button.hbs index ddf3f02f3..50af41786 100755 --- a/app/templates/components/create-doi-button.hbs +++ b/app/templates/components/create-doi-button.hbs @@ -1,12 +1,14 @@ - Create DOI - - - - DOI Form - - - File Upload - + + Create DOI + + + + + DOI Form + + + File Upload + - + \ No newline at end of file From 0e74ba5c6070c69e1c0fedcc8f072614b6ddca10 Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Wed, 2 Nov 2022 13:52:37 -0400 Subject: [PATCH 034/106] Fabrica Improvements 1 - rebase and fixes. --- app/helpers/settings-route.js | 8 +++ app/styles/local.css | 16 ++++++ .../components/application-header.hbs | 4 +- app/templates/components/doi-list.hbs | 21 ++++---- app/templates/components/provider-info.hbs | 2 +- app/templates/providers/show/index.hbs | 8 ++- app/templates/repositories/show/index.hbs | 54 ++++++++----------- .../repositories/show/prefixes/index.hbs | 23 ++++---- app/templates/repositories/show/settings.hbs | 26 +++++++++ 9 files changed, 104 insertions(+), 58 deletions(-) create mode 100755 app/helpers/settings-route.js diff --git a/app/helpers/settings-route.js b/app/helpers/settings-route.js new file mode 100755 index 000000000..a687a86d1 --- /dev/null +++ b/app/helpers/settings-route.js @@ -0,0 +1,8 @@ +import { helper as buildHelper } from '@ember/component/helper'; + +export function settingsRoute(route) { + if (route == "index") {return "settings";} + return route + '.settings'; +} + +export default buildHelper(settingsRoute); diff --git a/app/styles/local.css b/app/styles/local.css index e3d43fb50..2d7307a05 100755 --- a/app/styles/local.css +++ b/app/styles/local.css @@ -30,3 +30,19 @@ .btn-group-vertical { margin-left: 5px; } + +/* Fix info tab bar chart resize at upper breakpoints. Div width @ 33% causes svg to overflow the box.*/ + +@media (min-width: 992px) { + .row-chart .col-md-4 { + width: auto; + } +} + +/* Fix info tab bar chart indent at upper breakpoint.*/ +@media (min-width: 1200px) { + .col-lg-offset-3 { + /* margin-left: 25%; */ + margin-left: 0; + } +} diff --git a/app/templates/components/application-header.hbs b/app/templates/components/application-header.hbs index faaeb7404..9b13ec7d1 100644 --- a/app/templates/components/application-header.hbs +++ b/app/templates/components/application-header.hbs @@ -42,7 +42,7 @@ {{currentUser.roleName}} - + Settings @@ -71,4 +71,4 @@ {{/if}} - \ No newline at end of file + diff --git a/app/templates/components/doi-list.hbs b/app/templates/components/doi-list.hbs index 3a4863c1d..e7eeb0d67 100644 --- a/app/templates/components/doi-list.hbs +++ b/app/templates/components/doi-list.hbs @@ -5,28 +5,27 @@ {{#if (and repository.isActive - (gt repository.meta.prefixCount 0) (or (can 'create doi' model) (can 'upload doi' model) ) ) }} -
-
- + {{#if (gt repository.meta.prefixCount 0) }} +
+
+ +
-
- {{else}} -
-
- {{#if (eq repository.meta.prefixCount 0)}} + {{else}} +
+
Can't create DOI without a prefix. - {{/if}} +
-
+ {{/if}} {{/if}} {{#if (and (can 'move doi' repository) (gt model.length 0))}} diff --git a/app/templates/components/provider-info.hbs b/app/templates/components/provider-info.hbs index 90432a3a3..6f3f58d19 100644 --- a/app/templates/components/provider-info.hbs +++ b/app/templates/components/provider-info.hbs @@ -1,6 +1,6 @@
-
+
{{#if (eq model.memberType 'consortium')}} \ No newline at end of file +
+
+
+
+ +
+
\ No newline at end of file diff --git a/app/templates/repositories/show/index.hbs b/app/templates/repositories/show/index.hbs index 4bb66f7f4..ebe32d59e 100644 --- a/app/templates/repositories/show/index.hbs +++ b/app/templates/repositories/show/index.hbs @@ -1,42 +1,32 @@
- {{#if (can 'update repository' model)}} - - {{#if - (and - model.isActive - (or - (can 'create doi' model) - (can 'upload doi' model) - ) + {{#if + (and + model.isActive + (can 'update repository' model) + (or + (can 'create doi' model) + (can 'upload doi' model) ) + ) + }} + {{#if + (gt model.meta.prefixCount 0) }} - {{#if - (gt model.meta.prefixCount 0) - }} -
-
- -
+
+
+
- {{else}} -
-
- {{#if (eq model.meta.prefixCount 0)}} - - Can't create DOI without a prefix. - - {{/if}} -
+
+ {{else}} +
+
+ + Can't create DOI without a prefix. +
- {{/if}} - {{/if}} - -
-
-
-
+ {{/if}} {{/if}}
diff --git a/app/templates/repositories/show/prefixes/index.hbs b/app/templates/repositories/show/prefixes/index.hbs index f6e870aab..23281a066 100644 --- a/app/templates/repositories/show/prefixes/index.hbs +++ b/app/templates/repositories/show/prefixes/index.hbs @@ -2,28 +2,29 @@ {{#if (and model.repository.isActive - (gt model.repository.meta.prefixCount 0) (or (can 'create doi' model) (can 'upload doi' model) ) ) }} -
-
- + {{#if + (gt model.repository-prefixes.length 0) + }} +
+
+ +
-
- {{else}} -
-
- {{#if (eq model.repository.meta.prefixCount 0)}} + {{else}} +
+
Can't create DOI without a prefix. - {{/if}} +
-
+ {{/if}} {{/if}} {{#if (and (can 'write index') model.repository.isActive)}} diff --git a/app/templates/repositories/show/settings.hbs b/app/templates/repositories/show/settings.hbs index 4620c286c..39c14b5f8 100644 --- a/app/templates/repositories/show/settings.hbs +++ b/app/templates/repositories/show/settings.hbs @@ -1,5 +1,31 @@
+ {{#if + (and + model.isActive + (or + (can 'create doi' model) + (can 'upload doi' model) + ) + ) + }} + {{#if (gt model.meta.prefixCount 0) }} +
+
+ +
+
+ {{else}} +
+
+ + Can't create DOI without a prefix. + +
+
+ {{/if}} + {{/if}} + {{#if (can 'update repository' model)}}
From d9784a19a098ed8e5ee46a9ff3af8c98f8e1f4be Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Wed, 2 Nov 2022 14:33:03 -0400 Subject: [PATCH 035/106] Fabrica Improvements 1 - rebase and fixes. --- app/templates/components/index-info.hbs | 2 +- app/templates/index.hbs | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/templates/components/index-info.hbs b/app/templates/components/index-info.hbs index 5b120e48f..eac033d12 100644 --- a/app/templates/components/index-info.hbs +++ b/app/templates/components/index-info.hbs @@ -9,7 +9,7 @@
{{/if}} -
+
diff --git a/app/templates/index.hbs b/app/templates/index.hbs index 61a38eed3..e97808e2b 100644 --- a/app/templates/index.hbs +++ b/app/templates/index.hbs @@ -1,10 +1,14 @@ {{#if (can "read index")}} -
- - +
+
+
+
+ +
+
{{else}} From 0883b4191a1869696c244096933187be56bcfaa8 Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Mon, 17 Oct 2022 11:00:12 -0400 Subject: [PATCH 036/106] Fabrica-improvements: export basic metadata. --- app/components/doi-list.js | 2 ++ app/helpers/export-basic-metadata-url.js | 38 +++++++++++++++++++++++ app/templates/components/doi-list.hbs | 39 ++++++++++++------------ 3 files changed, 60 insertions(+), 19 deletions(-) create mode 100755 app/helpers/export-basic-metadata-url.js diff --git a/app/components/doi-list.js b/app/components/doi-list.js index 4de2e0e92..35a498c8f 100644 --- a/app/components/doi-list.js +++ b/app/components/doi-list.js @@ -1,9 +1,11 @@ import Component from '@ember/component'; import { inject as service } from '@ember/service'; import { computed } from '@ember/object'; +import ENV from 'bracco/config/environment'; export default Component.extend({ can: service(), + router: service(), tagName: 'div', classNames: ['row'], isResearcherProfile: computed('data', 'link', function () { diff --git a/app/helpers/export-basic-metadata-url.js b/app/helpers/export-basic-metadata-url.js new file mode 100755 index 000000000..d957d49c0 --- /dev/null +++ b/app/helpers/export-basic-metadata-url.js @@ -0,0 +1,38 @@ +import { helper as buildHelper } from '@ember/component/helper'; +import ENV from 'bracco/config/environment'; + +export function exportBasicMetadataUrl([ id, routeInfo ]) { + let query = ''; + + if (id !== undefined) { + if (routeInfo.name.startsWith("repositories")) { + query = "client-id=" + id + } else if (routeInfo.name.startsWith("providers")) { + query = "provider-id" + id + } + } + + if ('sort' in routeInfo.queryParams) { + query = query + (query ? '&' : '') + 'sort=' + routeInfo.queryParams['sort']; + } + + if ('page' in routeInfo.queryParams) { + query = query + (query ? '&' : '') + 'page=' + routeInfo.queryParams['page']; + } else if ('page[number]' in routeInfo.queryParams) { + query = query + (query ? '&' : '') + 'page[number]=' + routeInfo.queryParams['page[number]']; + } else { + query = query + (query? '&' : '') + 'page=1'; + } + + if ('size' in routeInfo.queryParams) { + query = query + (query ? '&' : '') + 'size=' + routeInfo.queryParams['size']; + } + + if ('page[size]' in routeInfo.queryParams) { + query = query + (query ? '&' : '') + 'page[size]=' + routeInfo.queryParams['page[size]']; + } + + return ENV.API_URL + '/dois/text/csv' + (query ? '?' : '') + query; +} + +export default buildHelper(exportBasicMetadataUrl); diff --git a/app/templates/components/doi-list.hbs b/app/templates/components/doi-list.hbs index e7eeb0d67..708be6a95 100644 --- a/app/templates/components/doi-list.hbs +++ b/app/templates/components/doi-list.hbs @@ -28,33 +28,34 @@ {{/if}} {{/if}} - {{#if (and (can 'move doi' repository) (gt model.length 0))}} + {{#if (and repository.isActive (gt model.length 0))}}
-
-
- - - Transfer - {{if media.isXl ' DOIs'}} - -
+
+
+ + {{#if (and (can 'move doi' repository))}} + + + Transfer + {{if media.isXl ' DOIs'}} + + {{/if}}
+
{{else}}
- {{#if (eq repository.meta.prefixCount 0)}} - - No DOIs available to transfer. - - {{/if}} + + No DOIs available to transfer. +
{{/if}} From da666a7340e7a2ed14a0e4118b1270c8656403bc Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Mon, 17 Oct 2022 11:37:05 -0400 Subject: [PATCH 037/106] Fabrica improvements(5): export basic metadata. --- app/templates/components/doi-list.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/templates/components/doi-list.hbs b/app/templates/components/doi-list.hbs index 708be6a95..3f75ab890 100644 --- a/app/templates/components/doi-list.hbs +++ b/app/templates/components/doi-list.hbs @@ -28,7 +28,7 @@ {{/if}} {{/if}} - {{#if (and repository.isActive (gt model.length 0))}} + {{#if (and repository.isActive (gt model.length 0))}}
From 753b88b8cd008e0cd666c216ab92a0ede0e8ab83 Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Mon, 17 Oct 2022 11:46:18 -0400 Subject: [PATCH 038/106] Fabrica improvements(5): export basic metadata. --- app/templates/components/doi-list.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/templates/components/doi-list.hbs b/app/templates/components/doi-list.hbs index 3f75ab890..4b614ad52 100644 --- a/app/templates/components/doi-list.hbs +++ b/app/templates/components/doi-list.hbs @@ -28,7 +28,7 @@ {{/if}} {{/if}} - {{#if (and repository.isActive (gt model.length 0))}} + {{#if (and repository.isActive (gt model.length 0))}}
From d735415d2f64d81be36ca02f094c489be24c8406 Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Wed, 19 Oct 2022 18:19:02 -0400 Subject: [PATCH 039/106] Fabrica improvements(5): export basic metadata. --- app/styles/local.css | 18 ++++++++++++++++++ app/templates/components/doi-list.hbs | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/app/styles/local.css b/app/styles/local.css index 2d7307a05..b0439b699 100755 --- a/app/styles/local.css +++ b/app/styles/local.css @@ -46,3 +46,21 @@ margin-left: 0; } } + +/* +/* Make this look more like other "buttons" in the left sidebar. / +.btn-group-sm.btn-single>.btn { + border-radius: 13px; +} + +/* Remove padding and height from a transparent column top element. / +.panel-transparent.panel-top { + height: 0; + margin-bottom: 0; +} + +/* Why does this have a left-margin of -5px. Correcting to 0. / +.btn-toolbar { + margin-left: 0; +} +*/ \ No newline at end of file diff --git a/app/templates/components/doi-list.hbs b/app/templates/components/doi-list.hbs index 4b614ad52..708be6a95 100644 --- a/app/templates/components/doi-list.hbs +++ b/app/templates/components/doi-list.hbs @@ -28,7 +28,7 @@ {{/if}} {{/if}} - {{#if (and repository.isActive (gt model.length 0))}} + {{#if (and repository.isActive (gt model.length 0))}}
From e1a256a1ddb7a7b9269130e21a252a3ac9bd18a9 Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Thu, 20 Oct 2022 13:45:41 -0400 Subject: [PATCH 040/106] Fabrica improvements(5): export basic metadata. --- app/components/doi-list.js | 1 + cypress/integration/client_admin/doi.test.ts | 10 +++++----- tests/integration/components/doi-list-test.js | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/components/doi-list.js b/app/components/doi-list.js index 35a498c8f..2486dbe93 100644 --- a/app/components/doi-list.js +++ b/app/components/doi-list.js @@ -2,6 +2,7 @@ import Component from '@ember/component'; import { inject as service } from '@ember/service'; import { computed } from '@ember/object'; import ENV from 'bracco/config/environment'; +import { reads } from '@ember/object/computed'; export default Component.extend({ can: service(), diff --git a/cypress/integration/client_admin/doi.test.ts b/cypress/integration/client_admin/doi.test.ts index e90a9ee00..2df52bce1 100644 --- a/cypress/integration/client_admin/doi.test.ts +++ b/cypress/integration/client_admin/doi.test.ts @@ -114,9 +114,9 @@ describe('ACCEPTANCE: CLIENT_ADMIN | DOIS', () => { // Set language. // Causes the aria dropdown to be populated and displayed so that selection can be made. - cy.get('div#doi-language div[role="button"]').click({ force: true }).then(($dropdown) => { + cy.get('div#doi-language div[role="button"]').click({ waitForAnimations: true }).then(($dropdown) => { // Makes the selection. - cy.get("ul.ember-power-select-options li").contains("English").click({ force: true }); + cy.get("ul.ember-power-select-options li").contains("English").click({ waitForAnimations: true }); }); // Set geolocation. @@ -144,10 +144,10 @@ describe('ACCEPTANCE: CLIENT_ADMIN | DOIS', () => { cy.get('#add-contributor').click({ force: true }).then(($subform) => { cy.get('.help-block.name-identifier-field').should('be.visible').should('have.text','Use name identifier expressed as URL. Uniquely identifies an individual or legal entity, according to various schemas, e.g. ORCID, ROR or ISNI. The Given Name, Family Name, and Name will automatically be filled out for ORCID and ROR identifiers.') // Causes the aria dropdown to be populated and displayed so that selection can be made. - cy.get('[doi-contributor] div[role="button"]').click({ force: true }).then(($dropdown) => { + cy.get('[doi-contributor] div[role="button"]').click({ waitForAnimations: true }).then(($dropdown) => { // Makes the selection from the dropdown. - cy.get("ul.ember-power-select-options li").contains("Data collector").click({ force: true }); - cy.get('#toggle-contributors').should('be.visible').click({ force: true }).then(($toggle) => { + cy.get("ul.ember-power-select-options li").contains("Data collector").click({ waitForAnimations: true }); + cy.get('#toggle-contributors').should('be.visible').click({ waitForAnimations: true }).then(($toggle) => { cy.get('#toggle-contributors').contains('Show 1 contributor'); }) }) diff --git a/tests/integration/components/doi-list-test.js b/tests/integration/components/doi-list-test.js index dd71c55c9..a41da64d5 100644 --- a/tests/integration/components/doi-list-test.js +++ b/tests/integration/components/doi-list-test.js @@ -1,4 +1,4 @@ -import { module, test } from 'qunit'; +import { module, test, skip } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import { render } from '@ember/test-helpers'; import hbs from 'htmlbars-inline-precompile'; @@ -8,7 +8,7 @@ module('Integration | Component | doi-list', function(hooks) { setupRenderingTest(hooks); setupFactoryGuy(hooks); - test('it renders', async function(assert) { + skip('it renders', async function(assert) { // model is list of DOIs this.set('model', makeList('doi', 1)); await render(hbs`{{doi-list model=model}}`); From c2cb43a100aa3cb9b2e6bb42e0844ae452bcd549 Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Thu, 20 Oct 2022 13:48:50 -0400 Subject: [PATCH 041/106] Fabrica improvements(5): export basic metadata. --- app/styles/local.css | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/app/styles/local.css b/app/styles/local.css index b0439b699..77a2dd80b 100755 --- a/app/styles/local.css +++ b/app/styles/local.css @@ -47,20 +47,12 @@ } } -/* -/* Make this look more like other "buttons" in the left sidebar. / +/* Make this look more like other "buttons" in the left sidebar. */ .btn-group-sm.btn-single>.btn { border-radius: 13px; } -/* Remove padding and height from a transparent column top element. / -.panel-transparent.panel-top { - height: 0; - margin-bottom: 0; -} - -/* Why does this have a left-margin of -5px. Correcting to 0. / +/* Why does this have a left-margin of -5px. Correcting to 0. */ .btn-toolbar { margin-left: 0; } -*/ \ No newline at end of file From c42a38407e931051b133b901241ccd547f633427 Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Mon, 24 Oct 2022 16:57:26 -0400 Subject: [PATCH 042/106] Fabrica improvements(5): export basic metadata. (Create component.) --- app/components/doi-list.js | 1 - 1 file changed, 1 deletion(-) diff --git a/app/components/doi-list.js b/app/components/doi-list.js index 2486dbe93..35a498c8f 100644 --- a/app/components/doi-list.js +++ b/app/components/doi-list.js @@ -2,7 +2,6 @@ import Component from '@ember/component'; import { inject as service } from '@ember/service'; import { computed } from '@ember/object'; import ENV from 'bracco/config/environment'; -import { reads } from '@ember/object/computed'; export default Component.extend({ can: service(), From 64caed7127290420aa17ada6dc3becb167c57191 Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Mon, 24 Oct 2022 16:58:02 -0400 Subject: [PATCH 043/106] Fabrica improvements(5): export basic metadata. (Create component.) --- app/components/export-basic-metadata.js | 11 +++++++++++ app/templates/components/export-basic-metadata.hbs | 13 +++++++++++++ 2 files changed, 24 insertions(+) create mode 100755 app/components/export-basic-metadata.js create mode 100755 app/templates/components/export-basic-metadata.hbs diff --git a/app/components/export-basic-metadata.js b/app/components/export-basic-metadata.js new file mode 100755 index 000000000..32d09d6f5 --- /dev/null +++ b/app/components/export-basic-metadata.js @@ -0,0 +1,11 @@ +import Component from '@ember/component'; +import { inject as service } from '@ember/service'; +import { reads } from '@ember/object/computed'; + +export default Component.extend({ + router: service(), + tagName: 'div', + classNames: ['export-basic-metadata'], + repositoryId: reads('router.currentRoute.attributes.repository.id'), + providerId: reads('router.currentRoute.attributes.provider.id') +}) \ No newline at end of file diff --git a/app/templates/components/export-basic-metadata.hbs b/app/templates/components/export-basic-metadata.hbs new file mode 100755 index 000000000..f9d5bbcf1 --- /dev/null +++ b/app/templates/components/export-basic-metadata.hbs @@ -0,0 +1,13 @@ +{{#if (eq link 'repositories.show.dois')}} + Export DOI Metadata + +{{else if (eq link 'providers.show.dois')}} + Export DOI Metadata + +{{else}} + Export DOI Metadata + +{{/if}} \ No newline at end of file From 75155ede479088db8cd7a10206cb819ca51a532f Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Tue, 25 Oct 2022 00:01:30 -0400 Subject: [PATCH 044/106] Fabrica improvements(5): export basic metadata. --- app/components/export-basic-metadata.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/components/export-basic-metadata.js b/app/components/export-basic-metadata.js index 32d09d6f5..9bf12bc7c 100755 --- a/app/components/export-basic-metadata.js +++ b/app/components/export-basic-metadata.js @@ -4,7 +4,7 @@ import { reads } from '@ember/object/computed'; export default Component.extend({ router: service(), - tagName: 'div', + tagName: '', classNames: ['export-basic-metadata'], repositoryId: reads('router.currentRoute.attributes.repository.id'), providerId: reads('router.currentRoute.attributes.provider.id') From 3711349b09488b316b605954ba82a417b7e5fca9 Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Wed, 26 Oct 2022 21:20:24 -0400 Subject: [PATCH 045/106] Fabrica improvements(5): export basic metadata. --- app/components/export-basic-metadata.js | 40 ++++++++++++++++--- app/helpers/export-basic-metadata-url.js | 38 ------------------ .../components/export-basic-metadata.hbs | 14 +------ package.json | 4 +- tests/integration/components/doi-list-test.js | 2 +- yarn.lock | 31 ++++++++++++++ 6 files changed, 70 insertions(+), 59 deletions(-) delete mode 100755 app/helpers/export-basic-metadata-url.js diff --git a/app/components/export-basic-metadata.js b/app/components/export-basic-metadata.js index 9bf12bc7c..191e83e8a 100755 --- a/app/components/export-basic-metadata.js +++ b/app/components/export-basic-metadata.js @@ -1,11 +1,39 @@ import Component from '@ember/component'; -import { inject as service } from '@ember/service'; -import { reads } from '@ember/object/computed'; +//import { inject as service } from '@ember/service'; +//import { reads } from '@ember/object/computed'; +import Papa from 'papaparse'; +import FileSaverMixin from 'ember-cli-file-saver/mixins/file-saver'; -export default Component.extend({ - router: service(), +export default Component.extend(FileSaverMixin, { + //router: service(), tagName: '', classNames: ['export-basic-metadata'], - repositoryId: reads('router.currentRoute.attributes.repository.id'), - providerId: reads('router.currentRoute.attributes.provider.id') + //repositoryId: reads('router.currentRoute.attributes.repository.id'), + //providerId: reads('router.currentRoute.attributes.provider.id'), + + actions: { + exportBasicMetadata(model) { + let dois = []; + + this.model.forEach(function(doi, meta = this.model.meta, i = 0) { + dois.push({ + "doi" : doi.doi, + "url" : doi.url, + "registered": doi.registered, + "state": doi.state, + //"resourceTypeGeneral": meta.resourceTypes[i].title, + //"resourceTypes": ??, + "title": doi.title, + "author": doi.author, + "publisher": doi.publisher, + "publicationYear": doi.publicationYear + }); + i++; + }); + + var csv = Papa.unparse(dois); + + this.saveFileAs('dois.csv', csv, 'text/csv'); + } + } }) \ No newline at end of file diff --git a/app/helpers/export-basic-metadata-url.js b/app/helpers/export-basic-metadata-url.js deleted file mode 100755 index d957d49c0..000000000 --- a/app/helpers/export-basic-metadata-url.js +++ /dev/null @@ -1,38 +0,0 @@ -import { helper as buildHelper } from '@ember/component/helper'; -import ENV from 'bracco/config/environment'; - -export function exportBasicMetadataUrl([ id, routeInfo ]) { - let query = ''; - - if (id !== undefined) { - if (routeInfo.name.startsWith("repositories")) { - query = "client-id=" + id - } else if (routeInfo.name.startsWith("providers")) { - query = "provider-id" + id - } - } - - if ('sort' in routeInfo.queryParams) { - query = query + (query ? '&' : '') + 'sort=' + routeInfo.queryParams['sort']; - } - - if ('page' in routeInfo.queryParams) { - query = query + (query ? '&' : '') + 'page=' + routeInfo.queryParams['page']; - } else if ('page[number]' in routeInfo.queryParams) { - query = query + (query ? '&' : '') + 'page[number]=' + routeInfo.queryParams['page[number]']; - } else { - query = query + (query? '&' : '') + 'page=1'; - } - - if ('size' in routeInfo.queryParams) { - query = query + (query ? '&' : '') + 'size=' + routeInfo.queryParams['size']; - } - - if ('page[size]' in routeInfo.queryParams) { - query = query + (query ? '&' : '') + 'page[size]=' + routeInfo.queryParams['page[size]']; - } - - return ENV.API_URL + '/dois/text/csv' + (query ? '?' : '') + query; -} - -export default buildHelper(exportBasicMetadataUrl); diff --git a/app/templates/components/export-basic-metadata.hbs b/app/templates/components/export-basic-metadata.hbs index f9d5bbcf1..78acfb485 100755 --- a/app/templates/components/export-basic-metadata.hbs +++ b/app/templates/components/export-basic-metadata.hbs @@ -1,13 +1 @@ -{{#if (eq link 'repositories.show.dois')}} - Export DOI Metadata - -{{else if (eq link 'providers.show.dois')}} - Export DOI Metadata - -{{else}} - Export DOI Metadata - -{{/if}} \ No newline at end of file + diff --git a/package.json b/package.json index d845e7238..9b03c6df5 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,9 @@ "mime": "^2.4.4", "pascal-case": "^3.1.1", "validator": "^13.7.0", - "wait-on": "^5.2.0" + "wait-on": "^5.2.0", + "ember-papaparse": "~1.0.0", + "ember-cli-file-saver": "~2.0.0" }, "fastbootDependencies": [ "node-fetch", diff --git a/tests/integration/components/doi-list-test.js b/tests/integration/components/doi-list-test.js index a41da64d5..672fb2f94 100644 --- a/tests/integration/components/doi-list-test.js +++ b/tests/integration/components/doi-list-test.js @@ -8,7 +8,7 @@ module('Integration | Component | doi-list', function(hooks) { setupRenderingTest(hooks); setupFactoryGuy(hooks); - skip('it renders', async function(assert) { + test('it renders', async function(assert) { // model is list of DOIs this.set('model', makeList('doi', 1)); await render(hbs`{{doi-list model=model}}`); diff --git a/yarn.lock b/yarn.lock index 6da011acf..bb17c4bc6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10825,6 +10825,17 @@ ember-cli-fastboot@^2.2.1: md5-hex "^2.0.0" silent-error "^1.1.0" +ember-cli-file-saver@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ember-cli-file-saver/-/ember-cli-file-saver-2.0.0.tgz#99c218710ba77f52d61c7b486e66635add4bbdf7" + integrity sha512-Cr7s+1EgT/eMabDdrpIrmQ/wqOe+/eDunxOb1IIc8GHDyK6ytgwjjpHG2vo/a6k3LEYRUcm7MRa9B1MVw4AKoQ== + dependencies: + broccoli-funnel "^2.0.1" + broccoli-merge-trees "^2.0.0" + broccoli-stew "^1.5.0" + ember-cli-babel "^6.3.0" + file-saver "2.0.0" + ember-cli-flash@^1.8.0: version "1.8.0" resolved "https://registry.yarnpkg.com/ember-cli-flash/-/ember-cli-flash-1.8.0.tgz#365decadc850e77b70c1c64ce6ab6f58662f7c38" @@ -11806,6 +11817,16 @@ ember-on-helper@^0.1.0: dependencies: ember-cli-babel "^7.7.3" +ember-papaparse@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/ember-papaparse/-/ember-papaparse-1.0.0.tgz#7116ad3392f0f3179e4b062341b88cb86092ca44" + integrity sha512-NxdUghiJSb4QeRGojJ8ruAC5hiij8bP3zZoUm/aSQIgiYBj4v+QDvs+JO3Z7S1Gao3PoZZeaePsey5H+yey4Wg== + dependencies: + broccoli-funnel "^2.0.1" + broccoli-merge-trees "^2.0.0" + ember-cli-babel "^6.6.0" + papaparse "^4.3.6" + ember-popper@^0.10.3: version "0.10.3" resolved "https://registry.yarnpkg.com/ember-popper/-/ember-popper-0.10.3.tgz#222ecce35a6777364bec7ec293437f27a28713a1" @@ -13024,6 +13045,11 @@ file-entry-cache@^6.0.0: dependencies: flat-cache "^3.0.4" +file-saver@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/file-saver/-/file-saver-2.0.0.tgz#74eef7748159503b60008a15af2f1930fb5df7ab" + integrity sha512-cYM1ic5DAkg25pHKgi5f10ziAM7RJU37gaH1XQlyNDrtUnzhC/dfoV9zf2OmF0RMKi42jG5B0JWBnPQqyj/G6g== + fileset@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/fileset/-/fileset-2.0.3.tgz#8e7548a96d3cc2327ee5e674168723a333bba2a0" @@ -17092,6 +17118,11 @@ pako@~1.0.5: resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.10.tgz#4328badb5086a426aa90f541977d4955da5c9732" integrity sha512-0DTvPVU3ed8+HNXOu5Bs+o//Mbdj9VNQMUOe9oKCwh8l0GNwpTDMKCWbRjgtD291AWnkAgkqA/LOnQS8AmS1tw== +papaparse@^4.3.6: + version "4.6.3" + resolved "https://registry.yarnpkg.com/papaparse/-/papaparse-4.6.3.tgz#742e5eaaa97fa6c7e1358d2934d8f18f44aee781" + integrity sha512-LRq7BrHC2kHPBYSD50aKuw/B/dGcg29omyJbKWY3KsYUZU69RKwaBHu13jGmCYBtOc4odsLCrFyk6imfyNubJQ== + parallel-transform@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/parallel-transform/-/parallel-transform-1.1.0.tgz#d410f065b05da23081fcd10f28854c29bda33b06" From a8c7dc540e2cb76fa42436f5687670a4a8a8f4c8 Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Thu, 27 Oct 2022 09:21:38 -0400 Subject: [PATCH 046/106] Fabrica improvements(5): export basic metadata. --- app/components/doi-list.js | 2 -- package.json | 8 ++++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/components/doi-list.js b/app/components/doi-list.js index 35a498c8f..4de2e0e92 100644 --- a/app/components/doi-list.js +++ b/app/components/doi-list.js @@ -1,11 +1,9 @@ import Component from '@ember/component'; import { inject as service } from '@ember/service'; import { computed } from '@ember/object'; -import ENV from 'bracco/config/environment'; export default Component.extend({ can: service(), - router: service(), tagName: 'div', classNames: ['row'], isResearcherProfile: computed('data', 'link', function () { diff --git a/package.json b/package.json index 9b03c6df5..0cccdc52b 100644 --- a/package.json +++ b/package.json @@ -47,9 +47,7 @@ "mime": "^2.4.4", "pascal-case": "^3.1.1", "validator": "^13.7.0", - "wait-on": "^5.2.0", - "ember-papaparse": "~1.0.0", - "ember-cli-file-saver": "~2.0.0" + "wait-on": "^5.2.0" }, "fastbootDependencies": [ "node-fetch", @@ -173,7 +171,9 @@ "typescript": "^3.7.4", "urijs": "^1.19.11", "vkbeautify": "^0.99.3", - "xml2js": "^0.4.23" + "xml2js": "^0.4.23", + "ember-papaparse": "~1.0.0", + "ember-cli-file-saver": "~2.0.0" }, "engines": { "node": "14.*" From 3c46679d21131d87381debd6b906d3074dab2e4d Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Thu, 27 Oct 2022 11:58:49 -0400 Subject: [PATCH 047/106] Fabrica improvements(5): export basic metadata. (FileSaver) --- app/components/export-basic-metadata.js | 15 ++++++--------- package.json | 8 ++++---- tests/integration/components/doi-list-test.js | 2 +- yarn.lock | 19 ++++--------------- 4 files changed, 15 insertions(+), 29 deletions(-) diff --git a/app/components/export-basic-metadata.js b/app/components/export-basic-metadata.js index 191e83e8a..fc7f548a5 100755 --- a/app/components/export-basic-metadata.js +++ b/app/components/export-basic-metadata.js @@ -1,15 +1,10 @@ import Component from '@ember/component'; -//import { inject as service } from '@ember/service'; -//import { reads } from '@ember/object/computed'; import Papa from 'papaparse'; -import FileSaverMixin from 'ember-cli-file-saver/mixins/file-saver'; +import FileSaver from 'file-saver'; -export default Component.extend(FileSaverMixin, { - //router: service(), +export default Component.extend({ tagName: '', classNames: ['export-basic-metadata'], - //repositoryId: reads('router.currentRoute.attributes.repository.id'), - //providerId: reads('router.currentRoute.attributes.provider.id'), actions: { exportBasicMetadata(model) { @@ -30,10 +25,12 @@ export default Component.extend(FileSaverMixin, { }); i++; }); - + var csv = Papa.unparse(dois); - this.saveFileAs('dois.csv', csv, 'text/csv'); + var FileSaver = require('file-saver'); + var blob = new Blob([csv], {type: "text/csv;charset=utf-8"}); + FileSaver.saveAs(blob, "dois.csv"); } } }) \ No newline at end of file diff --git a/package.json b/package.json index 0cccdc52b..c09a597ea 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,9 @@ "mime": "^2.4.4", "pascal-case": "^3.1.1", "validator": "^13.7.0", - "wait-on": "^5.2.0" + "wait-on": "^5.2.0", + "ember-papaparse": "~1.0.0", + "file-saver": "2.0.4" }, "fastbootDependencies": [ "node-fetch", @@ -171,9 +173,7 @@ "typescript": "^3.7.4", "urijs": "^1.19.11", "vkbeautify": "^0.99.3", - "xml2js": "^0.4.23", - "ember-papaparse": "~1.0.0", - "ember-cli-file-saver": "~2.0.0" + "xml2js": "^0.4.23" }, "engines": { "node": "14.*" diff --git a/tests/integration/components/doi-list-test.js b/tests/integration/components/doi-list-test.js index 672fb2f94..dd71c55c9 100644 --- a/tests/integration/components/doi-list-test.js +++ b/tests/integration/components/doi-list-test.js @@ -1,4 +1,4 @@ -import { module, test, skip } from 'qunit'; +import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import { render } from '@ember/test-helpers'; import hbs from 'htmlbars-inline-precompile'; diff --git a/yarn.lock b/yarn.lock index bb17c4bc6..dabb9d0ac 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10825,17 +10825,6 @@ ember-cli-fastboot@^2.2.1: md5-hex "^2.0.0" silent-error "^1.1.0" -ember-cli-file-saver@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ember-cli-file-saver/-/ember-cli-file-saver-2.0.0.tgz#99c218710ba77f52d61c7b486e66635add4bbdf7" - integrity sha512-Cr7s+1EgT/eMabDdrpIrmQ/wqOe+/eDunxOb1IIc8GHDyK6ytgwjjpHG2vo/a6k3LEYRUcm7MRa9B1MVw4AKoQ== - dependencies: - broccoli-funnel "^2.0.1" - broccoli-merge-trees "^2.0.0" - broccoli-stew "^1.5.0" - ember-cli-babel "^6.3.0" - file-saver "2.0.0" - ember-cli-flash@^1.8.0: version "1.8.0" resolved "https://registry.yarnpkg.com/ember-cli-flash/-/ember-cli-flash-1.8.0.tgz#365decadc850e77b70c1c64ce6ab6f58662f7c38" @@ -13045,10 +13034,10 @@ file-entry-cache@^6.0.0: dependencies: flat-cache "^3.0.4" -file-saver@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/file-saver/-/file-saver-2.0.0.tgz#74eef7748159503b60008a15af2f1930fb5df7ab" - integrity sha512-cYM1ic5DAkg25pHKgi5f10ziAM7RJU37gaH1XQlyNDrtUnzhC/dfoV9zf2OmF0RMKi42jG5B0JWBnPQqyj/G6g== +file-saver@2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/file-saver/-/file-saver-2.0.4.tgz#44c40e835319c9836a84221b4e255d4bb4cb7bb5" + integrity sha512-QqJr2lQUcwRg9QeCSi1nZFSv4Mx7MYL7oZFFWdjihHfChIC/Qk3PSNCn+pz5OF8fQvmvOPDi+8eN5ienicWXiQ== fileset@^2.0.3: version "2.0.3" From 8b7d6a5a65dfa5d7e3e8a6ea3a438166e32c76ee Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Thu, 27 Oct 2022 16:40:22 -0400 Subject: [PATCH 048/106] Fabrica Improvements - task 1 (basic metadata) --- app/components/export-basic-metadata.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/components/export-basic-metadata.js b/app/components/export-basic-metadata.js index fc7f548a5..31237eb82 100755 --- a/app/components/export-basic-metadata.js +++ b/app/components/export-basic-metadata.js @@ -10,20 +10,19 @@ export default Component.extend({ exportBasicMetadata(model) { let dois = []; - this.model.forEach(function(doi, meta = this.model.meta, i = 0) { + this.model.forEach(function(doi) { dois.push({ "doi" : doi.doi, "url" : doi.url, "registered": doi.registered, "state": doi.state, - //"resourceTypeGeneral": meta.resourceTypes[i].title, - //"resourceTypes": ??, + "resourceTypeGeneral": doi.types.resourceTypeGeneral, + "resourceType": doi.types.resourceType, "title": doi.title, "author": doi.author, "publisher": doi.publisher, "publicationYear": doi.publicationYear }); - i++; }); var csv = Papa.unparse(dois); From 49ca97d30257bc9e00badb6c31fc1268177f93c7 Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Fri, 28 Oct 2022 00:03:38 -0400 Subject: [PATCH 049/106] Fabrica Improvements - task 1 (basic metadata - formatCreators) --- app/components/export-basic-metadata.js | 6 ++-- app/utils/format-creators.js | 44 +++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 2 deletions(-) create mode 100755 app/utils/format-creators.js diff --git a/app/components/export-basic-metadata.js b/app/components/export-basic-metadata.js index 31237eb82..3f0da1efc 100755 --- a/app/components/export-basic-metadata.js +++ b/app/components/export-basic-metadata.js @@ -1,6 +1,8 @@ import Component from '@ember/component'; import Papa from 'papaparse'; import FileSaver from 'file-saver'; +import isEmpty from 'bracco/utils/is-empty'; +import formatCreators from '../utils/format-creators'; export default Component.extend({ tagName: '', @@ -19,12 +21,12 @@ export default Component.extend({ "resourceTypeGeneral": doi.types.resourceTypeGeneral, "resourceType": doi.types.resourceType, "title": doi.title, - "author": doi.author, + "author": formatCreators(doi.creators, {}), "publisher": doi.publisher, "publicationYear": doi.publicationYear }); }); - + var csv = Papa.unparse(dois); var FileSaver = require('file-saver'); diff --git a/app/utils/format-creators.js b/app/utils/format-creators.js new file mode 100755 index 000000000..afa350a05 --- /dev/null +++ b/app/utils/format-creators.js @@ -0,0 +1,44 @@ +export default function formatCreators(creators, hash) { + let limit = creators.length; + + if (hash.showOnly) { + limit = hash.showOnly; + } + + let names = []; + let name; + + creators.forEach((element, index, array) => { + name = ''; + + if (element.givenName && element.familyName) { + name = element.givenName + ' ' + element.familyName; + } else if (element.familyName) { + name = element.familyName; + } else if (element.givenName) { + name = element.givenName; + } else if (element.name) { + name = element.name + } else { + name = ''; + } + + if (name) { + names.push(name); + } + }); + + let ret = ''; + + names.forEach((element, index, array) => { + if (limit > index + 2) { + ret = ret + element + ', '; + } else if (limit > index + 1) { + ret = ret + element + ' & '; + } else { + ret = ret + element; + } + }); + + return ret; +} From 27fbeb660aaed669ba4e13c272a9e612428ab50f Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Fri, 28 Oct 2022 17:21:31 -0400 Subject: [PATCH 050/106] Fabrica improvements(5): export basic metadata. (Testing.) --- app/components/export-basic-metadata.js | 2 +- app/templates/components/export-basic-metadata.hbs | 2 +- cypress/integration/client_admin/doi.test.ts | 2 ++ cypress/integration/client_admin/info.test.ts | 2 ++ cypress/integration/client_admin/prefixes.test.ts | 1 + cypress/integration/client_admin/settings.test.ts | 2 ++ cypress/integration/consortium_admin/contact.test.ts | 2 ++ cypress/integration/consortium_admin/doi.test.ts | 1 + cypress/integration/consortium_admin/info.test.ts | 1 + cypress/integration/consortium_admin/organizations.test.ts | 2 ++ cypress/integration/consortium_admin/prefixes.test.ts | 2 ++ cypress/integration/consortium_admin/repositories.test.ts | 2 ++ cypress/integration/consortium_admin/settings.test.ts | 2 ++ cypress/integration/organization_admin/contact.test.ts | 2 ++ cypress/integration/organization_admin/doi.test.ts | 3 ++- cypress/integration/organization_admin/info.test.ts | 2 ++ cypress/integration/organization_admin/prefixes.test.ts | 2 ++ .../integration/organization_admin/repositories.test.ts | 2 ++ cypress/integration/organization_admin/settings.test.ts | 2 ++ cypress/integration/staff_admin/admin.test.ts | 7 +++++++ 20 files changed, 40 insertions(+), 3 deletions(-) diff --git a/app/components/export-basic-metadata.js b/app/components/export-basic-metadata.js index 3f0da1efc..030245240 100755 --- a/app/components/export-basic-metadata.js +++ b/app/components/export-basic-metadata.js @@ -6,7 +6,7 @@ import formatCreators from '../utils/format-creators'; export default Component.extend({ tagName: '', - classNames: ['export-basic-metadata'], + classNames: [], actions: { exportBasicMetadata(model) { diff --git a/app/templates/components/export-basic-metadata.hbs b/app/templates/components/export-basic-metadata.hbs index 78acfb485..02bd1b926 100755 --- a/app/templates/components/export-basic-metadata.hbs +++ b/app/templates/components/export-basic-metadata.hbs @@ -1 +1 @@ - + diff --git a/cypress/integration/client_admin/doi.test.ts b/cypress/integration/client_admin/doi.test.ts index 2df52bce1..f6aff7820 100644 --- a/cypress/integration/client_admin/doi.test.ts +++ b/cypress/integration/client_admin/doi.test.ts @@ -59,6 +59,8 @@ describe('ACCEPTANCE: CLIENT_ADMIN | DOIS', () => { }); }); + cy.get('button.export-basic-metadata').should('exist'); + // Has left sidebar facets. cy.get('.facets h4').contains(/Resource\s*Type/i); cy.get('.facets h4').contains(/Year\s*created/i); diff --git a/cypress/integration/client_admin/info.test.ts b/cypress/integration/client_admin/info.test.ts index c4300be4c..51d298acb 100644 --- a/cypress/integration/client_admin/info.test.ts +++ b/cypress/integration/client_admin/info.test.ts @@ -39,6 +39,8 @@ describe('ACCEPTANCE: CLIENT_ADMIN | INFO', () => { cy.get('ul.nav-tabs li a').contains(/DOIs/i) .and('have.attr', 'href').and('include', '/repositories/datacite.test/dois'); + cy.get('button.export-basic-metadata').should('not.exist'); + cy.get('#chart-doi-title').parent().parent('.panel').within((panel) => { cy.get('#chart-doi-title').contains(/DOIs\s*by\s*year/i); cy.get('.member.graphs a').and('have.attr', 'href') diff --git a/cypress/integration/client_admin/prefixes.test.ts b/cypress/integration/client_admin/prefixes.test.ts index 40f177e46..e32cf140a 100644 --- a/cypress/integration/client_admin/prefixes.test.ts +++ b/cypress/integration/client_admin/prefixes.test.ts @@ -56,6 +56,7 @@ describe('ACCEPTANCE: CLIENT_ADMIN | PREFIXES', () => { //cy.get('.create-doi-button ul.dropdown-menu ul li a').contains(/File\s*Upload/i); }); }); + cy.get('button.export-basic-metadata').should('not.exist'); // Has left sidebar facets. cy.get('.facets h4').contains(/Year\s*created/i); diff --git a/cypress/integration/client_admin/settings.test.ts b/cypress/integration/client_admin/settings.test.ts index dc2de5e09..94d79d9f8 100644 --- a/cypress/integration/client_admin/settings.test.ts +++ b/cypress/integration/client_admin/settings.test.ts @@ -53,6 +53,8 @@ describe('ACCEPTANCE: CLIENT_ADMIN | SETTINGS', () => { .and('have.attr', 'href').and('include', '/repositories/datacite.test/edit'); }) + cy.get('button.export-basic-metadata').should('not.exist'); + cy.get('.metadata').within(($metadata) => { cy.get('h5').contains(/Record\s*created/i); cy.get('h5').contains(/Record\s*last\s*modified/i); diff --git a/cypress/integration/consortium_admin/contact.test.ts b/cypress/integration/consortium_admin/contact.test.ts index 93909724a..c22e6d9ad 100644 --- a/cypress/integration/consortium_admin/contact.test.ts +++ b/cypress/integration/consortium_admin/contact.test.ts @@ -139,6 +139,8 @@ describe('ACCEPTANCE: CONSORTIUM_ADMIN | CONTACTS', () => { cy.get('h3.edit').contains('Add Contact'); + cy.get('button.export-basic-metadata').should('not.exist'); + cy.get('input#givenName-field').should('be.visible').type(given_name, { force: true }) .clickOutside(); cy.get('input#familyName-field').should('be.visible').type(family_name, { force: true }) diff --git a/cypress/integration/consortium_admin/doi.test.ts b/cypress/integration/consortium_admin/doi.test.ts index ac43d091c..de7bf618e 100644 --- a/cypress/integration/consortium_admin/doi.test.ts +++ b/cypress/integration/consortium_admin/doi.test.ts @@ -47,6 +47,7 @@ describe('ACCEPTANCE: CONSORTIUM_ADMIN | DOIS', () => { cy.get('.btn-group-vertical a#new-doi').should('not.exist'); cy.get('.btn-group-vertical a#upload-doi').should('not.exist'); + cy.get('button.export-basic-metadata').should('exist'); // Has left sidebar facets. cy.get('.facets h4').contains(/State/i); diff --git a/cypress/integration/consortium_admin/info.test.ts b/cypress/integration/consortium_admin/info.test.ts index 5b7a3a00f..eaccb24ff 100644 --- a/cypress/integration/consortium_admin/info.test.ts +++ b/cypress/integration/consortium_admin/info.test.ts @@ -190,6 +190,7 @@ describe('ACCEPTANCE: CONSORTIUM_ADMIN | INFO', () => { cy.on("url:changed", (newUrl) => { expect(newUrl).to.contain("/providers/dc"); + cy.get('button.export-basic-metadata').should('not.exist'); }); }); }); diff --git a/cypress/integration/consortium_admin/organizations.test.ts b/cypress/integration/consortium_admin/organizations.test.ts index 6f4bae211..53c84e34b 100644 --- a/cypress/integration/consortium_admin/organizations.test.ts +++ b/cypress/integration/consortium_admin/organizations.test.ts @@ -44,6 +44,8 @@ describe('ACCEPTANCE: CONSORTIUM_ADMIN | CONSORTIUM ORGANIZATIONS', () => { .and('have.attr', 'href').and('include', '/providers/dc/organizations/new'); }); + cy.get('button.export-basic-metadata').should('not.exist'); + // Has left sidebar facets. cy.get('.facets h4').contains(/Year\s*joined/i); cy.get('.facets h4').contains(/Region/i); diff --git a/cypress/integration/consortium_admin/prefixes.test.ts b/cypress/integration/consortium_admin/prefixes.test.ts index 0685ddf78..f8c093202 100644 --- a/cypress/integration/consortium_admin/prefixes.test.ts +++ b/cypress/integration/consortium_admin/prefixes.test.ts @@ -41,6 +41,8 @@ describe('ACCEPTANCE: CONSORTIUM_ADMIN | PREFIXES', () => { // Has left sidebar message box. // cy.get('div.alert').contains(/New prefixes can't be assigned from this page./i); + cy.get('button.export-basic-metadata').should('not.exist'); + // Has left sidebar facets. cy.get('.facets h4').contains(/State/i); cy.get('.facets h4').contains(/Year\s*created/i); diff --git a/cypress/integration/consortium_admin/repositories.test.ts b/cypress/integration/consortium_admin/repositories.test.ts index 1b8c245f5..f2ca8b956 100644 --- a/cypress/integration/consortium_admin/repositories.test.ts +++ b/cypress/integration/consortium_admin/repositories.test.ts @@ -41,6 +41,8 @@ describe('ACCEPTANCE: CONSORTIUM_ADMIN | REPOSITORIES', () => { // Has left sidebar message box. cy.get('div.alert').contains(/New repositories can't be created from this page./i); + cy.get('button.export-basic-metadata').should('not.exist'); + // Has left sidebar facets. cy.get('.facets h4').contains(/Year\s*joined/i); cy.get('.facets h4').contains(/Type/i); diff --git a/cypress/integration/consortium_admin/settings.test.ts b/cypress/integration/consortium_admin/settings.test.ts index 74c6d0ca9..808c90e1d 100644 --- a/cypress/integration/consortium_admin/settings.test.ts +++ b/cypress/integration/consortium_admin/settings.test.ts @@ -48,6 +48,8 @@ describe('ACCEPTANCE: CONSORTIUM_ADMIN | SETTINGS', () => { .and('have.attr', 'href').and('include', '/providers/dc/edit'); }); + cy.get('button.export-basic-metadata').should('not.exist'); + cy.get('.metadata').within(($metadata) => { cy.get('h5').contains(/Record\s*created/i); cy.get('h5').contains(/Record\s*last\s*modified/i); diff --git a/cypress/integration/organization_admin/contact.test.ts b/cypress/integration/organization_admin/contact.test.ts index bddd191c9..e4d71ba3b 100644 --- a/cypress/integration/organization_admin/contact.test.ts +++ b/cypress/integration/organization_admin/contact.test.ts @@ -45,6 +45,8 @@ describe('ACCEPTANCE: ORGANIZATION_ADMIN | CONTACTS', () => { cy.get('div.panel.facets').should('exist'); cy.get('a#add-contact').contains('Add Contact'); + + cy.get('button.export-basic-metadata').should('not.exist'); }); it('search contacts', () => { diff --git a/cypress/integration/organization_admin/doi.test.ts b/cypress/integration/organization_admin/doi.test.ts index 444c69063..dee8e3239 100644 --- a/cypress/integration/organization_admin/doi.test.ts +++ b/cypress/integration/organization_admin/doi.test.ts @@ -42,7 +42,8 @@ describe('ACCEPTANCE: ORGANIZATION_ADMIN | DOIS', () => { cy.get('.btn-group-vertical a#new-doi').should('not.exist'); cy.get('.btn-group-vertical a#upload-doi').should('not.exist'); - + cy.get('button.export-basic-metadata').should('exist'); + // Has left sidebar facets. cy.get('.facets h4').contains(/State/i); cy.get('.facets h4').contains(/Resource\s*Type/i); diff --git a/cypress/integration/organization_admin/info.test.ts b/cypress/integration/organization_admin/info.test.ts index 995c644fc..b1a8b8092 100644 --- a/cypress/integration/organization_admin/info.test.ts +++ b/cypress/integration/organization_admin/info.test.ts @@ -50,6 +50,8 @@ describe('ACCEPTANCE: ORGANIZATION_ADMIN | INFO', () => { cy.get('#chart-repository'); }); + cy.get('button.export-basic-metadata').should('not.exist'); + cy.get('#chart-doi-title').parent().parent('.panel').within((panel) => { cy.get('#chart-doi-title').contains(/DOIs/i); cy.get('.member.graphs a').and('have.attr', 'href') diff --git a/cypress/integration/organization_admin/prefixes.test.ts b/cypress/integration/organization_admin/prefixes.test.ts index 5fd364a2d..7ed1f63de 100644 --- a/cypress/integration/organization_admin/prefixes.test.ts +++ b/cypress/integration/organization_admin/prefixes.test.ts @@ -41,6 +41,8 @@ describe('ACCEPTANCE: ORGANIZATION_ADMIN | PREFIXES', () => { // Has left sidebar message box. // cy.get('div.alert').contains(/Please ask DataCite Staff if you want to add a prefix./i); + cy.get('button.export-basic-metadata').should('not.exist'); + // Has left sidebar facets. cy.get('.facets h4').contains(/State/i); cy.get('.facets h4').contains(/Year\s*created/i); diff --git a/cypress/integration/organization_admin/repositories.test.ts b/cypress/integration/organization_admin/repositories.test.ts index 17340992b..468853eb6 100644 --- a/cypress/integration/organization_admin/repositories.test.ts +++ b/cypress/integration/organization_admin/repositories.test.ts @@ -43,6 +43,8 @@ describe('ACCEPTANCE: ORGANIZATION_ADMIN | REPOSITORIES', () => { .and('have.attr', 'href').and('include', '/providers/datacite/repositories/new'); }); + cy.get('button.export-basic-metadata').should('not.exist'); + // Has left sidebar facets. cy.get('.facets h4').contains(/Year\s*joined/i); cy.get('.facets h4').contains(/Type/i); diff --git a/cypress/integration/organization_admin/settings.test.ts b/cypress/integration/organization_admin/settings.test.ts index 8663a6a14..a65d12f91 100644 --- a/cypress/integration/organization_admin/settings.test.ts +++ b/cypress/integration/organization_admin/settings.test.ts @@ -46,6 +46,8 @@ describe('ACCEPTANCE: ORGANIZATION_ADMIN | SETTINGS', () => { .and('have.attr', 'href').and('include', '/providers/datacite/edit'); }); + cy.get('button.export-basic-metadata').should('not.exist'); + cy.get('.metadata').within(($metadata) => { cy.get('h5').contains(/Record\s*created/i); cy.get('h5').contains(/Record\s*last\s*modified/i); diff --git a/cypress/integration/staff_admin/admin.test.ts b/cypress/integration/staff_admin/admin.test.ts index af39fb9a0..1b1b7050b 100644 --- a/cypress/integration/staff_admin/admin.test.ts +++ b/cypress/integration/staff_admin/admin.test.ts @@ -54,6 +54,7 @@ describe('Admin: Admin', () => { cy.visit('/'); cy.get('h2.work').contains('DataCite'); cy.get('li a.nav-link.active').contains('Info'); + cy.get('button.export-basic-metadata').should('not.exist'); }); it('visiting settings', () => { @@ -63,6 +64,7 @@ describe('Admin: Admin', () => { }); cy.get('h2.work').contains('DataCite'); cy.get('li a.nav-link.active').contains('Settings'); + cy.get('button.export-basic-metadata').should('not.exist'); }); it('visiting members', () => { @@ -74,6 +76,7 @@ describe('Admin: Admin', () => { cy.get('li a.nav-link.active').contains('Members'); cy.get('div#search').should('exist'); cy.get('div.panel.facets').should('exist'); + cy.get('button.export-basic-metadata').should('not.exist'); cy.get('a#add-provider').contains('Add Member'); }); @@ -87,6 +90,7 @@ describe('Admin: Admin', () => { cy.get('li a.nav-link.active').contains('Repositories'); cy.get('div#search').should('exist'); cy.get('div.panel.facets').should('exist'); + cy.get('button.export-basic-metadata').should('not.exist'); // staff can't add repositories here (needs to go to provider first) cy.get('a#add-repository').should('not.exist'); @@ -101,6 +105,7 @@ describe('Admin: Admin', () => { cy.get('li a.nav-link.active').contains('Contacts'); cy.get('div#search').should('exist'); cy.get('div.panel.facets').should('exist'); + cy.get('button.export-basic-metadata').should('not.exist'); // staff can't add contacts here (needs to go to provider first) cy.get('a#add-contact').should('not.exist'); @@ -115,6 +120,7 @@ describe('Admin: Admin', () => { cy.get('li a.nav-link.active').contains('Prefixes'); cy.get('div#search').should('exist'); cy.get('div.panel.facets').should('exist'); + cy.get('button.export-basic-metadata').should('not.exist'); cy.get('a#add-prefixes').contains('Add Prefixes'); }); @@ -136,6 +142,7 @@ describe('Admin: Admin', () => { cy.get('li a.nav-link.active').contains('DOIs'); cy.get('div#search').should('exist'); cy.get('div.panel.facets').should('exist'); + cy.get('button.export-basic-metadata').should('exist'); // staff can't add doi here (needs to go to repository first) cy.get('a#add-doi').should('not.exist'); From bded6918595f56e8cd015d786f1aa295aa117c1a Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Wed, 2 Nov 2022 17:37:28 -0400 Subject: [PATCH 051/106] Fabrica-improvements-5: export basic metadata (rebase and fixes). --- app/styles/local.css | 5 ----- 1 file changed, 5 deletions(-) diff --git a/app/styles/local.css b/app/styles/local.css index 77a2dd80b..71aedd9ed 100755 --- a/app/styles/local.css +++ b/app/styles/local.css @@ -51,8 +51,3 @@ .btn-group-sm.btn-single>.btn { border-radius: 13px; } - -/* Why does this have a left-margin of -5px. Correcting to 0. */ -.btn-toolbar { - margin-left: 0; -} From b646c14d5bdb351eefa5acc6c1e945248852aca1 Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Wed, 2 Nov 2022 18:03:26 -0400 Subject: [PATCH 052/106] Fabrica-improvements-5: export basic metadata (rebase and fixes). --- app/templates/components/doi-list.hbs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/templates/components/doi-list.hbs b/app/templates/components/doi-list.hbs index 708be6a95..ab0a32823 100644 --- a/app/templates/components/doi-list.hbs +++ b/app/templates/components/doi-list.hbs @@ -59,6 +59,17 @@
{{/if}} + {{else}} {{#if (gt model.length 0)}} +
+
+
+
+ +
+
+
+
+ {{/if}} {{/if}} {{#if (and (can 'viewState doi') (or model.meta.states model.query.state))}} From c7c1414c39a8d7ee91d71525dd0aebcc0f87e99a Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Wed, 2 Nov 2022 22:17:13 -0400 Subject: [PATCH 053/106] Fabrica-improvements-5: export basic metadata (rebase and fixes). --- cypress/integration/consortium_admin/info.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cypress/integration/consortium_admin/info.test.ts b/cypress/integration/consortium_admin/info.test.ts index eaccb24ff..a3f69200e 100644 --- a/cypress/integration/consortium_admin/info.test.ts +++ b/cypress/integration/consortium_admin/info.test.ts @@ -184,13 +184,14 @@ describe('ACCEPTANCE: CONSORTIUM_ADMIN | INFO', () => { cy.get('button#update-provider').should('be.visible'); cy.get('button').contains(/Cancel/i).should('be.visible'); + cy.get('button.export-basic-metadata').should('not.exist'); + cy.get('button').contains(/Cancel/i).should('be.visible').click({force: true}); }) }); cy.on("url:changed", (newUrl) => { expect(newUrl).to.contain("/providers/dc"); - cy.get('button.export-basic-metadata').should('not.exist'); }); }); }); From 27a1b3d59fd31ef76770b64f049089486143ab0d Mon Sep 17 00:00:00 2001 From: Cody Ross Date: Fri, 16 Dec 2022 14:41:22 -0500 Subject: [PATCH 054/106] Added alphabetical sort option for DOIs --- app/components/model-search.js | 1 + cypress/integration/consortium_admin/doi.test.ts | 1 + cypress/integration/organization_admin/doi.test.ts | 1 + 3 files changed, 3 insertions(+) diff --git a/app/components/model-search.js b/app/components/model-search.js index 93aa44c2d..548e80784 100644 --- a/app/components/model-search.js +++ b/app/components/model-search.js @@ -43,6 +43,7 @@ export default Component.extend({ '-updated': 'Sort by Date Updated', '-created': 'Sort by Date Created', name: 'Sort by DOI', + 'title': 'Sort Alphabetically', relevance: 'Sort by Relevance' }); } else if (this.modelName === 'Prefix') { diff --git a/cypress/integration/consortium_admin/doi.test.ts b/cypress/integration/consortium_admin/doi.test.ts index de7bf618e..26bb5cafa 100644 --- a/cypress/integration/consortium_admin/doi.test.ts +++ b/cypress/integration/consortium_admin/doi.test.ts @@ -72,6 +72,7 @@ describe('ACCEPTANCE: CONSORTIUM_ADMIN | DOIS', () => { cy.get('#sort select').contains(/Sort by Date Updated/i); cy.get('#sort select').contains(/Sort by Date Created/i); cy.get('#sort select').contains(/Sort by DOI/i); + cy.get('#sort select').contains(/Sort Alphabetically/i); cy.get('#sort select').contains(/Sort by Relevance/i); // Has search results as content. diff --git a/cypress/integration/organization_admin/doi.test.ts b/cypress/integration/organization_admin/doi.test.ts index dee8e3239..3d936645a 100644 --- a/cypress/integration/organization_admin/doi.test.ts +++ b/cypress/integration/organization_admin/doi.test.ts @@ -67,6 +67,7 @@ describe('ACCEPTANCE: ORGANIZATION_ADMIN | DOIS', () => { cy.get('#sort select').contains(/Sort by Date Updated/i); cy.get('#sort select').contains(/Sort by Date Created/i); cy.get('#sort select').contains(/Sort by DOI/i); + cy.get('#sort select').contains(/Sort Alphabetically/i); cy.get('#sort select').contains(/Sort by Relevance/i); // Has search results as content. From fad57fd46bb419c489c68635fe8b9365701e078a Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Sat, 17 Dec 2022 00:05:42 -0500 Subject: [PATCH 055/106] Fabrica Improvements 8 - Register DOIs in the Future. --- app/helpers/current-year.js | 7 +++++++ app/models/doi.js | 11 +++++++++-- app/templates/dois/show/edit.hbs | 2 +- app/templates/repositories/show/dois/new.hbs | 2 +- dotenv.js | 2 ++ 5 files changed, 20 insertions(+), 4 deletions(-) create mode 100755 app/helpers/current-year.js diff --git a/app/helpers/current-year.js b/app/helpers/current-year.js new file mode 100755 index 000000000..b00dcd92d --- /dev/null +++ b/app/helpers/current-year.js @@ -0,0 +1,7 @@ +import { helper as buildHelper } from '@ember/component/helper'; + +export function currentYear([add]) { + return new Date().getFullYear() + parseInt(add); +} + +export default buildHelper(currentYear); diff --git a/app/models/doi.js b/app/models/doi.js index 7b3505339..48ea7cd7b 100644 --- a/app/models/doi.js +++ b/app/models/doi.js @@ -91,11 +91,15 @@ const Validations = buildValidations({ }), validator('date', { after: '999', - before: '2023', + before: computed('model.maxMintFutureOffset', function () { + return new Date().getFullYear() + this.model.get('maxMintFutureOffset') +1; + }), precision: 'year', format: 'YYYY', errorFormat: 'YYYY', - message: 'Must be a year between 1000 and 2023.', + message: computed('model.maxMintFutureOffset', function () { + return `Must be a year between 1000 and ${new Date().getFullYear() + this.model.get('maxMintFutureOffset') }.`; + }), disabled: computed('model.{mode,state}', function () { return ( this.model.get('state') === 'draft' || @@ -227,5 +231,8 @@ export default Model.extend(Validations, { } else { return null; } + }), + maxMintFutureOffset: computed(function () { + return ENV.MAX_MINT_FUTURE_OFFSET; }) }); diff --git a/app/templates/dois/show/edit.hbs b/app/templates/dois/show/edit.hbs index 03920b5fb..b938c22eb 100644 --- a/app/templates/dois/show/edit.hbs +++ b/app/templates/dois/show/edit.hbs @@ -48,7 +48,7 @@
The year when the resource was or will be made publicly available.
+ @helpText="Must be a year between 1000 and {{current-year model.maxMintFutureOffset }}." @required={{false}} />
diff --git a/app/templates/repositories/show/dois/new.hbs b/app/templates/repositories/show/dois/new.hbs index a5a03a96b..09633c56a 100644 --- a/app/templates/repositories/show/dois/new.hbs +++ b/app/templates/repositories/show/dois/new.hbs @@ -40,7 +40,7 @@
The year when the resource was or will be made publicly available.
+ @helpText="Must be a year between 1000 and {{current-year model.doi.maxMintFutureOffset }}." @required={{false}} />
diff --git a/dotenv.js b/dotenv.js index 9e1bbd67d..2bd16b9d1 100644 --- a/dotenv.js +++ b/dotenv.js @@ -27,6 +27,7 @@ module.exports = function () { 'CLIENT_ADMIN_USERNAME', 'ENABLE_DOI_ESTIMATE', 'MIN_PREFIXES_AVAILABLE', + 'MAX_MINT_FUTURE_OFFSET', 'SHOW_N_PREFIXES' ], fastbootAllowedKeys: [ @@ -56,6 +57,7 @@ module.exports = function () { 'CLIENT_ADMIN_USERNAME', 'ENABLE_DOI_ESTIMATE', 'MIN_PREFIXES_AVAILABLE', + 'MAX_MINT_FUTURE_OFFSET', 'SHOW_N_PREFIXES' ], failOnMissingKey: false From 8df0e218a554827fa062076f1ff5376b9f4d4d88 Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Sat, 17 Dec 2022 00:40:17 -0500 Subject: [PATCH 056/106] Fabrica Improvements 8 - Register DOIs in the Future. --- config/environment.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/environment.js b/config/environment.js index c5d0243d8..8a374cf8b 100644 --- a/config/environment.js +++ b/config/environment.js @@ -10,6 +10,7 @@ module.exports = function (environment) { // Bring in the environment variables. let minPrefixesAvailable = ((typeof process.env.MIN_PREFIXES_AVAILABLE === 'undefined') || (process.env.MIN_PREFIXES_AVAILABLE == "")) ? 50 : process.env.MIN_PREFIXES_AVAILABLE; let showNPrefixes = ((typeof process.env.SHOW_N_PREFIXES === 'undefined') || (process.env.SHOW_N_PREFIXES == "")) ? 10 : process.env.SHOW_N_PREFIXES; + let maxMintFutureOffset = parseInt(((typeof process.env.MAX_MINT_FUTURE_OFFSET === 'undefined') || (process.env.MAX_MINT_FUTURE_OFFSET == "")) ? 5 : process.env.MAX_MINT_FUTURE_OFFSET); let ENV = { modulePrefix: 'bracco', @@ -107,7 +108,8 @@ module.exports = function (environment) { }, MIN_PREFIXES_AVAILABLE: minPrefixesAvailable, - SHOW_N_PREFIXES: showNPrefixes + SHOW_N_PREFIXES: showNPrefixes, + MAX_MINT_FUTURE_OFFSET: maxMintFutureOffset }; if (fabricaDeployTarget === 'stage') { From 6b1f557c5a35813eafa0f4799ddc44167e199c45 Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Mon, 19 Dec 2022 10:53:35 -0500 Subject: [PATCH 057/106] Fabrica Improvements 8 - Register DOIs in the Future. --- cypress/integration/client_admin/doi.test.ts | 9 +++++++-- package.json | 1 + yarn.lock | 5 +++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/cypress/integration/client_admin/doi.test.ts b/cypress/integration/client_admin/doi.test.ts index f6aff7820..d79bb1fb0 100644 --- a/cypress/integration/client_admin/doi.test.ts +++ b/cypress/integration/client_admin/doi.test.ts @@ -10,6 +10,8 @@ describe('ACCEPTANCE: CLIENT_ADMIN | DOIS', () => { const waitTime = 1000; const waitTime2 = 2000; const prefix = '10.80225'; + const dayjs = require('dayjs') + const yearPlusFive = dayjs().add(5, 'year').format('YYYY'); let suffix = ''; before(function () { @@ -76,7 +78,7 @@ describe('ACCEPTANCE: CLIENT_ADMIN | DOIS', () => { }); }); - it('is creating a doi - FORM', () => { + it.only('is creating a doi - FORM', () => { cy.visit('/repositories/datacite.test/dois/new'); cy.url().should('include', '/repositories/datacite.test/dois/new').then(() => { @@ -104,8 +106,11 @@ describe('ACCEPTANCE: CLIENT_ADMIN | DOIS', () => { // Set publisher. cy.get('#publisher-field').should('be.visible').type('DataCite', { force: true }); + cy.log('Year + 5 = ' + yearPlusFive); + // Set publication year. - cy.get('#publication-year-field').should('be.visible').type('2020', { force: true }); + cy.get('#publication-year-help').should('be.visible').should('have.text', 'Must be a year between 1000 and ' + yearPlusFive + '.'); + cy.get('#publication-year-field').should('be.visible').type(yearPlusFive, { force: true }); // Set resource type. // Causes the aria dropdown to be populated and displayed so that selection can be made. diff --git a/package.json b/package.json index c09a597ea..80e6dc795 100644 --- a/package.json +++ b/package.json @@ -92,6 +92,7 @@ "d3-shape": "^1.3.7", "d3-time": "^1.1.0", "d3-time-format": "^2.2.3", + "dayjs": "^1.11.7", "devtron": "^1.4.0", "dynamic-link": "^0.2.5", "edtf": "^2.7.1", diff --git a/yarn.lock b/yarn.lock index dabb9d0ac..203432dd0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9812,6 +9812,11 @@ dayjs@^1.10.4: resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.10.4.tgz#8e544a9b8683f61783f570980a8a80eaf54ab1e2" integrity sha512-RI/Hh4kqRc1UKLOAf/T5zdMMX5DQIlDxwUe3wSyMMnEbGunnpENCdbUgM+dW7kXidZqCttBrmw7BhN4TMddkCw== +dayjs@^1.11.7: + version "1.11.7" + resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.7.tgz#4b296922642f70999544d1144a2c25730fce63e2" + integrity sha512-+Yw9U6YO5TQohxLcIkrXBeY73WP3ejHWVvx8XCk3gxvQDCTEmS48ZrSZCKciI7Bhl/uCMyxYtE9UqRILmFphkQ== + debug@2.6.9, debug@^2.1.0, debug@^2.1.1, debug@^2.1.3, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" From f5252e48f01a0c9df57f934684a2e845f9a285b6 Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Mon, 19 Dec 2022 13:38:56 -0500 Subject: [PATCH 058/106] Fabrica Improvements 8 - Register DOIs in the Future. (fix a test). --- cypress/integration/client_admin/doi.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/integration/client_admin/doi.test.ts b/cypress/integration/client_admin/doi.test.ts index d79bb1fb0..c543e9615 100644 --- a/cypress/integration/client_admin/doi.test.ts +++ b/cypress/integration/client_admin/doi.test.ts @@ -78,7 +78,7 @@ describe('ACCEPTANCE: CLIENT_ADMIN | DOIS', () => { }); }); - it.only('is creating a doi - FORM', () => { + it('is creating a doi - FORM', () => { cy.visit('/repositories/datacite.test/dois/new'); cy.url().should('include', '/repositories/datacite.test/dois/new').then(() => { From b473f507aa1fef43ced238b6a386492f88877328 Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Mon, 19 Dec 2022 15:56:30 -0500 Subject: [PATCH 059/106] Fabrica Improvements 8 - Register DOIs in the Future. (review comments) --- cypress/integration/client_admin/doi.test.ts | 12 +++++------- cypress/plugins/index.js | 2 ++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cypress/integration/client_admin/doi.test.ts b/cypress/integration/client_admin/doi.test.ts index c543e9615..11befa4ca 100644 --- a/cypress/integration/client_admin/doi.test.ts +++ b/cypress/integration/client_admin/doi.test.ts @@ -10,8 +10,8 @@ describe('ACCEPTANCE: CLIENT_ADMIN | DOIS', () => { const waitTime = 1000; const waitTime2 = 2000; const prefix = '10.80225'; - const dayjs = require('dayjs') - const yearPlusFive = dayjs().add(5, 'year').format('YYYY'); + const dayjs = require('dayjs'); + const yearPlus = dayjs().add(Cypress.env('max_mint_future_offset'), 'year').format('YYYY'); let suffix = ''; before(function () { @@ -78,7 +78,7 @@ describe('ACCEPTANCE: CLIENT_ADMIN | DOIS', () => { }); }); - it('is creating a doi - FORM', () => { + it.only('is creating a doi - FORM', () => { cy.visit('/repositories/datacite.test/dois/new'); cy.url().should('include', '/repositories/datacite.test/dois/new').then(() => { @@ -106,11 +106,9 @@ describe('ACCEPTANCE: CLIENT_ADMIN | DOIS', () => { // Set publisher. cy.get('#publisher-field').should('be.visible').type('DataCite', { force: true }); - cy.log('Year + 5 = ' + yearPlusFive); - // Set publication year. - cy.get('#publication-year-help').should('be.visible').should('have.text', 'Must be a year between 1000 and ' + yearPlusFive + '.'); - cy.get('#publication-year-field').should('be.visible').type(yearPlusFive, { force: true }); + cy.get('#publication-year-help').should('be.visible').should('have.text', 'Must be a year between 1000 and ' + yearPlus + '.'); + cy.get('#publication-year-field').should('be.visible').type(yearPlus, { force: true }); // Set resource type. // Causes the aria dropdown to be populated and displayed so that selection can be made. diff --git a/cypress/plugins/index.js b/cypress/plugins/index.js index a9651a64d..eb7c22a50 100644 --- a/cypress/plugins/index.js +++ b/cypress/plugins/index.js @@ -53,6 +53,8 @@ module.exports = (on, config) => { config.env.client_admin_password = process.env.CLIENT_ADMIN_PASSWORD + config.env.max_mint_future_offset = process.env.MAX_MINT_FUTURE_OFFSET || 5 + on('task', { // deconstruct the individual properties hello({ greeting, name }) { From dadbc58ab05d98b3590a70bdc5207e8d6d7e8375 Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Mon, 19 Dec 2022 15:58:21 -0500 Subject: [PATCH 060/106] Fabrica Improvements 8 - Register DOIs in the Future. (review comments) --- cypress/integration/client_admin/doi.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/integration/client_admin/doi.test.ts b/cypress/integration/client_admin/doi.test.ts index 11befa4ca..9590c122a 100644 --- a/cypress/integration/client_admin/doi.test.ts +++ b/cypress/integration/client_admin/doi.test.ts @@ -78,7 +78,7 @@ describe('ACCEPTANCE: CLIENT_ADMIN | DOIS', () => { }); }); - it.only('is creating a doi - FORM', () => { + it('is creating a doi - FORM', () => { cy.visit('/repositories/datacite.test/dois/new'); cy.url().should('include', '/repositories/datacite.test/dois/new').then(() => { From c71e884142c593dceaa894fe357f10a278c285d2 Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Wed, 9 Nov 2022 13:09:25 -0500 Subject: [PATCH 061/106] Fabrica Improvements 9 - render mathematical notation (latex). --- app/components/doi-citation.js | 12 +++++++++++- app/components/doi-metadata.js | 10 ++++++++++ app/components/doi-summary.js | 13 +++++++++++++ app/index.html | 16 +++++++++++++++- 4 files changed, 49 insertions(+), 2 deletions(-) diff --git a/app/components/doi-citation.js b/app/components/doi-citation.js index f5fd52b21..6e20d7c98 100644 --- a/app/components/doi-citation.js +++ b/app/components/doi-citation.js @@ -72,5 +72,15 @@ export default Component.extend({ style = style === undefined ? 'apa' : style; this.selectStyle(style); } - } + }, + didInsertElement() { + this._super(...arguments); + + window.MathJax.typeset([this.get('element')]); + }, + didRender() { + this._super(...arguments); + + window.MathJax.typeset([this.get('element')]); + }, }); diff --git a/app/components/doi-metadata.js b/app/components/doi-metadata.js index 2c2a7cf44..10cd006fc 100644 --- a/app/components/doi-metadata.js +++ b/app/components/doi-metadata.js @@ -94,4 +94,14 @@ export default Component.extend({ this.showMetadata(metadata); }, }, + didInsertElement() { + this._super(...arguments); + + window.MathJax.typeset([this.get('element')]); + }, + didRender() { + this._super(...arguments); + + window.MathJax.typeset([this.get('element')]); + }, }); diff --git a/app/components/doi-summary.js b/app/components/doi-summary.js index 0ea79c9a9..f223117fc 100644 --- a/app/components/doi-summary.js +++ b/app/components/doi-summary.js @@ -1,5 +1,7 @@ import Component from '@ember/component'; import { inject as service } from '@ember/service'; +//import { formatMathMathjax } from 'bracco/helpers/format-math-mathjax'; +//import MathJax from 'mathjax'; export default Component.extend({ tagName: 'div', @@ -7,4 +9,15 @@ export default Component.extend({ isList: false, store: service(), isResearcherProfile: false, + + didInsertElement() { + this._super(...arguments); + + window.MathJax.typeset([this.get('element')]); + }, + didRender() { + this._super(...arguments); + + window.MathJax.typeset([this.get('element')]); + }, }); diff --git a/app/index.html b/app/index.html index f320f817f..4562e5826 100644 --- a/app/index.html +++ b/app/index.html @@ -8,7 +8,6 @@ {{content-for "head"}} - + + + + {{content-for "head-footer"}} From 600b84df7d6e33b42f7f3aebb8ed3a53c8568144 Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Wed, 9 Nov 2022 13:59:29 -0500 Subject: [PATCH 062/106] Fabrica Improvements 9 - render mathematical notation (test fixes). --- tests/index.html | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/index.html b/tests/index.html index 642e5ec88..0126d0216 100644 --- a/tests/index.html +++ b/tests/index.html @@ -23,6 +23,20 @@ + + + {{content-for "head-footer"}} {{content-for "test-head-footer"}} From f544865fb7d498ea05a119d2f53f7bf97e027c00 Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Wed, 9 Nov 2022 16:08:51 -0500 Subject: [PATCH 063/106] Fabrica Improvements 9 - render mathematical notation --- app/components/doi-citation.js | 2 ++ app/components/doi-metadata.js | 2 ++ app/components/doi-summary.js | 2 ++ 3 files changed, 6 insertions(+) diff --git a/app/components/doi-citation.js b/app/components/doi-citation.js index 6e20d7c98..a087ac84a 100644 --- a/app/components/doi-citation.js +++ b/app/components/doi-citation.js @@ -73,11 +73,13 @@ export default Component.extend({ this.selectStyle(style); } }, + /* didInsertElement() { this._super(...arguments); window.MathJax.typeset([this.get('element')]); }, + */ didRender() { this._super(...arguments); diff --git a/app/components/doi-metadata.js b/app/components/doi-metadata.js index 10cd006fc..5eabaefbf 100644 --- a/app/components/doi-metadata.js +++ b/app/components/doi-metadata.js @@ -94,11 +94,13 @@ export default Component.extend({ this.showMetadata(metadata); }, }, + /* didInsertElement() { this._super(...arguments); window.MathJax.typeset([this.get('element')]); }, + */ didRender() { this._super(...arguments); diff --git a/app/components/doi-summary.js b/app/components/doi-summary.js index f223117fc..76618adce 100644 --- a/app/components/doi-summary.js +++ b/app/components/doi-summary.js @@ -10,11 +10,13 @@ export default Component.extend({ store: service(), isResearcherProfile: false, + /* didInsertElement() { this._super(...arguments); window.MathJax.typeset([this.get('element')]); }, +*/ didRender() { this._super(...arguments); From 7d7c1cc082baa1ed9ca700a53f2f06991711e779 Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Thu, 15 Dec 2022 12:30:11 -0500 Subject: [PATCH 064/106] Fabrica Improvements 9 - render mathematical notation --- app/components/doi-citation.js | 29 ++++++++++++++++++++--------- app/components/doi-metadata.js | 14 +------------- app/components/doi-summary.js | 12 ++---------- app/helpers/format-text.js | 24 +++++++++++++++++------- app/index.html | 2 +- app/utils/check-for-tex.js | 9 +++++++++ 6 files changed, 50 insertions(+), 40 deletions(-) create mode 100755 app/utils/check-for-tex.js diff --git a/app/components/doi-citation.js b/app/components/doi-citation.js index a087ac84a..99ade4027 100644 --- a/app/components/doi-citation.js +++ b/app/components/doi-citation.js @@ -3,6 +3,7 @@ import { inject as service } from '@ember/service'; import fetch from 'fetch'; import ENV from 'bracco/config/environment'; import FileReader from 'ember-file-upload/system/file-reader'; +import checkForTex from '../utils/check-for-tex'; export default Component.extend({ currentUser: service(), @@ -52,6 +53,11 @@ export default Component.extend({ if (typeof response === 'string') { self.set('citationOutput', response); } else { + try { + self.set('citationOutput', ''); + } catch(e) { + /////// Workaround for 'destroyed object' Error (breaks 'select' action ) + } let reader = new FileReader(); reader.readAsText(response).then( (r) => { @@ -73,16 +79,21 @@ export default Component.extend({ this.selectStyle(style); } }, - /* - didInsertElement() { - this._super(...arguments); - - window.MathJax.typeset([this.get('element')]); - }, - */ + didRender() { this._super(...arguments); - - window.MathJax.typeset([this.get('element')]); + + let element = this.get('element'); + let citation = element.querySelector('[data-test-citation'); + let citationOutput = this.get('citationOutput') + + if (checkForTex(citationOutput)) { + if (citationOutput) { + window.MathJax.typesetClear([this.get('element')]); + citation.innerHTML = citationOutput; + } + + window.MathJax.typeset([this.get('element')]); + } }, }); diff --git a/app/components/doi-metadata.js b/app/components/doi-metadata.js index 5eabaefbf..0b11432ad 100644 --- a/app/components/doi-metadata.js +++ b/app/components/doi-metadata.js @@ -93,17 +93,5 @@ export default Component.extend({ selectMetadata(metadata) { this.showMetadata(metadata); }, - }, - /* - didInsertElement() { - this._super(...arguments); - - window.MathJax.typeset([this.get('element')]); - }, - */ - didRender() { - this._super(...arguments); - - window.MathJax.typeset([this.get('element')]); - }, + } }); diff --git a/app/components/doi-summary.js b/app/components/doi-summary.js index 76618adce..15cb4584f 100644 --- a/app/components/doi-summary.js +++ b/app/components/doi-summary.js @@ -1,7 +1,5 @@ import Component from '@ember/component'; import { inject as service } from '@ember/service'; -//import { formatMathMathjax } from 'bracco/helpers/format-math-mathjax'; -//import MathJax from 'mathjax'; export default Component.extend({ tagName: 'div', @@ -10,16 +8,10 @@ export default Component.extend({ store: service(), isResearcherProfile: false, - /* - didInsertElement() { - this._super(...arguments); - - window.MathJax.typeset([this.get('element')]); - }, -*/ didRender() { this._super(...arguments); - + window.MathJax.typeset([this.get('element')]); }, + }); diff --git a/app/helpers/format-text.js b/app/helpers/format-text.js index 29c4273a3..1ad4facb1 100644 --- a/app/helpers/format-text.js +++ b/app/helpers/format-text.js @@ -2,6 +2,8 @@ import { helper as buildHelper } from '@ember/component/helper'; import { htmlSafe } from '@ember/template'; import HtmlEntities from 'html-entities'; import SanitizeHtml from 'sanitize-html'; +import checkForTex from '../utils/check-for-tex'; + const Entities = HtmlEntities.AllHtmlEntities; const entities = new Entities(); @@ -12,16 +14,24 @@ export function formatText([ text ], hash) { let allowedTags = [ 'strong', 'em', 'b', 'i', 'code', 'pre', 'sub', 'sup', 'br' ]; let sanitizedText = SanitizeHtml(text, { allowedTags }); - let words = sanitizedText.split(' '); - let len = hash.limit || 500; - let out = ''; - if (words) { - out = words.splice(0, len).join(' '); + let out = ''; - if (words.length > len) { - out += ' …'; + // Doesn't parse math correctly (so leave it out for now). + if (!checkForTex(sanitizedText)) { + let words = sanitizedText.split(' '); + let len = hash.limit || 500; + + if (words) { + out = words.splice(0, len).join(' '); + + if (words.length > len) { + out += ' …'; + } } + + } else { + out = sanitizedText; } return htmlSafe(out); diff --git a/app/index.html b/app/index.html index 4562e5826..ddf58f75a 100644 --- a/app/index.html +++ b/app/index.html @@ -22,7 +22,7 @@