CCM NG: Some bugfixes for the PageModelsEditor
git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@5619 8810af33-2d31-482b-a856-94f89814c4dfpull/2/head
parent
b8985344aa
commit
f71d6fb7ac
|
|
@ -8,7 +8,7 @@ module.exports = {
|
|||
ccmcms: "./src/main/typescript/ccm-cms.ts"
|
||||
},
|
||||
|
||||
mode: "production",
|
||||
mode: "development",
|
||||
|
||||
output: {
|
||||
//path: path.resolve(__dirname, "src/main/resources/dist"),
|
||||
|
|
|
|||
|
|
@ -1153,7 +1153,9 @@ interface ComponentModelEditorProps {
|
|||
class ComponentModelEditor
|
||||
extends React.Component<ComponentModelEditorProps, {}> {
|
||||
|
||||
private static editorComponents: {[type: string]: EditorComponents} = {};
|
||||
private static editorComponents: Map<string, EditorComponents>
|
||||
= new Map<string, EditorComponents>();
|
||||
//{[type: string]: EditorComponents} = {};
|
||||
// private propertiesListComponents: {[type: string]: typeof React.Component};
|
||||
// private editorDialogComponents: {[type: string]: typeof React.Component};
|
||||
|
||||
|
|
@ -1169,10 +1171,12 @@ class ComponentModelEditor
|
|||
public static registerEditorComponents(type: string,
|
||||
components: EditorComponents) {
|
||||
|
||||
ComponentModelEditor.editorComponents = {
|
||||
...ComponentModelEditor.editorComponents,
|
||||
type: components,
|
||||
};
|
||||
ComponentModelEditor.editorComponents.set(type, components);
|
||||
|
||||
// ComponentModelEditor.editorComponents = {
|
||||
// ...ComponentModelEditor.editorComponents,
|
||||
// type: components,
|
||||
// };
|
||||
|
||||
// this.propertiesListComponents = {
|
||||
// ...this.propertiesListComponents,
|
||||
|
|
@ -1188,11 +1192,12 @@ class ComponentModelEditor
|
|||
public render(): React.ReactNode {
|
||||
|
||||
const components: EditorComponents
|
||||
= ComponentModelEditor.editorComponents[this.props.component.type];
|
||||
= this.getEditorComponents(this.props.component.type);
|
||||
//= ComponentModelEditor.editorComponents[this.props.component.type];
|
||||
const PropertiesList: typeof React.Component
|
||||
= components.propertiesList;
|
||||
const EditorDialog: typeof React.Component
|
||||
= components.propertiesList;
|
||||
= components.editorDialog;
|
||||
|
||||
return <li className="componentModelEditor">
|
||||
<PropertiesList component={this.props.component} />
|
||||
|
|
@ -1208,8 +1213,9 @@ class ComponentModelEditor
|
|||
|
||||
private getEditorComponents(type: string): EditorComponents {
|
||||
|
||||
if (ComponentModelEditor.editorComponents.hasOwnProperty(type)) {
|
||||
return ComponentModelEditor.editorComponents[type];
|
||||
if (ComponentModelEditor.editorComponents.has(type)) {
|
||||
return ComponentModelEditor
|
||||
.editorComponents.get(type) as EditorComponents;
|
||||
} else {
|
||||
const basicComponents: EditorComponents = {
|
||||
propertiesList:
|
||||
|
|
|
|||
|
|
@ -2113,6 +2113,23 @@ li.componentModelEditor dialog.dialogExpanded button.closeButton {
|
|||
z-index: 1200;
|
||||
}
|
||||
|
||||
li.componentModelEditor {
|
||||
|
||||
border-bottom: 1px solid #ccc;
|
||||
|
||||
margin-bottom: 1em;
|
||||
|
||||
padding-bottom: 0.33em;
|
||||
}
|
||||
|
||||
li.componentModelEditor dl dt {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
li.componentModelEditor dl dd {
|
||||
margin-bottom: 0.5em;
|
||||
}
|
||||
|
||||
li.componentModelEditor dialog.dialogExpanded h1 {
|
||||
|
||||
background-color: #0776a0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue