diff --git a/src/Moryx.Runtime.Maintenance.Web.UI/src/modules/components/ConfigEditor/CollectionEditor.tsx b/src/Moryx.Runtime.Maintenance.Web.UI/src/modules/components/ConfigEditor/CollectionEditor.tsx index 14e6d03..e5cae90 100644 --- a/src/Moryx.Runtime.Maintenance.Web.UI/src/modules/components/ConfigEditor/CollectionEditor.tsx +++ b/src/Moryx.Runtime.Maintenance.Web.UI/src/modules/components/ConfigEditor/CollectionEditor.tsx @@ -8,8 +8,14 @@ import Icon from "@mdi/react"; import * as React from "react"; import { Button, ButtonGroup, Col, Collapse, Container, DropdownItem, DropdownMenu, DropdownToggle, Input, Row } from "reactstrap"; import Entry from "../../models/Entry"; +import { EntryValueType } from "../../models/EntryValueType"; +import BooleanEditor from "./BooleanEditor"; +import ByteEditor from "./ByteEditor"; import CollapsibleEntryEditorBase, { CollapsibleEntryEditorBasePropModel } from "./CollapsibleEntryEditorBase"; import ConfigEditor from "./ConfigEditor"; +import EnumEditor from "./EnumEditor"; +import NumberEditor from "./NumberEditor"; +import StringEditor from "./StringEditor"; interface CollectionEditorStateModel { SelectedEntry: string; @@ -74,6 +80,35 @@ export default class CollectionEditor extends CollapsibleEntryEditorBase); + } + case EntryValueType.Boolean: { + return (); + } + case EntryValueType.Int16: + case EntryValueType.UInt16: + case EntryValueType.Int32: + case EntryValueType.UInt32: + case EntryValueType.Int64: + case EntryValueType.UInt64: + case EntryValueType.Single: + case EntryValueType.Double: { + return (); + } + case EntryValueType.String: { + return (); + } + case EntryValueType.Enum: { + return (); + } + } + + return (Not implemented yet: {entry.Value.Type}); + } + return { - this.props.Entry.SubEntries.map((entry, idx) => -
- - {entry.DisplayName} - - - - - - - - - - {this.preRenderConfigEditor(entry)} - -
, - ) + this.props.Entry.SubEntries.map((entry, idx) => { + if (Entry.isClassOrCollection(entry)) { + return ( +
+ + {entry.DisplayName} + + + + + + + + + + {this.preRenderConfigEditor(entry)} + +
+ ); + } else { + return ( +
+ + {this.preRenderConfigEditor(entry)} + + + + + + +
+ ); + } + }) } diff --git a/src/Moryx.Runtime.Maintenance.Web.UI/src/modules/models/Entry.ts b/src/Moryx.Runtime.Maintenance.Web.UI/src/modules/models/Entry.ts index bd491b2..8e2457d 100644 --- a/src/Moryx.Runtime.Maintenance.Web.UI/src/modules/models/Entry.ts +++ b/src/Moryx.Runtime.Maintenance.Web.UI/src/modules/models/Entry.ts @@ -7,6 +7,7 @@ import uuidv1 = require("uuid/v1"); import Config from "./Config"; import EntryValidation from "./EntryValidation"; import EntryValue from "./EntryValue"; +import { EntryValueType } from "./EntryValueType"; export default class Entry { public DisplayName: string; @@ -27,6 +28,10 @@ export default class Entry { this.Validation = new EntryValidation(); } + public static isClassOrCollection(entry: Entry): boolean { + return entry.Value.Type === EntryValueType.Class || entry.Value.Type === EntryValueType.Collection; + } + public static entryChain(entry: Entry): Entry[] { const entryChain: Entry[] = [entry]; let currentEntry = entry;