-
Notifications
You must be signed in to change notification settings - Fork 134
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
Show Service plan cost when selecting a service plan (if not free) #2959
Conversation
Hey irfanhabib! Thanks for submitting this pull request! I'm here to inform the recipients of the pull request that you and the commit authors have already signed the CLA. |
Codecov Report
@@ Coverage Diff @@
## v2-master #2959 +/- ##
=============================================
- Coverage 71.13% 71.09% -0.04%
=============================================
Files 632 632
Lines 27683 27768 +85
Branches 6297 6314 +17
=============================================
+ Hits 19691 19742 +51
- Misses 7992 8026 +34 |
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 need to check the spec: https://github.com/openservicebrokerapi/servicebroker/blob/v2.14/spec.md
I tried this with IBM Cloud and they have different cost metadata than is described in the specification (no amount field).
We should handle this gracefully - I suspect they use a costs model pre-dating the OSRB spec?? Need to check.
@@ -16,6 +16,11 @@ | |||
<span *ngIf="(getPlanAccessibility(selPlan.entity) | async) !== 'ok'"> ({{ getAccessibilityMessage(selPlan.entity) | async }})</span> | |||
</app-metadata-item> | |||
<app-metadata-item label="Free"> {{ isFree(selPlan) | titlecase}} </app-metadata-item> | |||
<ng-container *ngIf="!isFree(selPlan)"> |
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 will always be false as isFree is a string - need to use *ngIf="!selPlan.entity.entity.free">
@nwmac Updated the PR to handle missing |
thanks @irfanhabib Is there a mapping between the spec unit field https://github.com/openservicebrokerapi/servicebroker/blob/master/profile.md#cost-object with examples such as "MONTHLY", "HOURLY", "Request", "GB" and the actual label displayed in the UI, which in the screenshot shows as "Month" ? Can you point me to this mapping logic (as I couldn't easily review it) ? The service catalogs from PWS marketplace, seems to indeed stick to spec example and use the "MONTHLY" unit string.
I'm wondering whether a label such as the following would better accommodate the current specs, including the prefix/postfix display variation depending on currencies.
Alternative:
It's less nice looking, but might be more accurate (without going into complex wording logic). |
@gberche-orange The code is agnostic to what the actual unit in question is. It can be anything (month, GB etc..) In the example you'be provided, for example, the card would show the following: Cost (unit=1,000 API calls currency=Euro): 10.5 => |
@irfanhabib with the unit example of the OSB specifications where the unit example is This unusual wording is to be compared with an alternative display such as |
@gberche-orange I've changed the format to:
|
@gberche-orange |
@irfanhabib looks great, thanks. I guess the currency logic (prefix vs suffix) can be extended in the future with other currencies (e.g. yens...) |
@irfanhabib Should we remove the |
For testing, IBM has some funky pricing. See |
- Changed create service - select service step loading indicator to common step `blocked` indicator - Don't show the service plan cost if its not in OSRB format (aka more complex IBM format)
I've tweaked the output after reviewing. It looked like we were displaying the |
thanks @richard-cox, this seems a good balance to me |
Fixes #2958
Displays it like this: