diff --git a/CHANGES.md b/CHANGES.md index a52f7ed19..f9ef67085 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,7 +3,7 @@ **Bug fixes** -* +* Show POIs on dive detail page 2.21.1 / 2019-09-11 =================== diff --git a/src/app/config/factories.js b/src/app/config/factories.js index adbb0ceb0..d6880595f 100644 --- a/src/app/config/factories.js +++ b/src/app/config/factories.js @@ -15,6 +15,7 @@ function settingsFactory(globalSettings) { servicesUrl = globalSettings.API_URL + '/' + globalSettings.API_DIR + '/$lang/' + globalSettings.SERVICES_FILE, eventsUrl = globalSettings.API_URL + '/' + globalSettings.API_DIR + '/$lang/' + globalSettings.TOURISTIC_EVENTS_FILE, touristicUrl = globalSettings.API_URL + '/' + globalSettings.API_DIR + '/$lang/' + globalSettings.TOURISTIC_CONTENTS_FILE, + diveUrl = globalSettings.API_URL + '/' + globalSettings.API_DIR + '/$lang/' + globalSettings.DIVES_DIR + '/', divesUrl = globalSettings.API_URL + '/' + globalSettings.API_DIR + '/$lang/' + globalSettings.DIVES_FILE, flatUrl = globalSettings.API_URL + '/' + globalSettings.API_DIR + '/$lang/' + globalSettings.FLAT_FILE, warningCategoriesUrl = globalSettings.API_URL + '/' + globalSettings.API_DIR + '/$lang/' + globalSettings.WARNING_CAT_DIR + '/' + globalSettings.WARNING_CAT_FILE, @@ -48,6 +49,7 @@ function settingsFactory(globalSettings) { servicesUrl: servicesUrl, eventsUrl: eventsUrl, touristicUrl: touristicUrl, + diveUrl: diveUrl, divesUrl: divesUrl, flatUrl: flatUrl, warningCategoriesUrl: warningCategoriesUrl, diff --git a/src/app/config/settings.default.json b/src/app/config/settings.default.json index 7aaafda71..97af00e1a 100644 --- a/src/app/config/settings.default.json +++ b/src/app/config/settings.default.json @@ -125,6 +125,7 @@ "DEPARTURE_ARRIVAL_ICON": "", "API_DIR": "api", "TREKS_DIR": "treks", + "DIVES_DIR": "dives", "TREKS_FILE": "treks.geojson", "POI_FILE": "pois.geojson", "SERVICES_FILE": "services.geojson", diff --git a/src/app/detail/controllers.js b/src/app/detail/controllers.js index 3ab08425d..89fe795c3 100644 --- a/src/app/detail/controllers.js +++ b/src/app/detail/controllers.js @@ -233,7 +233,7 @@ function DetailController($scope, $rootScope, $state, $q, $modal, $timeout, $sta function getPoisOfResult(result, forceRefresh) { var deferred = $q.defer(); - poisService.getPoisFromElement(result.id, forceRefresh) + poisService.getPoisFromElement(result, forceRefresh) .then( function (elementPois) { $scope.pois = elementPois.features; @@ -248,8 +248,7 @@ function DetailController($scope, $rootScope, $state, $q, $modal, $timeout, $sta function getInterests(result, forceRefresh) { var promises = [], activeDefaultType = null; - - if (result.properties.contentType === 'trek') { + if (result.properties.contentType === 'trek' || result.properties.contentType === 'dive') { promises.push( getPoisOfResult(result, forceRefresh) .then( diff --git a/src/app/detail/templates/detail-aside.html b/src/app/detail/templates/detail-aside.html index af7e809b9..e438948f3 100644 --- a/src/app/detail/templates/detail-aside.html +++ b/src/app/detail/templates/detail-aside.html @@ -47,7 +47,7 @@ -
+
{{ 'POI' | translate }} diff --git a/src/app/detail/templates/detail-content-elevation.html b/src/app/detail/templates/detail-content-elevation.html index f32cda033..287f3b142 100644 --- a/src/app/detail/templates/detail-content-elevation.html +++ b/src/app/detail/templates/detail-content-elevation.html @@ -1,4 +1,4 @@ -
+

{{'PROFILE_ALTI' | translate}}

diff --git a/src/app/dives/services.js b/src/app/dives/services.js index 767a76148..b229bdd34 100644 --- a/src/app/dives/services.js +++ b/src/app/dives/services.js @@ -14,7 +14,7 @@ function divesService(globalSettings, settingsFactory, translationService, $q, $ /** * Dives Type */ - dive.properties.diveType = 'dive'; + dive.properties.contentType = 'dive'; /** * Dives IDs diff --git a/src/app/items-list/templates/items-list.html b/src/app/items-list/templates/items-list.html index 74b8aebb0..08b341d79 100644 --- a/src/app/items-list/templates/items-list.html +++ b/src/app/items-list/templates/items-list.html @@ -36,8 +36,8 @@

{{::'DEPTH_S' | translate}} {{result.properties.depth}} m {{::result.properties.difficulty.label}} {{::level.label}} - {{::result.properties.type1[0].name}} - {{::result.properties.type2[0].name}} + {{::result.properties.type1[0].name}} + {{::result.properties.type2[0].name}} {{::result.properties.target_audience}}

diff --git a/src/app/map/services.js b/src/app/map/services.js index 9d6a6d732..aa7286e22 100644 --- a/src/app/map/services.js +++ b/src/app/map/services.js @@ -32,7 +32,7 @@ function mapService($rootScope, $q, $state, $resource, $translate, $filter, util controlServices.addTo(this.map); var classServices = controlServices.getContainer().classList; - if (element.properties.contentType === 'trek') { + if (element.properties.contentType === 'trek' || element.properties.contentType === 'dive') { servicesService.getServicesFromElement(element.id) .then( function (services) { @@ -162,7 +162,7 @@ function mapService($rootScope, $q, $state, $resource, $translate, $filter, util } promises.push( - poisService.getPoisFromElement(element.id, true) + poisService.getPoisFromElement(element, true) .then( function (pois) { var counter = 0; diff --git a/src/app/pois/services.js b/src/app/pois/services.js index cf8335e52..1295a2a1b 100644 --- a/src/app/pois/services.js +++ b/src/app/pois/services.js @@ -68,11 +68,15 @@ function poisService($resource, $q, globalSettings, settingsFactory, translation }; - this.getPoisFromElement = function getPoisFromElement (elementId) { - + this.getPoisFromElement = function getPoisFromElement (element) { var deferred = $q.defer(); var currentLang = translationService.getCurrentLang(); - var url = settingsFactory.trekUrl.replace(/\$lang/, currentLang) + elementId + '/' + globalSettings.POI_FILE; + if (element.properties.contentType === 'trek') { + var url = settingsFactory.trekUrl.replace(/\$lang/, currentLang) + element.id + '/' + globalSettings.POI_FILE; + } + if (element.properties.contentType === 'dive') { + var url = settingsFactory.diveUrl.replace(/\$lang/, currentLang) + element.id + '/' + globalSettings.POI_FILE; + } var requests = $resource(url, {}, { query: { diff --git a/src/app/warning/services.js b/src/app/warning/services.js index 586ebe649..0b4168e5b 100644 --- a/src/app/warning/services.js +++ b/src/app/warning/services.js @@ -277,7 +277,7 @@ function WarningMapService(globalSettings, utilsFactory, iconsService, layersSer type = 'geojson'; elementLocation = []; } else { - currentLayer = (result.properties.contentType === 'trek' ? self._treksMarkersLayer : self._touristicsMarkersLayer); + currentLayer = (result.properties.contentType === 'trek' || result.properties.contentType === 'dive' ? self._treksMarkersLayer : self._touristicsMarkersLayer); type = 'category'; elementLocation = utilsFactory.getStartPoint(result); }