Skip to content

Commit

Permalink
Bug 1460990 - show underlying username in several places where user m…
Browse files Browse the repository at this point in the history
…ay look
  • Loading branch information
jwforres committed Jun 15, 2017
1 parent 6e95ce2 commit 697d6f4
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 7 deletions.
8 changes: 6 additions & 2 deletions app/scripts/extensions/nav/userDropdown.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
'use strict';

angular.module('openshiftConsole')
.run(function(extensionRegistry) {
.run(function(extensionRegistry, $rootScope) {
extensionRegistry
.add('nav-user-dropdown', function() {
var msg = 'Log out';
if ($rootScope.user.fullName && $rootScope.user.fullName !== $rootScope.user.metadata.name) {
msg += ' (' + $rootScope.user.metadata.name + ')';
}
return [{
type: 'dom',
node: '<li><a href="logout">Log out</a></li>'
node: '<li><a href="logout">' + _.escape(msg) + '</a></li>'
}];
});
});
3 changes: 3 additions & 0 deletions app/views/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ <h2 id="version">Version</h2>
<p>With the OpenShift command line interface (CLI), you can create applications and manage OpenShift projects from a terminal. To get started using the CLI, visit <a href="command-line">Command Line Tools</a>.
</p>

<h2>Account</h2>
<p>You are currently logged in under the user account <strong>{{user.metadata.name}}</strong>.</p>

</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/command-line.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ <h1 id="cli">Command Line Tools</h1>
</div>
</p>
<p>
After downloading and installing it, you can start by logging in using<span ng-if="sessionToken"> this current session token</span>:
After downloading and installing it, you can start by logging in. You are currently logged into this console as <strong>{{user.metadata.name}}</strong>. If you want to log into the CLI using the same session token:
<copy-to-clipboard display-wide="true" clipboard-text="'oc login ' + loginBaseURL + ' --token=' + sessionToken" input-text="'oc login ' + loginBaseURL + ' --token=<hidden>'"></copy-to-clipboard>
<pre class="code prettyprint ng-binding" ng-if="!sessionToken">
oc login {{loginBaseURL}}
Expand Down
7 changes: 4 additions & 3 deletions dist/scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -14838,11 +14838,12 @@ type:"dom",
node:'<li><a href="about">About</a></li>'
}), a;
});
} ]), angular.module("openshiftConsole").run([ "extensionRegistry", function(a) {
} ]), angular.module("openshiftConsole").run([ "extensionRegistry", "$rootScope", function(a, b) {
a.add("nav-user-dropdown", function() {
return [ {
var a = "Log out";
return b.user.fullName && b.user.fullName !== b.user.metadata.name && (a += " (" + b.user.metadata.name + ")"), [ {
type:"dom",
node:'<li><a href="logout">Log out</a></li>'
node:'<li><a href="logout">' + _.escape(a) + "</a></li>"
} ];
});
} ]), angular.module("openshiftConsole").run([ "extensionRegistry", "Constants", function(a, b) {
Expand Down
4 changes: 3 additions & 1 deletion dist/scripts/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,8 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
"<p>The <a target=\"_blank\" ng-href=\"{{'welcome' | helpLink}}\">documentation</a> helps you learn about OpenShift and start exploring its features. From getting started with creating your first application to trying out more advanced build and deployment techniques, it provides guidance on setting up and managing your OpenShift environment as an application developer.</p>\n" +
"<p>With the OpenShift command line interface (CLI), you can create applications and manage OpenShift projects from a terminal. To get started using the CLI, visit <a href=\"command-line\">Command Line Tools</a>.\n" +
"</p>\n" +
"<h2>Account</h2>\n" +
"<p>You are currently logged in under the user account <strong>{{user.metadata.name}}</strong>.</p>\n" +
"</div>\n" +
"</div>\n" +
"</div>\n" +
Expand Down Expand Up @@ -4439,7 +4441,7 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
"</div>\n" +
"</p>\n" +
"<p>\n" +
"After downloading and installing it, you can start by logging in using<span ng-if=\"sessionToken\"> this current session token</span>:\n" +
"After downloading and installing it, you can start by logging in. You are currently logged into this console as <strong>{{user.metadata.name}}</strong>. If you want to log into the CLI using the same session token:\n" +
"<copy-to-clipboard display-wide=\"true\" clipboard-text=\"'oc login ' + loginBaseURL + ' --token=' + sessionToken\" input-text=\"'oc login ' + loginBaseURL + ' --token=<hidden>'\"></copy-to-clipboard>\n" +
"<pre class=\"code prettyprint ng-binding\" ng-if=\"!sessionToken\">\n" +
" oc login {{loginBaseURL}}\n" +
Expand Down

0 comments on commit 697d6f4

Please sign in to comment.