Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combine secrets page tables into one and group by type. #1717

Merged
merged 1 commit into from
Jun 15, 2017
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
4 changes: 2 additions & 2 deletions app/scripts/controllers/secrets.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Controller of the openshiftConsole
*/
angular.module('openshiftConsole')
.controller('SecretsController', function ($routeParams, $scope, DataService, ProjectsService, SecretsService) {
.controller('SecretsController', function ($routeParams, $scope, DataService, ProjectsService) {
$scope.projectName = $routeParams.project;
$scope.secretsByType = {};
$scope.alerts = $scope.alerts || {};
Expand All @@ -20,7 +20,7 @@ angular.module('openshiftConsole')
$scope.context = context;

DataService.list("secrets", context).then(function(secrets) {
$scope.secretsByType = SecretsService.groupSecretsByType(secrets);
$scope.secrets = _.sortByAll(secrets.by("metadata.name"), ["type", "metadata.name"]);
$scope.loaded = true;
});
}));
Expand Down
65 changes: 3 additions & 62 deletions app/views/secrets.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ <h1>
<div ng-if="!loaded" class="mar-top-xl">Loading...</div>
<div ng-if="loaded" class="row">
<div class="col-md-12">
<h2>Source Secrets</h2>
<table class="table table-bordered table-hover table-mobile secrets-table table-layout-fixed">
<colgroup>
<col class="col-sm-5">
Expand All @@ -41,12 +40,12 @@ <h2>Source Secrets</h2>
</tr>
</thead>
<!-- message doesnt show right when there are both dcs and rcs and they are all filtered -->
<tbody ng-if="secretsByType.source.length === 0">
<tbody ng-if="!secrets.length">
<!-- If there are no deployment configs and no replication controllers owned by a deployment config -->
<tr><td colspan="3"><em>No secrets</em></td></tr>
</tbody>
<tbody ng-if="secretsByType.source.length > 0">
<tr ng-if="secret" ng-repeat="secret in secretsByType.source | orderBy : 'metadata.name'">
<tbody ng-if="secrets.length">
<tr ng-repeat="secret in secrets track by (secret | uid)">
<td data-title="Name">
<a ng-href="{{secret | navigateResourceURL}}">{{secret.metadata.name}}</a>
</td>
Expand All @@ -59,64 +58,6 @@ <h2>Source Secrets</h2>
</tr>
</tbody>
</table>
<div ng-if="secretsByType.images.length !== 0">
<h2>Image Secrets</h2>
<table class="table table-bordered table-hover table-mobile secrets-table table-layout-fixed">
<colgroup>
<col class="col-sm-5">
<col class="col-sm-5">
</colgroup>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Created</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="secret in secretsByType.image | orderBy : 'metadata.name'">
<td data-title="Name">
<a ng-href="{{secret | navigateResourceURL}}">{{secret.metadata.name}}</a>
</td>
<td data-title="Type">
{{secret.type}}
</td>
<td data-title="Created">
<span am-time-ago="secret.metadata.creationTimestamp"></span>
</td>
</tr>
</tbody>
</table>
</div>
<div ng-if="secretsByType.other.length !== 0">
<h2>Other Secrets</h2>
<table class="table table-bordered table-hover table-mobile secrets-table table-layout-fixed">
<colgroup>
<col class="col-sm-5">
<col class="col-sm-5">
</colgroup>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Created</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="secret in secretsByType.other | orderBy : 'metadata.name'">
<td data-title="Name">
<a ng-href="{{secret | navigateResourceURL}}">{{secret.metadata.name}}</a>
</td>
<td data-title="Type">
{{secret.type}}
</td>
<td data-title="Created">
<span am-time-ago="secret.metadata.creationTimestamp"></span>
</td>
</tr>
</tbody>
</table>
</div>
</div><!-- /col-* -->
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions dist/scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -6026,10 +6026,10 @@ a.routesForService = {}, angular.forEach(c.by("metadata.name"), function(c) {
c.unwatchAll(g);
});
}));
} ]), angular.module("openshiftConsole").controller("SecretsController", [ "$routeParams", "$scope", "DataService", "ProjectsService", "SecretsService", function(a, b, c, d, e) {
} ]), angular.module("openshiftConsole").controller("SecretsController", [ "$routeParams", "$scope", "DataService", "ProjectsService", function(a, b, c, d) {
b.projectName = a.project, b.secretsByType = {}, b.alerts = b.alerts || {}, d.get(a.project).then(_.spread(function(a, d) {
b.project = a, b.context = d, c.list("secrets", d).then(function(a) {
b.secretsByType = e.groupSecretsByType(a), b.loaded = !0;
b.secrets = _.sortByAll(a.by("metadata.name"), [ "type", "metadata.name" ]), b.loaded = !0;
});
}));
} ]), angular.module("openshiftConsole").controller("SecretController", [ "$routeParams", "$filter", "$scope", "DataService", "ProjectsService", "SecretsService", function(a, b, c, d, e, f) {
Expand Down
65 changes: 3 additions & 62 deletions dist/scripts/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -12902,7 +12902,6 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
"<div ng-if=\"!loaded\" class=\"mar-top-xl\">Loading...</div>\n" +
"<div ng-if=\"loaded\" class=\"row\">\n" +
"<div class=\"col-md-12\">\n" +
"<h2>Source Secrets</h2>\n" +
"<table class=\"table table-bordered table-hover table-mobile secrets-table table-layout-fixed\">\n" +
"<colgroup>\n" +
"<col class=\"col-sm-5\">\n" +
Expand All @@ -12916,12 +12915,12 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
"</tr>\n" +
"</thead>\n" +
"\n" +
"<tbody ng-if=\"secretsByType.source.length === 0\">\n" +
"<tbody ng-if=\"!secrets.length\">\n" +
"\n" +
"<tr><td colspan=\"3\"><em>No secrets</em></td></tr>\n" +
"</tbody>\n" +
"<tbody ng-if=\"secretsByType.source.length > 0\">\n" +
"<tr ng-if=\"secret\" ng-repeat=\"secret in secretsByType.source | orderBy : 'metadata.name'\">\n" +
"<tbody ng-if=\"secrets.length\">\n" +
"<tr ng-repeat=\"secret in secrets track by (secret | uid)\">\n" +
"<td data-title=\"Name\">\n" +
"<a ng-href=\"{{secret | navigateResourceURL}}\">{{secret.metadata.name}}</a>\n" +
"</td>\n" +
Expand All @@ -12934,64 +12933,6 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
"</tr>\n" +
"</tbody>\n" +
"</table>\n" +
"<div ng-if=\"secretsByType.images.length !== 0\">\n" +
"<h2>Image Secrets</h2>\n" +
"<table class=\"table table-bordered table-hover table-mobile secrets-table table-layout-fixed\">\n" +
"<colgroup>\n" +
"<col class=\"col-sm-5\">\n" +
"<col class=\"col-sm-5\">\n" +
"</colgroup>\n" +
"<thead>\n" +
"<tr>\n" +
"<th>Name</th>\n" +
"<th>Type</th>\n" +
"<th>Created</th>\n" +
"</tr>\n" +
"</thead>\n" +
"<tbody>\n" +
"<tr ng-repeat=\"secret in secretsByType.image | orderBy : 'metadata.name'\">\n" +
"<td data-title=\"Name\">\n" +
"<a ng-href=\"{{secret | navigateResourceURL}}\">{{secret.metadata.name}}</a>\n" +
"</td>\n" +
"<td data-title=\"Type\">\n" +
"{{secret.type}}\n" +
"</td>\n" +
"<td data-title=\"Created\">\n" +
"<span am-time-ago=\"secret.metadata.creationTimestamp\"></span>\n" +
"</td>\n" +
"</tr>\n" +
"</tbody>\n" +
"</table>\n" +
"</div>\n" +
"<div ng-if=\"secretsByType.other.length !== 0\">\n" +
"<h2>Other Secrets</h2>\n" +
"<table class=\"table table-bordered table-hover table-mobile secrets-table table-layout-fixed\">\n" +
"<colgroup>\n" +
"<col class=\"col-sm-5\">\n" +
"<col class=\"col-sm-5\">\n" +
"</colgroup>\n" +
"<thead>\n" +
"<tr>\n" +
"<th>Name</th>\n" +
"<th>Type</th>\n" +
"<th>Created</th>\n" +
"</tr>\n" +
"</thead>\n" +
"<tbody>\n" +
"<tr ng-repeat=\"secret in secretsByType.other | orderBy : 'metadata.name'\">\n" +
"<td data-title=\"Name\">\n" +
"<a ng-href=\"{{secret | navigateResourceURL}}\">{{secret.metadata.name}}</a>\n" +
"</td>\n" +
"<td data-title=\"Type\">\n" +
"{{secret.type}}\n" +
"</td>\n" +
"<td data-title=\"Created\">\n" +
"<span am-time-ago=\"secret.metadata.creationTimestamp\"></span>\n" +
"</td>\n" +
"</tr>\n" +
"</tbody>\n" +
"</table>\n" +
"</div>\n" +
"</div>\n" +
"</div>\n" +
"</div>\n" +
Expand Down