aboutsummaryrefslogtreecommitdiff
path: root/src/client/northstar
diff options
context:
space:
mode:
authorlaurawilsonri <laura_wilson@brown.edu>2019-04-15 20:20:46 -0400
committerlaurawilsonri <laura_wilson@brown.edu>2019-04-15 20:20:46 -0400
commitb7a766aa5d53686e032b34d7213ad543108f12c3 (patch)
treed71854e091fa24997a30856d9ac9c937a6cd45d2 /src/client/northstar
parent8b1026d357dd40fc4a00010739d99ffc9db08641 (diff)
parentff6ba4107aa33e021803399180b0d2844fc19d84 (diff)
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into richTextEditor
Diffstat (limited to 'src/client/northstar')
-rw-r--r--src/client/northstar/dash-fields/HistogramField.ts17
-rw-r--r--src/client/northstar/dash-nodes/HistogramBox.tsx2
-rw-r--r--src/client/northstar/manager/Gateway.ts16
-rw-r--r--src/client/northstar/model/binRanges/VisualBinRangeHelper.ts2
4 files changed, 14 insertions, 23 deletions
diff --git a/src/client/northstar/dash-fields/HistogramField.ts b/src/client/northstar/dash-fields/HistogramField.ts
index 6abde4677..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 {
@@ -35,12 +27,11 @@ export class HistogramField extends BasicField<HistogramOperation> {
}
- ToJson(): { type: Types, data: string, _id: string } {
+ ToJson() {
return {
type: Types.HistogramOp,
-
data: this.toString(),
- _id: this.Id
+ id: this.Id
};
}
diff --git a/src/client/northstar/dash-nodes/HistogramBox.tsx b/src/client/northstar/dash-nodes/HistogramBox.tsx
index 2084fc346..3e94fed81 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";
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";