Skip to content

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

Merged
merged 1 commit into from
Aug 9, 2017

Conversation

jeff-phillips-18
Copy link
Member

@jeff-phillips-18 jeff-phillips-18 commented Aug 4, 2017

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

image

image

image

image

image

@ncameronbritt
Copy link

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.

@jeff-phillips-18
Copy link
Member Author

@ncameronbritt OK, I thought we might want it there to allow creation of bindings from the page.

@ncameronbritt
Copy link

For applications in the overview, "create binding" is available in the kebab if there is a bindable service.

@jeff-phillips-18
Copy link
Member Author

@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,
Copy link
Contributor

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

Copy link
Member Author

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.

Copy link
Contributor

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);
Copy link
Member

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.

Copy link
Member Author

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')) {
Copy link
Member

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

Copy link
Member Author

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;
Copy link
Member

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.

Copy link
Member Author

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>
Copy link
Member

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

Copy link
Member Author

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)">
Copy link
Member

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

  1. There are no bindings
  2. There are bindable instances
  3. I don't have authority to create bindings

We should show a message like "No bindings." in this case.

Copy link
Member Author

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>
Copy link
Member

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".

Copy link
Member Author

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>
Copy link
Member

Choose a reason for hiding this comment

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

aria-hidden="true"

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed

Copy link
Member

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>
Copy link
Member

Choose a reason for hiding this comment

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

href="./"

Copy link
Member Author

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)">
Copy link
Member

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.

Copy link
Member Author

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>
Copy link
Member

Choose a reason for hiding this comment

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

aria-hidden="true"

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed

@serenamarie125
Copy link

@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.

@jeff-phillips-18 jeff-phillips-18 changed the title WIP: Add bindings list to resource pages Add bindings list to resource pages Aug 8, 2017
@jeff-phillips-18
Copy link
Member Author

Removed WIP status

@jeff-phillips-18
Copy link
Member Author

I believe all review comments have been addressed. @spadgett @dtaylor113 please take another look.

Copy link
Member

@spadgett spadgett left a 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>
Copy link
Member

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}}">
Copy link
Member

Choose a reason for hiding this comment

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

nit: indentation looks off?

Copy link
Member Author

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
@spadgett
Copy link
Member

spadgett commented Aug 9, 2017

[merge]

@openshift-bot
Copy link

Evaluated for origin web console merge up to eea7670

@openshift-bot
Copy link

openshift-bot commented Aug 9, 2017

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)

@openshift-bot openshift-bot merged commit 215a1b5 into openshift:master Aug 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants