aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/app
diff options
context:
space:
mode:
authorStas Vilchik <stas.vilchik@sonarsource.com>2017-11-23 16:05:14 +0100
committerStas Vilchik <stas.vilchik@sonarsource.com>2017-12-11 18:00:33 +0100
commitb5825706ab56c92dfae7e12d91af4891e363e03b (patch)
tree3711cb5e469be80d887c749564667b3517ed8a53 /server/sonar-web/src/main/js/app
parent36685ff3e20875421162206c34aabb31d5b21fdb (diff)
downloadsonarqube-b5825706ab56c92dfae7e12d91af4891e363e03b.tar.gz
sonarqube-b5825706ab56c92dfae7e12d91af4891e363e03b.zip
SONAR-10080 turn Projects to My Projects
Diffstat (limited to 'server/sonar-web/src/main/js/app')
-rw-r--r--server/sonar-web/src/main/js/app/components/nav/global/GlobalNavMenu.js5
-rw-r--r--server/sonar-web/src/main/js/app/types.ts16
2 files changed, 19 insertions, 2 deletions
diff --git a/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavMenu.js b/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavMenu.js
index 2a1d784aa1c..02b3ab3ce11 100644
--- a/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavMenu.js
+++ b/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavMenu.js
@@ -30,7 +30,8 @@ export default class GlobalNavMenu extends React.PureComponent {
currentUser: PropTypes.object.isRequired,
location: PropTypes.shape({
pathname: PropTypes.string.isRequired
- }).isRequired
+ }).isRequired,
+ sonarCloud: PropTypes.bool
};
static defaultProps = {
@@ -46,7 +47,7 @@ export default class GlobalNavMenu extends React.PureComponent {
return (
<li>
<Link to="/projects" activeClassName="active">
- {translate('projects.page')}
+ {this.props.sonarCloud ? translate('my_projects') : translate('projects.page')}
</Link>
</li>
);
diff --git a/server/sonar-web/src/main/js/app/types.ts b/server/sonar-web/src/main/js/app/types.ts
index 73239aeb430..f18764601e4 100644
--- a/server/sonar-web/src/main/js/app/types.ts
+++ b/server/sonar-web/src/main/js/app/types.ts
@@ -133,3 +133,19 @@ export enum Visibility {
Public = 'public',
Private = 'private'
}
+
+export interface CurrentUser {
+ isLoggedIn: boolean;
+ showOnboardingTutorial?: boolean;
+}
+
+export interface LoggedInUser extends CurrentUser {
+ avatar?: string;
+ email?: string;
+ isLoggedIn: true;
+ name: string;
+}
+
+export function isLoggedIn(user: CurrentUser): user is LoggedInUser {
+ return user.isLoggedIn;
+}