Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/2.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Oct 17, 2018
2 parents bcb6e08 + 561834c commit 6e5d3ca
Show file tree
Hide file tree
Showing 24 changed files with 405 additions and 134 deletions.
30 changes: 7 additions & 23 deletions contribs/gmf/apps/desktop/index.html.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<span class="fa fa-print"></span>
</button>
<button ngeo-btn class="btn btn-default" ng-model="mainCtrl.drawFeatureActive"
data-toggle="tooltip" data-placement="left" data-original-title="{{'Draw & Measure'|translate}}">
data-toggle="tooltip" data-placement="left" data-original-title="{{'Draw and Measure'|translate}}">
<span class="fa fa-paint-brush"></span>
</button>
<button ngeo-btn class="btn btn-default" ng-model="mainCtrl.filterSelectorActive"
Expand All @@ -78,10 +78,6 @@
data-toggle="tooltip" data-placement="left" data-original-title="{{'Profile'|translate}}">
<span class="fa fa-chart-area"></span>
</button>
<button ngeo-btn class="btn btn-default" ng-model="mainCtrl.googleStreetViewActive"
data-toggle="tooltip" data-placement="left" data-original-title="{{'Street View'|translate}}">
<span class="fa fa-street-view"></span>
</button>
<button ngeo-btn class="btn btn-default" ng-model="mainCtrl.importDataSourceActive"
data-toggle="tooltip" data-placement="left" data-original-title="{{'Import Layer'|translate}}">
<span class="fa fa-upload"></span>
Expand All @@ -97,14 +93,16 @@
</div>
<div
class="gmf-app-tools-content container-fluid"
ng-class="{'gmf-app-active': mainCtrl.toolsActive,'gmf-app-googlestreetview-active': mainCtrl.googleStreetViewActive }">
ng-class="{'gmf-app-active': mainCtrl.toolsActive}">
<div ng-show="mainCtrl.loginActive" class="row">
<div class="col-sm-12">
<div class="gmf-app-tools-content-heading">
{{'Login' | translate}}
<a class="btn close" ng-click="mainCtrl.loginActive = false">&times;</a>
</div>
<gmf-authentication></gmf-authentication>
<gmf-authentication
gmf-authentication-info-message="mainCtrl.loginInfoMessage"
></gmf-authentication>
</div>
</div>
<div ng-show="mainCtrl.printPanelActive" class="row">
Expand All @@ -122,7 +120,7 @@
<div ng-show="mainCtrl.drawFeatureActive" class="row">
<div class="col-sm-12">
<div class="gmf-app-tools-content-heading">
{{'Draw & Measure'|translate}}
{{'Draw and Measure'|translate}}
<a class="btn close" ng-click="mainCtrl.drawFeatureActive = false">&times;</a>
</div>
<gmf-drawfeature
Expand Down Expand Up @@ -189,19 +187,6 @@
</div>
</div>
</div>
<div ng-show="mainCtrl.googleStreetViewActive" class="row">
<div class="col-sm-12">
<div class="gmf-app-tools-content-heading">
{{'Street View'|translate}}
<a class="btn close" ng-click="mainCtrl.googleStreetViewActive = false">&times;</a>
</div>
<ngeo-googlestreetview
active="mainCtrl.googleStreetViewActive"
feature-style="mainCtrl.googleStreetViewStyle"
map="mainCtrl.map">
</ngeo-googlestreetview>
</div>
</div>
<div ng-show="mainCtrl.importDataSourceActive" class="row">
<div class="col-sm-12">
<div class="gmf-app-tools-content-heading">
Expand Down Expand Up @@ -323,8 +308,7 @@
ngeo-resizemap-state="profileChartActive">
</gmf-profile>
</footer>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=es6,default-3.6"></script>
<script src="https://maps.googleapis.com/maps/api/js?v=3&key=AIzaSyCYnqxEQA5sz13sWSgMr97ejzvUeGP8gz4"></script>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=es6,default-3.6,Array.prototype.includes"></script>
<% for (var chunk in htmlWebpackPlugin.files.chunks) { %>
<script src="<%= htmlWebpackPlugin.files.chunks[chunk].entry %>"></script>
<% } %>
Expand Down
7 changes: 4 additions & 3 deletions contribs/gmf/apps/desktop_alt/index.html.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<span class="fa fa-print"></span>
</button>
<button ngeo-btn class="btn btn-default" ng-model="mainCtrl.drawFeatureActive"
data-toggle="tooltip" data-placement="left" data-original-title="{{'Draw & Measure'|translate}}">
data-toggle="tooltip" data-placement="left" data-original-title="{{'Draw and Measure'|translate}}">
<span class="fa fa-paint-brush"></span>
</button>
<button ngeo-btn class="btn btn-default" ng-model="mainCtrl.filterSelectorActive"
Expand Down Expand Up @@ -105,6 +105,7 @@
<a class="btn close" ng-click="mainCtrl.loginActive = false">&times;</a>
</div>
<gmf-authentication
gmf-authentication-info-message="mainCtrl.loginInfoMessage"
gmf-authentication-allow-password-reset="::false"
gmf-authentication-allow-password-change="::false">
</gmf-authentication>
Expand Down Expand Up @@ -136,7 +137,7 @@
<div ng-show="mainCtrl.drawFeatureActive" class="row">
<div class="col-sm-12">
<div class="gmf-app-tools-content-heading">
{{'Draw & Measure'|translate}}
{{'Draw and Measure'|translate}}
<a class="btn close" ng-click="mainCtrl.drawFeatureActive = false">&times;</a>
</div>
<gmf-drawfeature
Expand Down Expand Up @@ -353,7 +354,7 @@
ngeo-resizemap-state="queryGridActive">
</gmf-displayquerygrid>
</footer>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=es6,default-3.6"></script>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=es6,default-3.6,Array.prototype.includes"></script>
<script src="https://maps.googleapis.com/maps/api/js?v=3&key=AIzaSyCYnqxEQA5sz13sWSgMr97ejzvUeGP8gz4"></script>
<% for (var chunk in htmlWebpackPlugin.files.chunks) { %>
<script src="<%= htmlWebpackPlugin.files.chunks[chunk].entry %>"></script>
Expand Down
3 changes: 2 additions & 1 deletion contribs/gmf/apps/mobile/index.html.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@
</ul>
</div>
<gmf-authentication id="login" class="gmf-mobile-nav-slide" data-header-title="{{'Login' | translate}}"
gmf-authentication-info-message="mainCtrl.loginInfoMessage"
gmf-mobile-nav-back="authCtrl.gmfUser.username !== null">
</gmf-authentication>
</nav>
Expand All @@ -171,7 +172,7 @@
</gmf-authentication>
</div>
</ngeo-modal>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=es6,default-3.6"></script>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=es6,default-3.6,Array.prototype.includes"></script>
<% for (var chunk in htmlWebpackPlugin.files.chunks) { %>
<script src="<%= htmlWebpackPlugin.files.chunks[chunk].entry %>"></script>
<% } %>
Expand Down
3 changes: 2 additions & 1 deletion contribs/gmf/apps/mobile_alt/index.html.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,11 @@
</ul>
</div>
<gmf-authentication id="login" class="gmf-mobile-nav-slide" data-header-title="{{'Login' | translate}}"
gmf-authentication-info-message="mainCtrl.loginInfoMessage"
gmf-mobile-nav-back="authCtrl.gmfUser.username !== null">
</gmf-authentication>
</nav>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=es6,default-3.6"></script>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=es6,default-3.6,Array.prototype.includes"></script>
<% for (var chunk in htmlWebpackPlugin.files.chunks) { %>
<script src="<%= htmlWebpackPlugin.files.chunks[chunk].entry %>"></script>
<% } %>
Expand Down
4 changes: 4 additions & 0 deletions contribs/gmf/apps/oeedit/Controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,10 @@ exports.module.run(/* @ngInject */ ($templateCache) => {
$templateCache.put('gmf/contextualdata', require('./contextualdata.html'));
});

exports.module.value('gmfPermalinkOptions', /** @type {gmfx.PermalinkOptions} */ ({
pointRecenterZoom: 10
}));

exports.module.controller('OEEditController', exports);

export default exports;
2 changes: 1 addition & 1 deletion contribs/gmf/apps/oeedit/index.html.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@
ngeo-resizemap-state="profileChartActive">
</gmf-profile>
</footer>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=es6"></script>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=es6,default-3.6,Array.prototype.includes"></script>
<% for (var chunk in htmlWebpackPlugin.files.chunks) { %>
<script src="<%= htmlWebpackPlugin.files.chunks[chunk].entry %>"></script>
<% } %>
Expand Down
1 change: 1 addition & 0 deletions contribs/gmf/apps/oeview/index.html.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
ngeo-resizemap-state="profileChartActive">
</gmf-profile>
</footer>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=es6,default-3.6,Array.prototype.includes"></script>
<% for (var chunk in htmlWebpackPlugin.files.chunks) { %>
<script src="<%= htmlWebpackPlugin.files.chunks[chunk].entry %>"></script>
<% } %>
Expand Down
8 changes: 8 additions & 0 deletions contribs/gmf/externs/gmf-themes.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,14 @@ gmfThemes.GmfLayer = function() {};
gmfThemes.GmfLayer.prototype.dimensions;


/**
* The dimensions applied by filters on the layer configuration, if the value
* is null we will take the dimension from the application.
* @type {!ngeox.DimensionsFiltersConfig}
*/
gmfThemes.GmfLayer.prototype.dimensionsFilters;


/**
* @type {boolean|undefined}
*/
Expand Down
11 changes: 10 additions & 1 deletion contribs/gmf/options/gmfx.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,8 @@ gmfx.PasswordValidator;
* crosshairStyle: (Array<(null|ol.style.Style)>|null|ol.FeatureStyleFunction|ol.style.Style|undefined),
* crosshairEnabledByDefault: (boolean|undefined),
* projectionCodes: (Array.<string>|undefined),
* useLocalStorage: (boolean|undefined)
* useLocalStorage: (boolean|undefined),
* pointRecenterZoom: (number|undefined)
* }}
*/
gmfx.PermalinkOptions;
Expand Down Expand Up @@ -283,6 +284,14 @@ gmfx.PermalinkOptions.prototype.projectionCodes;
gmfx.PermalinkOptions.prototype.useLocalStorage;


/**
* Zoom level to use when result is a single point feature. If not set the map
* is not zoomed to a specific zoom level.
* @type {number|undefined}
*/
gmfx.PermalinkOptions.prototype.pointRecenterZoom


/**
* Fields that can come from a print v3 server and can be used in the partial
* of the gmf print panel.
Expand Down
5 changes: 5 additions & 0 deletions contribs/gmf/src/authentication/component.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ <h4 class="modal-title">
</div>

<div ng-if="!$ctrl.gmfUser.username">

<div class="alert alert-warning" ng-show="$ctrl.infoMessage">
<span>{{ $ctrl.infoMessage }}</span>
</div>

<form
name="loginForm"
role="form"
Expand Down
11 changes: 10 additions & 1 deletion contribs/gmf/src/authentication/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ function gmfAuthenticationTemplateUrl($element, $attrs, gmfAuthenticationTemplat
* Example:
*
* <gmf-authentication
* gmf-authentication-info-message="mainCtrl.loginInfoMessage"
* gmf-authentication-allow-password-change="::true">
* </gmf-authentication>
*
Expand All @@ -80,6 +81,7 @@ function gmfAuthenticationTemplateUrl($element, $attrs, gmfAuthenticationTemplat
* should also allow the user to change its password. Don't add this option alone, use
* it in a dedicated authentication component, in a ngeo-modal, directly in
* your index.html (see example 2.)
* @htmlAttribute {string} gmf-authentication-info-message Message to show above the authentication form.
*
* Example 2:
*
Expand Down Expand Up @@ -107,7 +109,8 @@ exports.component_ = {
'allowPasswordReset': '<?gmfAuthenticationAllowPasswordReset',
'allowPasswordChange': '<?gmfAuthenticationAllowPasswordChange',
'passwordValidator': '<?gmfAuthenticationPasswordValidator',
'forcePasswordChange': '<?gmfAuthenticationForcePasswordChange'
'forcePasswordChange': '<?gmfAuthenticationForcePasswordChange',
'infoMessage': '=?gmfAuthenticationInfoMessage'
},
controller: 'GmfAuthenticationController',
templateUrl: gmfAuthenticationTemplateUrl
Expand Down Expand Up @@ -190,6 +193,12 @@ exports.AuthenticationController_ = class {
*/
this.forcePasswordChange;

