-
Notifications
You must be signed in to change notification settings - Fork 231
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
Service Instance Details Pages #1906
Service Instance Details Pages #1906
Conversation
8eed8fe
to
d5ce3be
Compare
@cdcabrera Let me know when you'd like a review, thanks! |
@spadgett Edit: went ahead and worked a few questions into the review response comments |
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.
@cdcabrera Thanks. I realize this is a WIP, but I've added some initial comments.
app/scripts/app.js
Outdated
@@ -271,6 +271,16 @@ angular | |||
controller: 'ServiceController', | |||
reloadOnSearch: false | |||
}) | |||
.when('/project/:project/browse/provisioned', { |
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 think it would be good to match the API kind in the code even if we prefer to it as "Provisioned Service" in the UI. So I'd suggest /browse/service-instances/
and /browser/services-instances/:instance
with corresponding names to the controller and views.
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.
@spadgett what about matching file names too?
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.
Yes, let's be consistent with the filenames also
$routeParams, | ||
DataService, | ||
ProjectsService, | ||
$filter) { |
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.
Nit: I like to keep the lists alphabetized to keep them more manageable.
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.
Sure thing
$scope.serviceClasses = {}; | ||
$scope.alerts = {}; | ||
//$scope.renderOptions = $scope.renderOptions || {}; | ||
//$scope.renderOptions.hideFilterWidget = true; |
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.
The two commented out lines can be removed.
|
||
$scope.podFailureReasons = { | ||
"Pending": "This pod will not receive traffic until all of its containers have been created." | ||
}; |
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.
Looks like you have a fair amount of code from the service controller that is not needed here.
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.
Indeed, used the service controller as the basis. Anything we can wipe out... keep those comments coming
var watches = []; | ||
|
||
// receives routes for the current service and maps service ports to each route name | ||
var getPortsByRoute = 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.
This entire function can be removed.
app/views/provisioned.html
Outdated
<th>Age</th>--> | ||
</tr> | ||
</thead> | ||
<tbody ng-if="(serviceInstances | hashSize) === 0"> |
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.
Use | size
instead of | hashSize
app/views/provisioned.html
Outdated
<td colspan="5"><em>{{emptyMessage}}</em></td> | ||
</tr> | ||
</tbody> | ||
<tbody ng-if="(serviceInstances | hashSize) > 0"> |
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.
| size
app/views/provisioned.html
Outdated
</tr> | ||
</tbody> | ||
<tbody ng-if="(serviceInstances | hashSize) > 0"> | ||
<tr ng-repeat="serviceInstance in serviceInstances | orderObjectsByDate : true"> |
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.
Better to sort in the controller, not the view.
Use track by (serviceInstance | uid)
app/views/provisioned.html
Outdated
</tbody> | ||
<tbody ng-if="(serviceInstances | hashSize) > 0"> | ||
<tr ng-repeat="serviceInstance in serviceInstances | orderObjectsByDate : true"> | ||
<td data-title="Name"><a href="{{serviceInstance | navigateResourceURL}}">{{serviceInstance | serviceInstanceDisplayName:serviceClasses}}</a></td> |
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.
nit: ng-href
app/views/provisioned.html
Outdated
</td> | ||
<td data-title="Status"> | ||
<div row class="status"> | ||
<status-icon status="serviceInstance | deploymentStatus" disable-animation></status-icon> |
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.
deploymentStatus
is not correct here. You'll need to look at the overview service instance row to see how we determine status.
|
||
// TODO: code duplicated from directives/bindService.js | ||
// extract & share | ||
var sortServiceInstances = 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.
}; | ||
|
||
var groupBindings = function() { | ||
// Build two maps: |
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.
6c9d67f
to
02d8e1f
Compare
return {}; | ||
} | ||
return _.get(state, ['notificationsByObjectUID', uid], {}); | ||
};*/ |
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.
This can go.
DataService.list("secrets", context, null, { errorNotification: false }).then(function(secretData) { | ||
state.secrets = secretData.by("metadata.name"); | ||
}); | ||
}, 300);*/ |
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.
This can go.
group: 'servicecatalog.k8s.io', | ||
resource: 'instances' | ||
}, $routeParams.instance, context, serviceResolved)); | ||
|
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.
watches.push(DataService.watch({
group: 'servicecatalog.k8s.io',
resource: 'bindings'
}, context, function(bindings) {
$scope.bindings = _.filter(bindings.by('metadata.name'), { spec: { instanceRef: { name: instance.metadata.name } } });
}));
setDisplayName(); | ||
}); | ||
|
||
watches.push(DataService.watch({ |
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.
This watch can go since you're already watching the instance for this page above.
02d8e1f
to
496cfdb
Compare
08c7767
to
aafc1fa
Compare
@spadgett & @jeff-phillips-18 additional updates... Short checklist of things that may need to be altered
|
@@ -271,6 +271,16 @@ angular | |||
controller: 'ServiceController', | |||
reloadOnSearch: false | |||
}) | |||
.when('/project/:project/browse/service-instances', { |
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.
Note that upstream it will either be called ServiceInstance
or ServiceCatalogInstance
. What you have now looks good, but we might change the name to align with the final name in the upstream service catalog.
(Nothing to change right now)
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.
Following up to say the name upstream will be ServiceInstance
, so what you have is good 👍
app/scripts/constants.js
Outdated
return _.get(window.OPENSHIFT_CONSTANTS, 'ENABLE_TECH_PREVIEW_FEATURE.service_catalog_landing_page'); | ||
}, | ||
canI: { | ||
resource: 'rolebindings', |
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.
resource: { group: 'servicecatalog.k8s.io', resource: 'instances' }
$filter, | ||
$routeParams, | ||
DataService, | ||
ProjectsService) { |
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.
indentation
|
||
var serviceClassName = _.get($scope.serviceInstance.spec, 'serviceClassName'); | ||
$scope.serviceClass = _.get($scope.serviceClasses, [serviceClassName]); | ||
$scope.plan = _.find(_.get($scope.serviceClass, 'plans'), {name: 'default'}); |
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.
You don't want name: 'default'
. You want whatever plan is set in the service instance
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.
$scope.plan = _.find(_.get($scope.serviceClass, 'plans'), {name: $scope.serviceInstance.spec.planName });
$scope.displayName = $filter('serviceInstanceDisplayName')($scope.serviceInstance, $scope.serviceClasses); | ||
};*/ | ||
|
||
var setDescription = 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.
Maybe updateDescriptionAndPlan
since it's not just description, or possibly updateServiceClassMetadata
app/scripts/filters/resources.js
Outdated
return status; | ||
}; | ||
}) | ||
.filter('serviceInstanceMessage', function(statusConditionFilter) { |
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.
Maybe 'readyConditionMessage'
<a ng-href="{{serviceInstance | editYamlURL}}" role="button">Edit YAML</a> | ||
</li> | ||
<li ng-if="{resource: 'instances', group: 'servicecatalog.k8s.io'} | canI : 'delete'"> | ||
<delete-link |
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.
Probably want the same dialog as used here:
Let's make it a common component that we can reuse. We'll eventually need to handle bindings.
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.
In converting this over to a service, did a comparison on the current directive/component delete link looks like there are obvious "copy" differences, but the core of it is the same. Passing in the additional parameter/option/attribute for "group" and wrapping some of the display logic/ng-ifs with a service instance could solve this while separating out the DOM manipulation/modal call from the service
Purpose we either modify the existing, or create a new component, for the delete link for "service instances". This may make linking to the new "Service Instances Service" unnecessary unless we want to further eliminate the delete logic from the delete link directive/component... a little like pulling on a thread with this one
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.
@spadgett after going over the modal designs, talked with @ncameronbritt about the style. The style for...
fits more inline with the design aspect as opposed to the current...
Since this seems to fit partially with the "Service Instances Service" I can do a few things..
- leave the new "Service Instances Service" as is, free floating and convert the existing Provisioned Service "delete" links over to the preferred modal design
- leave the new "Service Instances Service" as is and leave the delete links/buttons alone
- just convert the new "Service Instances Service" by removing the DOM manipulation/modal
- or leave everything as is
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 probably want something closer to the first dialog, but I'd rather do that in a separate PR. Let's reuse what we have for now and revisit the design for both overview and this page later.
{{plan.description}} | ||
</p> | ||
<dl class="dl-horizontal left"> | ||
<dt ng-if-start="serviceClass.description">Description:</dt> |
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.
Probably want this above the plan details
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 should show externalMetadata.longDescription
if it's there even if description
is not.
<dt ng-if-start="serviceInstance | serviceInstanceMessage">Status Reason:</dt> | ||
<dd ng-if-end> | ||
{{serviceInstance | serviceInstanceMessage}} | ||
</dd> |
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've used a somewhat different layout for status on the route page and the build config page
</dl> | ||
</div> | ||
<div class="col-lg-6"> | ||
<resource-service-bindings |
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 might rename this component to just service-bindings
if we're using it for service instances too.
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 can do this, it's going to affect a handful of files.
[test] |
@beanh66 Can you take a look at this, based on your design? |
@beanh66 @serenamarie125 Just a heads up that the PR is still WIP, so some things are missing. |
Okay no problem @spadgett! @cdcabrera let me know when this is ready for UI review and we can meet if that's easiest. |
55258ed
to
99e5d5a
Compare
Reference point for PR #1961 Consider looking at breaking out another component for the status from |
e7ebf2d
to
36b4f2f
Compare
76a42c1
to
5989859
Compare
@cdcabrera I'm seeing these errors on the overview in the console. Do you see this as well? Doesn't happen on master.
|
app/scripts/constants.js
Outdated
resource: 'serviceinstances' | ||
}, | ||
verb: 'list' | ||
} |
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.
This should be
canI: {
resource: 'serviceinstances',
group: 'servicecatalog.k8s.io',
verb: 'list'
}
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.
that would break, sure thing
app/scripts/constants.js
Outdated
], | ||
isValid: function(){ | ||
return _.get(window.OPENSHIFT_CONSTANTS, 'ENABLE_TECH_PREVIEW_FEATURE.service_catalog_landing_page'); | ||
}, |
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.
Should be able to remove isValid
now that #2078 is in the merge queue. The canI
check below should hide the menu item when service catalog is not enabled.
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.
#2078 has merged
@spadgett, yeah looks like I need to verify something and possible rebase |
Yeah you'll want to rebase to pick up #2048 to properly test |
5989859
to
3248b3b
Compare
@spadgett rebased, don't see any errors on my end. Do we still need the line in isValid: function(){
return _.get(window.OPENSHIFT_CONSTANTS, 'ENABLE_TECH_PREVIEW_FEATURE.service_catalog_landing_page');
}, |
You can remove |
See my comment above on the |
<div ng-if="!loaded" class="mar-top-xl">Loading...</div> | ||
<div ng-if="serviceInstance"> | ||
<h1 class="contains-actions"> | ||
<div class="pull-right dropdown" ng-hide="!('instances' | canIDoAny)"> |
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.
Needs to be serviceInstances
here or the menu will never show up.
<div class="pull-right dropdown" ng-if="'serviceInstances' | canIDoAny">
You need to update resourceServiceBindings.js with ctrl.showBindings = CatalogService.SERVICE_CATALOG_ENABLED &&
(_.get(ctrl, 'apiObject.kind') === 'ServiceInstance' || enableTechPreviewFeature('pod_presets')); |
8e9be4a
to
fe5187b
Compare
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.
Thanks @cdcabrera
[merge] |
fe5187b
to
0fd1a62
Compare
[merge] |
Flake #1685 [test] |
@cdcabrera You have a dist mismatch. Try rebase, |
Can do @spadgett |
Updates for service instances. Prep to allow updates to chosen parameters for instance and bindings.
0fd1a62
to
f015611
Compare
Evaluated for origin web console test up to f015611 |
[merge] |
Evaluated for origin web console merge up to f015611 |
Origin Web Console Merge Results: SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_request_origin_web_console/219/) (Base Commit: d06b7c0) (PR Branch Commit: f015611) |
Origin Web Console Test Results: SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_request_origin_web_console/234/) (Base Commit: d06b7c0) (PR Branch Commit: f015611) |
Prep for update around service instances and bindings. Page for service instances.
Related to Origin Design PR #52
Dependency on Origin-Web-Common PR 164