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

Add delete binding (unbind) action to provisioned services #1505

Closed

Conversation

benjaminapetersen
Copy link
Contributor

@benjaminapetersen benjaminapetersen commented May 3, 2017

Depends on #1578

WIP, still some things to do. Based on mock-ups from here. Progress thus far:

screen shot 2017-05-03 at 12 10 26 pm

screen shot 2017-05-03 at 12 10 34 pm

screen shot 2017-05-03 at 12 10 39 pm

TODO:

  • <service> has been unbound from <application>. Application name is missing.
  • factor bindService and unbindService duplicate code into separate service, OR collapse unbindService into bindService & toggle.

@jwforres @spadgett @ncameronbritt

@@ -16,10 +17,16 @@ angular.module('openshiftConsole').component('bindService', {
});

function BindService($filter,
BindingModalUtils,
DataService,
DNS1123_SUBDOMAIN_VALIDATION) {
var ctrl = this;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jwforres thoughts here, pulled some things from bindService to share w/both components.

'use strict';

angular.module('openshiftConsole')
.factory('BindingModalUtils', function() {
Copy link
Member

Choose a reason for hiding this comment

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

@benjaminapetersen We're planning to switch to the angular-patternfly pf-wizard component, which should handle most of this for us.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good, keep the service till then so don't have to duplicate code?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Going to probably push up sortApplications as well, as I need that for unbindService to be able to get the name of the associated app.

@spadgett
Copy link
Member

spadgett commented May 4, 2017

I feel like this should be either create binding / delete binding OR add binding / remove binding. Create / remove seems wrong.

@ncameronbritt @jwforres Opinion?

@benjaminapetersen
Copy link
Contributor Author

benjaminapetersen commented May 4, 2017

I tend toward create/delete, it implies you are manipulating a type of resource.

@benjaminapetersen benjaminapetersen force-pushed the unbind-service branch 2 times, most recently from de0ef50 to a74e2ca Compare May 4, 2017 20:00
@ncameronbritt
Copy link

I agree with @spadgett about choosing the right pair of verbs. I think I like create/delete better as well, but I also want to make sure that we're choosing words that reflect how we want users to understand what they're doing. Ignoring what happens technically, is there a metaphor we would use to describe the concept?

@benjaminapetersen
Copy link
Contributor Author

screen shot 2017-05-09 at 11 40 39 am

@openshift-bot openshift-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 20, 2017
@benjaminapetersen benjaminapetersen force-pushed the unbind-service branch 4 times, most recently from 947c04c to 20f9c25 Compare May 30, 2017 15:54
@benjaminapetersen
Copy link
Contributor Author

btw, rebased

@openshift-bot openshift-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 30, 2017
@openshift-bot openshift-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 6, 2017
@benjaminapetersen benjaminapetersen changed the title [WIP] Add unbind action to provisioned services Add unbind action to provisioned services Jun 6, 2017
@benjaminapetersen
Copy link
Contributor Author

benjaminapetersen commented Jun 6, 2017

[TEST] rebased / resolved conflicts

@benjaminapetersen
Copy link
Contributor Author

ah, meh, another rebase todo.

@benjaminapetersen
Copy link
Contributor Author

@jwforres rebased

ServiceInstancesService... ftw?

@benjaminapetersen benjaminapetersen force-pushed the unbind-service branch 2 times, most recently from 3a9b70a to 05e515e Compare June 6, 2017 20:23
@openshift-bot openshift-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 6, 2017
@benjaminapetersen
Copy link
Contributor Author

Will rebase again after #1599

@benjaminapetersen benjaminapetersen changed the title Add unbind action to provisioned services Add delete binding (unbind) action to provisioned services Jun 9, 2017
@openshift-bot openshift-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 9, 2017
.concat(statefulSets);
return _.sortByAll(apiObjects, ['metadata.name', 'kind']);
}
}
Copy link
Member

Choose a reason for hiding this comment

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

I would prefer to see an explicit return null here, that makes it clear to someone scanning the function that there is a case where the utility will return a null instead of an array

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think _.sortByAll will ever return a null. Even _.sortByAll(null, ['metadata.name', 'kind']) will return [ ].

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahh... my bad. Got it. Will do.

group: 'servicecatalog.k8s.io',
resource: 'bindings'
}, ctrl.selectedBinding, context).then(function(result) {
console.log('did we succeed?', result);
Copy link
Member

Choose a reason for hiding this comment

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

remove these two console.log stmts

};

ctrl.$onInit = function() {
// loadApps();
Copy link
Member

Choose a reason for hiding this comment

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

I know its not implemented yet, but you will only want to loadApps if the target of unbind is a service instance object, should update your comment here with a TODO that is clear.

</p>
</div>
<div ng-if="ctrl.error">
<div class="title">Removal of Binding Failed <span class="fa fa-times text-danger"></span></div>
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 called the action Delete Binding, then it shouldnt say Removal here

{{ctrl.error.data.message | upperFirst}}
</span>
<span ng-if="!ctrl.error.data.message">
An error occurred removing the binding.
Copy link
Member

Choose a reason for hiding this comment

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

same here, delete not remove

@@ -0,0 +1,13 @@
<h3 class="mar-top-none">
Select a service to unbind from <strong>{{ctrl.displayName}}</strong>
Copy link
Member

Choose a reason for hiding this comment

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

we agreed on friday we didnt want to use the term "unbind"

@jwforres
Copy link
Member

jwforres commented Jun 13, 2017 via email

@benjaminapetersen benjaminapetersen force-pushed the unbind-service branch 3 times, most recently from a486461 to f35afb3 Compare June 13, 2017 16:11
@openshift-bot openshift-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 13, 2017
@openshift-bot
Copy link

Evaluated for origin web console test up to 3fe6155

@openshift-bot
Copy link

Origin Web Console Test Results: SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin_web_console/1517/) (Base Commit: 54262a2)

@openshift-bot
Copy link

Origin Web Console Action Required: Pull request cannot be automatically merged, please rebase your branch from latest HEAD and push again

@openshift-bot openshift-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 14, 2017
@benjaminapetersen
Copy link
Contributor Author

Fixed by PR #1705

@benjaminapetersen benjaminapetersen deleted the unbind-service branch June 19, 2017 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants