Rename map-store-map-config-provider middleware

This commit is contained in:
Daniel García Aubert 2018-03-07 18:53:20 +01:00
parent faaf121eb6
commit 6c2f893651

View File

@ -47,7 +47,7 @@ LayergroupController.prototype.register = function(app) {
cors(),
userMiddleware(),
this.prepareContext,
getMapStoreMapConfigProvider(this.mapStore, this.userLimitsApi),
createMapStoreMapConfigProvider(this.mapStore, this.userLimitsApi),
getTile(this.tileBackend, 'map_tile'),
setCacheControlHeader(),
setLastModifiedHeader(),
@ -66,7 +66,7 @@ LayergroupController.prototype.register = function(app) {
cors(),
userMiddleware(),
this.prepareContext,
getMapStoreMapConfigProvider(this.mapStore, this.userLimitsApi),
createMapStoreMapConfigProvider(this.mapStore, this.userLimitsApi),
getTile(this.tileBackend, 'map_tile'),
setCacheControlHeader(),
setLastModifiedHeader(),
@ -86,7 +86,7 @@ LayergroupController.prototype.register = function(app) {
cors(),
userMiddleware(),
this.prepareContext,
getMapStoreMapConfigProvider(this.mapStore, this.userLimitsApi),
createMapStoreMapConfigProvider(this.mapStore, this.userLimitsApi),
getTile(this.tileBackend, 'maplayer_tile'),
setCacheControlHeader(),
setLastModifiedHeader(),
@ -105,7 +105,7 @@ LayergroupController.prototype.register = function(app) {
cors(),
userMiddleware(),
this.prepareContext,
getMapStoreMapConfigProvider(this.mapStore, this.userLimitsApi),
createMapStoreMapConfigProvider(this.mapStore, this.userLimitsApi),
getFeatureAttributes(this.attributesBackend),
setCacheControlHeader(),
setLastModifiedHeader(),
@ -123,7 +123,7 @@ LayergroupController.prototype.register = function(app) {
userMiddleware(),
allowQueryParams(['layer']),
this.prepareContext,
getMapStoreMapConfigProvider(this.mapStore, this.userLimitsApi, forcedFormat),
createMapStoreMapConfigProvider(this.mapStore, this.userLimitsApi, forcedFormat),
getPreviewImageByCenter(this.previewBackend),
setCacheControlHeader(),
setLastModifiedHeader(),
@ -139,7 +139,7 @@ LayergroupController.prototype.register = function(app) {
userMiddleware(),
allowQueryParams(['layer']),
this.prepareContext,
getMapStoreMapConfigProvider(this.mapStore, this.userLimitsApi, forcedFormat),
createMapStoreMapConfigProvider(this.mapStore, this.userLimitsApi, forcedFormat),
getPreviewImageByBoundingBox(this.previewBackend),
setCacheControlHeader(),
setLastModifiedHeader(),
@ -173,7 +173,7 @@ LayergroupController.prototype.register = function(app) {
userMiddleware(),
allowQueryParams(allowedDataviewQueryParams),
this.prepareContext,
getMapStoreMapConfigProvider(this.mapStore, this.userLimitsApi),
createMapStoreMapConfigProvider(this.mapStore, this.userLimitsApi),
getDataview(this.dataviewBackend),
setCacheControlHeader(),
setLastModifiedHeader(),
@ -189,7 +189,7 @@ LayergroupController.prototype.register = function(app) {
userMiddleware(),
allowQueryParams(allowedDataviewQueryParams),
this.prepareContext,
getMapStoreMapConfigProvider(this.mapStore, this.userLimitsApi),
createMapStoreMapConfigProvider(this.mapStore, this.userLimitsApi),
getDataview(this.dataviewBackend),
setCacheControlHeader(),
setLastModifiedHeader(),
@ -205,7 +205,7 @@ LayergroupController.prototype.register = function(app) {
userMiddleware(),
allowQueryParams(allowedDataviewQueryParams),
this.prepareContext,
getMapStoreMapConfigProvider(this.mapStore, this.userLimitsApi),
createMapStoreMapConfigProvider(this.mapStore, this.userLimitsApi),
dataviewSearch(this.dataviewBackend),
setCacheControlHeader(),
setLastModifiedHeader(),
@ -221,7 +221,7 @@ LayergroupController.prototype.register = function(app) {
userMiddleware(),
allowQueryParams(allowedDataviewQueryParams),
this.prepareContext,
getMapStoreMapConfigProvider(this.mapStore, this.userLimitsApi),
createMapStoreMapConfigProvider(this.mapStore, this.userLimitsApi),
dataviewSearch(this.dataviewBackend),
setCacheControlHeader(),
setLastModifiedHeader(),
@ -282,8 +282,8 @@ function getRequestParams(locals) {
return params;
}
function getMapStoreMapConfigProvider (mapStore, userLimitsApi, forcedFormat = null) {
return function getMapStoreMapConfigProviderMiddleware (req, res, next) {
function createMapStoreMapConfigProvider (mapStore, userLimitsApi, forcedFormat = null) {
return function createMapStoreMapConfigProviderMiddleware (req, res, next) {
const { user } = res.locals;
const params = getRequestParams(res.locals);