diff --git a/app/scripts/controllers/overview.js b/app/scripts/controllers/overview.js index b248c5bc14..03f2b01ce1 100644 --- a/app/scripts/controllers/overview.js +++ b/app/scripts/controllers/overview.js @@ -1101,6 +1101,7 @@ function OverviewController($scope, // - API objects by binding name state.bindingsByApplicationUID = {}; state.applicationsByBinding = {}; + state.deleteableBindingsByApplicationUID = {}; // If there are no bindings, nothing to do. if (_.isEmpty(state.bindings)) { @@ -1139,6 +1140,7 @@ function OverviewController($scope, // pod preset covers the selector. var applicationSelector = new LabelSelector(_.get(apiObject, 'spec.selector')); state.bindingsByApplicationUID[applicationUID] = []; + state.deleteableBindingsByApplicationUID[applicationUID] = []; // Look at each pod preset selector to see if it covers this API object selector. _.each(podPresetSelectors, function(podPresetSelector, bindingName) { @@ -1147,6 +1149,9 @@ function OverviewController($scope, // the target. We want to show bindings both in the "application" // object rows and the service instance rows. state.bindingsByApplicationUID[applicationUID].push(state.bindings[bindingName]); + if (!_.get(state.bindings[bindingName], 'metadata.deletionTimestamp')) { + state.deleteableBindingsByApplicationUID[applicationUID].push(state.bindings[bindingName]); + } state.applicationsByBinding[bindingName] = state.applicationsByBinding[bindingName] || []; state.applicationsByBinding[bindingName].push(apiObject); } diff --git a/app/scripts/directives/overview/serviceInstanceRow.js b/app/scripts/directives/overview/serviceInstanceRow.js index 91577e6563..71d9f24f08 100644 --- a/app/scripts/directives/overview/serviceInstanceRow.js +++ b/app/scripts/directives/overview/serviceInstanceRow.js @@ -43,6 +43,12 @@ row.description = getDescription(); }; + row.$onChanges = function(changes) { + if (changes.bindings) { + row.deleteableBindings = _.reject(row.bindings, 'metadata.deletionTimestamp'); + } + }; + row.getSecretForBinding = function(binding) { return binding && _.get(row, ['state', 'secrets', binding.spec.secretName]); }; diff --git a/app/views/overview/_list-row-actions.html b/app/views/overview/_list-row-actions.html index 684c5dfdd1..e641698cd3 100644 --- a/app/views/overview/_list-row-actions.html +++ b/app/views/overview/_list-row-actions.html @@ -25,10 +25,10 @@ -
  • +
  • Create Binding
  • -
  • +
  • Delete Binding
  • diff --git a/app/views/overview/_list-row.html b/app/views/overview/_list-row.html index d5d205d578..351e01e9ac 100644 --- a/app/views/overview/_list-row.html +++ b/app/views/overview/_list-row.html @@ -21,7 +21,7 @@
    diff --git a/app/views/overview/_service-instance-row.html b/app/views/overview/_service-instance-row.html index 9043c599ea..fd7d4a30a6 100644 --- a/app/views/overview/_service-instance-row.html +++ b/app/views/overview/_service-instance-row.html @@ -55,7 +55,7 @@

  • Create Binding
  • -
  • +
  • Delete Binding
  • @@ -127,7 +127,10 @@

    - + + Deleting + + Pending
    diff --git a/dist/scripts/scripts.js b/dist/scripts/scripts.js index 051a22f6ec..b50ac63044 100644 --- a/dist/scripts/scripts.js +++ b/dist/scripts/scripts.js @@ -368,7 +368,7 @@ errorNotification:!1 Q.secrets = a.by("metadata.name"); }); }, 300), $a = function() { -if (Q.bindingsByApplicationUID = {}, Q.applicationsByBinding = {}, !_.isEmpty(Q.bindings)) { +if (Q.bindingsByApplicationUID = {}, Q.applicationsByBinding = {}, Q.deleteableBindingsByApplicationUID = {}, !_.isEmpty(Q.bindings)) { var a = [ z.deploymentConfigs, z.vanillaReplicationControllers, z.deployments, z.vanillaReplicaSets, z.statefulSets ]; if (!_.some(a, function(a) { return !a; @@ -380,8 +380,8 @@ c && (b[a.metadata.name] = new LabelSelector(c)); }), _.each(a, function(a) { _.each(a, function(a) { var c = T(a), d = new LabelSelector(_.get(a, "spec.selector")); -Q.bindingsByApplicationUID[c] = [], _.each(b, function(b, e) { -b.covers(d) && (Q.bindingsByApplicationUID[c].push(Q.bindings[e]), Q.applicationsByBinding[e] = Q.applicationsByBinding[e] || [], Q.applicationsByBinding[e].push(a)); +Q.bindingsByApplicationUID[c] = [], Q.deleteableBindingsByApplicationUID[c] = [], _.each(b, function(b, e) { +b.covers(d) && (Q.bindingsByApplicationUID[c].push(Q.bindings[e]), _.get(Q.bindings[e], "metadata.deletionTimestamp") || Q.deleteableBindingsByApplicationUID[c].push(Q.bindings[e]), Q.applicationsByBinding[e] = Q.applicationsByBinding[e] || [], Q.applicationsByBinding[e].push(a)); }); }); }); @@ -13092,6 +13092,8 @@ return _.get(g, [ "state", "serviceClasses", a, "description" ]); }; g.$doCheck = function() { g.notifications = e.getNotifications(g.apiObject, g.state), g.displayName = i(g.apiObject, g.serviceClasses), g.description = j(); +}, g.$onChanges = function(a) { +a.bindings && (g.deleteableBindings = _.reject(g.bindings, "metadata.deletionTimestamp")); }, g.getSecretForBinding = function(a) { return a && _.get(g, [ "state", "secrets", a.spec.secretName ]); }, g.isBindable = d.isServiceBindable(g.apiObject, g.state.serviceClasses), g.closeOverlayPanel = function() { diff --git a/dist/scripts/templates.js b/dist/scripts/templates.js index d6859ed02a..972c40fd01 100644 --- a/dist/scripts/templates.js +++ b/dist/scripts/templates.js @@ -11649,10 +11649,10 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function( "
    Edit\n" + "

  • \n" + "\n" + - "
  • \n" + + "
  • \n" + "Create Binding\n" + "
  • \n" + - "
  • \n" + + "
  • \n" + "Delete Binding\n" + "
  • \n" + "
  • \n" + @@ -11995,7 +11995,7 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function( "\n" + "\n" + "
    \n" + - "\n" + + "\n" + "
    \n" + "" ); @@ -12247,7 +12247,7 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function( "
  • \n" + "Create Binding\n" + "
  • \n" + - "
  • \n" + + "
  • \n" + "Delete Binding\n" + "
  • \n" + "
  • \n" + @@ -12297,7 +12297,10 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function( "\n" + "\n" + "
    \n" + - "\n" + + "\n" + + " Deleting\n" + + "\n" + + "\n" + " Pending\n" + "\n" + "\n" + @@ -12319,7 +12322,7 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function( "\n" + "
    \n" + "
    \n" + - "\n" + + "\n" + "
    \n" + "" );