Skip to content

Commit 77622f9

Browse files
committed
Use label-editor for PVC labels
Fixes a problem where the regex used for validating label names is wrong. Names with a `/` were incorrectly blocked.
1 parent afbed7d commit 77622f9

File tree

2 files changed

+15
-26
lines changed

2 files changed

+15
-26
lines changed

app/views/directives/osc-persistent-volume-claim.html

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -206,25 +206,19 @@
206206
Use
207207
<a href="" ng-click="showAdvancedOptions = true">label selectors</a>
208208
to request storage.
209+
210+
<div class="learn-more-block mar-top-sm">
211+
<a ng-href="{{'selector_label' | helpLink}}" target="_blank">Learn More&nbsp;<i class="fa fa-external-link" aria-hidden="true"></i></a>
212+
</div>
209213
</div>
210214

211-
<div ng-show="showAdvancedOptions" class="form-group">
212-
<fieldset class="compute-resource">
213-
<label>Label Selector</label>
214-
<div class="help-block mar-bottom-lg">
215-
Enter a label and value to use for your storage.
216-
<div class="learn-more-block">
217-
<a ng-href="{{'selector_label' | helpLink}}" target="_blank">Learn More&nbsp;<i class="fa fa-external-link" aria-hidden="true"></i></a>
218-
</div>
219-
</div>
220-
<key-value-editor
221-
entries="claim.selectedLabels"
222-
key-placeholder="label"
223-
value-placeholder="value"
224-
key-validator="[a-zA-Z][a-zA-Z0-9_-]*"
225-
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."
226-
add-row-link="Add Label"></key-value-editor>
227-
</fieldset>
215+
<div ng-show="showAdvancedOptions" class="form-group osc-form">
216+
<label-editor
217+
labels="claim.selectedLabels"
218+
expand="true"
219+
can-toggle="false"
220+
help-text="Enter a label and value to use for your storage.">
221+
</label-editor>
228222
</div>
229223
</fieldset>
230224
</ng-form>

dist/scripts/templates.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8309,18 +8309,13 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
83098309
"Use\n" +
83108310
"<a href=\"\" ng-click=\"showAdvancedOptions = true\">label selectors</a>\n" +
83118311
"to request storage.\n" +
8312-
"</div>\n" +
8313-
"<div ng-show=\"showAdvancedOptions\" class=\"form-group\">\n" +
8314-
"<fieldset class=\"compute-resource\">\n" +
8315-
"<label>Label Selector</label>\n" +
8316-
"<div class=\"help-block mar-bottom-lg\">\n" +
8317-
"Enter a label and value to use for your storage.\n" +
8318-
"<div class=\"learn-more-block\">\n" +
8312+
"<div class=\"learn-more-block mar-top-sm\">\n" +
83198313
"<a ng-href=\"{{'selector_label' | helpLink}}\" target=\"_blank\">Learn More&nbsp;<i class=\"fa fa-external-link\" aria-hidden=\"true\"></i></a>\n" +
83208314
"</div>\n" +
83218315
"</div>\n" +
8322-
"<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" +
8323-
"</fieldset>\n" +
8316+
"<div ng-show=\"showAdvancedOptions\" class=\"form-group osc-form\">\n" +
8317+
"<label-editor labels=\"claim.selectedLabels\" expand=\"true\" can-toggle=\"false\" help-text=\"Enter a label and value to use for your storage.\">\n" +
8318+
"</label-editor>\n" +
83248319
"</div>\n" +
83258320
"</fieldset>\n" +
83268321
"</ng-form>"

0 commit comments

Comments
 (0)