Skip to content
Permalink
Browse files

Fix missing panels after refactoring

Problems where mostly related, because now there is no seperate
controller for each panel but component integrates controller in
 itself and thus Core.exists('x.controller') should be
Core.exists('x');

fixes #228
  • Loading branch information...
raitisbe committed Jul 19, 2019
1 parent 3991ea1 commit dfead3f7c4ee4e775528063de2cf2345770b0abd
@@ -1,21 +1,5 @@
export default {
template: ['config', function (config) {
return {
template: require('components/compositions/partials/compositions.html'),
link: function (scope, element) {
if (angular.isUndefined(config.design) || config.design == '') {
var el = document.getElementsByClassName('mid-pane');
if (el.length > 0) {
el[0].style.marginTop = '0px';
}
var el = document.getElementsByClassName('keywords-panel');
if (el.length > 0) {
el[0].style.display = 'none';
}
}
}
};
}],
template: require('components/compositions/partials/compositions.html'),
controller: ['$scope', 'Core', 'hs.compositions.service', 'hs.compositions.service_parser', '$window', 'config', '$compile',
function ($scope, Core, Composition, compositionParser, $window, config, $compile) {
$scope.CS = Composition;
@@ -512,6 +496,19 @@ export default {
$scope.getPageSize();
});

//This was put here from link function of previous compositions.directive
//since components dont support link functions anymore
if (angular.isUndefined(config.design) || config.design == '') {
var el = document.getElementsByClassName('mid-pane');
if (el.length > 0) {
el[0].style.marginTop = '0px';
}
var el = document.getElementsByClassName('keywords-panel');
if (el.length > 0) {
el[0].style.display = 'none';
}
}

$scope.$emit('scope_loaded', "Compositions");
}
]
@@ -3,6 +3,7 @@ export default {
controller:
['$scope', 'Core', '$compile', 'hs.utils.service', '$http', 'hs.datasource_selector.service', 'config',
function ($scope, Core, $compile, utils, $http, DS, config) {
$scope.Core = Core;
$scope.data = DS.data;
$scope.DS = DS;
$scope.dsPaging = $scope.data.paging;
@@ -33,7 +34,7 @@ export default {

/**
* @function openMickaAdvancedSearch
* @memberOf hs.datasource_selector.controller
* @memberOf hs.datasource_selector
* Opens Micka Advanced Search dialog, might pass current search string.
*/
$scope.openMickaAdvancedSearch = function () {
@@ -49,7 +50,7 @@ export default {

/**
* @function showSuggestions
* @memberOf hs.datasource_selector.controller
* @memberOf hs.datasource_selector
* @param {String} input Suggestion class type name (e.g. "Organisation Name")
* @param {String} param Suggestion paramater of Micka service (e.g. "org")
* @param {String} field Expected property name in response object (e.g. "value")
@@ -78,7 +79,7 @@ export default {

/**
* @function getPreviousRecords
* @memberOf hs.datasource_selector.controller
* @memberOf hs.datasource_selector
* @param {Object} ds Selected datasource
* Loads previous records of datasets from selected datasource (based on number of results per page and current start)
*/
@@ -95,7 +96,7 @@ export default {

/**
* @function getNextRecords
* @memberOf hs.datasource_selector.controller
* @memberOf hs.datasource_selector
* @param {Object} ds Selected datasource
* Loads next records of datasets from selected datasource (based on number of results per page and current start)
*/
@@ -114,7 +115,7 @@ export default {

/**
* @function showMetadata
* @memberOf hs.datasource_selector.controller
* @memberOf hs.datasource_selector
* @param {Object} ds Datasource of selected layer
* @param {Object} layer Metadata record of selected layer
* Show metadata record dialog window for selected layer.
@@ -159,7 +160,7 @@ export default {

/**
* @function addLayerToMap
* @memberOf hs.datasource_selector.controller
* @memberOf hs.datasource_selector
* @param {Object} ds Datasource of selected layer
* @param {Object} layer Metadata record of selected layer
* Add selected layer to map (into layer manager) if possible (supported formats: WMS, WFS, Sparql, kml, geojson, json)
@@ -192,7 +193,7 @@ export default {

/**
* @function setOtnKeyword
* @memberOf hs.datasource_selector.controller
* @memberOf hs.datasource_selector
* @param {String} theme Selected Otn theme keyword
* Select Otn Keyword as query subject (used with dropdown list in Gui)
*/
@@ -50,5 +50,5 @@ angular.module('hs.datasource_selector', ['hs.map'])
* @name hs.datasource_selector
* @description Display Datasource selector panel in app. Panel contains datasource types switcher and loaded list of datas.
*/
.component('hs.datasource_selector', datasourceSelectorComponent);
.component('hs.datasourceSelector', datasourceSelectorComponent);

@@ -297,7 +297,7 @@ export default ['$rootScope', 'hs.map.service', 'Core', 'config', '$http', '$q',

/**
* @function zoomTo
* @memberOf hs.datasource_selector.controller
* @memberOf hs.datasource_selector
* @param {String} bbox Bounding box of selected layer
* ZoomTo / MoveTo to selected layer overview
*/
@@ -315,7 +315,7 @@ export default ['$rootScope', 'hs.map.service', 'Core', 'config', '$http', '$q',

/**
* @function addExtentFeature
* @memberOf hs.datasource_selector.controller
* @memberOf hs.datasource_selector
* @param {Object} record Record of one dataset from Get Records response
* (PRIVATE) Create extent features for displaying extent of loaded dataset records in map
*/
@@ -345,7 +345,7 @@ export default ['$rootScope', 'hs.map.service', 'Core', 'config', '$http', '$q',

/**
* @function layerDownload
* @memberOf hs.datasource_selector.controller
* @memberOf hs.datasource_selector
* @param {Object} ds Datasource of selected layer
* @param {Object} layer Metadata record of selected layer
* @returns {String} Download url of layer if possible
@@ -362,7 +362,7 @@ export default ['$rootScope', 'hs.map.service', 'Core', 'config', '$http', '$q',

/**
* @function layerRDF
* @memberOf hs.datasource_selector.controller
* @memberOf hs.datasource_selector
* @param {Object} ds Datasource of selected layer
* @param {Object} layer Metadata record of selected layer
* @returns {String} URL to record file
@@ -374,7 +374,7 @@ export default ['$rootScope', 'hs.map.service', 'Core', 'config', '$http', '$q',

/**
* @function addLayerToMap
* @memberOf hs.datasource_selector.controller
* @memberOf hs.datasource_selector
* @param {Object} ds Datasource of selected layer
* @param {Object} layer Metadata record of selected layer
* Add selected layer to map (into layer manager) if possible (supported formats: WMS, WFS, Sparql, kml, geojson, json)
@@ -39,7 +39,7 @@ export default ['Core',
description: 'Select data or services for your map composition',
name: 'datasource_selector',
directive: 'hs.datasource_selector.directive',
controller: 'hs.datasource_selector.controller',
controller: 'hs.datasource_selector',
mdicon: 'dns'
},
{
@@ -23,12 +23,12 @@
<hs.layermanager hs.draggable ng-show="Core.panelVisible('layermanager', this)"></hs.layermanager>
<hs.legend hs.draggable ng-if="Core.exists('hs.legend')" ng-show="Core.panelVisible('legend', this)"></hs.legend>
<hs.add-layers hs.draggable ng-if="Core.exists('hs.addLayers') && !Core.singleDatasources" ng-show="Core.panelVisible('ows', this)"></hs.add-layers>
<hs.datasource_selector hs.draggable ng-if="Core.exists('hs.datasource_selector.controller')" ng-show="Core.panelVisible('datasource_selector', this)"></hs.datasource_selector>
<hs.compositions hs.draggable ng-if="Core.exists('hs.compositions.controller')" ng-show="Core.panelVisible('composition_browser', this)"></hs.compositions>
<hs.datasource-selector hs.draggable ng-if="Core.exists('hs.datasource_selector')" ng-show="Core.panelVisible('datasource_selector', this)"></hs.datasource-selector>
<hs.compositions hs.draggable ng-if="Core.exists('hs.compositions')" ng-show="Core.panelVisible('composition_browser', this)"></hs.compositions>
<div hs.feature_crossfilter.directive hs.draggable ng-controller="hs.feature_crossfilter.controller" ng-if="Core.exists('hs.feature_crossfilter.controller')" ng-show="Core.panelVisible('feature_crossfilter', this)"></div>
<hs.measure hs.draggable ng-if="Core.exists('hs.measure.controller')" ng-show="Core.panelVisible('measure', this)"></hs.measure>
<hs.measure hs.draggable ng-if="Core.exists('hs.measure')" ng-show="Core.panelVisible('measure', this)"></hs.measure>
<hs.print hs.draggable ng-if="Core.exists('hs.print')" ng-show="Core.panelVisible('print', this)"></hs.print>
<hs.styler hs.draggable ng-if="Core.exists('hs.styler.controller')" ng-show="Core.panelVisible('styler', this)"></hs.styler>
<hs.styler hs.draggable ng-if="Core.exists('hs.styler')" ng-show="Core.panelVisible('styler', this)"></hs.styler>
<hs.permalink hs.draggable ng-if="Core.exists('hs.permalink')" ng-show="Core.panelVisible('permalink', this)"></hs.permalink>
<div hs.query.directive_infopanel hs.draggable ng-controller="hs.query.controller" id="infopanel" ng-if="Core.exists('hs.query.controller') && config.design != 'md'" ng-show="Core.panelVisible('info', this)"></div>
<div hs.query.directive_infopanel_md hs.draggable ng-controller="hs.query.controller" id="infopanel" ng-if="Core.exists('hs.query.controller') && config.design == 'md'" ng-show="Core.panelVisible('info', this)"></div>
@@ -1,8 +1,6 @@
export default {
template: ['config', function (config) {
return {
template: require('components/measure/partials/measure.html'),
};
return require('components/measure/partials/measure.html');
}],
controller: ['$scope', 'hs.map.service', 'Core', 'hs.measure.service',
function ($scope, OlMap, Core, Measure) {
@@ -17,7 +17,7 @@
<span class="sidebar-item-title">Legend</span>
</a>

<a href="#" class="sidebar-item list-group-item" ng-if="Core.exists('hs.datasource_selector.controller')" ng-click="setMainPanel('datasource_selector')" ng-class="{active: Core.mainpanel == 'datasource_selector'}">
<a href="#" class="sidebar-item list-group-item" ng-if="Core.exists('hs.datasource_selector')" ng-click="setMainPanel('datasource_selector')" ng-class="{active: Core.mainpanel == 'datasource_selector'}">
<span class="menu-icon icon-database" data-toggle="tooltip" data-container="body" data-placement="auto" title="{{'Select data or services for your map composition'|translate}}"></span>
<span class="sidebar-item-title" ng-if="!Core.singleDatasources" translate>Datasource Selector</span>
<span class="sidebar-item-title" ng-if="Core.singleDatasources" translate>Add layers</span>
@@ -56,7 +56,7 @@ define(['angular', 'ol', 'angular-material'],

/**
* @function showSuggestions
* @memberOf hs.datasource_selector.controller
* @memberOf hs.datasource_selector
* @param {String} input Suggestion class type name (e.g. "Organisation Name")
* @param {String} param Suggestion paramater of Micka service (e.g. "org")
* @param {String} field Expected property name in response object (e.g. "value")
@@ -71,7 +71,7 @@ define(['angular', 'ol', 'angular-material'],

/**
* @function getPreviousRecords
* @memberOf hs.datasource_selector.controller
* @memberOf hs.datasource_selector
* @param {Object} ds Selected datasource
* Loads previous records of datasets from selected datasource (based on number of results per page and current start)
*/
@@ -88,7 +88,7 @@ define(['angular', 'ol', 'angular-material'],

/**
* @function getNextRecords
* @memberOf hs.datasource_selector.controller
* @memberOf hs.datasource_selector
* @param {Object} ds Selected datasource
* Loads next records of datasets from selected datasource (based on number of results per page and current start)
*/
@@ -107,7 +107,7 @@ define(['angular', 'ol', 'angular-material'],

/**
* @function showMetadata
* @memberOf hs.datasource_selector.controller
* @memberOf hs.datasource_selector
* @param {Object} ds Datasource of selected layer
* @param {Object} layer Metadata record of selected layer
* Show metadata record dialog window for selected layer.
@@ -137,7 +137,7 @@ define(['angular', 'ol', 'angular-material'],

/**
* @function addLayerToMap
* @memberOf hs.datasource_selector.controller
* @memberOf hs.datasource_selector
* @param {Object} ds Datasource of selected layer
* @param {Object} layer Metadata record of selected layer
* Add selected layer to map (into layer manager) if possible (supported formats: WMS, WFS, Sparql, kml, geojson, json)

0 comments on commit dfead3f

Please sign in to comment.
You can’t perform that action at this time.