Skip to content

Commit

Permalink
Added readonly fields refs #268
Browse files Browse the repository at this point in the history
  • Loading branch information
DailisLangovskis authored and raitisbe committed Sep 13, 2019
1 parent d87354a commit 46e1c34
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 15 deletions.
7 changes: 4 additions & 3 deletions components/query/attribute-row.component.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
export default {
template: require('./partials/attribute-row.html'),
bindings: {
attribute: '=',
feature: '=',
template: '='
attribute: '<',
feature: '<',
readonly: '@',
template: '<'
},
controller: ['$scope', function ($scope) {
angular.extend($scope, {
Expand Down
2 changes: 1 addition & 1 deletion components/query/feature.component.js.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'utils.module';
export default {
template: require('./partials/feature.html'),
bindings: {
feature: '='
feature: '<'
},
controller: ['$scope', 'hs.utils.service', 'hs.utils.layerUtilsService', 'hs.map.service',
function ($scope, utils, layerUtilsService, hsMap) {
Expand Down
6 changes: 3 additions & 3 deletions components/query/partials/attribute-row.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="input-group-prepend">
<span class="input-group-text">{{$ctrl.attribute.name}}</span>
</div>
<input class="form-control" ng-model="$ctrl.attribute.value" ng-change="change()" readonly></input>
<input class="form-control" ng-model="$ctrl.attribute.value" ng-change="change()"
ng-readonly="{{$ctrl.readonly}}"></input>
</div>
</div>

</div>
5 changes: 3 additions & 2 deletions components/query/partials/feature.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
<div class="col-12 m-2"><strong>{{$ctrl.feature.name}} in layer {{$ctrl.feature.layer}}</strong></div>
</div>
<hs.query.attribute-row ng-repeat="attribute in $ctrl.feature.attributes track by attribute.name | orderBy : 'name'"
template='$ctrl.feature.hstemplate' feature="$ctrl.feature" attribute='attribute'>
template='$ctrl.feature.hstemplate' feature="$ctrl.feature" attribute='attribute' readonly=false>
</hs.query.attribute-row>
<hs.query.attribute-row ng-repeat="stat in $ctrl.feature.stats" feature="$ctrl.feature" attribute='stat'>
<hs.query.attribute-row ng-repeat="stat in $ctrl.feature.stats" feature="$ctrl.feature" attribute="stat"
readonly=true>
</hs.query.attribute-row>
<div class="row">
<div class="col-12 m-2 text-right">
Expand Down
4 changes: 2 additions & 2 deletions components/query/partials/infopanel.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="card panel-default mainpanel">
<hs.layout.panel-header panel-name="info" panel-title="'Info'||translate"></hs.layout.panel-header>
<div class="card-body">
<hs.query.feature ng-repeat="feature in data.features | orderBy : 'name'" feature="feature"></hs.query.feature>
<hs.query.feature ng-repeat="item in data.features | orderBy : 'name'" feature="item"></hs.query.feature>
<table class="table table-striped" style="table-layout:fixed" ng-show="data.attributes.length > 0">
<tr ng-repeat="attribute in data.attributes | orderBy : name">
<td class="first-col">{{attribute.name}}</td>
Expand All @@ -13,7 +13,7 @@
<div class="col-12 m-2"><strong>{{data.coordinates[0].name}}</strong></div>
</div>
<div class="row" ng-repeat="projection in data.coordinates[0].projections | orderBy : name">
<div class="input-group m-1" >
<div class="input-group m-1">
<div class="input-group-prepend">
<span class="input-group-text">{{projection.name}}</span>
</div>
Expand Down
8 changes: 4 additions & 4 deletions components/query/query-wms.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default ['$rootScope', '$http', '$sce', 'hs.query.baseService', 'hs.map.s
name: featureName,
attributes: attributes
};
Base.setData(group, 'groups');
Base.setData(group, 'features');
});
});
doc.querySelectorAll("featureMember").forEach(function ($this) {
Expand All @@ -93,7 +93,7 @@ export default ['$rootScope', '$http', '$sce', 'hs.query.baseService', 'hs.map.s
updated = true;
}
}
if (updated) Base.setData(group, 'groups');
if (updated) Base.setData(group, 'features');
});
doc.querySelectorAll("msGMLOutput").forEach(function ($this) {
for (var layer_i in $this.children) {
Expand All @@ -119,7 +119,7 @@ export default ['$rootScope', '$http', '$sce', 'hs.query.baseService', 'hs.map.s
updated = true;
}
}
if (updated) Base.setData(group, 'groups');
if (updated) Base.setData(group, 'features');
}

}
Expand All @@ -139,7 +139,7 @@ export default ['$rootScope', '$http', '$sce', 'hs.query.baseService', 'hs.map.s

function queriesCollected(coordinate) {
var invisiblePopup = Base.getInvisiblePopup();
if (Base.data.groups.length > 0 || invisiblePopup.contentDocument.body.innerHTML.length > 30) {
if (Base.data.features.length > 0 || invisiblePopup.contentDocument.body.innerHTML.length > 30) {
$rootScope.$broadcast('queryWmsResult', coordinate);
}
}
Expand Down

0 comments on commit 46e1c34

Please sign in to comment.