aboutsummaryrefslogtreecommitdiff
path: root/src/client/northstar/core
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2019-04-09 08:53:24 -0400
committerBob Zeleznik <zzzman@gmail.com>2019-04-09 08:53:24 -0400
commit37763de22835e3a4a7ad995eb089d23054109c3d (patch)
treeb84bb1453328b3158a0473fc53126846c0b061ac /src/client/northstar/core
parent78e098c4ecb95b90482e7d27fd82fb857de96bb4 (diff)
parentcf86d1b7917f0317af550293344f784a341bd7b9 (diff)
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web
Diffstat (limited to 'src/client/northstar/core')
-rw-r--r--src/client/northstar/core/BaseObject.ts6
-rw-r--r--src/client/northstar/core/attribute/AttributeModel.ts10
-rw-r--r--src/client/northstar/core/attribute/AttributeTransformationModel.ts19
-rw-r--r--src/client/northstar/core/attribute/CalculatedAttributeModel.ts6
-rw-r--r--src/client/northstar/core/brusher/IBaseBrushable.ts4
-rw-r--r--src/client/northstar/core/brusher/IBaseBrusher.ts2
-rw-r--r--src/client/northstar/core/filter/FilterModel.ts8
-rw-r--r--src/client/northstar/core/filter/IBaseFilterConsumer.ts4
-rw-r--r--src/client/northstar/core/filter/IBaseFilterProvider.ts2
-rw-r--r--src/client/northstar/core/filter/ValueComparision.ts22
10 files changed, 46 insertions, 37 deletions
diff --git a/src/client/northstar/core/BaseObject.ts b/src/client/northstar/core/BaseObject.ts
index e9e766e31..ed3818071 100644
--- a/src/client/northstar/core/BaseObject.ts
+++ b/src/client/northstar/core/BaseObject.ts
@@ -1,10 +1,10 @@
-import { IEquatable } from '../utils/IEquatable'
-import { IDisposable } from '../utils/IDisposable'
+import { IEquatable } from '../utils/IEquatable';
+import { IDisposable } from '../utils/IDisposable';
export class BaseObject implements IEquatable, IDisposable {
public Equals(other: Object): boolean {
- return this == other;
+ return this === other;
}
public Dispose(): void {
diff --git a/src/client/northstar/core/attribute/AttributeModel.ts b/src/client/northstar/core/attribute/AttributeModel.ts
index 124a5b45a..c89b1617c 100644
--- a/src/client/northstar/core/attribute/AttributeModel.ts
+++ b/src/client/northstar/core/attribute/AttributeModel.ts
@@ -1,5 +1,5 @@
-import { Attribute, DataType, VisualizationHint } from '../../model/idea/idea'
-import { BaseObject } from '../BaseObject'
+import { Attribute, DataType, VisualizationHint } from '../../model/idea/idea';
+import { BaseObject } from '../BaseObject';
import { observable } from "mobx";
export abstract class AttributeModel extends BaseObject {
@@ -34,7 +34,7 @@ export class ColumnAttributeModel extends AttributeModel {
}
public Equals(other: ColumnAttributeModel): boolean {
- return this.Attribute.rawName == other.Attribute.rawName;
+ return this.Attribute.rawName === other.Attribute.rawName;
}
}
@@ -93,7 +93,7 @@ export class BackendAttributeModel extends AttributeModel {
}
public get DisplayName(): string {
- return this._displayName.ReplaceAll("_", " ");;
+ return this._displayName.ReplaceAll("_", " ");
}
public get CodeName(): string {
@@ -105,7 +105,7 @@ export class BackendAttributeModel extends AttributeModel {
}
public Equals(other: BackendAttributeModel): boolean {
- return this.Id == other.Id;
+ return this.Id === other.Id;
}
} \ No newline at end of file
diff --git a/src/client/northstar/core/attribute/AttributeTransformationModel.ts b/src/client/northstar/core/attribute/AttributeTransformationModel.ts
index cc5aa7154..66485183b 100644
--- a/src/client/northstar/core/attribute/AttributeTransformationModel.ts
+++ b/src/client/northstar/core/attribute/AttributeTransformationModel.ts
@@ -1,4 +1,4 @@
-;
+
import { computed, observable } from "mobx";
import { AggregateFunction } from "../../model/idea/idea";
import { AttributeModel } from "./AttributeModel";
@@ -20,16 +20,21 @@ export class AttributeTransformationModel implements IEquatable {
if (this.AggregateFunction === AggregateFunction.Count) {
return "count";
}
- if (this.AggregateFunction === AggregateFunction.Avg)
+ if (this.AggregateFunction === AggregateFunction.Avg) {
displayName = "avg(" + displayName + ")";
- else if (this.AggregateFunction === AggregateFunction.Max)
+ }
+ else if (this.AggregateFunction === AggregateFunction.Max) {
displayName = "max(" + displayName + ")";
- else if (this.AggregateFunction === AggregateFunction.Min)
+ }
+ else if (this.AggregateFunction === AggregateFunction.Min) {
displayName = "min(" + displayName + ")";
- else if (this.AggregateFunction === AggregateFunction.Sum)
+ }
+ else if (this.AggregateFunction === AggregateFunction.Sum) {
displayName = "sum(" + displayName + ")";
- else if (this.AggregateFunction === AggregateFunction.SumE)
+ }
+ else if (this.AggregateFunction === AggregateFunction.SumE) {
displayName = "sumE(" + displayName + ")";
+ }
return displayName;
}
@@ -41,7 +46,7 @@ export class AttributeTransformationModel implements IEquatable {
}
public Equals(other: AttributeTransformationModel): boolean {
- return this.AggregateFunction == other.AggregateFunction &&
+ return this.AggregateFunction === other.AggregateFunction &&
this.AttributeModel.Equals(other.AttributeModel);
}
} \ No newline at end of file
diff --git a/src/client/northstar/core/attribute/CalculatedAttributeModel.ts b/src/client/northstar/core/attribute/CalculatedAttributeModel.ts
index ab96c794d..a197c1305 100644
--- a/src/client/northstar/core/attribute/CalculatedAttributeModel.ts
+++ b/src/client/northstar/core/attribute/CalculatedAttributeModel.ts
@@ -1,5 +1,5 @@
import { BackendAttributeModel, AttributeModel, CodeAttributeModel } from "./AttributeModel";
-import { DataType, VisualizationHint } from '../../model/idea/idea'
+import { DataType, VisualizationHint } from '../../model/idea/idea';
export class CalculatedAttributeManager {
public static AllCalculatedAttributes: Array<AttributeModel> = new Array<AttributeModel>();
@@ -11,7 +11,7 @@ export class CalculatedAttributeManager {
public static CreateBackendAttributeModel(id: string, dataType: DataType, displayName: string, codeName: string, visualizationHints: VisualizationHint[]): BackendAttributeModel {
var filtered = this.AllCalculatedAttributes.filter(am => {
if (am instanceof BackendAttributeModel &&
- am.Id == id) {
+ am.Id === id) {
return true;
}
return false;
@@ -27,7 +27,7 @@ export class CalculatedAttributeManager {
public static CreateCodeAttributeModel(code: string, codeName: string, visualizationHints: VisualizationHint[]): CodeAttributeModel {
var filtered = this.AllCalculatedAttributes.filter(am => {
if (am instanceof CodeAttributeModel &&
- am.CodeName == codeName) {
+ am.CodeName === codeName) {
return true;
}
return false;
diff --git a/src/client/northstar/core/brusher/IBaseBrushable.ts b/src/client/northstar/core/brusher/IBaseBrushable.ts
index 99a36636f..c46db4d22 100644
--- a/src/client/northstar/core/brusher/IBaseBrushable.ts
+++ b/src/client/northstar/core/brusher/IBaseBrushable.ts
@@ -1,6 +1,6 @@
-import { PIXIPoint } from '../../utils/MathUtil'
+import { PIXIPoint } from '../../utils/MathUtil';
import { IEquatable } from '../../utils/IEquatable';
-import { Document } from '../../../../fields/Document'
+import { Document } from '../../../../fields/Document';
export interface IBaseBrushable<T> extends IEquatable {
BrusherModels: Array<Document>;
diff --git a/src/client/northstar/core/brusher/IBaseBrusher.ts b/src/client/northstar/core/brusher/IBaseBrusher.ts
index d7ae65464..d2de6ed62 100644
--- a/src/client/northstar/core/brusher/IBaseBrusher.ts
+++ b/src/client/northstar/core/brusher/IBaseBrusher.ts
@@ -1,4 +1,4 @@
-import { PIXIPoint } from '../../utils/MathUtil'
+import { PIXIPoint } from '../../utils/MathUtil';
import { IEquatable } from '../../utils/IEquatable';
diff --git a/src/client/northstar/core/filter/FilterModel.ts b/src/client/northstar/core/filter/FilterModel.ts
index aee99d2b6..e2ba3f652 100644
--- a/src/client/northstar/core/filter/FilterModel.ts
+++ b/src/client/northstar/core/filter/FilterModel.ts
@@ -15,7 +15,7 @@ export class FilterModel {
public Equals(other: FilterModel): boolean {
if (!Utils.EqualityHelper(this, other)) return false;
- if (!this.isSame(this.ValueComparisons, (other as FilterModel).ValueComparisons)) return false;
+ if (!this.isSame(this.ValueComparisons, (other).ValueComparisons)) return false;
return true;
}
@@ -46,16 +46,16 @@ export class FilterModel {
let filtered = baseOperation.FilterModels.filter(fm => fm && fm.ValueComparisons.length > 0);
if (!isFirst && filtered.length > 0) {
filterModels.push(...filtered);
- ret = "(" + baseOperation.FilterModels.filter(fm => fm != null).map(fm => fm.ToPythonString()).join(" || ") + ")";
+ ret = "(" + baseOperation.FilterModels.filter(fm => fm !== null).map(fm => fm.ToPythonString()).join(" || ") + ")";
}
if (Utils.isBaseFilterConsumer(baseOperation) && baseOperation.Links) {
let children = new Array<string>();
let linkedGraphNodes = baseOperation.Links;
linkedGraphNodes.map(linkVm => {
let filterDoc = linkVm.Get(KeyStore.LinkedFromDocs);
- if (filterDoc && filterDoc != FieldWaiting && filterDoc instanceof Document) {
+ if (filterDoc && filterDoc !== FieldWaiting && filterDoc instanceof Document) {
let filterHistogram = filterDoc.GetT(KeyStore.Data, HistogramField);
- if (filterHistogram && filterHistogram != FieldWaiting) {
+ if (filterHistogram && filterHistogram !== FieldWaiting) {
if (!visitedFilterProviders.has(filterHistogram.Data)) {
let child = FilterModel.GetFilterModelsRecursive(filterHistogram.Data, visitedFilterProviders, filterModels, false);
if (child !== "") {
diff --git a/src/client/northstar/core/filter/IBaseFilterConsumer.ts b/src/client/northstar/core/filter/IBaseFilterConsumer.ts
index 93f66a154..59d7adf4c 100644
--- a/src/client/northstar/core/filter/IBaseFilterConsumer.ts
+++ b/src/client/northstar/core/filter/IBaseFilterConsumer.ts
@@ -1,5 +1,5 @@
-import { FilterOperand } from '../filter/FilterOperand'
-import { IEquatable } from '../../utils/IEquatable'
+import { FilterOperand } from '../filter/FilterOperand';
+import { IEquatable } from '../../utils/IEquatable';
import { Document } from "../../../../fields/Document";
export interface IBaseFilterConsumer extends IEquatable {
diff --git a/src/client/northstar/core/filter/IBaseFilterProvider.ts b/src/client/northstar/core/filter/IBaseFilterProvider.ts
index d082bfe12..fc3301b11 100644
--- a/src/client/northstar/core/filter/IBaseFilterProvider.ts
+++ b/src/client/northstar/core/filter/IBaseFilterProvider.ts
@@ -1,4 +1,4 @@
-import { FilterModel } from '../filter/FilterModel'
+import { FilterModel } from '../filter/FilterModel';
export interface IBaseFilterProvider {
FilterModels: Array<FilterModel>;
diff --git a/src/client/northstar/core/filter/ValueComparision.ts b/src/client/northstar/core/filter/ValueComparision.ts
index 1e729d06e..80b1242a9 100644
--- a/src/client/northstar/core/filter/ValueComparision.ts
+++ b/src/client/northstar/core/filter/ValueComparision.ts
@@ -1,5 +1,5 @@
-import { Predicate } from '../../model/idea/idea'
-import { Utils } from '../../utils/Utils'
+import { Predicate } from '../../model/idea/idea';
+import { Utils } from '../../utils/Utils';
import { AttributeModel } from '../attribute/AttributeModel';
export class ValueComparison {
@@ -15,15 +15,19 @@ export class ValueComparison {
}
public Equals(other: Object): boolean {
- if (!Utils.EqualityHelper(this, other))
+ if (!Utils.EqualityHelper(this, other)) {
return false;
- if (this.Predicate !== (other as ValueComparison).Predicate)
+ }
+ if (this.Predicate !== (other as ValueComparison).Predicate) {
return false;
+ }
let isComplex = (typeof this.Value === "object");
- if (!isComplex && this.Value != (other as ValueComparison).Value)
+ if (!isComplex && this.Value !== (other as ValueComparison).Value) {
return false;
- if (isComplex && !this.Value.Equals((other as ValueComparison).Value))
+ }
+ if (isComplex && !this.Value.Equals((other as ValueComparison).Value)) {
return false;
+ }
return true;
}
@@ -58,13 +62,13 @@ export class ValueComparison {
var rawName = this.attributeModel.CodeName;
switch (this.Predicate) {
case Predicate.STARTS_WITH:
- ret += rawName + " != null && " + rawName + ".StartsWith(" + val + ") ";
+ ret += rawName + " !== null && " + rawName + ".StartsWith(" + val + ") ";
return ret;
case Predicate.ENDS_WITH:
- ret += rawName + " != null && " + rawName + ".EndsWith(" + val + ") ";
+ ret += rawName + " !== null && " + rawName + ".EndsWith(" + val + ") ";
return ret;
case Predicate.CONTAINS:
- ret += rawName + " != null && " + rawName + ".Contains(" + val + ") ";
+ ret += rawName + " !== null && " + rawName + ".Contains(" + val + ") ";
return ret;
default:
ret += rawName + " " + op + " " + val + " ";