List mobile service to mobile client connections#3021
List mobile service to mobile client connections#3021sedroche wants to merge 4 commits intoopenshift:masterfrom
Conversation
8f04aa9 to
a4fff6f
Compare
|
@openshift/team-ux-review |
|
@cshinn I think similar items related to button placement, etc. |
|
/ok-to-test |
|
Separating the unbound services more strongly would help get them out of the way for people who don't necessarily want to bind all of their services to a given mobile client. They wouldn't need to expand, but a short message like the PR screenshot could be useful if it's easier for them to expand. In that case, I think it would look better for the button to be fixed width relative to the text inside rather than sized based on the grid. |
|
@cshinn Thanks Chris. I'll start on these changes now. |
|
|
||
| return { | ||
| generateName: consumerId.toLowerCase() + '-' + _.get(serviceClass, 'spec.externalMetadata.serviceName').toLowerCase() + '-', | ||
| annotations: { |
There was a problem hiding this comment.
I believe the annotations $filter can be used to get & set annotations.
There was a problem hiding this comment.
Annotations are already ready to go -> openshift/origin-web-common#341
|
|
||
| var serviceClass = BindingService.getServiceClassForInstance(svcToBind, ctrl.serviceClasses); | ||
| BindingService.bindService(svcToBind, application, serviceClass, ctrl.parameterData).then(function(binding){ | ||
|
|
There was a problem hiding this comment.
I don't know if other kinds of services would cause this function to bloat over time, but it may be wise to branch early:
// call separate functions early, which can share another function if necessary to deduplicate.
ctrl.bindService = function() {
if (ctrl.isMobileEnabled && isMobileService(serviceClass)) {
bindMobileService();
} else {
bindService();
}
}| Navigate.toProjectCatalog($routeParams.project, {category: 'mobile', subcategory: 'services'}); | ||
| }; | ||
|
|
||
| watches.push(DataService.watch(APIService.getPreferredVersion("clusterserviceclasses"), {namespace: $routeParams.project}, function(serviceClasses){ |
There was a problem hiding this comment.
Should this be within $onInit?
var watchClusterServiceClasses = _.once(function() { ... });
ctrl.$onInit = function() {
watchClusterServiceClasses();
// etc.
}|
|
||
| watches.push(DataService.watch(APIService.getPreferredVersion("clusterserviceclasses"), {namespace: $routeParams.project}, function(serviceClasses){ | ||
| ctrl.serviceClasses = serviceClasses.by("metadata.name"); | ||
| watches.push(DataService.watch(APIService.getPreferredVersion("serviceinstances"), {namespace: $routeParams.project}, function(serviceInstances){ |
There was a problem hiding this comment.
I would probably suggest putting the var serviceInstanceVersion = APIService.getPreferredVersion('serviceinstances') at the top. For the most part we do that everywhere.
| watches.push(DataService.watch(APIService.getPreferredVersion("clusterserviceclasses"), {namespace: $routeParams.project}, function(serviceClasses){ | ||
| ctrl.serviceClasses = serviceClasses.by("metadata.name"); | ||
| watches.push(DataService.watch(APIService.getPreferredVersion("serviceinstances"), {namespace: $routeParams.project}, function(serviceInstances){ | ||
| ctrl.serviceInstances = _.filter(serviceInstances.by('metadata.name'), function(serviceInstance){ |
There was a problem hiding this comment.
try running grunt jshint, just to ensure spacing & what not won't fail CI. I think there may be a rule about function() {.
There was a problem hiding this comment.
There doesn't seem to be a rule but i have updated this style anyway
| var extendedAnnotationSpace = "org.aerogear.binding-ext." + this.apiObject.metadata.name; | ||
| var watches = []; | ||
| var bindingsWatch = false; | ||
| row.bindingsLimit = _.get(row.serviceClass, "spec.externalMetadata.bindingsLimit", 1); |
There was a problem hiding this comment.
row.$onInit? Not sure if there is a risk on a race condition here, for things like row.bindingsLimit.
There was a problem hiding this comment.
Possibly applies to anything that deals with this.apiObject as well.
Even if not a race condition issue, its probably a better convention.
There was a problem hiding this comment.
yes, makes sense. Will update.
| }; | ||
|
|
||
| row.showOverlayPanel = function(panelName, state) { | ||
| row.parameterData = _.reduce(row.bindData, function(acc, current) { |
There was a problem hiding this comment.
parameterData is passed in as an attribute, just want to check & verify you do need 2-way data binding here.
There was a problem hiding this comment.
No, I believe one way is correct. The child component only uses parameterData
| }; | ||
|
|
||
| row.showOverlayPanel = function(panelName, state) { | ||
| row.parameterData = _.reduce(row.bindData, function(acc, current) { |
There was a problem hiding this comment.
Nit: i think we typically use result for the accumulator var in a _.reduce. That, or a name that describes the object being built, in this case something like paramData.
| .mobile-service-instance-row { | ||
| .icon { | ||
| clear: both; | ||
| color: #888; |
There was a problem hiding this comment.
Any $pf- var for the color?
| margin: 0 10px; | ||
| display: block; | ||
| float: left; | ||
| font-size: 1.6em; |
There was a problem hiding this comment.
$pf- var for font-size?
There was a problem hiding this comment.
Could you point to where the $pf- vars are defined please?
There was a problem hiding this comment.
The console's own vars are in styles/_variables.less. The paths to the PF files we are importing can be found in styles/main.less. That will be in bower_components/patternfly/. A good start would be patternfly/src/less/variables.less.
| <div class="list-pf-name"> | ||
| <h3> | ||
| <span class="logo" ng-if="row.serviceClass.spec.externalMetadata.imageUrl"> | ||
| <img src="{{row.serviceClass.spec.externalMetadata.imageUrl}}"> |
There was a problem hiding this comment.
title or alt on the img for accessibility purposes?
a4fff6f to
77357ea
Compare
77357ea to
3b3e6a0
Compare
|
@cshinn I have updated this view with your suggested changes. Hopefully everything looks good, let me know if you require any more changes. Unbound ServicesBound and unboundBoth BoundCreating binding flowDeleting binding flow |
|
@benjaminapetersen I have applied some feedback here if you can take a second look. Cheers. |
|
@sedroche looks good! I'm not sure if this is the correct PR to address it, but it'd probably be good to get mobile service icons with transparent backgrounds so that they don't look off when hovered/selected. Could also save time to skip the modal when there's only one choice of binding. |







Displaying a list of mobile services that can be bound to a mobile client.
A binding can be created from within the component.
Each service will have configuration created during a binding which will be displayed to the user in this component.

NOTE: This PR makes use of openshift/origin-web-common#334 to identify specific bindings between client <-> service
and openshift/origin-web-common#320
and openshift/origin-web-common#341