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