-
Notifications
You must be signed in to change notification settings - Fork 230
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
Add delete binding (unbind) action to provisioned services #1505
Conversation
de7650a
to
2b2fa4a
Compare
@@ -16,10 +17,16 @@ angular.module('openshiftConsole').component('bindService', { | |||
}); | |||
|
|||
function BindService($filter, | |||
BindingModalUtils, | |||
DataService, | |||
DNS1123_SUBDOMAIN_VALIDATION) { | |||
var ctrl = this; | |||
|
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.
@jwforres thoughts here, pulled some things from bindService
to share w/both components.
'use strict'; | ||
|
||
angular.module('openshiftConsole') | ||
.factory('BindingModalUtils', function() { |
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.
@benjaminapetersen We're planning to switch to the angular-patternfly pf-wizard component, which should handle most of this for us.
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.
Sounds good, keep the service till then so don't have to duplicate code?
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.
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.
442a118
to
9cab1ec
Compare
I feel like this should be either create binding / delete binding OR add binding / remove binding. Create / remove seems wrong. @ncameronbritt @jwforres Opinion? |
92f24b9
to
c9c49e3
Compare
c9c49e3
to
0d47703
Compare
I tend toward create/delete, it implies you are manipulating a type of resource. |
de0ef50
to
a74e2ca
Compare
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? |
a74e2ca
to
5e63120
Compare
947c04c
to
20f9c25
Compare
btw, rebased |
20f9c25
to
8ce21f9
Compare
8ce21f9
to
8f5b82c
Compare
8f5b82c
to
56c2952
Compare
[TEST] rebased / resolved conflicts |
ah, meh, another rebase todo. |
56c2952
to
2b32e1f
Compare
2b32e1f
to
ab2d17e
Compare
@jwforres rebased ServiceInstancesService... ftw? |
3a9b70a
to
05e515e
Compare
Will rebase again after #1599 |
.concat(statefulSets); | ||
return _.sortByAll(apiObjects, ['metadata.name', 'kind']); | ||
} | ||
} |
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 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
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 don't think _.sortByAll
will ever return a null. Even _.sortByAll(null, ['metadata.name', 'kind'])
will return [ ]
.
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.
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); |
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 these two console.log stmts
}; | ||
|
||
ctrl.$onInit = function() { | ||
// loadApps(); |
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 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> |
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 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. |
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 here, delete not remove
@@ -0,0 +1,13 @@ | |||
<h3 class="mar-top-none"> | |||
Select a service to unbind from <strong>{{ctrl.displayName}}</strong> |
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 agreed on friday we didnt want to use the term "unbind"
no i mean the fact that you have an if check here, in the case where the if
doesn't pass the function returns nothing, effectively an undefined result
wherever it was called from
…On Tue, Jun 13, 2017 at 11:47 AM, Ben Petersen ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In app/scripts/services/bindingModalUtils.js
<#1505 (comment)>
:
> + function() {
+ return {
+ sortApplications: function(deploymentConfigs,
+ deployments,
+ replicationControllers,
+ replicaSets,
+ statefulSets) {
+ // Don't waste time sorting on each data load, just sort when we have them all
+ if (deploymentConfigs && deployments && replicationControllers && replicaSets && statefulSets) {
+ var apiObjects = deploymentConfigs.concat(deployments)
+ .concat(replicationControllers)
+ .concat(replicaSets)
+ .concat(statefulSets);
+ return _.sortByAll(apiObjects, ['metadata.name', 'kind']);
+ }
+ }
I don't think _.sortByAll will ever return a null. Even _.sortByAll(null,
['metadata.name', 'kind']) will return [ ].
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1505 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABZk7QrLt1gjvJe-vXGM5kkp4fhj94laks5sDq8jgaJpZM4NPtX5>
.
|
a486461
to
f35afb3
Compare
f35afb3
to
3fe6155
Compare
Evaluated for origin web console test up to 3fe6155 |
Origin Web Console Test Results: SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin_web_console/1517/) (Base Commit: 54262a2) |
Origin Web Console Action Required: Pull request cannot be automatically merged, please rebase your branch from latest HEAD and push again |
Fixed by PR #1705 |
Depends on #1578
WIP, still some things to do. Based on mock-ups from here. Progress thus far:
TODO:
<service>
has been unbound from<application>
. Application name is missing.bindService
andunbindService
duplicate code into separate service, OR collapseunbindService
into bindService & toggle.@jwforres @spadgett @ncameronbritt