]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-9566 Don't redirect to "My Issues" at organization level
authorGrégoire Aubert <gregoire.aubert@sonarsource.com>
Mon, 24 Jul 2017 08:56:55 +0000 (10:56 +0200)
committerGrégoire Aubert <gregoire.aubert@sonarsource.com>
Tue, 25 Jul 2017 07:20:30 +0000 (09:20 +0200)
server/sonar-web/src/main/js/apps/organizations/components/OrganizationPage.js
server/sonar-web/src/main/js/apps/organizations/navigation/OrganizationNavigation.js
server/sonar-web/src/main/js/apps/organizations/navigation/__tests__/OrganizationNavigation-test.js

index 9111c0c70e2b4442931b6005270b90ddda419168..de6ded0a88b0e7058facafb86d791f48eeda1fa1 100644 (file)
@@ -24,7 +24,7 @@ import { connect } from 'react-redux';
 import OrganizationNavigation from '../navigation/OrganizationNavigation';
 import NotFound from '../../../app/components/NotFound';
 import { fetchOrganization } from '../actions';
-import { getCurrentUser, getOrganizationByKey } from '../../../store/rootReducer';
+import { getOrganizationByKey } from '../../../store/rootReducer';
 import type { Organization } from '../../../store/organizations/duck';
 
 type OwnProps = {
@@ -33,7 +33,6 @@ type OwnProps = {
 
 type Props = {
   children?: React.Element<*>,
-  currentUser: { isLoggedIn: boolean, showOnboardingTutorial: true },
   location: Object,
   organization: null | Organization,
   params: { organizationKey: string },
@@ -89,11 +88,7 @@ class OrganizationPage extends React.PureComponent {
     return (
       <div>
         <Helmet defaultTitle={organization.name} titleTemplate={'%s - ' + organization.name} />
-        <OrganizationNavigation
-          currentUser={this.props.currentUser}
-          organization={organization}
-          location={this.props.location}
-        />
+        <OrganizationNavigation organization={organization} location={this.props.location} />
         {this.props.children}
       </div>
     );
@@ -101,7 +96,6 @@ class OrganizationPage extends React.PureComponent {
 }
 
 const mapStateToProps = (state, ownProps: OwnProps) => ({
-  currentUser: getCurrentUser(state),
   organization: getOrganizationByKey(state, ownProps.params.organizationKey)
 });
 
index e6c50799dbce09a90e573f923f2dcfa99647af41..382ea88ac87bc0246351b22ecf097934243b003a 100644 (file)
@@ -25,7 +25,6 @@ import { translate } from '../../../helpers/l10n';
 import ContextNavBar from '../../../components/nav/ContextNavBar';
 import NavBarTabs from '../../../components/nav/NavBarTabs';
 import OrganizationIcon from '../../../components/icons-components/OrganizationIcon';
-import { isMySet } from '../../issues/utils';
 import { getQualityGatesUrl } from '../../../helpers/urls';
 import type { Organization } from '../../../store/organizations/duck';
 
@@ -40,7 +39,6 @@ const ADMIN_PATHS = [
 
 export default class OrganizationNavigation extends React.PureComponent {
   props: {
-    currentUser: { isLoggedIn: boolean },
     location: { pathname: string },
     organization: Organization
   };
@@ -138,7 +136,7 @@ export default class OrganizationNavigation extends React.PureComponent {
   }
 
   render() {
-    const { currentUser, organization, location } = this.props;
+    const { organization, location } = this.props;
 
     const isHomeActive =
       location.pathname === `organizations/${organization.key}/projects` ||
@@ -203,10 +201,7 @@ export default class OrganizationNavigation extends React.PureComponent {
             <Link
               to={{
                 pathname: `/organizations/${organization.key}/issues`,
-                query:
-                  currentUser.isLoggedIn && isMySet()
-                    ? { resolved: 'false', myIssues: 'true' }
-                    : { resolved: 'false' }
+                query: { resolved: 'false' }
               }}
               activeClassName="active">
               {translate('issues.page')}
index f4a2b09a38b2a0875bed87240cb180684d33a841..3f337c032d5d22bd9c4f1f5161e47e727023ea31 100644 (file)
@@ -30,7 +30,6 @@ it('regular user', () => {
   expect(
     shallow(
       <OrganizationNavigation
-        currentUser={{ isLoggedIn: true }}
         location={{ pathname: '/organizations/foo' }}
         organization={organization}
       />
@@ -43,7 +42,6 @@ it('admin', () => {
   expect(
     shallow(
       <OrganizationNavigation
-        currentUser={{ isLoggedIn: true }}
         location={{ pathname: '/organizations/foo' }}
         organization={organization}
       />
@@ -56,7 +54,6 @@ it('undeletable org', () => {
   expect(
     shallow(
       <OrganizationNavigation
-        currentUser={{ isLoggedIn: true }}
         location={{ pathname: '/organizations/foo' }}
         organization={organization}
       />