Skip to content

Commit

Permalink
Update UserQueryBuilderWidget layout
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasstein committed Aug 23, 2016
1 parent 277ab42 commit 3b34e74
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/main/js/apps/sample/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,7 @@
"l": 20,
"t": 100,
"w": 632,
"h": 280
"h": 300
}
}
},
Expand Down
31 changes: 30 additions & 1 deletion src/main/js/bundles/dn_querybuilder/UserQueryBuilderWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ define([
_init: function () {
ct_css.switchHidden(this._geometryButton.domNode, true);
ct_css.switchHidden(this._spatialRelationDiv, true);
ct_css.switchHidden(this._useOnlyGeometryDiv, true);
this.maxComboBoxHeight = 160;
var store = new Memory({
data: this.storeData
Expand Down Expand Up @@ -135,10 +136,12 @@ define([
if (value === true) {
ct_css.switchHidden(this._geometryButton.domNode, false);
ct_css.switchHidden(this._spatialRelationDiv, false);
ct_css.switchHidden(this._useOnlyGeometryDiv, false);
} else {
this.drawGeometryHandler.clearGraphics();
ct_css.switchHidden(this._geometryButton.domNode, true);
ct_css.switchHidden(this._spatialRelationDiv, true);
ct_css.switchHidden(this._useOnlyGeometryDiv, true);
}
});
} else {
Expand Down Expand Up @@ -269,7 +272,26 @@ define([
},
_onDone: function () {
this._setProcessing(true);
var complexQuery = this._getComplexQuery();
var complexQuery = {};
var checkBox = this._useOnlyGeometry;
if(!checkBox.checked) {
complexQuery = this._getComplexQuery()
} else {
if (this.querygeometryTool) {
var geometry = this._geometry;
if (geometry) {
var spatialRelation = this._spatialRelationSelect.value;
var operator = "$" + spatialRelation;
complexQuery.geometry = {};
complexQuery.geometry[operator] = geometry;
}
} else {
var extent = this.mapState.getExtent();
complexQuery.geometry = {
$contains: extent
};
}
}

this._searchReplacer(complexQuery);

Expand Down Expand Up @@ -298,6 +320,13 @@ define([
_onChooseGeometry: function () {
this.querygeometryTool.set("active", true);
},
_onUseOnlyGeometry: function(value) {
if(value) {
ct_css.switchHidden(this._centerNode.domNode, true);
} else {
ct_css.switchHidden(this._centerNode.domNode, false);
}
},
_getComplexQuery: function () {
var match = this._matchSelect.value;
var customQuery = {};
Expand Down
2 changes: 1 addition & 1 deletion src/main/js/bundles/dn_querybuilder/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"title": "${wizard.userWindowTitle}",
"marginBox": {
"w": 632,
"h": 320
"h": 300
},
"dockTool": "userQueryBuilderTool",
"closable": true,
Expand Down
1 change: 1 addition & 0 deletions src/main/js/bundles/dn_querybuilder/nls/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ define({
userGeometryEverywhere: "everywhere",
userGeometryEnhanced: "geometry",
userGeometryExtent: "current extent",
userUseOnlyGeometry: "Purely geometrical query",
userChooseGeometry: "Choose geometry",
userWindowTitle: "Build your own Query",
userSpatialRelation: "Spatial Relation",
Expand Down
1 change: 1 addition & 0 deletions src/main/js/bundles/dn_querybuilder/nls/de/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ define({
userGeometryEverywhere: "\u00fcberall",
userGeometryEnhanced: "Geometrie",
userGeometryExtent: "Aktueller Kartenausschnitt",
userUseOnlyGeometry: "Rein geometrische Abfrage",
userChooseGeometry: "Geometrie festlegen",
userWindowTitle: "Eigene Abfrage erstellen",
userSpatialRelation: "R\u00e4umliche Verkn\u00fcpfung",
Expand Down
4 changes: 3 additions & 1 deletion src/main/js/bundles/dn_querybuilder/styles/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@
max-width: 300px;
overflow: hidden;
text-overflow: ellipsis;
vertical-align: middle;
}

.userQueryBuilderWizard .inputContainer {
height: 94px;
height: 110px;
}

.userQueryBuilderWizard .inputContainer .settingsDiv {
Expand Down Expand Up @@ -59,6 +60,7 @@
max-width: 300px;
overflow: hidden;
text-overflow: ellipsis;
vertical-align: middle;
}

.editableQueryBuilderWizard .inputContainer .noWidth {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
<label>${i18n.userSpatialRelation}</label>
<input data-dojo-attach-point="_spatialRelationNode"/>
</div>
<div class="settingsDiv" data-dojo-attach-point="_useOnlyGeometryDiv">
<label>${i18n.userUseOnlyGeometry}</label>
<input data-dojo-type="dijit/form/CheckBox" data-dojo-attach-point="_useOnlyGeometry" value="agreed"
data-dojo-attach-event="onChange:_onUseOnlyGeometry">
</div>
<div class="settingsDiv" data-dojo-attach-point="_matchDiv">
<label>${i18n.userMatch}</label>
<input data-dojo-attach-point="_matchNode">
Expand All @@ -30,7 +35,8 @@
</div>
<div data-dojo-attach-point="_bottomNode" data-dojo-type="dijit/layout/ContentPane"
data-dojo-props="region: 'bottom'">
<button data-dojo-type="dijit.form.Button" type="button" data-dojo-attach-event="onClick:_onDone" data-dojo-props="iconClass:'icon-magnifier'">
<button data-dojo-type="dijit.form.Button" type="button" data-dojo-attach-event="onClick:_onDone"
data-dojo-props="iconClass:'icon-magnifier'">
${i18n.userDone}
</button>
</div>
Expand Down

0 comments on commit 3b34e74

Please sign in to comment.