Skip to content

Commit

Permalink
Merge pull request #613 from periodo/authority-form-fixes
Browse files Browse the repository at this point in the history
Authority form bug fixes
  • Loading branch information
rybesh authored Sep 13, 2024
2 parents 2d750c4 + 8abee29 commit 6d339bc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module.exports = RandomID(class NonLDSourceForm extends React.Component {
}

render() {
const { onValueChange } = this.props
const { onValueChange, sameAs } = this.props
, value = this.props.value || {}


Expand Down Expand Up @@ -67,15 +67,15 @@ A full citation is encouraged, but a title alone is sufficient.`,
my: 3,
name: 'sameAs',
label: 'Same as (read-only)',
value: value.sameAs || '',
value: sameAs || '',
disabled: true,
}),

h(InputBlock, {
my: 3,
name: 'yearPublished',
label: 'Year published',
value: (value.yearPublished || '').trim(),
value: (value.yearPublished || '').toString().trim(),
onChange: this.handleChange,
}),

Expand Down
2 changes: 2 additions & 0 deletions modules/periodo-app/src/forms/AuthorityForm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const h = require('react-hyperscript')

const lenses = {
source: R.lensProp('source'),
sameAs: R.lensProp('sameAs'),
locator: R.lensPath([ 'source', 'locator' ]),
editorialNote: R.lensProp('editorialNote'),
}
Expand Down Expand Up @@ -49,6 +50,7 @@ module.exports = Validated(
const formProps = {
value: get(lenses.source),
onValueChange: value => set(lenses.source, value),
sameAs: get(lenses.sameAs),
}

return (
Expand Down
1 change: 1 addition & 0 deletions modules/periodo-app/src/forms/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const VALID_AUTHORITY_FIELDS = [
'source',
'periods',
'editorialNote',
'sameAs',
]

const VALID_AUTHORITY_SOURCE_AGENT_FIELDS = [
Expand Down

0 comments on commit 6d339bc

Please sign in to comment.