aboutsummaryrefslogtreecommitdiff
path: root/src/client/northstar
diff options
context:
space:
mode:
authorab <abdullah_ahmed@brown.edu>2019-04-19 17:06:56 -0400
committerab <abdullah_ahmed@brown.edu>2019-04-19 17:06:56 -0400
commitd77951f2f29b5b7b4869128116c3627d77e2c73b (patch)
tree81a0a02dc59af308ec322920a2060ac1b53d15f2 /src/client/northstar
parentbe1976fb0ba33064978ee973993b3a2316cdf43c (diff)
parentecae4ae106be3e07471208cb93ec0965548d2d12 (diff)
Merge commit 'ecae4ae' into new_search
Diffstat (limited to 'src/client/northstar')
-rw-r--r--src/client/northstar/dash-fields/HistogramField.ts12
-rw-r--r--src/client/northstar/dash-nodes/HistogramBox.tsx4
-rw-r--r--src/client/northstar/manager/Gateway.ts16
-rw-r--r--src/client/northstar/model/binRanges/VisualBinRangeHelper.ts2
4 files changed, 13 insertions, 21 deletions
diff --git a/src/client/northstar/dash-fields/HistogramField.ts b/src/client/northstar/dash-fields/HistogramField.ts
index 82de51d56..c699691a4 100644
--- a/src/client/northstar/dash-fields/HistogramField.ts
+++ b/src/client/northstar/dash-fields/HistogramField.ts
@@ -6,6 +6,7 @@ import { BasicField } from "../../../fields/BasicField";
import { Field, FieldId } from "../../../fields/Field";
import { CurrentUserUtils } from "../../../server/authentication/models/current_user_utils";
import { Types } from "../../../server/Message";
+import { OmitKeys } from "../../../Utils";
export class HistogramField extends BasicField<HistogramOperation> {
@@ -13,17 +14,8 @@ export class HistogramField extends BasicField<HistogramOperation> {
super(data ? data : HistogramOperation.Empty, save, id);
}
- omitKeys(obj: any, keys: any) {
- var dup: any = {};
- for (var key in obj) {
- if (keys.indexOf(key) === -1) {
- dup[key] = obj[key];
- }
- }
- return dup;
- }
toString(): string {
- return JSON.stringify(this.omitKeys(this.Data, ['Links', 'BrushLinks', 'Result', 'BrushColors', 'FilterModels', 'FilterOperand']));
+ return JSON.stringify(OmitKeys(this.Data, ['Links', 'BrushLinks', 'Result', 'BrushColors', 'FilterModels', 'FilterOperand']));
}
Copy(): Field {
diff --git a/src/client/northstar/dash-nodes/HistogramBox.tsx b/src/client/northstar/dash-nodes/HistogramBox.tsx
index 2084fc346..0e84ace50 100644
--- a/src/client/northstar/dash-nodes/HistogramBox.tsx
+++ b/src/client/northstar/dash-nodes/HistogramBox.tsx
@@ -8,7 +8,7 @@ import { KeyStore } from "../../../fields/KeyStore";
import { CurrentUserUtils } from "../../../server/authentication/models/current_user_utils";
import { ChartType, VisualBinRange } from '../../northstar/model/binRanges/VisualBinRange';
import { VisualBinRangeHelper } from "../../northstar/model/binRanges/VisualBinRangeHelper";
-import { AggregateBinRange, AggregateFunction, BinRange, Catalog, DoubleValueAggregateResult, HistogramResult, Result } from "../../northstar/model/idea/idea";
+import { AggregateBinRange, AggregateFunction, BinRange, Catalog, DoubleValueAggregateResult, HistogramResult } from "../../northstar/model/idea/idea";
import { ModelHelpers } from "../../northstar/model/ModelHelpers";
import { HistogramOperation } from "../../northstar/operations/HistogramOperation";
import { SizeConverter } from "../../northstar/utils/SizeConverter";
@@ -118,7 +118,7 @@ export class HistogramBox extends React.Component<FieldViewProps> {
this.props.Document.GetTAsync(this.props.fieldKey, HistogramField).then((histoOp: Opt<HistogramField>) => runInAction(() => {
this.HistoOp = histoOp ? histoOp.Data : HistogramOperation.Empty;
if (this.HistoOp !== HistogramOperation.Empty) {
- reaction(() => this.props.Document.GetList(KeyStore.LinkedFromDocs, []), (docs: Document[]) => this.HistoOp.Links.splice(0, this.HistoOp.Links.length, ...docs), { fireImmediately: true });
+ reaction(() => this.props.Document.GetList(KeyStore.LinkedFromDocs, [] as Document[]), (docs) => this.HistoOp.Links.splice(0, this.HistoOp.Links.length, ...docs), { fireImmediately: true });
reaction(() => this.props.Document.GetList(KeyStore.BrushingDocs, []).length,
() => {
let brushingDocs = this.props.Document.GetList(KeyStore.BrushingDocs, [] as Document[]);
diff --git a/src/client/northstar/manager/Gateway.ts b/src/client/northstar/manager/Gateway.ts
index 207a9ad19..d26f2724f 100644
--- a/src/client/northstar/manager/Gateway.ts
+++ b/src/client/northstar/manager/Gateway.ts
@@ -36,7 +36,7 @@ export class Gateway {
public async ClearCatalog(): Promise<void> {
try {
- const json = await this.MakePostJsonRequest("Datamart/ClearAllAugmentations", {});
+ await this.MakePostJsonRequest("Datamart/ClearAllAugmentations", {});
}
catch (error) {
throw new Error("can not reach northstar's backend");
@@ -180,18 +180,18 @@ export class Gateway {
public static ConstructUrl(appendix: string): string {
- let base = Settings.Instance.ServerUrl;
+ let base = NorthstarSettings.Instance.ServerUrl;
if (base.slice(-1) === "/") {
base = base.slice(0, -1);
}
- let url = base + "/" + Settings.Instance.ServerApiPath + "/" + appendix;
+ let url = base + "/" + NorthstarSettings.Instance.ServerApiPath + "/" + appendix;
return url;
}
}
declare var ENV: any;
-export class Settings {
+export class NorthstarSettings {
private _environment: any;
@observable
@@ -248,10 +248,10 @@ export class Settings {
return window.location.origin + "/";
}
- private static _instance: Settings;
+ private static _instance: NorthstarSettings;
@action
- public Update(environment: any): void {
+ public UpdateEnvironment(environment: any): void {
/*let serverParam = new URL(document.URL).searchParams.get("serverUrl");
if (serverParam) {
if (serverParam === "debug") {
@@ -278,9 +278,9 @@ export class Settings {
this.DegreeOfParallelism = environment.DEGREE_OF_PARALLISM;
}
- public static get Instance(): Settings {
+ public static get Instance(): NorthstarSettings {
if (!this._instance) {
- this._instance = new Settings();
+ this._instance = new NorthstarSettings();
}
return this._instance;
}
diff --git a/src/client/northstar/model/binRanges/VisualBinRangeHelper.ts b/src/client/northstar/model/binRanges/VisualBinRangeHelper.ts
index 9671e55f8..a92412686 100644
--- a/src/client/northstar/model/binRanges/VisualBinRangeHelper.ts
+++ b/src/client/northstar/model/binRanges/VisualBinRangeHelper.ts
@@ -4,7 +4,7 @@ import { NominalVisualBinRange } from "./NominalVisualBinRange";
import { QuantitativeVisualBinRange } from "./QuantitativeVisualBinRange";
import { AlphabeticVisualBinRange } from "./AlphabeticVisualBinRange";
import { DateTimeVisualBinRange } from "./DateTimeVisualBinRange";
-import { Settings } from "../../manager/Gateway";
+import { NorthstarSettings } from "../../manager/Gateway";
import { ModelHelpers } from "../ModelHelpers";
import { AttributeTransformationModel } from "../../core/attribute/AttributeTransformationModel";