Skip to content

Commit

Permalink
Use label-editor for PVC labels
Browse files Browse the repository at this point in the history
Fixes a problem where the regex used for validating label names is
wrong. Names with a `/` were incorrectly blocked.
  • Loading branch information
spadgett committed Nov 1, 2017
1 parent afbed7d commit 77622f9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 26 deletions.
28 changes: 11 additions & 17 deletions app/views/directives/osc-persistent-volume-claim.html
Original file line number Diff line number Diff line change
Expand Up @@ -206,25 +206,19 @@
Use
<a href="" ng-click="showAdvancedOptions = true">label selectors</a>
to request storage.

<div class="learn-more-block mar-top-sm">
<a ng-href="{{'selector_label' | helpLink}}" target="_blank">Learn More&nbsp;<i class="fa fa-external-link" aria-hidden="true"></i></a>
</div>
</div>

<div ng-show="showAdvancedOptions" class="form-group">
<fieldset class="compute-resource">
<label>Label Selector</label>
<div class="help-block mar-bottom-lg">
Enter a label and value to use for your storage.
<div class="learn-more-block">
<a ng-href="{{'selector_label' | helpLink}}" target="_blank">Learn More&nbsp;<i class="fa fa-external-link" aria-hidden="true"></i></a>
</div>
</div>
<key-value-editor
entries="claim.selectedLabels"
key-placeholder="label"
value-placeholder="value"
key-validator="[a-zA-Z][a-zA-Z0-9_-]*"
key-validator-error-tooltip="A valid label name is an alphanumeric (a-z and 0-9) string beginning with a letter that may contain underscores and dashes."
add-row-link="Add Label"></key-value-editor>
</fieldset>
<div ng-show="showAdvancedOptions" class="form-group osc-form">
<label-editor
labels="claim.selectedLabels"
expand="true"
can-toggle="false"
help-text="Enter a label and value to use for your storage.">
</label-editor>
</div>
</fieldset>
</ng-form>
13 changes: 4 additions & 9 deletions dist/scripts/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -8309,18 +8309,13 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
"Use\n" +
"<a href=\"\" ng-click=\"showAdvancedOptions = true\">label selectors</a>\n" +
"to request storage.\n" +
"</div>\n" +
"<div ng-show=\"showAdvancedOptions\" class=\"form-group\">\n" +
"<fieldset class=\"compute-resource\">\n" +
"<label>Label Selector</label>\n" +
"<div class=\"help-block mar-bottom-lg\">\n" +
"Enter a label and value to use for your storage.\n" +
"<div class=\"learn-more-block\">\n" +
"<div class=\"learn-more-block mar-top-sm\">\n" +
"<a ng-href=\"{{'selector_label' | helpLink}}\" target=\"_blank\">Learn More&nbsp;<i class=\"fa fa-external-link\" aria-hidden=\"true\"></i></a>\n" +
"</div>\n" +
"</div>\n" +
"<key-value-editor entries=\"claim.selectedLabels\" key-placeholder=\"label\" value-placeholder=\"value\" key-validator=\"[a-zA-Z][a-zA-Z0-9_-]*\" key-validator-error-tooltip=\"A valid label name is an alphanumeric (a-z and 0-9) string beginning with a letter that may contain underscores and dashes.\" add-row-link=\"Add Label\"></key-value-editor>\n" +
"</fieldset>\n" +
"<div ng-show=\"showAdvancedOptions\" class=\"form-group osc-form\">\n" +
"<label-editor labels=\"claim.selectedLabels\" expand=\"true\" can-toggle=\"false\" help-text=\"Enter a label and value to use for your storage.\">\n" +
"</label-editor>\n" +
"</div>\n" +
"</fieldset>\n" +
"</ng-form>"
Expand Down

0 comments on commit 77622f9

Please sign in to comment.