d2-analysis
Advanced tools
Comparing version 0.0.11 to 0.0.12
@@ -10,2 +10,4 @@ 'use strict'; | ||
var _d2Analysis = require('d2-analysis'); | ||
var Axis = exports.Axis = undefined; | ||
@@ -20,3 +22,3 @@ | ||
config.forEach(function (dimension) { | ||
t.push(new Api.Dimension(dimension).val()); | ||
t.push(new _d2Analysis.Dimension(dimension).val()); | ||
}); | ||
@@ -23,0 +25,0 @@ |
@@ -10,2 +10,4 @@ 'use strict'; | ||
var _d2Analysis = require('d2-analysis'); | ||
var Dimension = exports.Dimension = undefined; | ||
@@ -24,3 +26,3 @@ | ||
t.items = config.items.map(function (record) { | ||
return new Api.Record(record).val(); | ||
return new _d2Analysis.Record(record).val(); | ||
}); | ||
@@ -27,0 +29,0 @@ }; |
@@ -10,2 +10,4 @@ 'use strict'; | ||
var _d2Analysis = require('d2-analysis'); | ||
var Layout = exports.Layout = undefined; | ||
@@ -20,5 +22,5 @@ | ||
// constructor | ||
t.columns = Api.Axis(config.columns).val(); | ||
t.rows = Api.Axis(config.rows).val(); | ||
t.filters = Api.Axis(config.filters).val(); | ||
t.columns = (0, _d2Analysis.Axis)(config.columns).val(); | ||
t.rows = (0, _d2Analysis.Axis)(config.rows).val(); | ||
t.filters = (0, _d2Analysis.Axis)(config.filters).val(); | ||
@@ -40,3 +42,3 @@ t.showColTotals = (0, _d2Utilizr.isBoolean)(config.colTotals) ? config.colTotals : (0, _d2Utilizr.isBoolean)(config.showColTotals) ? config.showColTotals : true; | ||
t.legendSet = new Api.Record(config.legendSet).val(true); | ||
t.legendSet = new _d2Analysis.Record(config.legendSet).val(true); | ||
@@ -181,3 +183,3 @@ t.parentGraphMap = (0, _d2Utilizr.isObject)(config.parentGraphMap) ? config.parentGraphMap : null; | ||
displayProperty = this.displayProperty || 'name', | ||
request = new Api.Request(), | ||
request = new _d2Analysis.Request(), | ||
i; | ||
@@ -184,0 +186,0 @@ |
@@ -10,2 +10,4 @@ 'use strict'; | ||
var _d2Analysis = require('d2-analysis'); | ||
var Response = exports.Response = undefined; | ||
@@ -20,3 +22,3 @@ | ||
t.headers = (config.headers || []).map(function (header) { | ||
return new Api.ResponseHeader(header); | ||
return new _d2Analysis.ResponseHeader(header); | ||
}); | ||
@@ -27,3 +29,3 @@ | ||
t.rows = (config.rows || []).map(function (row) { | ||
return Api.ResponseRow(row); | ||
return (0, _d2Analysis.ResponseRow)(row); | ||
}); | ||
@@ -106,3 +108,3 @@ | ||
ids.forEach(function (id) { | ||
records.push(new Api.Record({ | ||
records.push(new _d2Analysis.Record({ | ||
id: id, | ||
@@ -139,3 +141,3 @@ name: metaData.names[id] | ||
this.rows.forEach(function (responseRow) { | ||
idCombination = new Api.ResponseRowIdCombination(); | ||
idCombination = new _d2Analysis.ResponseRowIdCombination(); | ||
@@ -157,3 +159,3 @@ headerIndexOrder.forEach(function (index) { | ||
Response.prototype.getValue = function (param, layout) { | ||
var id = param instanceof Api.ResponseRowIdCombination ? param.get() : param; | ||
var id = param instanceof _d2Analysis.ResponseRowIdCombination ? param.get() : param; | ||
@@ -160,0 +162,0 @@ return this.getIdValueMap(layout)[param]; |
@@ -6,3 +6,3 @@ 'use strict'; | ||
}); | ||
exports.config = exports.manager = exports.pivot = exports.api = undefined; | ||
exports.config = exports.manager = exports.pivot = exports.api = exports.UiConfig = exports.OptionConfig = exports.PeriodConfig = exports.DimensionConfig = exports.SessionStorageManager = exports.RequestManager = exports.I18nManager = exports.CalendarManager = exports.DateManager = exports.AppManager = exports.Table = exports.TableAxis = exports.Response = exports.ResponseRowIdCombination = exports.ResponseRow = exports.ResponseHeader = exports.Request = exports.Layout = exports.Axis = exports.Dimension = exports.Record = undefined; | ||
@@ -41,2 +41,4 @@ var _Record = require('./api/Record.js'); | ||
var _SessionStorageManager = require('./manager/SessionStorageManager.js'); | ||
var _DimensionConfig = require('./config/DimensionConfig.js'); | ||
@@ -50,2 +52,23 @@ | ||
exports.Record = _Record.Record; | ||
exports.Dimension = _Dimension.Dimension; | ||
exports.Axis = _Axis.Axis; | ||
exports.Layout = _Layout.Layout; | ||
exports.Request = _Request.Request; | ||
exports.ResponseHeader = _ResponseHeader.ResponseHeader; | ||
exports.ResponseRow = _ResponseRow.ResponseRow; | ||
exports.ResponseRowIdCombination = _ResponseRowIdCombination.ResponseRowIdCombination; | ||
exports.Response = _Response.Response; | ||
exports.TableAxis = _TableAxis.TableAxis; | ||
exports.Table = _Table.Table; | ||
exports.AppManager = _AppManager.AppManager; | ||
exports.DateManager = _DateManager.DateManager; | ||
exports.CalendarManager = _CalendarManager.CalendarManager; | ||
exports.I18nManager = _I18nManager.I18nManager; | ||
exports.RequestManager = _RequestManager.RequestManager; | ||
exports.SessionStorageManager = _SessionStorageManager.SessionStorageManager; | ||
exports.DimensionConfig = _DimensionConfig.DimensionConfig; | ||
exports.PeriodConfig = _PeriodConfig.PeriodConfig; | ||
exports.OptionConfig = _OptionConfig.OptionConfig; | ||
exports.UiConfig = _UiConfig.UiConfig; | ||
var api = exports.api = { | ||
@@ -52,0 +75,0 @@ Record: _Record.Record, |
@@ -123,2 +123,12 @@ 'use strict'; | ||
AppManager.prototype.setAuth = function (env) { | ||
if (!(env === 'production' && !(this.manifest && (0, _d2Utilizr.isString)(this.manifest.activities.dhis.auth)))) { | ||
$.ajaxSetup({ | ||
headers: { | ||
Authorization: 'Basic ' + btoa(this.manifest.activities.dhis.auth) | ||
} | ||
}); | ||
} | ||
}; | ||
// dep 1 | ||
@@ -125,0 +135,0 @@ |
{ | ||
"name": "d2-analysis", | ||
"version": "0.0.11", | ||
"version": "0.0.12", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
import {arrayFrom} from 'd2-utilizr'; | ||
import {Dimension} from 'd2-analysis'; | ||
@@ -12,3 +13,3 @@ export var Axis; | ||
config.forEach(function(dimension) { | ||
t.push((new Api.Dimension(dimension)).val()); | ||
t.push((new Dimension(dimension)).val()); | ||
}); | ||
@@ -15,0 +16,0 @@ |
import {isObject, arrayFrom, arrayContains, arrayPluck, arrayUnique} from 'd2-utilizr'; | ||
import {Record} from 'd2-analysis'; | ||
@@ -16,3 +17,3 @@ export var Dimension; | ||
t.items = config.items.map(function(record) { | ||
return (new Api.Record(record)).val(); | ||
return (new Record(record)).val(); | ||
}); | ||
@@ -19,0 +20,0 @@ }; |
import {isString, isNumber, isBoolean, isObject, isDefined, arrayFrom, arrayContains, arrayClean, arrayPluck} from 'd2-utilizr'; | ||
import {Axis, Record, Request} from 'd2-analysis'; | ||
@@ -12,5 +13,5 @@ export var Layout; | ||
// constructor | ||
t.columns = (Api.Axis(config.columns)).val(); | ||
t.rows = (Api.Axis(config.rows)).val(); | ||
t.filters = (Api.Axis(config.filters)).val(); | ||
t.columns = (Axis(config.columns)).val(); | ||
t.rows = (Axis(config.rows)).val(); | ||
t.filters = (Axis(config.filters)).val(); | ||
@@ -32,3 +33,3 @@ t.showColTotals = isBoolean(config.colTotals) ? config.colTotals : (isBoolean(config.showColTotals) ? config.showColTotals : true); | ||
t.legendSet = (new Api.Record(config.legendSet)).val(true); | ||
t.legendSet = (new Record(config.legendSet)).val(true); | ||
@@ -170,3 +171,3 @@ t.parentGraphMap = isObject(config.parentGraphMap) ? config.parentGraphMap : null; | ||
displayProperty = this.displayProperty || 'name', | ||
request = new Api.Request(), | ||
request = new Request(), | ||
i; | ||
@@ -173,0 +174,0 @@ |
import {isObject, arrayFrom, arrayClean} from 'd2-utilizr'; | ||
import {Record, ResponseHeader, ResponseRow, ResponseRowIdCombination} from 'd2-analysis'; | ||
@@ -12,3 +13,3 @@ export var Response; | ||
t.headers = (config.headers || []).map(function(header) { | ||
return new Api.ResponseHeader(header); | ||
return new ResponseHeader(header); | ||
}); | ||
@@ -19,3 +20,3 @@ | ||
t.rows = (config.rows || []).map(function(row) { | ||
return Api.ResponseRow(row); | ||
return ResponseRow(row); | ||
}); | ||
@@ -98,3 +99,3 @@ | ||
ids.forEach(function(id) { | ||
records.push((new Api.Record({ | ||
records.push((new Record({ | ||
id: id, | ||
@@ -131,3 +132,3 @@ name: metaData.names[id] | ||
this.rows.forEach(function(responseRow) { | ||
idCombination = new Api.ResponseRowIdCombination(); | ||
idCombination = new ResponseRowIdCombination(); | ||
@@ -149,3 +150,3 @@ headerIndexOrder.forEach(function(index) { | ||
Response.prototype.getValue = function(param, layout) { | ||
var id = param instanceof Api.ResponseRowIdCombination ? param.get() : param; | ||
var id = param instanceof ResponseRowIdCombination ? param.get() : param; | ||
@@ -152,0 +153,0 @@ return this.getIdValueMap(layout)[param]; |
@@ -19,2 +19,3 @@ import {Record} from './api/Record.js'; | ||
import {RequestManager} from './manager/RequestManager.js'; | ||
import {SessionStorageManager} from './manager/SessionStorageManager.js'; | ||
@@ -26,2 +27,29 @@ import {DimensionConfig} from './config/DimensionConfig.js'; | ||
export { | ||
Record, | ||
Dimension, | ||
Axis, | ||
Layout, | ||
Request, | ||
ResponseHeader, | ||
ResponseRow, | ||
ResponseRowIdCombination, | ||
Response, | ||
TableAxis, | ||
Table, | ||
AppManager, | ||
DateManager, | ||
CalendarManager, | ||
I18nManager, | ||
RequestManager, | ||
SessionStorageManager, | ||
DimensionConfig, | ||
PeriodConfig, | ||
OptionConfig, | ||
UiConfig | ||
}; | ||
export const api = { | ||
@@ -28,0 +56,0 @@ Record: Record, |
@@ -149,2 +149,12 @@ import {isString, arrayFrom, arrayClean, arraySort} from 'd2-utilizr'; | ||
AppManager.prototype.setAuth = function(env) { | ||
if (!(env === 'production' && !(this.manifest && isString(this.manifest.activities.dhis.auth)))) { | ||
$.ajaxSetup({ | ||
headers: { | ||
Authorization: 'Basic ' + btoa(this.manifest.activities.dhis.auth) | ||
} | ||
}); | ||
} | ||
}; | ||
// dep 1 | ||
@@ -151,0 +161,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
348108
70
4689