From aa58b1db7192223927db572cda584933c8a81574 Mon Sep 17 00:00:00 2001 From: Jonas Raoni Soares da Silva Date: Sat, 6 Mar 2021 22:22:00 +0300 Subject: [PATCH] pkp/pkp-lib#6099 Added a required country field to the context form. --- cypress/tests/data/20-CreateContext.spec.js | 2 ++ locale/en_US/manager.po | 3 +++ schemas/context.json | 6 ++++++ 3 files changed, 11 insertions(+) diff --git a/cypress/tests/data/20-CreateContext.spec.js b/cypress/tests/data/20-CreateContext.spec.js index a5c4b917cf..d3ca845317 100644 --- a/cypress/tests/data/20-CreateContext.spec.js +++ b/cypress/tests/data/20-CreateContext.spec.js @@ -23,12 +23,14 @@ describe('Data suite tests', function() { cy.get('div[id=context-acronym-error-en_US]').find('span').contains('This field is required.'); cy.get('div[id=context-urlPath-error]').find('span').contains('This field is required.'); cy.get('div[id=context-primaryLocale-error]').find('span').contains('This field is required.'); + cy.get('div[id=context-country-error]').find('span').contains('This field is required.'); cy.get('input[name="name-en_US"]').type(Cypress.env('contextTitles')['en_US'], {delay: 0}); cy.get('input[name=acronym-en_US]').type('JPK', {delay: 0}); cy.get('span').contains('Enable this preprint server').siblings('input').check(); cy.get('input[name="supportedLocales"][value="en_US').check(); cy.get('input[name="supportedLocales"][value="fr_CA').check(); cy.get('input[name="primaryLocale"][value="en_US').check(); + cy.get('select[id=context-country-control]').select('Iceland'); // Test invalid path characters cy.get('input[name=urlPath]').type('public&-)knowledge', {delay: 0}); diff --git a/locale/en_US/manager.po b/locale/en_US/manager.po index 8b8efd5869..cc6d3ae2cd 100644 --- a/locale/en_US/manager.po +++ b/locale/en_US/manager.po @@ -188,6 +188,9 @@ msgstr "Include any information about your server which may be of interest to re msgid "manager.setup.contextInitials" msgstr "Server initials" +msgid "manager.setup.selectCountry" +msgstr "Select the country where this server is located, or the country of the mailing address for the server or publisher." + msgid "manager.setup.serverThumbnail" msgstr "Server thumbnail" diff --git a/schemas/context.json b/schemas/context.json index 55b52f40fc..7ae9e3cc07 100644 --- a/schemas/context.json +++ b/schemas/context.json @@ -10,6 +10,12 @@ "nullable" ] }, + "country": { + "type": "string", + "validation": [ + "country" + ] + }, "enableAuthorScreening": { "type": "boolean", "default": 0,