diff --git a/src/components/Form/FormGroup.vue b/src/components/Form/FormGroup.vue index ce7b6087..84350664 100644 --- a/src/components/Form/FormGroup.vue +++ b/src/components/Form/FormGroup.vue @@ -53,6 +53,7 @@ + + diff --git a/src/components/Form/mocks/field-affiliations.js b/src/components/Form/mocks/field-affiliations.js new file mode 100644 index 00000000..1edcc894 --- /dev/null +++ b/src/components/Form/mocks/field-affiliations.js @@ -0,0 +1,461 @@ +export default { + name: 'author-affiliations', + component: 'author-affiliations', + items: { + "12": { + "_data": { + "id": 12, + "authorId": 5, + "ror": "https://ror.org/0213rcc28", + "name": { + "en": "Simon Fraser University", + "fr_CA": "Simon Fraser University", + "de": "Simon Fraser University", + "nl": "Simon Fraser University", + "tr": "Simon Fraser University", + } + }, + "_hasLoadableAdapters": false, + "_metadataExtractionAdapters": [], + "_extractionAdaptersLoaded": false, + "_metadataInjectionAdapters": [], + "_injectionAdaptersLoaded": false, + "_localesTable": { + "be@cyrillic": "be", + "bs": "bs_Latn", + "fr_FR": "fr", + "nb": "nb_NO", + "sr@cyrillic": "sr_Cyrl", + "sr@latin": "sr_Latn", + "uz@cyrillic": "uz", + "uz@latin": "uz_Latn", + "zh_CN": "zh_Hans" + } + }, + "13": { + "_data": { + "id": 13, + "authorId": 5, + "ror": "https://ror.org/02e2c7k09", + "name": { + "en": "Delft University of Technology", + "fr_CA": "", + "de": "", + "nl": "Technische Universiteit Delft", + "tr": "Delft University of Technology", + } + }, + "_hasLoadableAdapters": false, + "_metadataExtractionAdapters": [], + "_extractionAdaptersLoaded": false, + "_metadataInjectionAdapters": [], + "_injectionAdaptersLoaded": false, + "_localesTable": { + "be@cyrillic": "be", + "bs": "bs_Latn", + "fr_FR": "fr", + "nb": "nb_NO", + "sr@cyrillic": "sr_Cyrl", + "sr@latin": "sr_Latn", + "uz@cyrillic": "uz", + "uz@latin": "uz_Latn", + "zh_CN": "zh_Hans" + } + }, + "14": { + "_data": { + "id": 14, + "authorId": 5, + "ror": "", + "name": { + "en": "German National Library of Science and Technology", + "fr_CA": "", + "de": "Technische Informationsbibliothek (TIB)", + "nl": "", + "tr": "", + } + }, + "_hasLoadableAdapters": false, + "_metadataExtractionAdapters": [], + "_extractionAdaptersLoaded": false, + "_metadataInjectionAdapters": [], + "_injectionAdaptersLoaded": false, + "_localesTable": { + "be@cyrillic": "be", + "bs": "bs_Latn", + "fr_FR": "fr", + "nb": "nb_NO", + "sr@cyrillic": "sr_Cyrl", + "sr@latin": "sr_Latn", + "uz@cyrillic": "uz", + "uz@latin": "uz_Latn", + "zh_CN": "zh_Hans" + } + }, + "15": { + "_data": { + "id": 15, + "authorId": 5, + "ror": "https://ror.org/0304hq317", + "name": { + "en": "Leibniz University Hannover", + "fr_CA": "", + "de": "Technische Universität Hannover", + "nl": "", + "tr": "", + } + }, + "_hasLoadableAdapters": false, + "_metadataExtractionAdapters": [], + "_extractionAdaptersLoaded": false, + "_metadataInjectionAdapters": [], + "_injectionAdaptersLoaded": false, + "_localesTable": { + "be@cyrillic": "be", + "bs": "bs_Latn", + "fr_FR": "fr", + "nb": "nb_NO", + "sr@cyrillic": "sr_Cyrl", + "sr@latin": "sr_Latn", + "uz@cyrillic": "uz", + "uz@latin": "uz_Latn", + "zh_CN": "zh_Hans" + } + } + }, + rorsApiResponse: { + "itemsMax": 110723, + "items": [ + { + "displayLocale": "en", + "id": 1, + "isActive": true, + "name": { + "en": "RMIT University", + "fr_CA": "" + }, + "ror": "https://ror.org/04ttjf776" + }, + { + "displayLocale": "en", + "id": 2, + "isActive": true, + "name": { + "en": "La Trobe University", + "fr_CA": "" + }, + "ror": "https://ror.org/01rxfrp27" + }, + { + "displayLocale": "en", + "id": 3, + "isActive": true, + "name": { + "en": "Victoria University", + "fr_CA": "" + }, + "ror": "https://ror.org/04j757h98" + }, + { + "displayLocale": "en", + "id": 4, + "isActive": true, + "name": { + "en": "University of New England", + "fr_CA": "" + }, + "ror": "https://ror.org/04r659a56" + }, + { + "displayLocale": "en", + "id": 5, + "isActive": true, + "name": { + "en": "Griffith University", + "fr_CA": "" + }, + "ror": "https://ror.org/02sc3r913" + }, + { + "displayLocale": "en", + "id": 6, + "isActive": true, + "name": { + "en": "Central Queensland University", + "fr_CA": "" + }, + "ror": "https://ror.org/023q4bk22" + }, + { + "displayLocale": "en", + "id": 7, + "isActive": true, + "name": { + "en": "University of South Australia", + "fr_CA": "" + }, + "ror": "https://ror.org/01p93h210" + }, + { + "displayLocale": "en", + "id": 8, + "isActive": true, + "name": { + "en": "Bond University", + "fr_CA": "" + }, + "ror": "https://ror.org/006jxzx88" + }, + { + "displayLocale": "en", + "id": 9, + "isActive": true, + "name": { + "en": "Charles Sturt University", + "fr_CA": "" + }, + "ror": "https://ror.org/00wfvh315" + }, + { + "displayLocale": "en", + "id": 10, + "isActive": true, + "name": { + "en": "Federation University", + "fr_CA": "" + }, + "ror": "https://ror.org/05qbzwv83" + }, + { + "displayLocale": "en", + "id": 11, + "isActive": true, + "name": { + "en": "Burnet Institute", + "fr_CA": "" + }, + "ror": "https://ror.org/05ktbsm52" + }, + { + "displayLocale": "en", + "id": 12, + "isActive": true, + "name": { + "en": "Mater Research", + "fr_CA": "" + }, + "ror": "https://ror.org/00nx6aa03" + }, + { + "displayLocale": "en", + "id": 13, + "isActive": true, + "name": { + "en": "St Vincents Institute of Medical Research", + "fr_CA": "" + }, + "ror": "https://ror.org/02k3cxs74" + }, + { + "displayLocale": "en", + "id": 14, + "isActive": true, + "name": { + "en": "The Heart Research Institute", + "fr_CA": "" + }, + "ror": "https://ror.org/046fa4y88" + }, + { + "displayLocale": "en", + "id": 15, + "isActive": true, + "name": { + "en": "University Mental Health Research Institute", + "fr_CA": "" + }, + "ror": "https://ror.org/02d439m40" + }, + { + "displayLocale": "en", + "id": 16, + "isActive": true, + "name": { + "en": "Rolls-Royce (United Kingdom)", + "fr_CA": "" + }, + "ror": "https://ror.org/04h08p482" + }, + { + "displayLocale": "en", + "id": 17, + "isActive": true, + "name": { + "en": "BP (United Kingdom)", + "fr_CA": "" + }, + "ror": "https://ror.org/01zctcs90" + }, + { + "displayLocale": "en", + "id": 18, + "isActive": true, + "name": { + "en": "Rio Tinto (United Kingdom)", + "fr_CA": "" + }, + "ror": "https://ror.org/05m7zw681" + }, + { + "displayLocale": "en", + "id": 19, + "isActive": true, + "name": { + "en": "Arup Group (United States)", + "fr_CA": "" + }, + "ror": "https://ror.org/03awtex73" + }, + { + "displayLocale": "en", + "id": 20, + "isActive": true, + "name": { + "en": "BT Group (United Kingdom)", + "fr_CA": "" + }, + "ror": "https://ror.org/00kv9pj15" + }, + { + "displayLocale": "en", + "id": 21, + "isActive": true, + "name": { + "en": "Mater Health Services", + "fr_CA": "" + }, + "ror": "https://ror.org/03mjtdk61" + }, + { + "displayLocale": "en", + "id": 22, + "isActive": true, + "name": { + "en": "Pilkington (United Kingdom)", + "fr_CA": "" + }, + "ror": "https://ror.org/04yyp8h20" + }, + { + "displayLocale": "en", + "id": 23, + "isActive": true, + "name": { + "en": "Trojan Technologies (Canada)", + "fr_CA": "" + }, + "ror": "https://ror.org/022rkxt86" + }, + { + "displayLocale": "en", + "id": 24, + "isActive": true, + "name": { + "en": "The Alfred Hospital", + "fr_CA": "" + }, + "ror": "https://ror.org/01wddqe20" + }, + { + "displayLocale": "en", + "id": 25, + "isActive": true, + "name": { + "en": "Washington State Department of Health", + "fr_CA": "" + }, + "ror": "https://ror.org/02x2akc96" + }, + { + "displayLocale": "en", + "id": 26, + "isActive": true, + "name": { + "en": "Women's and Children's Hospital", + "fr_CA": "" + }, + "ror": "https://ror.org/03kwrfk72" + }, + { + "displayLocale": "en", + "id": 27, + "isActive": true, + "name": { + "en": "Xstrata (United Kingdom)", + "fr_CA": "" + }, + "ror": "https://ror.org/037mpqg03" + }, + { + "displayLocale": "en", + "id": 28, + "isActive": true, + "name": { + "en": "Teck (Canada)", + "fr_CA": "" + }, + "ror": "https://ror.org/05cggb038" + }, + { + "displayLocale": "en", + "id": 29, + "isActive": true, + "name": { + "en": "Hunter New England Local Health District", + "fr_CA": "" + }, + "ror": "https://ror.org/050b31k83" + }, + { + "displayLocale": "en", + "id": 30, + "isActive": true, + "name": { + "en": "Cancer Council Victoria", + "fr_CA": "" + }, + "ror": "https://ror.org/023m51b03" + } + ] + }, + /* [ rorsApiResponseItem, ... ] */ + rorsApiResponseItem: { + "displayLocale": "en", + "id": 1, + "isActive": true, + "name": { + "en": "Simon Fraser University", + "fr_CA": "Simon Fraser University", + "de": "Simon Fraser University", + "nl": "Simon Fraser University", + "tr": "Simon Fraser University", + }, + "ror": "https://ror.org/0213rcc28" + }, + newItem: { + "newId": { + "_data": { + "id": null, + "authorId": null, + "ror": "", + "name": {} + }, + "_hasLoadableAdapters": false, + "_metadataExtractionAdapters": [], + "_extractionAdaptersLoaded": false, + "_metadataInjectionAdapters": [], + "_injectionAdaptersLoaded": false, + "_localesTable": {} + } + }, +}; diff --git a/src/components/Icon/Icon.stories.js b/src/components/Icon/Icon.stories.js index 7afae93d..d4cfe95e 100644 --- a/src/components/Icon/Icon.stories.js +++ b/src/components/Icon/Icon.stories.js @@ -122,6 +122,7 @@ export const iconGallery = { 'ReviewAssignments', 'ReviewRequestDeclined', 'ReviewSent', + 'Ror', 'Search', 'Settings', 'Sort', diff --git a/src/components/Icon/Icon.vue b/src/components/Icon/Icon.vue index a67339d1..a51c7422 100644 --- a/src/components/Icon/Icon.vue +++ b/src/components/Icon/Icon.vue @@ -27,6 +27,53 @@ /> + + @@ -100,6 +147,7 @@ import ReadRecommendation from './icons/ReadRecommendation.vue'; import ReviewAssignments from './icons/ReviewAssignments.vue'; import ReviewRequestDeclined from './icons/ReviewRequestDeclined.vue'; import ReviewSent from './icons/ReviewSent.vue'; +import Ror from './icons/Ror.vue'; import Search from './icons/Search.vue'; import Settings from './icons/Settings.vue'; import Sort from './icons/Sort.vue'; @@ -176,6 +224,7 @@ const svgIcons = { ReviewAssignments, ReviewRequestDeclined, ReviewSent, + Ror, Search, Settings, Sort, @@ -200,7 +249,8 @@ const isSvgIcon = computed(() => !!svgIcons[props.icon]); const classes = computed(() => { let classes = []; - if (props.icon !== 'orcid') { + let nonFontAwesomeIcons = ['orcid', 'ror']; + if (!nonFontAwesomeIcons.includes(props.icon)) { classes.push('fa-' + props.icon); } if (props.inline) { @@ -249,4 +299,14 @@ const classes = computed(() => { fill: #ffffff; } } + +/** + * Ror icon + */ +.pkpIcon--ror { + display: inline-block; + width: 1.5em; + height: 1.5em; + vertical-align: middle; +} diff --git a/src/components/Icon/icons/Ror.vue b/src/components/Icon/icons/Ror.vue new file mode 100644 index 00000000..5bee1728 --- /dev/null +++ b/src/components/Icon/icons/Ror.vue @@ -0,0 +1,45 @@ +