Skip to content

Commit

Permalink
Update required filled progress bar
Browse files Browse the repository at this point in the history
  • Loading branch information
claravox committed Jan 15, 2025
1 parent a50696f commit 657ec19
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion deposit/static/deposit/js/metadata-form.js

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions metadata_form/src/js/TreeKeywordSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,11 @@ class TreeKeywordSelector extends React.Component {
const title = this.props.schema.title || this.props.uiSchema['ui:title']
const required = this.props.required
const fullLine = title + (required ? '*' : '')
let label = <label className='w-100'>{fullLine}</label>
if (this.fieldNeedsAttention()) {
label = <label className='w-100 text-danger'>{fullLine}</label>
}
return label
const labelClasses = "w-100" + (required ? ' select-required' : '')
+ (this.fieldNeedsAttention() ? ' text-danger' : '')
+ ((!('minItems' in this.props.schema) && required) ||
(required && 'minItems' in this.props.schema && this.state.value.length >= this.props.schema.minItems) ? ' select-filled' : '')
return <label className={labelClasses}>{fullLine}</label>
}

render () {
Expand Down
2 changes: 1 addition & 1 deletion research/static/research/js/metadata-form.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion vault/static/vault/js/metadata-form.js

Large diffs are not rendered by default.

0 comments on commit 657ec19

Please sign in to comment.