Skip to content

List mobile service to mobile client connections#3021

Closed
sedroche wants to merge 4 commits intoopenshift:masterfrom
aerogear-attic:connected-services-list
Closed

List mobile service to mobile client connections#3021
sedroche wants to merge 4 commits intoopenshift:masterfrom
aerogear-attic:connected-services-list

Conversation

@sedroche
Copy link
Copy Markdown

@sedroche sedroche commented Jun 12, 2018

Displaying a list of mobile services that can be bound to a mobile client.

servicestobind

A binding can be created from within the component.

empty-connected
pending-binding

Each service will have configuration created during a binding which will be displayed to the user in this component.
binding-config

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

@openshift-ci-robot openshift-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jun 12, 2018
@sedroche sedroche force-pushed the connected-services-list branch from 8f04aa9 to a4fff6f Compare June 14, 2018 16:06
@openshift-ci-robot openshift-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jun 14, 2018
@benjaminapetersen
Copy link
Copy Markdown
Contributor

@openshift/team-ux-review

@benjaminapetersen benjaminapetersen self-requested a review June 15, 2018 18:15
@benjaminapetersen
Copy link
Copy Markdown
Contributor

@cshinn I think similar items related to button placement, etc.

@spadgett
Copy link
Copy Markdown
Member

/ok-to-test

@openshift-ci-robot openshift-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jun 18, 2018
@cshinn
Copy link
Copy Markdown

cshinn commented Jun 18, 2018

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.

mobile control panel 13

@sedroche
Copy link
Copy Markdown
Author

sedroche commented Jun 19, 2018

@cshinn Thanks Chris. I'll start on these changes now.

Comment thread app/scripts/directives/bindService.js Outdated

return {
generateName: consumerId.toLowerCase() + '-' + _.get(serviceClass, 'spec.externalMetadata.serviceName').toLowerCase() + '-',
annotations: {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I believe the annotations $filter can be used to get & set annotations.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yes, I will update this.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Annotations are already ready to go -> openshift/origin-web-common#341

Comment thread app/scripts/directives/bindService.js Outdated

var serviceClass = BindingService.getServiceClassForInstance(svcToBind, ctrl.serviceClasses);
BindingService.bindService(svcToBind, application, serviceClass, ctrl.parameterData).then(function(binding){

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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();
   }
}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

👍

Navigate.toProjectCatalog($routeParams.project, {category: 'mobile', subcategory: 'services'});
};

watches.push(DataService.watch(APIService.getPreferredVersion("clusterserviceclasses"), {namespace: $routeParams.project}, function(serviceClasses){
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should this be within $onInit?

var watchClusterServiceClasses = _.once(function() { ... });
ctrl.$onInit = function() {
   watchClusterServiceClasses();
   // etc.
}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

👍


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){
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would probably suggest putting the var serviceInstanceVersion = APIService.getPreferredVersion('serviceinstances') at the top. For the most part we do that everywhere.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yep, I will update these

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){
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

try running grunt jshint, just to ensure spacing & what not won't fail CI. I think there may be a rule about function() {.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

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

Choose a reason for hiding this comment

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

row.$onInit? Not sure if there is a risk on a race condition here, for things like row.bindingsLimit.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Possibly applies to anything that deals with this.apiObject as well.

Even if not a race condition issue, its probably a better convention.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

yes, makes sense. Will update.

};

row.showOverlayPanel = function(panelName, state) {
row.parameterData = _.reduce(row.bindData, function(acc, current) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

parameterData is passed in as an attribute, just want to check & verify you do need 2-way data binding here.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

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) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

👍

.mobile-service-instance-row {
.icon {
clear: both;
color: #888;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Any $pf- var for the color?

margin: 0 10px;
display: block;
float: left;
font-size: 1.6em;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

$pf- var for font-size?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Could you point to where the $pf- vars are defined please?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Choose a reason for hiding this comment

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

title or alt on the img for accessibility purposes?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

👍

@sedroche sedroche force-pushed the connected-services-list branch from a4fff6f to 77357ea Compare June 22, 2018 12:53
@openshift-ci-robot openshift-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jun 22, 2018
@sedroche sedroche force-pushed the connected-services-list branch from 77357ea to 3b3e6a0 Compare June 22, 2018 13:22
@sedroche
Copy link
Copy Markdown
Author

@cshinn I have updated this view with your suggested changes. Hopefully everything looks good, let me know if you require any more changes.

Unbound Services

unbound-chris

Bound and unbound

1and1-chris

Both Bound

bothbound

Creating binding flow

binding

Deleting binding flow

unbinding

@sedroche
Copy link
Copy Markdown
Author

@benjaminapetersen I have applied some feedback here if you can take a second look. Cheers.

@sedroche sedroche closed this Jun 22, 2018
@sedroche sedroche reopened this Jun 22, 2018
@cshinn
Copy link
Copy Markdown

cshinn commented Jun 22, 2018

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

@beanh66
Copy link
Copy Markdown

beanh66 commented Jun 25, 2018

@cshinn We removed the section header called "DETAILS" for the CNV flows. I believe @rhamilto pointed out that this style is reserved for specific items such as BUILDS, NETWORKING, etc. Wondering if the same applies here.
See CNV design: screen shot 2018-06-25 at 9 01 39 am

@cshinn
Copy link
Copy Markdown

cshinn commented Jun 25, 2018

@beanh66 that's a good point. @sedroche in cases where there's only one set of data under a bound service, it probably makes sense to leave that out to be consistent

@sedroche sedroche closed this Jun 28, 2018
@sedroche sedroche deleted the connected-services-list branch June 29, 2018 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants