Skip to content

Commit 6465c23

Browse files
committed
Multiple author affiliations (Ror)
1 parent 5d35187 commit 6465c23

11 files changed

+1190
-54
lines changed

public/globals.js

+17
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ window.pkp = {
158158
'article.metadata': 'Metadata',
159159
'author.users.contributor.principalContact': 'Primary Contact',
160160
'author.users.contributor.setPrincipalContact': 'Set Primary Contact',
161+
'common.add': 'Add',
161162
'common.addCCBCC': 'Add CC/BCC',
162163
'common.assign': 'Assign',
163164
'common.attachFiles': 'Attach Files',
@@ -804,6 +805,22 @@ window.pkp = {
804805
'The submission has been advanced to the next round of review',
805806
'workflow.submissionNextReviewRoundInFutureStage':
806807
'The submission advanced to the next review round, was accepted, and is currently in the {$stage} stage.',
808+
'user.affiliations': 'Affiliations',
809+
'user.affiliations.description': 'Enter the full name of the institution below, avoiding any acronyms. Select the name from the dropdown and click "Add" to include the affiliation in your profile. (e.g. "Simon Fraser University")',
810+
'user.affiliations.institution': 'Institution',
811+
'user.affiliations.translation': 'More information',
812+
'user.affiliations.translationEditActionLabel': 'Edit institution name',
813+
'user.affiliations.translationDeleteActionLabel': 'Remove institution',
814+
'user.affiliations.translationActionsAriaLabel': 'Click to edit or delete',
815+
'user.affiliations.translationsAllAvailable': 'All translations available',
816+
'user.affiliations.translationsSomeAvailable': '{$count} of {$total} languages completed',
817+
'user.affiliations.typeTranslationNameInLanguageLabel': 'Type the institute name in {$language}',
818+
'user.affiliations.translationNameInLanguage': 'Institute name in {$language}',
819+
'user.affiliations.deleteModal.title': 'Are you sure?',
820+
'user.affiliations.deleteModal.message': 'The affiliation <strong>{$affiliation}</strong> will be deleted.',
821+
'user.affiliations.searchPhraseLabel': 'Type the institute name in {$language}',
822+
'user.affiliations.searchPhraseNothingFound': 'Your search phrase could not be found',
823+
'user.affiliations.primaryLocaleRequired': 'The primary language {$primaryLocale} is required',
807824
},
808825
tinyMCE: {
809826
skinUrl: '/styles/tinymce',

src/components/DropdownActions/DropdownActions.vue

+3-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,9 @@ const emit = defineEmits([
127127
]);
128128
129129
const emitAction = (action) => {
130-
if (action.name) {
130+
if (action.name && (action.id || action.id === 0)) {
131+
emit('action', [action.name, action.id]);
132+
} else if (action.name) {
131133
emit('action', action.name);
132134
}
133135
};

src/components/Form/FormGroup.vue

+2
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
</template>
5454

5555
<script>
56+
import FieldAffiliations from './fields/FieldAffiliations.vue';
5657
import FieldArchivingPn from './fields/FieldArchivingPn.vue';
5758
import FieldAutosuggestPreset from './fields/FieldAutosuggestPreset.vue';
5859
import FieldBaseAutosuggest from './fields/FieldBaseAutosuggest.vue';
@@ -84,6 +85,7 @@ import {shouldShowFieldWithinGroup} from './formHelpers';
8485
export default {
8586
name: 'FormGroup',
8687
components: {
88+
FieldAffiliations,
8789
FieldArchivingPn,
8890
FieldAutosuggestPreset,
8991
FieldBaseAutosuggest,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import {Primary, Controls, Stories, Meta, ArgTypes} from '@storybook/blocks';
2+
3+
import * as FieldAffiliationsStories from './FieldAffiliations.stories.js';
4+
5+
<Meta of={FieldAffiliationsStories} />
6+
7+
# FieldAffiliation
8+
9+
## Usage
10+
11+
A special component to maintain affiliations (institutions) of authors (contributors).
12+
13+
The Affiliations currently saved are shown in a tabular way.
14+
15+
The default locale name and a clickable status message is shown, which shows which translations are saved. The affiliation name can be retrieved from an API or entered manually. If retrieved from the API, the values will be read only.
16+
17+
The data of the API is from a cached data dump from https://ror.org. Getting and saving the data dump is done with the classes in the namespace "PKP\ror".
18+
19+
The `value` are an array of Affiliation objects.
20+
21+
<Primary />
22+
<Controls />
23+
<Stories />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import {http, HttpResponse} from 'msw';
2+
import FieldAffiliations from './FieldAffiliations.vue';
3+
import FieldAffiliationsMock from '@/components/Form/mocks/field-affiliations';
4+
5+
export default {
6+
title: 'Forms/FieldAffiliations',
7+
component: FieldAffiliations,
8+
render: (args) => ({
9+
components: {FieldAffiliations},
10+
setup() {
11+
return {args};
12+
},
13+
template: '<FieldAffiliations v-bind="args"/>',
14+
}),
15+
parameters: {
16+
msw: {
17+
handlers: [
18+
http.get('https://api.ror.org/v2/organizations', async () => {
19+
return HttpResponse.json(FieldAffiliationsMock.organizations);
20+
}),
21+
],
22+
},
23+
docs: {
24+
story: {
25+
height: '500px',
26+
},
27+
},
28+
},
29+
};
30+
31+
export const Base = {
32+
args: {...FieldAffiliationsMock},
33+
};

0 commit comments

Comments
 (0)