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

Support service instance parameters #231

Merged
merged 1 commit into from
Jun 6, 2017

Conversation

spadgett
Copy link
Member

@spadgett spadgett commented May 16, 2017

https://trello.com/c/qvua05Kh

Initial support for service instance parameters using angular-schema-form.

openshift catalog components 2017-05-16 18-20-42

@jwforres FYI

@spadgett spadgett force-pushed the provision-params branch from a2dc190 to 63f5561 Compare May 17, 2017 17:14
@spadgett spadgett changed the title [WIP] Support service instance parameters Support service instance parameters May 17, 2017
@spadgett
Copy link
Member Author

@jeff-phillips-18 It looks like all of the tests failed in travis and I'm not sure why. Any idea?

@spadgett spadgett force-pushed the provision-params branch from 63f5561 to 68760b3 Compare May 17, 2017 19:11
@spadgett
Copy link
Member Author

@jeff-phillips-18 Nevermind, I have the tests passing.

@@ -176,7 +179,8 @@ export class OrderServiceController implements angular.IController {
},
spec: {
serviceClassName: serviceClassName,
planName: this.ctrl.selectedPlan.name
planName: this.ctrl.selectedPlan.name,
parameters: this.ctrl.parameterData
Copy link
Member

Choose a reason for hiding this comment

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

depending on when this gets in might need to update this to the new parameter model format before sending

@@ -0,0 +1,32 @@
<div class="schema-form-array {{form.htmlClass}}"
Copy link
Member

Choose a reason for hiding this comment

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

as far as naming these files, can it be src/decorators/schema-form-bootstrap/array.html ?
decorators/bootstrap is a little too generic to be clear what its for

Copy link
Member

Choose a reason for hiding this comment

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

also how much did you have to change these files? it would be nice if we could keep track of how much we were having to change the OOTB decorators we copied these from. Also should probably have a comment saying which version of the decorators we based it off of in case we need / want to update them.

Copy link
Member Author

Choose a reason for hiding this comment

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

as far as naming these files, can it be src/decorators/schema-form-bootstrap/array.html

I was trying to match the template path to make the files and originals easier to find (see index.ts), but I'm OK changing it too

$templateCache.put('decorators/bootstrap/array.html', require('./decorators/bootstrap/array.html'));

@spadgett
Copy link
Member Author

@jwforres Here are the diffs:

array.html

13,14c13,14
13,14c13,14
<               style="position: relative; z-index: 20;"
<               type="button" class="close pull-right">
---
>               style="position: absolute; z-index: 20; right: 0; top: 12px; font-size: 20px;"
>               type="button" class="close">
29d28
<       <i class="glyphicon glyphicon-plus"></i>

checkbox.html

1c1,2
< <div class="checkbox schema-form-checkbox {{form.htmlClass}}"
---
> <div class="form-group">
>   <div class="checkbox schema-form-checkbox {{form.htmlClass}}"
3c4
<   <label class="{{form.labelHtmlClass}}">
---
>     <label class="{{form.checkboxLabelHtmlClass}}">
13c14,15
<   <div class="help-block" sf-message="form.description"></div>
---
>     <div class="help-block {{form.checkboxHelpHtmlClass}}" sf-message="form.description"></div>
>   </div>
---
>   <div class="help-block" sf-message="form.description"></div>

checkboxes.html

9a10
>   <div class="{{form.fieldWrapperHtmlClass}}">
20c21
<
---
>     </div>

default.html

3c3
<   <label class="control-label {{form.labelHtmlClass}}" ng-class="{'sr-only': !showTitle()}" for="{{form.key.slice(-1)[0]}}">{{form.title}}</label>
---
>   <label class="control-label {{form.labelHtmlClass}}" ng-class="{required: form.required, 'sr-only': !showTitle()}" for="{{form.key.slice(-1)[0]}}">{{form.title}}</label>
4a5
>   <div class="{{form.fieldWrapperHtmlClass}}">
14a16
>            ng-required="form.required"
51a54
>   </div>

select.html (to change to ui-select)

3c3
<   <label class="control-label {{form.labelHtmlClass}}" ng-show="showTitle()">
---
>    <label class="control-label {{form.labelHtmlClass}}" ng-class="{ required: form.required }" ng-show="showTitle()">
6c6,7
<   <select sf-field-model
---
>   <div class="{{form.fieldWrapperHtmlClass}}">
>     <ui-select sf-field-model
7a9
>             ng-required="form.required"
9,13c11,18
<           class="form-control {{form.fieldHtmlClass}}"
<           schema-validate="form"
<           ng-options="item.value as item.name group by item.group for item in form.titleMap"
<           name="{{form.key.slice(-1)[0]}}">
<   </select>
---
>             schema-validate="form">
>       <ui-select-match>
>         {{$select.selected.name}}
>       </ui-select-match>
>       <ui-select-choices repeat="item.value as item in form.titleMap | filter : $select.search">
>         <span ng-bind-html="item.name | highlightKeywords : $select.search"></span>
>       </ui-select-choices>
>     </ui-select>
14a20
>   </div>

@spadgett
Copy link
Member Author

I think eventually we'll need to write our own decorator for secrets and valueFrom (rather than just modifying the views from the bootstrap decorator), so this might be a point in time thing.

@spadgett spadgett force-pushed the provision-params branch from 68760b3 to a249994 Compare May 18, 2017 12:51
Copy link
Member

@jwforres jwforres left a comment

Choose a reason for hiding this comment

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

OK fine with it as is then since it sounds like we will need to have some updates to support the secretParameters long term

@spadgett spadgett force-pushed the provision-params branch 2 times, most recently from 60e1259 to 871d145 Compare May 23, 2017 18:10
@spadgett spadgett force-pushed the provision-params branch 2 times, most recently from 380a221 to 37f5428 Compare June 1, 2017 18:03
@spadgett
Copy link
Member Author

spadgett commented Jun 1, 2017

Rebased and disabled the horizontal form styles for now.

@jwforres
Copy link
Member

jwforres commented Jun 1, 2017

@spadgett looks like travis failed on dist, otherwise this is ready to merge once master re-opens

@spadgett spadgett force-pushed the provision-params branch 3 times, most recently from 3876fe2 to c78041c Compare June 1, 2017 20:10
@spadgett
Copy link
Member Author

spadgett commented Jun 2, 2017

Updated the client to not send empty parameter values. See discussion in openshift/origin#14445

@jim-minter FYI

@spadgett spadgett force-pushed the provision-params branch from 947c15f to bbf897f Compare June 2, 2017 18:50
Use angular-schema-form to show a form based on the parameter JSON schema.
This adds a catalog-parameters component that can be reused for bind.
@spadgett spadgett force-pushed the provision-params branch from bbf897f to c3192fe Compare June 5, 2017 12:48
@spadgett
Copy link
Member Author

spadgett commented Jun 5, 2017

Rebased. @jwforres PTAL, the changes to omit empty parameters are here:

https://github.com/openshift/origin-web-catalog/pull/231/files#diff-7a34cbbd85f9a19385ee34c6b893075fR339

@jwforres
Copy link
Member

jwforres commented Jun 5, 2017

LGTM, ready to merge it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants