Merge pull request #4495 from ulferts/fix/timelines_api_v2_paths_on_sub_uri

fix paths in timelines when in sub uri context
pull/4497/head
Oliver Günther 9 years ago
commit b9402e760c
  1. 5
      frontend/app/components/common/path-heleper/path-helper.service.js
  2. 14
      frontend/app/timelines/services/timeline-loader-service.js

@ -217,6 +217,11 @@ function PathHelper() {
return PathHelper.apiWorkPackagesPath() + '/column_sums'; return PathHelper.apiWorkPackagesPath() + '/column_sums';
}, },
// API V2
apiV2ProjectsPath: function() {
return PathHelper.apiV2 + '/projects';
},
// API V3 // API V3
apiConfigurationPath: function() { apiConfigurationPath: function() {
return PathHelper.apiV3 + '/configuration'; return PathHelper.apiV3 + '/configuration';

@ -604,7 +604,7 @@ module.exports = function($q, FilterQueryStringBuilder, Color, HistoricalPlannin
this.loader = new QueueingLoader(options.ajax_defaults); this.loader = new QueueingLoader(options.ajax_defaults);
this.dataEnhancer = new DataEnhancer(timeline); this.dataEnhancer = new DataEnhancer(timeline);
this.globalPrefix = PathHelper.staticBase + PathHelper.apiV2; this.globalPrefix = PathHelper.apiV2;
this.die = function () { this.die = function () {
this.dataEnhancer.die.apply(this.dataEnhancer, arguments); this.dataEnhancer.die.apply(this.dataEnhancer, arguments);
@ -659,8 +659,7 @@ module.exports = function($q, FilterQueryStringBuilder, Color, HistoricalPlannin
}; };
TimelineLoader.prototype.registerProjectReportings = function () { TimelineLoader.prototype.registerProjectReportings = function () {
var projectPrefix = this.globalPrefix + var projectPrefix = PathHelper.apiV2ProjectsPath() +
PathHelper.projectsPath() +
"/" + "/" +
this.options.project_id; this.options.project_id;
@ -691,8 +690,7 @@ module.exports = function($q, FilterQueryStringBuilder, Color, HistoricalPlannin
}; };
TimelineLoader.prototype.registerGlobalElements = function () { TimelineLoader.prototype.registerGlobalElements = function () {
var projectPrefix = this.globalPrefix + var projectPrefix = PathHelper.apiV2ProjectsPath() +
PathHelper.projectsPath() +
"/" + "/" +
this.options.project_id; this.options.project_id;
@ -818,8 +816,7 @@ module.exports = function($q, FilterQueryStringBuilder, Color, HistoricalPlannin
TimelineLoader.prototype.registerPlanningElements = function (ids) { TimelineLoader.prototype.registerPlanningElements = function (ids) {
this.inChunks(ids, function (projectIdsOfPacket, i) { this.inChunks(ids, function (projectIdsOfPacket, i) {
var projectPrefix = this.globalPrefix + var projectPrefix = PathHelper.apiV2ProjectsPath() +
PathHelper.projectsPath() +
"/" + "/" +
projectIdsOfPacket.join(','); projectIdsOfPacket.join(',');
@ -850,8 +847,7 @@ module.exports = function($q, FilterQueryStringBuilder, Color, HistoricalPlannin
TimelineLoader.prototype.registerPlanningElementsByID = function (ids) { TimelineLoader.prototype.registerPlanningElementsByID = function (ids) {
this.inChunks(ids, function (planningElementIdsOfPacket, i) { this.inChunks(ids, function (planningElementIdsOfPacket, i) {
var projectPrefix = this.globalPrefix + var projectPrefix = PathHelper.apiV2ProjectsPath() +
PathHelper.projectsPath() +
"/" + "/" +
this.options.project_id; this.options.project_id;

Loading…
Cancel
Save