fixing code after code review
This commit is contained in:
Родитель
975433b8b2
Коммит
3d8cebd517
|
@ -7,7 +7,7 @@ import utils from '../utils';
|
|||
interface IConfigurationsActions {
|
||||
loadConfiguration(): any;
|
||||
loadDashboard(id: string): any;
|
||||
loadDashboardComplete(dashboard: IDashboardConfig): any;
|
||||
loadDashboardComplete(dashboard: IDashboardConfig): { dashboard: IDashboardConfig };
|
||||
createDashboard(dashboard: IDashboardConfig): any;
|
||||
loadTemplate(id: string): any;
|
||||
saveConfiguration(dashboard: IDashboardConfig): any;
|
||||
|
@ -84,7 +84,7 @@ class ConfigurationsActions extends AbstractActions implements IConfigurationsAc
|
|||
};
|
||||
}
|
||||
|
||||
loadDashboardComplete(dashboard: IDashboardConfig): any {
|
||||
loadDashboardComplete(dashboard: IDashboardConfig): { dashboard: IDashboardConfig } {
|
||||
return { dashboard };
|
||||
}
|
||||
|
||||
|
|
|
@ -123,8 +123,9 @@ export default class Scorecard extends GenericComponent<IScorecardProps, any> {
|
|||
return;
|
||||
}
|
||||
|
||||
let evt = typeof event !== 'undefined' && event || arguments[2];
|
||||
evt.preventDefault();
|
||||
let eventObject = typeof event !== 'undefined' && event || arguments[2];
|
||||
eventObject.preventDefault();
|
||||
|
||||
var { title } = this.props || '' as any;
|
||||
var args = { ...value };
|
||||
this.trigger(value.onClick, args);
|
||||
|
|
|
@ -99,7 +99,7 @@ export default class ApplicationInsightsQuery extends DataSourcePlugin<IQueryPar
|
|||
});
|
||||
}
|
||||
|
||||
var dashboardId = ConfigurationsStore.getState().dashboard.id;
|
||||
let dashboardId = ConfigurationsStore.getState().dashboard.id;
|
||||
|
||||
return (dispatch) => {
|
||||
request(
|
||||
|
@ -132,7 +132,7 @@ export default class ApplicationInsightsQuery extends DataSourcePlugin<IQueryPar
|
|||
}
|
||||
|
||||
// Map tables to appropriate results
|
||||
var resultTables = tables.filter((aTable, idx) => {
|
||||
let resultTables = tables.filter((aTable, idx) => {
|
||||
return idx < resultStatus.length &&
|
||||
(resultStatus[idx].Kind === 'QueryResult' || resultStatus[idx].Kind === 'PrimaryResults');
|
||||
});
|
||||
|
@ -216,7 +216,7 @@ export default class ApplicationInsightsQuery extends DataSourcePlugin<IQueryPar
|
|||
mappings = mappings || {};
|
||||
|
||||
return table.Rows.map((rowValues, rowIdx) => {
|
||||
var row = {};
|
||||
let row = {};
|
||||
|
||||
table.Columns.forEach((col, idx) => {
|
||||
row[col.ColumnName] = rowValues[idx];
|
||||
|
|
|
@ -33,8 +33,8 @@ export default class CosmosDBQuery extends DataSourcePlugin<IQueryParams> {
|
|||
*/
|
||||
dependenciesUpdated(dependencies: any) {
|
||||
let emptyDependency = false;
|
||||
Object.keys(this._props.dependencies).forEach(k => {
|
||||
if (typeof dependencies[k] === 'undefined') { emptyDependency = true; }
|
||||
Object.keys(this._props.dependencies).forEach(dependencyKey => {
|
||||
if (typeof dependencies[dependencyKey] === 'undefined') { emptyDependency = true; }
|
||||
});
|
||||
|
||||
// If one of the dependencies is not supplied, do not run the query
|
||||
|
|
|
@ -52,15 +52,15 @@ export function scorecard (
|
|||
|
||||
let checkValue = (values && values[0] && values[0][countField]) || 0;
|
||||
|
||||
let createValue = (value: any, heading: string, color: string, icon: string, sv?: any, sh?: string) => {
|
||||
let createValue = (value: any, heading: string, color: string, icon: string, subValue?: any, subHeading?: string) => {
|
||||
let item = {};
|
||||
const prefix = getPrefix(format);
|
||||
item[prefix + 'value'] = isFinite(value) ? utils.kmNumber(value, postfix) : '-';
|
||||
item[prefix + 'heading'] = heading;
|
||||
item[prefix + 'color'] = color;
|
||||
item[prefix + 'icon'] = icon;
|
||||
item[prefix + 'subvalue'] = isFinite(sv) ? sv : '';
|
||||
item[prefix + 'subheading'] = sh || '';
|
||||
item[prefix + 'subvalue'] = isFinite(subValue) ? subValue : '';
|
||||
item[prefix + 'subheading'] = subHeading || '';
|
||||
return item;
|
||||
};
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче