aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src
diff options
context:
space:
mode:
authorWouter Admiraal <wouter.admiraal@sonarsource.com>2020-10-05 13:55:29 +0200
committersonartech <sonartech@sonarsource.com>2020-10-15 20:07:59 +0000
commit8d61d7655bf8fc5df7b8d3afcc9f351da73cc6dd (patch)
tree7a89e3fc3e13a5306b6124d7d037fe0bd254db0c /server/sonar-web/src
parentbdf2f9c417c36a139e2641843fd8fa307784600b (diff)
downloadsonarqube-8d61d7655bf8fc5df7b8d3afcc9f351da73cc6dd.tar.gz
sonarqube-8d61d7655bf8fc5df7b8d3afcc9f351da73cc6dd.zip
SONAR-13925 Do not truncate Rules search field at 200 chars
Diffstat (limited to 'server/sonar-web/src')
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/components/App.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/__snapshots__/App-test.tsx.snap2
2 files changed, 4 insertions, 0 deletions
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/App.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/App.tsx
index 78c1e827e91..fb335dddd5c 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/components/App.tsx
+++ b/server/sonar-web/src/main/js/apps/coding-rules/components/App.tsx
@@ -81,6 +81,7 @@ import RuleDetails from './RuleDetails';
import RuleListItem from './RuleListItem';
const PAGE_SIZE = 100;
+const MAX_SEARCH_LENGTH = 200;
const LIMIT_BEFORE_LOAD_MORE = 5;
interface StateToProps {
@@ -600,6 +601,7 @@ export class App extends React.PureComponent<Props, State> {
<SearchBox
className="spacer-bottom"
id="coding-rules-search"
+ maxLength={MAX_SEARCH_LENGTH}
minLength={2}
onChange={this.handleSearch}
placeholder={translate('search.search_for_rules')}
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/__snapshots__/App-test.tsx.snap b/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/__snapshots__/App-test.tsx.snap
index 8339287fb2d..247c393d511 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/__snapshots__/App-test.tsx.snap
+++ b/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/__snapshots__/App-test.tsx.snap
@@ -66,6 +66,7 @@ exports[`should render correctly: loaded (ScreenPositionHelper) 1`] = `
<SearchBox
className="spacer-bottom"
id="coding-rules-search"
+ maxLength={200}
minLength={2}
onChange={[Function]}
placeholder="search.search_for_rules"
@@ -362,6 +363,7 @@ exports[`should render correctly: open rule (ScreenPositionHelper) 1`] = `
<SearchBox
className="spacer-bottom"
id="coding-rules-search"
+ maxLength={200}
minLength={2}
onChange={[Function]}
placeholder="search.search_for_rules"