Clean up read-only support
This commit is contained in:
parent
c300b7cfea
commit
fc247b3570
@ -43,7 +43,7 @@ export class AppComponent implements OnInit {
|
|||||||
public virtualRootPageId?: string;
|
public virtualRootPageId?: string;
|
||||||
public options = {
|
public options = {
|
||||||
isExpandedField: 'expanded',
|
isExpandedField: 'expanded',
|
||||||
animateExpand: true,
|
animateExpand: false,
|
||||||
scrollOnActivate: false,
|
scrollOnActivate: false,
|
||||||
allowDrag: true,
|
allowDrag: true,
|
||||||
allowDrop: (element, { parent, index }) => {
|
allowDrop: (element, { parent, index }) => {
|
||||||
|
@ -236,6 +236,7 @@ export class DatabaseComponent extends EditorNodeContract implements OnInit {
|
|||||||
x.editable = !this.readonly;
|
x.editable = !this.readonly;
|
||||||
x.minWidth = 150;
|
x.minWidth = 150;
|
||||||
x.resizable = true;
|
x.resizable = true;
|
||||||
|
x._parentEditorUUID = this.editorUUID;
|
||||||
|
|
||||||
if ( x.additionalData?.width ) {
|
if ( x.additionalData?.width ) {
|
||||||
x.width = x.additionalData.width;
|
x.width = x.additionalData.width;
|
||||||
|
@ -1,13 +1,14 @@
|
|||||||
import {ICellRendererAngularComp} from 'ag-grid-angular';
|
import {ICellRendererAngularComp} from 'ag-grid-angular';
|
||||||
import {Component} from '@angular/core';
|
import {Component} from '@angular/core';
|
||||||
import {ICellRendererParams} from 'ag-grid-community';
|
import {ICellRendererParams} from 'ag-grid-community';
|
||||||
|
import {EditorService} from '../../../../service/editor.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'editor-boolean-renderer',
|
selector: 'editor-boolean-renderer',
|
||||||
template: `
|
template: `
|
||||||
<ng-container *ngIf="!checkbox">{{ display }}</ng-container>
|
<ng-container *ngIf="!checkbox">{{ display }}</ng-container>
|
||||||
<div *ngIf="checkbox" style="width: 100%; text-align: center; padding-top: 3px;">
|
<div *ngIf="checkbox" style="width: 100%; text-align: center; padding-top: 3px;">
|
||||||
<ion-checkbox [checked]="params.value" (ionChange)="onChecked($event)"></ion-checkbox>
|
<ion-checkbox [checked]="params.value" (ionChange)="onChecked($event)" [disabled]="!editorService.canEdit()"></ion-checkbox>
|
||||||
</div>
|
</div>
|
||||||
`,
|
`,
|
||||||
styles: [`
|
styles: [`
|
||||||
@ -27,9 +28,20 @@ export class BooleanRendererComponent implements ICellRendererAngularComp {
|
|||||||
|
|
||||||
public checked = false;
|
public checked = false;
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
public editorService: EditorService,
|
||||||
|
) { }
|
||||||
|
|
||||||
agInit(params: ICellRendererParams): void {
|
agInit(params: ICellRendererParams): void {
|
||||||
|
console.log('bool renderer', this);
|
||||||
this.params = params;
|
this.params = params;
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
|
if ( this.params.colDef._parentEditorUUID ) {
|
||||||
|
// @ts-ignore
|
||||||
|
this.editorService = this.editorService.getEditor(this.params.colDef._parentEditorUUID)
|
||||||
|
}
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
this.checkbox = params.colDef.additionalData.labelType === 'checkbox';
|
this.checkbox = params.colDef.additionalData.labelType === 'checkbox';
|
||||||
|
|
||||||
|
@ -72,8 +72,10 @@ export class FilesComponent extends EditorNodeContract implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.pendingSetup = false;
|
this.pendingSetup = false;
|
||||||
|
if ( this.fileUploader ) {
|
||||||
this.fileUploader.nativeElement.value = null;
|
this.fileUploader.nativeElement.value = null;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public async performDelete(): Promise<void> {
|
public async performDelete(): Promise<void> {
|
||||||
await this.api.deleteFileGroup(this.page.UUID, this.node.UUID, this.node.Value.Value);
|
await this.api.deleteFileGroup(this.page.UUID, this.node.UUID, this.node.Value.Value);
|
||||||
|
Loading…
Reference in New Issue
Block a user