Skip to content

Commit

Permalink
[8.x] fix: [Search:WebCrawlers:ViewCrawler:Manage Domains page]Incorr…
Browse files Browse the repository at this point in the history
…ect total number of options announced for Policy and Rules combo box (elastic#199745) (elastic#200003)

# Backport

This will backport the following commits from `main` to `8.x`:
- [fix: [Search:WebCrawlers:ViewCrawler:Manage Domains page]Incorrect
total number of options announced for Policy and Rules combo box
(elastic#199745)](elastic#199745)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Alexey
Antonov","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-13T13:42:41Z","message":"fix:
[Search:WebCrawlers:ViewCrawler:Manage Domains page]Incorrect total
number of options announced for Policy and Rules combo box
(elastic#199745)\n\nCloses: elastic#199132\r\n\r\n## Description\r\nVisible total
number of options should the same as announced for the\r\nuser as not to
confuse them. Especially for the users using
assistive\r\ntechnologies.\r\n\r\n## What was changed: \r\n1. value of
`hasNoInitialSelection` attribute value has been updated for\r\nthe
mentioned cases. This removes the extra selection option from the\r\nDOM
and fixes the `a11y` issue.\r\n\r\n## Screen:\r\n\r\n<img width=\"1201\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/6cf3dc6f-8664-44a9-baa8-453764098ad9\">","sha":"e9671937bacfaa911d32de0e8885e7f26425888a","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Project:Accessibility","release_note:skip","v9.0.0","Team:Search","backport:prev-minor"],"title":"fix:
[Search:WebCrawlers:ViewCrawler:Manage Domains page]Incorrect total
number of options announced for Policy and Rules combo
box","number":199745,"url":"https://github.com/elastic/kibana/pull/199745","mergeCommit":{"message":"fix:
[Search:WebCrawlers:ViewCrawler:Manage Domains page]Incorrect total
number of options announced for Policy and Rules combo box
(elastic#199745)\n\nCloses: elastic#199132\r\n\r\n## Description\r\nVisible total
number of options should the same as announced for the\r\nuser as not to
confuse them. Especially for the users using
assistive\r\ntechnologies.\r\n\r\n## What was changed: \r\n1. value of
`hasNoInitialSelection` attribute value has been updated for\r\nthe
mentioned cases. This removes the extra selection option from the\r\nDOM
and fixes the `a11y` issue.\r\n\r\n## Screen:\r\n\r\n<img width=\"1201\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/6cf3dc6f-8664-44a9-baa8-453764098ad9\">","sha":"e9671937bacfaa911d32de0e8885e7f26425888a"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/199745","number":199745,"mergeCommit":{"message":"fix:
[Search:WebCrawlers:ViewCrawler:Manage Domains page]Incorrect total
number of options announced for Policy and Rules combo box
(elastic#199745)\n\nCloses: elastic#199132\r\n\r\n## Description\r\nVisible total
number of options should the same as announced for the\r\nuser as not to
confuse them. Especially for the users using
assistive\r\ntechnologies.\r\n\r\n## What was changed: \r\n1. value of
`hasNoInitialSelection` attribute value has been updated for\r\nthe
mentioned cases. This removes the extra selection option from the\r\nDOM
and fixes the `a11y` issue.\r\n\r\n## Screen:\r\n\r\n<img width=\"1201\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/6cf3dc6f-8664-44a9-baa8-453764098ad9\">","sha":"e9671937bacfaa911d32de0e8885e7f26425888a"}}]}]
BACKPORT-->

Co-authored-by: Alexey Antonov <[email protected]>
  • Loading branch information
kibanamachine and alexwizp authored Nov 13, 2024
1 parent 90f432c commit 82117f1
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ const DEFAULT_DESCRIPTION = (
defaultMessage="Create a crawl rule to include or exclude pages whose URL matches the rule. Rules run in sequential order, and each URL is evaluated according to the first match. {link}"
values={{
link: (
<EuiLink href={docLinks.appSearchCrawlRules} target="_blank" external>
<EuiLink
data-test-subj="enterpriseSearchLearnMoreAboutCrawlRulesLink"
href={docLinks.appSearchCrawlRules}
target="_blank"
external
>
{i18n.translate(
'xpack.enterpriseSearch.appSearch.crawler.crawlRulesTable.descriptionLinkText',
{ defaultMessage: 'Learn more about crawl rules' }
Expand All @@ -78,9 +83,10 @@ export const CrawlRulesTable: React.FC<CrawlRulesTableProps> = ({
{
editingRender: (crawlRule, onChange, { isInvalid, isLoading }) => (
<EuiSelect
data-test-subj="enterpriseSearchColumnsSelect"
fullWidth
hasNoInitialSelection
value={(crawlRule as CrawlRule).policy}
hasNoInitialSelection={!(crawlRule as CrawlRule).policy}
onChange={(e) => onChange(e.target.value)}
disabled={isLoading}
isInvalid={isInvalid}
Expand All @@ -106,9 +112,10 @@ export const CrawlRulesTable: React.FC<CrawlRulesTableProps> = ({
{
editingRender: (crawlRule, onChange, { isInvalid, isLoading }) => (
<EuiSelect
data-test-subj="enterpriseSearchColumnsSelect"
fullWidth
hasNoInitialSelection
value={(crawlRule as CrawlRule).rule}
hasNoInitialSelection={!(crawlRule as CrawlRule).rule}
onChange={(e) => onChange(e.target.value)}
disabled={isLoading}
isInvalid={isInvalid}
Expand Down Expand Up @@ -139,6 +146,7 @@ export const CrawlRulesTable: React.FC<CrawlRulesTableProps> = ({
<EuiFlexGroup alignItems="center" gutterSize="s" responsive={false}>
<EuiFlexItem>
<EuiFieldText
data-test-subj="enterpriseSearchColumnsFieldText"
fullWidth
value={(crawlRule as CrawlRule).pattern}
onChange={(e) => onChange(e.target.value)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,12 @@ const DEFAULT_DESCRIPTION = (
defaultMessage="Create a crawl rule to include or exclude pages whose URL matches the rule. Rules run in sequential order, and each URL is evaluated according to the first match."
/>
<EuiSpacer size="s" />
<EuiLink href={docLinks.crawlerManaging} target="_blank" external>
<EuiLink
data-test-subj="enterpriseSearchLearnMoreAboutCrawlRulesLink"
href={docLinks.crawlerManaging}
target="_blank"
external
>
{i18n.translate('xpack.enterpriseSearch.crawler.crawlRulesTable.descriptionLinkText', {
defaultMessage: 'Learn more about crawl rules',
})}
Expand All @@ -126,10 +131,11 @@ export const CrawlRulesTable: React.FC<CrawlRulesTableProps> = ({
{
editingRender: (crawlRule, onChange, { isInvalid, isLoading }) => (
<EuiSelect
data-test-subj="enterpriseSearchColumnsSelect"
data-telemetry-id="entSearchContent-crawler-domainDetail-crawlRules-policy"
fullWidth
hasNoInitialSelection
value={(crawlRule as CrawlRule).policy}
hasNoInitialSelection={!(crawlRule as CrawlRule).policy}
onChange={(e) => onChange(e.target.value)}
disabled={isLoading}
isInvalid={isInvalid}
Expand All @@ -152,10 +158,11 @@ export const CrawlRulesTable: React.FC<CrawlRulesTableProps> = ({
{
editingRender: (crawlRule, onChange, { isInvalid, isLoading }) => (
<EuiSelect
data-test-subj="enterpriseSearchColumnsSelect"
data-telemetry-id="entSearchContent-crawler-domainDetail-crawlRules-rule"
fullWidth
hasNoInitialSelection
value={(crawlRule as CrawlRule).rule}
hasNoInitialSelection={!(crawlRule as CrawlRule).rule}
onChange={(e) => onChange(e.target.value)}
disabled={isLoading}
isInvalid={isInvalid}
Expand Down Expand Up @@ -183,6 +190,7 @@ export const CrawlRulesTable: React.FC<CrawlRulesTableProps> = ({
<EuiFlexGroup alignItems="center" gutterSize="s" responsive={false}>
<EuiFlexItem>
<EuiFieldText
data-test-subj="enterpriseSearchColumnsFieldText"
fullWidth
value={(crawlRule as CrawlRule).pattern}
onChange={(e) => onChange(e.target.value)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const ConnectorFields: React.FC<ActionConnectorFieldsProps> = ({ readOnly, isEdi
'data-test-subj': 'config.apiProvider-select',
options: providerOptions,
fullWidth: true,
hasNoInitialSelection: true,
hasNoInitialSelection: false,
disabled: readOnly,
readOnly,
},
Expand Down

0 comments on commit 82117f1

Please sign in to comment.