aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/issues
diff options
context:
space:
mode:
authorGrégoire Aubert <gregoire.aubert@sonarsource.com>2018-07-06 11:44:51 +0200
committerSonarTech <sonartech@sonarsource.com>2018-07-11 20:21:22 +0200
commitdf81c0dd7ca62b44441269d67d6b4a174b8f2f76 (patch)
treee1e5b2dcbfe02d054fce6b2d80178a83e5d0090a /server/sonar-web/src/main/js/apps/issues
parent29b0f28f9e4fc05ce662212a55aef45ad0278201 (diff)
downloadsonarqube-df81c0dd7ca62b44441269d67d6b4a174b8f2f76.tar.gz
sonarqube-df81c0dd7ca62b44441269d67d6b4a174b8f2f76.zip
SONAR-10945 Hide QP in rules pages
* SONAR-11003 Always set organization parameter in api/rules/search * SONAR-11002 Show rules and hide quality profiles inside rules page
Diffstat (limited to 'server/sonar-web/src/main/js/apps/issues')
-rw-r--r--server/sonar-web/src/main/js/apps/issues/sidebar/AssigneeFacet.tsx8
-rw-r--r--server/sonar-web/src/main/js/apps/issues/sidebar/Sidebar.tsx10
-rw-r--r--server/sonar-web/src/main/js/apps/issues/sidebar/TagFacet.tsx8
3 files changed, 11 insertions, 15 deletions
diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/AssigneeFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/AssigneeFacet.tsx
index b4896bafea6..26d0204509e 100644
--- a/server/sonar-web/src/main/js/apps/issues/sidebar/AssigneeFacet.tsx
+++ b/server/sonar-web/src/main/js/apps/issues/sidebar/AssigneeFacet.tsx
@@ -38,7 +38,7 @@ export interface Props {
onChange: (changes: Partial<Query>) => void;
onToggle: (property: string) => void;
open: boolean;
- organization: { key: string } | undefined;
+ organization: string | undefined;
stats: { [x: string]: number } | undefined;
referencedUsers: { [login: string]: ReferencedUser };
}
@@ -77,11 +77,7 @@ export default class AssigneeFacet extends React.PureComponent<Props> {
};
handleSearch = (query: string) => {
- let organization = this.props.component && this.props.component.organization;
- if (this.props.organization && !organization) {
- organization = this.props.organization.key;
- }
- return searchAssignees(query, organization);
+ return searchAssignees(query, this.props.organization);
};
handleSelect = (option: { value: string }) => {
diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/Sidebar.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/Sidebar.tsx
index c850ffa0750..77611af9140 100644
--- a/server/sonar-web/src/main/js/apps/issues/sidebar/Sidebar.tsx
+++ b/server/sonar-web/src/main/js/apps/issues/sidebar/Sidebar.tsx
@@ -63,6 +63,10 @@ export default class Sidebar extends React.PureComponent<Props> {
const displayFilesFacet = component !== undefined;
const displayAuthorFacet = !component || component.qualifier !== 'DEV';
+ const organizationKey =
+ (component && component.organization) ||
+ (this.props.organization && this.props.organization.key);
+
return (
<div className="search-navigator-facets-list">
<FacetMode facetMode={query.facetMode} onChange={this.props.onFilterChange} />
@@ -124,7 +128,7 @@ export default class Sidebar extends React.PureComponent<Props> {
onChange={this.props.onFilterChange}
onToggle={this.props.onFacetToggle}
open={!!openFacets.rules}
- organization={this.props.organization && this.props.organization.key}
+ organization={organizationKey}
referencedRules={this.props.referencedRules}
rules={query.rules}
stats={facets.rules}
@@ -136,7 +140,7 @@ export default class Sidebar extends React.PureComponent<Props> {
onChange={this.props.onFilterChange}
onToggle={this.props.onFacetToggle}
open={!!openFacets.tags}
- organization={this.props.organization}
+ organization={organizationKey}
stats={facets.tags}
tags={query.tags}
/>
@@ -200,7 +204,7 @@ export default class Sidebar extends React.PureComponent<Props> {
onChange={this.props.onFilterChange}
onToggle={this.props.onFacetToggle}
open={!!openFacets.assignees}
- organization={this.props.organization}
+ organization={organizationKey}
referencedUsers={this.props.referencedUsers}
stats={facets.assignees}
/>
diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/TagFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/TagFacet.tsx
index dab0d43d298..91e30bf9de5 100644
--- a/server/sonar-web/src/main/js/apps/issues/sidebar/TagFacet.tsx
+++ b/server/sonar-web/src/main/js/apps/issues/sidebar/TagFacet.tsx
@@ -38,7 +38,7 @@ interface Props {
onChange: (changes: Partial<Query>) => void;
onToggle: (property: string) => void;
open: boolean;
- organization: { key: string } | undefined;
+ organization: string | undefined;
stats: { [x: string]: number } | undefined;
tags: string[];
}
@@ -74,11 +74,7 @@ export default class TagFacet extends React.PureComponent<Props> {
};
handleSearch = (query: string) => {
- let organization = this.props.component && this.props.component.organization;
- if (this.props.organization && !organization) {
- organization = this.props.organization.key;
- }
- return searchIssueTags({ organization, ps: 50, q: query }).then(tags =>
+ return searchIssueTags({ organization: this.props.organization, ps: 50, q: query }).then(tags =>
tags.map(tag => ({ label: tag, value: tag }))
);
};