Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion assets/app/scripts/controllers/projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ angular.module('openshiftConsole')
AuthService.withUser().then(function() {
DataService.list("projects", $scope, function(projects) {
$scope.projects = projects.by("metadata.name");
$scope.emptyMessage = "You have no projects. For an <a href='https://github.com/openshift/origin/tree/master/examples/sample-app'>example</a>, run <code>openshift cli create -f https://raw.githubusercontent.com/openshift/origin/master/examples/sample-app/project.json</code>";
$scope.emptyMessage = "No projects to show.";
});
});

Expand Down
10 changes: 7 additions & 3 deletions assets/app/views/projects.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
<div class="container">
<div>
<h1 style="margin-top: 10px;">Projects</h1>
<div ng-if="(projects | hashSize) == 0">
<div ng-bind-html="emptyMessage"></div>
</div>
<div class="tile tile-click" ng-click="tileClickHandler($event)" style="margin-bottom: 10px;" ng-repeat="project in projects">
<h2><a class="tile-target" href="/project/{{project.metadata.name}}">{{project.displayName || project.metadata.name}}</a></h2>
<div class="muted" style="margin-top: -5px;" ng-if="project | annotation : 'description'">{{project | annotation : 'description'}}</div>
</div>
<div ng-if="emptyMessage && (projects | hashSize) == 0">{{emptyMessage}}</div>
<div style="margin-top: 10px;">
To create a new project, run <code>openshift ex new-project &lt;projectname&gt; --admin={{user.metadata.name || '&lt;YourUsername&gt;'}}</code>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is user.metadata.name scope qualified?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, it's the full username (including provider prefix)

</div>
<div style="margin-top: 10px;">
To be added as an admin to an existing project, run <code>openshift ex policy add-user admin {{user.metadata.name || '&lt;YourUsername&gt;'}} -n &lt;projectname&gt;</code>
</div>
</div>
</div>
8 changes: 8 additions & 0 deletions hack/test-cmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -252,3 +252,11 @@ openshift ex policy add-user cluster-admin system:no-user
openshift ex policy remove-user cluster-admin system:no-user
openshift ex policy remove-user-from-project system:no-user
echo "ex policy: ok"

# Test the commands the UI projects page tells users to run
# These should match what is described in projects.html
openshift ex new-project ui-test-project --admin="anypassword:createuser"
openshift ex policy add-user admin anypassword:adduser -n ui-test-project
osc describe policybinding master -n ui-test-project | grep createuser
osc describe policybinding master -n ui-test-project | grep adduser
echo "UI project commands: ok"
12 changes: 8 additions & 4 deletions pkg/assets/bindata.go
Original file line number Diff line number Diff line change
Expand Up @@ -13288,7 +13288,7 @@ this._labelFilterRootElement && (a ? this._labelFilterRootElement.show() :this._
} ]), angular.module("openshiftConsole").controller("ProjectsController", [ "$scope", "$location", "DataService", "AuthService", function(a, b, c, d) {
a.projects = {}, a.alerts = a.alerts || {}, a.emptyMessage = "Loading...", d.withUser().then(function() {
c.list("projects", a, function(b) {
a.projects = b.by("metadata.name"), a.emptyMessage = "You have no projects. For an <a href='https://github.com/openshift/origin/tree/master/examples/sample-app'>example</a>, run <code>openshift cli create -f https://raw.githubusercontent.com/openshift/origin/master/examples/sample-app/project.json</code>";
a.projects = b.by("metadata.name"), a.emptyMessage = "No projects to show.";
});
}), a.tileClickHandler = function(a) {
var c = $(a.target);
Expand Down Expand Up @@ -56069,13 +56069,17 @@ func views_project_html() ([]byte, error) {
var _views_projects_html = []byte(`<div class="container">
<div>
<h1 style="margin-top: 10px">Projects</h1>
<div ng-if="(projects | hashSize) == 0">
<div ng-bind-html="emptyMessage"></div>
</div>
<div class="tile tile-click" ng-click="tileClickHandler($event)" style="margin-bottom: 10px" ng-repeat="project in projects">
<h2><a class="tile-target" href="/project/{{project.metadata.name}}">{{project.displayName || project.metadata.name}}</a></h2>
<div class="muted" style="margin-top: -5px" ng-if="project | annotation : 'description'">{{project | annotation : 'description'}}</div>
</div>
<div ng-if="emptyMessage && (projects | hashSize) == 0">{{emptyMessage}}</div>
<div style="margin-top: 10px">
To create a new project, run <code>openshift ex new-project &lt;projectname&gt; --admin={{user.metadata.name || '&lt;YourUsername&gt;'}}</code>
</div>
<div style="margin-top: 10px">
To be added as an admin to an existing project, run <code>openshift ex policy add-user admin {{user.metadata.name || '&lt;YourUsername&gt;'}} -n &lt;projectname&gt;</code>
</div>
</div>
</div>`)

Expand Down