/**
* @type {?string}
* @export
*/
this.infoMessage = null;

/**
* @type {boolean}
* @export
Expand Down
34 changes: 34 additions & 0 deletions contribs/gmf/src/controllers/AbstractAppController.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,44 @@ const exports = function(config, $scope, $injector) {
});
};

/**
* Url to redirect to after login success.
* @type {?string}
*/
this.loginRedirectUrl = null;

/**
* Information message for the login form.
* @type {?string}
*/
this.loginInfoMessage = null;

$scope.$on('authenticationrequired', (event, args) => {
/** @type {angularGettext.Catalog} */
const gettextCatalog = $injector.get('gettextCatalog');
this.loginInfoMessage = gettextCatalog.getString(
'Some layers in this link are not accessible to unauthenticated users. ' +
'Please log in to see whole data.');
this.loginRedirectUrl = args.url;
this.loginActive = true;

const unbind = $scope.$watch(() => this.loginActive, () => {
if (!this.loginActive) {
this.loginInfoMessage = null;
this.loginRedirectUrl = null;
unbind();
}
});
});

/**
* @param {gmfx.AuthenticationEvent} evt Event.
*/
const userChange = (evt) => {
if (this.loginRedirectUrl) {
window.location = this.loginRedirectUrl;
return;
}
const user = evt.detail.user;
const roleId = (user.username !== null) ? user.role_id : undefined;

Expand Down

0 comments on commit 6e5d3ca

Please sign in to comment.