Every editor page will instantiate its own editor service
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -11,6 +11,7 @@ import {EditorService} from '../../../service/editor.service';
|
||||
})
|
||||
export class CodeComponent extends EditorNodeContract implements OnInit {
|
||||
@Input() nodeId: string;
|
||||
@Input() editorUUID?: string;
|
||||
public dirty = false;
|
||||
protected dbRecord: any = {};
|
||||
protected codeRefId!: string;
|
||||
@@ -95,7 +96,7 @@ export class CodeComponent extends EditorNodeContract implements OnInit {
|
||||
protected hadLoad = false;
|
||||
|
||||
constructor(
|
||||
public readonly editorService: EditorService,
|
||||
public editorService: EditorService,
|
||||
public readonly api: ApiService,
|
||||
) { super(); }
|
||||
|
||||
@@ -183,6 +184,7 @@ export class CodeComponent extends EditorNodeContract implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.editorService = this.editorService.getEditor(this.editorUUID);
|
||||
this.editorService.registerNodeEditor(this.nodeId, this).then(() => {
|
||||
this.editorOptions.readOnly = !this.editorService.canEdit();
|
||||
});
|
||||
|
||||
@@ -22,6 +22,7 @@ import {EditorService} from '../../../service/editor.service';
|
||||
})
|
||||
export class DatabaseComponent extends EditorNodeContract implements OnInit {
|
||||
@Input() nodeId: string;
|
||||
@Input() editorUUID?: string;
|
||||
@ViewChild('agGridElement') agGridElement: AgGridAngular;
|
||||
|
||||
public dbRecord: any;
|
||||
@@ -41,7 +42,7 @@ export class DatabaseComponent extends EditorNodeContract implements OnInit {
|
||||
protected modals: ModalController,
|
||||
protected alerts: AlertController,
|
||||
protected loader: LoadingController,
|
||||
public readonly editorService: EditorService,
|
||||
public editorService: EditorService,
|
||||
) { super(); }
|
||||
|
||||
title = 'app';
|
||||
@@ -65,6 +66,7 @@ export class DatabaseComponent extends EditorNodeContract implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.editorService = this.editorService.getEditor(this.editorUUID);
|
||||
this.editorService.registerNodeEditor(this.nodeId, this).then(() => {
|
||||
console.log('database editor', this);
|
||||
});
|
||||
|
||||
@@ -12,6 +12,7 @@ import {EditorNodeContract} from '../../nodes/EditorNode.contract';
|
||||
})
|
||||
export class FilesComponent extends EditorNodeContract implements OnInit {
|
||||
@Input() nodeId: string;
|
||||
@Input() editorUUID: string;
|
||||
@ViewChild('uploadForm') uploadForm: ElementRef;
|
||||
|
||||
public fileRecords: Array<any> = [];
|
||||
@@ -26,7 +27,7 @@ export class FilesComponent extends EditorNodeContract implements OnInit {
|
||||
|
||||
constructor(
|
||||
protected api: ApiService,
|
||||
public readonly editorService: EditorService,
|
||||
public editorService: EditorService,
|
||||
@Inject(APP_BASE_HREF) private baseHref: string
|
||||
) { super(); }
|
||||
|
||||
@@ -76,6 +77,7 @@ export class FilesComponent extends EditorNodeContract implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.editorService = this.editorService.getEditor(this.editorUUID);
|
||||
this.editorService.registerNodeEditor(this.nodeId, this).then(() => {
|
||||
|
||||
});
|
||||
|
||||
@@ -11,6 +11,7 @@ import {v4} from 'uuid';
|
||||
export class MarkdownComponent extends EditorNodeContract implements OnInit {
|
||||
// @ViewChild('editable') editable;
|
||||
@Input() nodeId: string;
|
||||
@Input() editorUUID?: string;
|
||||
|
||||
// public isFocused = false;
|
||||
public initialValue = 'Click to edit...';
|
||||
@@ -29,7 +30,7 @@ export class MarkdownComponent extends EditorNodeContract implements OnInit {
|
||||
};
|
||||
|
||||
constructor(
|
||||
public readonly editorService: EditorService,
|
||||
public editorService: EditorService,
|
||||
) {
|
||||
super();
|
||||
this.contents = this.initialValue;
|
||||
@@ -37,6 +38,7 @@ export class MarkdownComponent extends EditorNodeContract implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.editorService = this.editorService.getEditor(this.editorUUID);
|
||||
this.editorService.registerNodeEditor(this.nodeId, this).then(() => {
|
||||
if ( !this.node.Value ) {
|
||||
this.node.Value = {};
|
||||
|
||||
@@ -10,6 +10,7 @@ import {EditorService} from '../../../service/editor.service';
|
||||
export class NormComponent extends EditorNodeContract implements OnInit {
|
||||
@ViewChild('editable') editable;
|
||||
@Input() nodeId: string;
|
||||
@Input() editorUUID?: string;
|
||||
|
||||
public isFocused = false;
|
||||
public initialValue = 'Click to edit...';
|
||||
@@ -19,7 +20,7 @@ export class NormComponent extends EditorNodeContract implements OnInit {
|
||||
protected hadOneFocusOut = false;
|
||||
|
||||
constructor(
|
||||
public readonly editorService: EditorService,
|
||||
public editorService: EditorService,
|
||||
) {
|
||||
super();
|
||||
this.contents = this.initialValue;
|
||||
@@ -36,6 +37,7 @@ export class NormComponent extends EditorNodeContract implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.editorService = this.editorService.getEditor(this.editorUUID);
|
||||
this.editorService.registerNodeEditor(this.nodeId, this).then(() => {
|
||||
if ( !this.node.Value ) {
|
||||
this.node.Value = {};
|
||||
|
||||
Reference in New Issue
Block a user