-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
1,154 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import {Primary, Controls, Stories, Meta, ArgTypes} from '@storybook/blocks'; | ||
|
||
import * as FieldAffiliationsStories from './FieldAffiliations.stories.js'; | ||
|
||
<Meta of={FieldAffiliationsStories} /> | ||
|
||
# FieldAffiliation | ||
|
||
## Usage | ||
|
||
A special component to maintain affiliations (institutions) of authors (contributors). | ||
|
||
The Affiliations currently saved are shown in a tabular way. | ||
|
||
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. | ||
|
||
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". | ||
|
||
The `value` are an array of Affiliation objects. | ||
|
||
<Primary /> | ||
<Controls /> | ||
<Stories /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import FieldAffiliations from './FieldAffiliations.vue'; | ||
import FieldAffiliationsMock from '@/components/Form/mocks/field-affiliations'; | ||
import {http, HttpResponse} from "msw"; | ||
|
||
const args = {...FieldAffiliationsMock}; | ||
|
||
export default { | ||
title: 'Forms/FieldAffiliations', | ||
component: FieldAffiliations, | ||
args: {}, | ||
parameters: { | ||
msw: { | ||
handlers: [ | ||
http.get( | ||
'https://mock/index.php/publicknowledge/api/v1/rors/?searchPhrase=Simon+Fraser+University', | ||
async () => { | ||
return HttpResponse.json(args.apiResponse); | ||
}, | ||
), | ||
], | ||
}, | ||
}, | ||
render: (args) => ({ | ||
components: {FieldAffiliations}, | ||
setup() { | ||
return {args} | ||
}, | ||
template: ` | ||
<FieldAffiliations v-bind="args"/>` | ||
}), | ||
decorators: [ | ||
() => ({ | ||
template: '<div style="height: 600px"><story/></div>', | ||
}), | ||
], | ||
}; | ||
|
||
export const Base = { | ||
args: {...FieldAffiliationsMock}, | ||
}; |
Oops, something went wrong.