summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorAnaël Closson <ac2550@intl.att.com>2017-09-07 10:50:24 +0200
committerSébastien Determe <sd378r@intl.att.com>2017-09-07 09:00:36 +0000
commit25f65d0f6bd061facf88dab5859ddef1926dfecc (patch)
tree6d79cff941d0385071558b5052c0555c95a7795f /src/main
parent1aa4dc3048d39515c77c2565d0a050f6d5c9192f (diff)
Incorrect select field filtering
The filtering of select input fields was incorrectly handled and resulte in inconsistent state Issue-Id: CLAMP-49 Change-Id: I1678a861ca4fcb8b384fb75356ff95eee88f2fc6 Signed-off-by: Anaël Closson <ac2550@intl.att.com>
Diffstat (limited to 'src/main')
-rw-r--r--src/main/resources/META-INF/resources/designer/partials/portfolios/holmes_properties.html2
-rw-r--r--src/main/resources/META-INF/resources/designer/partials/portfolios/stringMatch_properties.html4
-rw-r--r--src/main/resources/META-INF/resources/designer/partials/portfolios/tca_properties.html4
-rw-r--r--src/main/resources/META-INF/resources/designer/scripts/aOnBoot.js77
4 files changed, 31 insertions, 56 deletions
diff --git a/src/main/resources/META-INF/resources/designer/partials/portfolios/holmes_properties.html b/src/main/resources/META-INF/resources/designer/partials/portfolios/holmes_properties.html
index 98c643238..3c7607b93 100644
--- a/src/main/resources/META-INF/resources/designer/partials/portfolios/holmes_properties.html
+++ b/src/main/resources/META-INF/resources/designer/partials/portfolios/holmes_properties.html
@@ -46,7 +46,7 @@
<label for="operationalPolicy" class="col-sm-4 control-label">Operational policy</label>
</div>
<div class="col-sm-8">
- <select class="form-control" id="operationalPolicy" name="operationalPolicy" autofocus="autofocus" required ng-trim="true">
+ <select class="form-control" id="operationalPolicy" name="operationalPolicy" autofocus="autofocus" required ng-trim="true" enableFilter="true">
<option ng-repeat="x in operationalPolicies" value="{{x}}">{{x}}</option>
</select>
</div>
diff --git a/src/main/resources/META-INF/resources/designer/partials/portfolios/stringMatch_properties.html b/src/main/resources/META-INF/resources/designer/partials/portfolios/stringMatch_properties.html
index 75491185f..018a4535b 100644
--- a/src/main/resources/META-INF/resources/designer/partials/portfolios/stringMatch_properties.html
+++ b/src/main/resources/META-INF/resources/designer/partials/portfolios/stringMatch_properties.html
@@ -227,7 +227,7 @@ label{
<label class="col-sm-4 control-label">Ops Policy:</label>
<div class="col-sm-8">
<select class="form-control" id="policyName" name="policyName"
- autofocus="autofocus" required ng-trim="true">
+ autofocus="autofocus" required ng-trim="true" enableFilter="true">
<option ng-repeat="x in policyNames" value="{{x}}">{{x}}</option>
</select>
</div>
@@ -972,4 +972,4 @@ label{
$(".stringMatchPanel").css("display", "unset");
}
</script>
-</div> \ No newline at end of file
+</div>
diff --git a/src/main/resources/META-INF/resources/designer/partials/portfolios/tca_properties.html b/src/main/resources/META-INF/resources/designer/partials/portfolios/tca_properties.html
index 3219fe432..7305fd91a 100644
--- a/src/main/resources/META-INF/resources/designer/partials/portfolios/tca_properties.html
+++ b/src/main/resources/META-INF/resources/designer/partials/portfolios/tca_properties.html
@@ -197,7 +197,7 @@
<div class="col-sm-8 form-group">
<label class="col-sm-3"> Policy </label>
<div class="col-sm-9" style="padding:0px;">
- <select name="tcaPol" id="tcaPol" enableFilter="false"></select>
+ <select name="tcaPol" id="tcaPol" enableFilter="true"></select>
</div>
</div>
@@ -620,4 +620,4 @@
});
}
</script>
-</div> \ No newline at end of file
+</div>
diff --git a/src/main/resources/META-INF/resources/designer/scripts/aOnBoot.js b/src/main/resources/META-INF/resources/designer/scripts/aOnBoot.js
index 97dd42e11..01a39b62d 100644
--- a/src/main/resources/META-INF/resources/designer/scripts/aOnBoot.js
+++ b/src/main/resources/META-INF/resources/designer/scripts/aOnBoot.js
@@ -113,61 +113,36 @@ function loadPropertyWindow(type) {
function setMultiSelect() {
$("select").each(function(index, mySelect) {
- if ($(mySelect).parents(".multiselect-native-select") &&
- $(mySelect).parents(".multiselect-native-select").length < 1) {
- if (!$(mySelect).attr("multiple")) {
- if ($(mySelect).attr("enableFilter")) {
- $(mySelect).multiselect({
- numberDisplayed: 1,
- maxHeight: 200
- });
- } else {
- $(mySelect).multiselect({
- numberDisplayed: 1,
- enableFiltering: true,
- maxHeight: 200
- });
- }
- } else {
- $(mySelect).multiselect({
- numberDisplayed: 1,
- includeSelectAllOption: true,
- enableFiltering: true,
- maxHeight: 200,
- enableCaseInsensitiveFiltering: true
- });
- }
+ var mySelectObj = $(mySelect);
+ if (! mySelectObj.parents(".multiselect-native-select")) {
+ // keep native for this one
+ return;
+ }
- } else if ($(mySelect).parents(".multiselect-native-select") &&
- $(mySelect).parents(".multiselect-native-select").length > 0) {
- var selectDrop = $(mySelect).parent(".multiselect-native-select").find("select");
- $(mySelect).parent(".multiselect-native-select").parent().html(selectDrop);
- if (!$(mySelect).attr("multiple")) {
- if ($(mySelect).attr("enableFilter")) {
- $(mySelect).multiselect({
- numberDisplayed: 1,
- maxHeight: 200
- });
- } else {
- $(mySelect).multiselect({
- numberDisplayed: 1,
- enableFiltering: true,
- maxHeight: 200
- });
- }
- } else {
- $(mySelect).multiselect({
- numberDisplayed: 1,
- includeSelectAllOption: true,
- enableFiltering: true,
- maxHeight: 200,
- enableCaseInsensitiveFiltering: true
- });
- }
+ if (mySelectObj.parents(".multiselect-native-select").length > 0) {
+ var selectDrop = mySelectObj.parent(".multiselect-native-select").find("select");
+ mySelectObj.parent(".multiselect-native-select").parent().html(selectDrop);
}
+
+ var options = {
+ numberDisplayed: 1,
+ maxHeight: 200
+ };
+
+ if (mySelectObj.attr("multiple")
+ && mySelectObj.attr("multiple") != 'false') {
+ options.includeSelectAllOption = true;
+ }
+
+ if (mySelectObj.attr("enableFilter")
+ && mySelectObj.attr("enableFilter") != 'false') {
+ options.enableCaseInsensitiveFiltering = true;
+ options.enableFiltering = true;
+ }
+
+ mySelectObj.multiselect(options);
});
- //refeshMultiSelect();
}
function loadSharedPropertyByService(onChangeUUID, refresh, callBack) {