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
improve logic and ui for inferring bundle and type name when saving to catalog #108
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,9 +24,12 @@ <h3 class="modal-title">{{getTitle()}}</h3> | |
<div class="modal-body add-to-catalog-modal"> | ||
<form ng-show="state.view === VIEWS.form" name="form" novalidate> | ||
|
||
<div class="form-group"> | ||
<div class="form-group" ng-class="{'has-error': form.name.$invalid}"> | ||
<label class="control-label">Blueprint display name</label> | ||
<input ng-model="config.name" ng-disabled="state.saving" class="form-control" name="name" type="text" /> | ||
<input ng-model="config.name" ng-disabled="state.saving" class="form-control" name="name" type="text" required /> | ||
<p class="help-block" ng-show="form.name.$invalid"> | ||
<span ng-if="form.name.$error.required">You must specify a name for this item</span> | ||
</p> | ||
</div> | ||
|
||
<div class="form-group"> | ||
|
@@ -57,19 +60,17 @@ <h3 class="modal-title">{{getTitle()}}</h3> | |
<label class="control-label">Bundle ID</label> | ||
<div class="input-group"> | ||
<span class="input-group-addon">catalog-bom-</span> | ||
<input ng-model="config.bundle" ng-disabled="state.saving" class="form-control" placeholder="E.g my-bundle" name="bundle" required ng-pattern="state.pattern" autofocus /> | ||
<input ng-model="config.bundle" ng-disabled="state.saving" class="form-control" name="bundle" ng-pattern="state.pattern" autofocus placeholder="{{ config.name | bundlize }}"/> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I get that |
||
</div> | ||
<p class="help-block" ng-show="form.bundle.$invalid"> | ||
<span ng-if="form.bundle.$error.required">You must specify a bundle ID</span> | ||
<span ng-if="form.bundle.$error.pattern">The bundle ID can contains only letters, numbers as well a the following characters: <code>.</code>, <code>-</code> and <code>_</code></span> | ||
</p> | ||
</div> | ||
|
||
<div class="form-group" ng-class="{'has-error': form.symbolicName.$invalid}"> | ||
<label class="control-label">Blueprint symbolic name</label> | ||
<input ng-model="config.symbolicName" ng-disabled="state.saving" class="form-control" placeholder="E.g my-catalog-id" name="symbolicName" required ng-pattern="state.pattern" autofocus /> | ||
<input ng-model="config.symbolicName" ng-disabled="state.saving" class="form-control" name="symbolicName" ng-pattern="state.pattern" autofocus placeholder="{{ config.name | bundlize }}"/> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I get that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good spot, fitxed |
||
<p class="help-block" ng-show="form.symbolicName.$invalid"> | ||
<span ng-if="form.symbolicName.$error.required">You must specify a blueprint symbolic name</span> | ||
<span ng-if="form.symbolicName.$error.pattern">The blueprint symbolic name can contains only letters, numbers as well a the following characters: <code>.</code>, <code>-</code> and <code>_</code></span> | ||
</p> | ||
</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.
Why create this
var
(which should belet
) ? The function should live withinbundlizeProvider
which you can then call directly within this file withbundlizeProvider()(input);
. Actually, a better way would be to rely on the$filter
service like so:$filter('bundlize')(input);
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 didn't like
bundlizeProvider()(textToBundlize)
, but$filter('bundlize')(text)
is not bad, changed