aboutsummaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/client')
-rw-r--r--src/client/northstar/dash-fields/HistogramField.ts5
-rw-r--r--src/client/views/collections/collectionFreeForm/CollectionFreeFormLayoutEngines.tsx11
2 files changed, 9 insertions, 7 deletions
diff --git a/src/client/northstar/dash-fields/HistogramField.ts b/src/client/northstar/dash-fields/HistogramField.ts
index f3365e73d..076516977 100644
--- a/src/client/northstar/dash-fields/HistogramField.ts
+++ b/src/client/northstar/dash-fields/HistogramField.ts
@@ -7,7 +7,7 @@ import { ObjectField } from "../../../new_fields/ObjectField";
import { CurrentUserUtils } from "../../../server/authentication/models/current_user_utils";
import { OmitKeys } from "../../../Utils";
import { Deserializable } from "../../util/SerializationHelper";
-import { Copy, ToScriptString } from "../../../new_fields/FieldSymbols";
+import { Copy, ToScriptString, ToString } from "../../../new_fields/FieldSymbols";
function serialize(field: HistogramField) {
const obj = OmitKeys(field, ['Links', 'BrushLinks', 'Result', 'BrushColors', 'FilterModels', 'FilterOperand']).omit;
@@ -60,4 +60,7 @@ export class HistogramField extends ObjectField {
[ToScriptString]() {
return this.toString();
}
+ [ToString]() {
+ return this.toString();
+ }
} \ No newline at end of file
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormLayoutEngines.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormLayoutEngines.tsx
index 8c8da63cc..5924c3afb 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormLayoutEngines.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormLayoutEngines.tsx
@@ -7,8 +7,10 @@ import { OverlayView, OverlayElementOptions } from "../../OverlayView";
import { emptyFunction } from "../../../../Utils";
import React = require("react");
import { ObservableMap, runInAction } from "mobx";
-import { Id } from "../../../../new_fields/FieldSymbols";
+import { Id, ToString } from "../../../../new_fields/FieldSymbols";
import { DateField } from "../../../../new_fields/DateField";
+import { ObjectField } from "../../../../new_fields/ObjectField";
+import { RefField } from "../../../../new_fields/RefField";
interface PivotData {
type: string;
@@ -35,11 +37,8 @@ export interface ViewDefResult {
}
function toLabel(target: FieldResult<Field>) {
- if (target instanceof DateField) {
- const date = DateCast(target).date;
- if (date) {
- return `${date.toDateString()} ${date.toTimeString()}`;
- }
+ if (target instanceof ObjectField || target instanceof RefField) {
+ return target[ToString]();
}
return String(target);
}