Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't export private classes, directive and components. #4457

Merged
merged 1 commit into from
Dec 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 2 additions & 3 deletions contribs/gmf/apps/desktop_alt/Controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* This file includes `goog.require`'s for all the components/directives used
* by the HTML page and the controller to provide the configuration.
*/

import angular from 'angular';
import './sass/desktop_alt.scss';
import gmfControllersAbstractDesktopController from 'gmf/controllers/AbstractDesktopController.js';
import appBase from '../appmodule.js';
Expand All @@ -31,13 +31,12 @@ if (!window.requestAnimationFrame) {
/**
* @param {angular.IScope} $scope Scope.
* @param {angular.auto.IInjectorService} $injector Main injector.
* @param {gettext} gettext The gettext service
* @constructor
* @extends {gmf.controllers.AbstractDesktopController}
* @ngInject
* @export
*/
const exports = function($scope, $injector, gettext) {
const exports = function($scope, $injector) {
gmfControllersAbstractDesktopController.call(this, {
srid: 21781,
mapViewConfig: {
Expand Down
7 changes: 3 additions & 4 deletions contribs/gmf/src/authentication/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ exports.component('gmfAuthentication', component);
/**
* @private
*/
exports.AuthenticationController_ = class {
class AuthenticationController {
/**
* @private
* @param {!angular.JQLite} $element Element.
Expand Down Expand Up @@ -448,10 +448,9 @@ exports.AuthenticationController_ = class {
this.notification_.clear();
this.error = false;
}
};
}

exports.controller('GmfAuthenticationController',
exports.AuthenticationController_);
exports.controller('GmfAuthenticationController', AuthenticationController);


export default exports;
2 changes: 1 addition & 1 deletion contribs/gmf/src/authentication/module.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @module gmf.authentication.module
*/
import * as angular from 'angular';
import angular from 'angular';
import gmfAuthenticationComponent from 'gmf/authentication/component.js';

import gmfAuthenticationService from 'gmf/authentication/Service.js';
Expand Down
19 changes: 9 additions & 10 deletions contribs/gmf/src/backgroundlayerselector/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ exports.component('gmfBackgroundlayerselector', component);
* @ngdoc controller
* @ngname GmfBackgroundlayerselectorController
*/
exports.Controller_ = function($scope, ngeoBackgroundLayerMgr, gmfThemes) {
function Controller($scope, ngeoBackgroundLayerMgr, gmfThemes) {

/**
* @type {?ol.Map}
Expand Down Expand Up @@ -160,13 +160,13 @@ exports.Controller_ = function($scope, ngeoBackgroundLayerMgr, gmfThemes) {
}));

$scope.$on('$destroy', this.handleDestroy_.bind(this));
};
}


/**
* Initialise the controller.
*/
exports.Controller_.prototype.$onInit = function() {
Controller.prototype.$onInit = function() {
this.handleThemesChange_();
};

Expand All @@ -175,7 +175,7 @@ exports.Controller_.prototype.$onInit = function() {
* Called when the themes changes. Set (or reset) the background layers.
* @private
*/
exports.Controller_.prototype.handleThemesChange_ = function() {
Controller.prototype.handleThemesChange_ = function() {
this.gmfThemes_.getBgLayers().then((layers) => {
this.bgLayers = layers;

Expand All @@ -201,7 +201,7 @@ exports.Controller_.prototype.handleThemesChange_ = function() {
* @returns {number} The background layer opacity.
* @export
*/
exports.Controller_.prototype.getSetBgLayerOpacity = function(val) {
Controller.prototype.getSetBgLayerOpacity = function(val) {
if (val) {
this.opacityLayer.setOpacity(val);
}
Expand All @@ -213,7 +213,7 @@ exports.Controller_.prototype.getSetBgLayerOpacity = function(val) {
* @param {boolean=} opt_silent Do not notify listeners.
* @export
*/
exports.Controller_.prototype.setLayer = function(layer, opt_silent) {
Controller.prototype.setLayer = function(layer, opt_silent) {
this.bgLayer = layer;
this.backgroundLayerMgr_.set(this.map, layer);
if (!opt_silent && this.select) {
Expand All @@ -226,21 +226,20 @@ exports.Controller_.prototype.setLayer = function(layer, opt_silent) {
* @param {ol.layer.Base} layer The opacity background layer.
* @export
*/
exports.Controller_.prototype.setOpacityBgLayer = function(layer) {
Controller.prototype.setOpacityBgLayer = function(layer) {
this.backgroundLayerMgr_.setOpacityBgLayer(this.map, layer);
};

/**
* @private
*/
exports.Controller_.prototype.handleDestroy_ = function() {
Controller.prototype.handleDestroy_ = function() {
this.listenerKeys_.forEach(olEvents.unlistenByKey);
this.listenerKeys_.length = 0;
};


exports.controller('GmfBackgroundlayerselectorController',
exports.Controller_);
exports.controller('GmfBackgroundlayerselectorController', Controller);


export default exports;
32 changes: 15 additions & 17 deletions contribs/gmf/src/contextualdata/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const exports = angular.module('gmfContextualdata', [
* @ngdoc directive
* @ngname gmfContextualdata
*/
exports.directive_ = function() {
function directive() {
return {
restrict: 'A',
scope: false,
Expand All @@ -70,10 +70,9 @@ exports.directive_ = function() {
controller.init();
}
};
};
}

exports.directive('gmfContextualdata',
exports.directive_);
exports.directive('gmfContextualdata', directive);


/**
Expand All @@ -88,7 +87,7 @@ exports.directive('gmfContextualdata',
* @ngdoc controller
* @ngInject
*/
exports.Controller_ = function($compile, $timeout, $scope, gmfRaster) {
function Controller($compile, $timeout, $scope, gmfRaster) {

/**
* @type {ol.Map}
Expand Down Expand Up @@ -139,12 +138,12 @@ exports.Controller_ = function($compile, $timeout, $scope, gmfRaster) {
this.gmfRaster_ = gmfRaster;

angular.element('body').on('mousedown', this.hidePopover.bind(this));
};
}

/**
*
*/
exports.Controller_.prototype.init = function() {
Controller.prototype.init = function() {
this.preparePopover_();

const mapDiv = this.map.getTargetElement();
Expand All @@ -158,7 +157,7 @@ exports.Controller_.prototype.init = function() {
* @param {!Event} event Event.
* @private
*/
exports.Controller_.prototype.handleMapContextMenu_ = function(event) {
Controller.prototype.handleMapContextMenu_ = function(event) {
this.$scope_.$apply(() => {
const pixel = this.map.getEventPixel(event);
const coordinate = this.map.getCoordinateFromPixel(pixel);
Expand All @@ -174,7 +173,7 @@ exports.Controller_.prototype.handleMapContextMenu_ = function(event) {
});
};

exports.Controller_.prototype.setContent_ = function(coordinate) {
Controller.prototype.setContent_ = function(coordinate) {
const scope = this.$scope_.$new(true);
this.$compile_(this.content_)(scope);

Expand Down Expand Up @@ -205,7 +204,7 @@ exports.Controller_.prototype.setContent_ = function(coordinate) {
/**
* @private
*/
exports.Controller_.prototype.preparePopover_ = function() {
Controller.prototype.preparePopover_ = function() {

const container = document.createElement('DIV');
container.classList.add('popover');
Expand All @@ -232,17 +231,17 @@ exports.Controller_.prototype.preparePopover_ = function() {
this.map.addOverlay(this.overlay_);
};

exports.Controller_.prototype.showPopover = function() {
Controller.prototype.showPopover = function() {
const element = /** @type {Object} */ (this.overlay_.getElement());
angular.element(element).css('display', 'block');
};

exports.Controller_.prototype.hidePopover = function() {
Controller.prototype.hidePopover = function() {
const element = /** @type {Object} */ (this.overlay_.getElement());
angular.element(element).css('display', 'none');
};

exports.controller('GmfContextualdataController', exports.Controller_);
exports.controller('GmfContextualdataController', Controller);


/**
Expand Down Expand Up @@ -273,16 +272,15 @@ exports.controller('GmfContextualdataController', exports.Controller_);
* @ngdoc directive
* @ngname gmfContextualdatacontent
*/
exports.contentDirective_ = function(
gmfContextualdatacontentTemplateUrl) {
function contentDirective(gmfContextualdatacontentTemplateUrl) {
return {
restrict: 'A',
scope: true,
templateUrl: gmfContextualdatacontentTemplateUrl
};
};
}

exports.directive('gmfContextualdatacontent', exports.contentDirective_);
exports.directive('gmfContextualdatacontent', contentDirective);


export default exports;
2 changes: 1 addition & 1 deletion contribs/gmf/src/datasource/module.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @module gmf.datasource.module
*/
import * as angular from 'angular';
import angular from 'angular';
import gmfDatasourceDataSourceBeingFiltered from 'gmf/datasource/DataSourceBeingFiltered.js';
import gmfDatasourceExternalDataSourcesManager from 'gmf/datasource/ExternalDataSourcesManager.js';
import gmfDatasourceHelper from 'gmf/datasource/Helper.js';
Expand Down
24 changes: 11 additions & 13 deletions contribs/gmf/src/disclaimer/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ const exports = angular.module('gmfDisclaimer', [
* @constructor
* @private
* @param {!angular.JQLite} $element Element.
* @param {!angular.IScope} $scope Angular scope.
* @param {!angular.ISCEService} $sce Angular sce service.
* @param {!angular.ITimeoutService} $timeout Angular timeout service.
* @param {!angular.gettext.gettextCatalog} gettextCatalog Gettext catalog.
Expand All @@ -41,8 +40,7 @@ const exports = angular.module('gmfDisclaimer', [
* @ngdoc controller
* @ngname GmfDisclaimerController
*/
exports.Controller_ = function($element, $scope, $sce, $timeout,
gettextCatalog, ngeoCreatePopup, ngeoDisclaimer, ngeoEventHelper, ngeoLayerHelper) {
function Controller($element, $sce, $timeout, gettextCatalog, ngeoCreatePopup, ngeoDisclaimer, ngeoEventHelper, ngeoLayerHelper) {

/**
* @type {?ol.Map}
Expand Down Expand Up @@ -135,13 +133,13 @@ exports.Controller_ = function($element, $scope, $sce, $timeout,
* @private
*/
this.dataLayerGroup_ = null;
};
}


/**
* Initialise the controller.
*/
exports.Controller_.prototype.$onInit = function() {
Controller.prototype.$onInit = function() {
this.dataLayerGroup_ = this.ngeoLayerHelper_.getGroupFromMap(this.map,
gmfBase.DATALAYERGROUP_NAME);
this.registerLayer_(this.dataLayerGroup_);
Expand All @@ -151,7 +149,7 @@ exports.Controller_.prototype.$onInit = function() {
* @param {ol.Collection.Event} evt Event.
* @private
*/
exports.Controller_.prototype.handleLayersAdd_ = function(evt) {
Controller.prototype.handleLayersAdd_ = function(evt) {
this.timeout_(() => {
const layer = evt.element;
googAsserts.assertInstanceof(layer, olLayerBase);
Expand All @@ -164,7 +162,7 @@ exports.Controller_.prototype.handleLayersAdd_ = function(evt) {
* @param {ol.Collection.Event} evt Event.
* @private
*/
exports.Controller_.prototype.handleLayersRemove_ = function(evt) {
Controller.prototype.handleLayersRemove_ = function(evt) {
const layer = evt.element;
googAsserts.assertInstanceof(layer, olLayerBase);
this.unregisterLayer_(layer);
Expand All @@ -175,7 +173,7 @@ exports.Controller_.prototype.handleLayersRemove_ = function(evt) {
* @param {ol.layer.Base} layer Layer.
* @private
*/
exports.Controller_.prototype.registerLayer_ = function(layer) {
Controller.prototype.registerLayer_ = function(layer) {

const layerUid = olUtilGetUid(layer);

Expand Down Expand Up @@ -223,7 +221,7 @@ exports.Controller_.prototype.registerLayer_ = function(layer) {
* @param {ol.layer.Base} layer Layer.
* @private
*/
exports.Controller_.prototype.unregisterLayer_ = function(layer) {
Controller.prototype.unregisterLayer_ = function(layer) {

const layerUid = olUtilGetUid(layer);

Expand All @@ -249,7 +247,7 @@ exports.Controller_.prototype.unregisterLayer_ = function(layer) {
};


exports.Controller_.prototype.$onDestroy = function() {
Controller.prototype.$onDestroy = function() {
this.unregisterLayer_(this.dataLayerGroup_);
};

Expand All @@ -258,7 +256,7 @@ exports.Controller_.prototype.$onDestroy = function() {
* @param {string} msg Disclaimer message.
* @private
*/
exports.Controller_.prototype.showDisclaimerMessage_ = function(msg) {
Controller.prototype.showDisclaimerMessage_ = function(msg) {
msg = this.gettextCatalog_.getString(msg);
if (this.external) {
if (this.msgs_.indexOf(msg) < 0) {
Expand All @@ -281,7 +279,7 @@ exports.Controller_.prototype.showDisclaimerMessage_ = function(msg) {
* @param {string} msg Disclaimer message.
* @private
*/
exports.Controller_.prototype.closeDisclaimerMessage_ = function(msg) {
Controller.prototype.closeDisclaimerMessage_ = function(msg) {
msg = this.gettextCatalog_.getString(msg);
if (this.external) {
this.visibility = false;
Expand Down Expand Up @@ -348,7 +346,7 @@ exports.Controller_.prototype.closeDisclaimerMessage_ = function(msg) {
* @ngname gmfDisclaimer
*/
const component = {
controller: exports.Controller_,
controller: Controller,
bindings: {
'popup': '<?gmfDisclaimerPopup',
'map': '=gmfDisclaimerMap',
Expand Down
2 changes: 1 addition & 1 deletion contribs/gmf/src/disclaimer/module.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @module gmf.disclaimer.module
*/
import * as angular from 'angular';
import angular from 'angular';
import gmfDisclaimerComponent from 'gmf/disclaimer/component.js';

/**
Expand Down