mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-] update library to use new js-api 3.0.0 (#4097)
This commit is contained in:
committed by
Eugenio Romano
parent
2acd1b4e26
commit
3ef7d3b7ea
@@ -21,7 +21,7 @@ import { Component, Inject, OnInit, Optional } from '@angular/core';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
|
||||
import { MinimalNodeEntryEntity, NodeEntry } from 'alfresco-js-api';
|
||||
import { NodeBodyLock, Node, NodeEntry } from '@alfresco/js-api';
|
||||
import { AlfrescoApiService } from '@alfresco/adf-core';
|
||||
|
||||
@Component({
|
||||
@@ -32,7 +32,7 @@ import { AlfrescoApiService } from '@alfresco/adf-core';
|
||||
export class NodeLockDialogComponent implements OnInit {
|
||||
|
||||
form: FormGroup;
|
||||
node: MinimalNodeEntryEntity = null;
|
||||
node: Node = null;
|
||||
nodeName: string;
|
||||
|
||||
constructor(
|
||||
@@ -42,7 +42,8 @@ export class NodeLockDialogComponent implements OnInit {
|
||||
@Optional()
|
||||
@Inject(MAT_DIALOG_DATA)
|
||||
public data: any
|
||||
) {}
|
||||
) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
const { node } = this.data;
|
||||
@@ -65,12 +66,12 @@ export class NodeLockDialogComponent implements OnInit {
|
||||
return 0;
|
||||
}
|
||||
|
||||
private get nodeBodyLock(): object {
|
||||
return {
|
||||
private get nodeBodyLock(): NodeBodyLock {
|
||||
return new NodeBodyLock({
|
||||
'timeToExpire': this.lockTimeInSeconds,
|
||||
'type': this.form.value.allowOwner ? 'ALLOW_OWNER_CHANGES' : 'FULL',
|
||||
'lifetime': 'PERSISTENT'
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
private toggleLock(): Promise<NodeEntry> {
|
||||
@@ -85,10 +86,10 @@ export class NodeLockDialogComponent implements OnInit {
|
||||
|
||||
submit(): void {
|
||||
this.toggleLock()
|
||||
.then((node) => {
|
||||
.then((node: NodeEntry) => {
|
||||
this.data.node.isLocked = this.form.value.isLocked;
|
||||
this.dialog.close(node.entry);
|
||||
})
|
||||
.catch((error) => this.data.onError(error));
|
||||
.catch((error: any) => this.data.onError(error));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user