From 16fef9633898854448e3545515af41c11286a52e Mon Sep 17 00:00:00 2001 From: Oliwia Rogala Date: Thu, 15 Feb 2024 11:17:11 +0100 Subject: [PATCH] fix: associate HTML labels with inputs (#9599) Refs #8879 Co-authored-by: morsko1 --- src/core/components/auth/api-key-auth.jsx | 11 ++++- src/core/components/auth/basic-auth.jsx | 28 +++++++++--- src/core/components/param-body.jsx | 10 ++++- .../components/parameter-include-empty.jsx | 16 ++++--- src/core/components/parameters/parameters.jsx | 9 +++- .../oas3/components/auth/http-auth.jsx | 45 ++++++++++++++----- 6 files changed, 90 insertions(+), 29 deletions(-) diff --git a/src/core/components/auth/api-key-auth.jsx b/src/core/components/auth/api-key-auth.jsx index 5b3527e8c06..f85c6014c05 100644 --- a/src/core/components/auth/api-key-auth.jsx +++ b/src/core/components/auth/api-key-auth.jsx @@ -66,10 +66,17 @@ export default class ApiKeyAuth extends React.Component {

In: { schema.get("in") }

- + { value ? ****** - : + : + + } { diff --git a/src/core/components/auth/basic-auth.jsx b/src/core/components/auth/basic-auth.jsx index baa5268ffc9..f982f71f624 100644 --- a/src/core/components/auth/basic-auth.jsx +++ b/src/core/components/auth/basic-auth.jsx @@ -65,20 +65,34 @@ export default class BasicAuth extends React.Component { - + { username ? { username } - : + : + + } - + { username ? ****** - : + : + + } { diff --git a/src/core/components/param-body.jsx b/src/core/components/param-body.jsx index 3ac5a21e88e..11eeef9f7b9 100644 --- a/src/core/components/param-body.jsx +++ b/src/core/components/param-body.jsx @@ -2,6 +2,7 @@ import React, { PureComponent } from "react" import PropTypes from "prop-types" import { fromJS, List } from "immutable" import { getKnownSyntaxHighlighterLanguage } from "core/utils/jsonParse" +import createHtmlReadyId from "core/utils/create-html-ready-id" const NOOP = Function.prototype @@ -118,6 +119,9 @@ export default class ParamBody extends PureComponent { language = "json" } + const regionId = createHtmlReadyId(`${pathMethod[1]}${pathMethod[0]}_parameters`) + const controlId = `${regionId}_select` + return (
{ @@ -137,14 +141,16 @@ export default class ParamBody extends PureComponent {
} -