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 = {
type Props = {
children?: React.Element<*>,
- currentUser: { isLoggedIn: boolean, showOnboardingTutorial: true },
location: Object,
organization: null | Organization,
params: { organizationKey: string },
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>
);
}
const mapStateToProps = (state, ownProps: OwnProps) => ({
- currentUser: getCurrentUser(state),
organization: getOrganizationByKey(state, ownProps.params.organizationKey)
});
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';
export default class OrganizationNavigation extends React.PureComponent {
props: {
- currentUser: { isLoggedIn: boolean },
location: { pathname: string },
organization: Organization
};
}
render() {
- const { currentUser, organization, location } = this.props;
+ const { organization, location } = this.props;
const isHomeActive =
location.pathname === `organizations/${organization.key}/projects` ||
<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')}
expect(
shallow(
<OrganizationNavigation
- currentUser={{ isLoggedIn: true }}
location={{ pathname: '/organizations/foo' }}
organization={organization}
/>
expect(
shallow(
<OrganizationNavigation
- currentUser={{ isLoggedIn: true }}
location={{ pathname: '/organizations/foo' }}
organization={organization}
/>
expect(
shallow(
<OrganizationNavigation
- currentUser={{ isLoggedIn: true }}
location={{ pathname: '/organizations/foo' }}
organization={organization}
/>