Skip to content

Commit

Permalink
properly display but do not change or remove sameAs property
Browse files Browse the repository at this point in the history
when editing authorities
  • Loading branch information
rybesh committed Sep 13, 2024
1 parent 7879e4b commit 8abee29
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 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,7 +67,7 @@ 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,
}),

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 8abee29

Please sign in to comment.