-
Notifications
You must be signed in to change notification settings - Fork 232
Add bindings list to resource pages #1912
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
Conversation
Looks good to me with one exception, and it’s my fault for not documenting it clearly: if there are no bindings, we should not show the bindings section for applications (deployments etc) in the overview expanded state. So in the cases of your 2nd and 3rd screen shots, the "Service Bindings" section shouldn't be there. That is the current behavior. |
@ncameronbritt OK, I thought we might want it there to allow creation of bindings from the page. |
For applications in the overview, "create binding" is available in the kebab if there is a bindable service. |
@ncameronbritt updated to not show bindings section on the overview page sections when there are no bindings |
@@ -2,10 +2,19 @@ | |||
|
|||
angular.module("openshiftConsole") | |||
.factory("CatalogService", function($filter, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we be concerned that there is already a "CatalogService" in origin-web-catalog? https://github.com/openshift/origin-web-catalog/blob/master/src/services/catalog.service.ts#L4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One is Catalog the other CatalogService, not great but not conflicting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, ok, I see that now in index.ts.
DataService.list("secrets", context, null, { errorNotification: false }).then(function(secretData) { | ||
ctrl.secrets = secretData.by("metadata.name"); | ||
}); | ||
}, 300); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can build the secret URL from just the name without loading all of the secrets (if that's how this is used). I'd rather not load them if not necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove from resourceServiceBindings.js and from overview.js
}, {poll: limitWatches, pollInterval: DEFAULT_POLL_INTERVAL})); | ||
} | ||
|
||
if (CatalogService.SERVICE_CATALOG_ENABLED && canI({resource: 'instances', group: 'servicecatalog.k8s.io'}, 'watch')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This canI
check looks wrong
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added comment for this, basically no point watching the serviceclasses if we can't watch serviceinstances (removed the extra check and did it all under the same if)
ctrl.serviceClasses = []; | ||
ctrl.serviceInstances = []; | ||
ctrl.secrets = []; | ||
ctrl.showBindings = CatalogService.SERVICE_CATALOG_ENABLED; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should be checking for ENABLE_TECH_PREVIEW_FEATURE.pod_presets
as well. If pos presets aren't enabled, we shouldn't try to get the bindings for a resource.
This might be a problem on the overview already as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding check here and in listRow.js
<div ng-if="!($ctrl.bindableServiceInstances | size)"> | ||
<span>You must have a bindable service in your namespace in order to create bindings.</span> | ||
<div> | ||
<a href="/">Browse Catalog</a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this should be
<a href="./">Browse Catalog</a>
at least according to
https://github.com/openshift/origin-web-console#navigation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
Create Binding | ||
</a> | ||
</div> | ||
<div ng-if="!($ctrl.bindableServiceInstances | size)"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this section will be totally empty if
- There are no bindings
- There are bindable instances
- I don't have authority to create bindings
We should show a message like "No bindings." in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a message "There are no service bindings."
</overview-service-binding> | ||
<div ng-if="($ctrl.bindableServiceInstances | size) && ({resource: 'bindings', group: 'servicecatalog.k8s.io'} | canI : 'create')"> | ||
<a href="" ng-click="$ctrl.createBinding()" role="button"> | ||
<span class="pficon pficon-add-circle-o"></span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we add the circle here, we'll need to add it for other things like "Create Autoscaler" etc on these pages.
Needs an aria-hidden="true"
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added aria-hidden. I will check with uxd about using the circle.
@@ -19,7 +19,10 @@ | |||
<span ng-if="!row.bindings.length | |||
&& row.isBindable | |||
&& ({resource: 'bindings', group: 'servicecatalog.k8s.io'} | canI : 'create')"> | |||
<a href="" ng-click="row.showOverlayPanel('bindService', {target: row.apiObject})">Create Binding</a> | |||
<a href="" ng-click="row.showOverlayPanel('bindService', {target: row.apiObject})"> | |||
<span class="pficon pficon-add-circle-o"></span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aria-hidden="true"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might have missed this one?
<div ng-if="!($ctrl.bindableServiceInstances | size)"> | ||
<span>You must have a bindable service in your namespace in order to create bindings.</span> | ||
<div> | ||
<a href="/">Browse Catalog</a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
href="./"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
Create Binding | ||
</a> | ||
</div> | ||
<div ng-if="!($ctrl.bindableServiceInstances | size)"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above: need a message when there are no bindings, bindable services, and you don't have authority to create a binding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the overview page, the service bindings section is not shown at all when there are no service bindings. The create action is in the kebab.
@@ -144,7 +149,10 @@ | |||
</div> | |||
<div class="row" ng-if="row.isBindable && ({resource: 'bindings', group: 'servicecatalog.k8s.io'} | canI : 'create')"> | |||
<div class="col-sm-12"> | |||
<a href="" ng-click="row.showOverlayPanel('bindService', {target: row.apiObject})">Create Binding</a> | |||
<a href="" ng-click="row.showOverlayPanel('bindService', {target: row.apiObject})"> | |||
<span class="pficon pficon-add-circle-o"></span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aria-hidden="true"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
@spadgett @jeff-phillips-18 Agreed from a consistency perspective. Although putting this on pages with so many font colors, sizes and weight makes it even more distracting. I'd suggest you add the + and then we have a follow on Visual Design story to look at these pages and see what we can do to make them look less distracting. |
Removed WIP status |
I believe all review comments have been addressed. @spadgett @dtaylor113 please take another look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -19,7 +19,10 @@ | |||
<span ng-if="!row.bindings.length | |||
&& row.isBindable | |||
&& ({resource: 'bindings', group: 'servicecatalog.k8s.io'} | canI : 'create')"> | |||
<a href="" ng-click="row.showOverlayPanel('bindService', {target: row.apiObject})">Create Binding</a> | |||
<a href="" ng-click="row.showOverlayPanel('bindService', {target: row.apiObject})"> | |||
<span class="pficon pficon-add-circle-o"></span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might have missed this one?
@@ -110,7 +115,7 @@ | |||
<span ng-if="(binding | isBindingReady) && ('secrets' | canI : 'get')"> | |||
<a | |||
ng-if="(binding | isBindingReady) && ('secrets' | canI : 'get')" | |||
ng-href="{{row.getSecretForBinding(binding) | navigateResourceURL}}"> | |||
ng-href="{{binding.spec.secretName | navigateResourceURL : 'Secret' : row.apiObject.metadata.namespace}}"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: indentation looks off?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. Thanks @spadgett
Add resourceServiceBindings component. Use common utility functions for bindings Add utility SERVICE_CATALOG_ENABLED to CatalogService
[merge] |
Evaluated for origin web console merge up to eea7670 |
Origin Web Console Merge Results: SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_request_origin_web_console/70/) (Base Commit: e5867ae) (PR Branch Commit: eea7670) |
https://trello.com/c/g0RYkM0h
Requires origin-web-common release including openshift/origin-web-common#131
Add resourceServiceBindings component.
Use common utility functions for bindings
Add utility SERVICE_CATALOG_ENABLED to CatalogService
@openshift/team-ux-review