Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/core/components/content-type.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ export default class ContentType extends React.Component {
contentTypes: PropTypes.oneOfType([ImPropTypes.list, ImPropTypes.set, ImPropTypes.seq]),
value: PropTypes.string,
onChange: PropTypes.func,
className: PropTypes.string
className: PropTypes.string,
ariaLabel: PropTypes.string
}

static defaultProps = {
Expand Down Expand Up @@ -40,14 +41,14 @@ export default class ContentType extends React.Component {
onChangeWrapper = e => this.props.onChange(e.target.value)

render() {
let { contentTypes, className, value } = this.props
let { contentTypes, className, value, ariaLabel } = this.props

if ( !contentTypes || !contentTypes.size )
return null

return (
<div className={ "content-type-wrapper " + ( className || "" ) }>
<select className="content-type" value={value || ""} onChange={this.onChangeWrapper} >
<select className="content-type" aria-label={ariaLabel} value={value || ""} onChange={this.onChangeWrapper} >
{ contentTypes.map( (val) => {
return <option key={ val } value={ val }>{ val }</option>
}).toArray()}
Expand Down
7 changes: 6 additions & 1 deletion src/core/components/param-body.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,12 @@ export default class ParamBody extends PureComponent {
}
<label htmlFor="">
<span>Parameter content type</span>
<ContentType value={ consumesValue } contentTypes={ consumes } onChange={onChangeConsumes} className="body-param-content-type" />
<ContentType
value={ consumesValue }
contentTypes={ consumes }
onChange={onChangeConsumes}
className="body-param-content-type"
ariaLabel="Parameter content type" />
</label>
</div>

Expand Down
3 changes: 2 additions & 1 deletion src/core/components/parameters/parameters.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ export default class Parameters extends Component {
onChange={(value) => {
this.onChangeMediaType({ value, pathMethod })
}}
className="body-param-content-type" />
className="body-param-content-type"
ariaLabel="Request content type" />
</label>
</div>
<div className="opblock-description-wrapper">
Expand Down
1 change: 1 addition & 0 deletions src/core/components/response.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ export default class Response extends React.Component {
: Seq()
}
onChange={this._onContentTypeChange}
ariaLabel="Media Type"
/>
{controlsAcceptHeader ? (
<small className="response-control-media-type__accept-message">
Expand Down
3 changes: 2 additions & 1 deletion src/core/components/responses.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ export default class Responses extends React.Component {
<ContentType value={producesValue}
onChange={this.onChangeProducesWrapper}
contentTypes={produces}
className="execute-content-type"/>
className="execute-content-type"
ariaLabel="Response content type" />
</label> }
</div>
<div className="responses-inner">
Expand Down