mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-05-12 17:04:46 +00:00
[ACS-5752] fixed incorrect info drawer properties update (#3492)
This commit is contained in:
parent
b25a3ad9d8
commit
02f581e4c2
@ -82,7 +82,7 @@ describe('LibraryMetadataFormComponent', () => {
|
|||||||
expect(component.form.value).toEqual(siteEntryModel);
|
expect(component.form.value).toEqual(siteEntryModel);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should update form data when node data changes', () => {
|
it('should update form data and properties when node data changes', () => {
|
||||||
const newSiteEntryModel = {
|
const newSiteEntryModel = {
|
||||||
title: 'libraryTitle2',
|
title: 'libraryTitle2',
|
||||||
description: 'description2',
|
description: 'description2',
|
||||||
@ -93,10 +93,12 @@ describe('LibraryMetadataFormComponent', () => {
|
|||||||
component.toggleEdit();
|
component.toggleEdit();
|
||||||
|
|
||||||
expect(component.form.value).toEqual(siteEntryModel);
|
expect(component.form.value).toEqual(siteEntryModel);
|
||||||
|
expect(component.canUpdateLibrary).toBeFalse();
|
||||||
|
|
||||||
component.node = {
|
component.node = {
|
||||||
entry: {
|
entry: {
|
||||||
id: 'libraryId',
|
id: 'libraryId',
|
||||||
|
role: 'SiteManager',
|
||||||
...newSiteEntryModel
|
...newSiteEntryModel
|
||||||
} as Site
|
} as Site
|
||||||
};
|
};
|
||||||
@ -104,6 +106,7 @@ describe('LibraryMetadataFormComponent', () => {
|
|||||||
component.ngOnChanges();
|
component.ngOnChanges();
|
||||||
|
|
||||||
expect(component.form.value).toEqual(newSiteEntryModel);
|
expect(component.form.value).toEqual(newSiteEntryModel);
|
||||||
|
expect(component.canUpdateLibrary).toBeTrue();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should assign form value to node entry if updating of form is finished with success', () => {
|
it('should assign form value to node entry if updating of form is finished with success', () => {
|
||||||
|
@ -186,6 +186,7 @@ export class LibraryMetadataFormComponent implements OnInit, OnChanges, OnDestro
|
|||||||
|
|
||||||
ngOnChanges() {
|
ngOnChanges() {
|
||||||
this.updateForm(this.node);
|
this.updateForm(this.node);
|
||||||
|
this.canUpdateLibrary = this.node?.entry?.role === 'SiteManager';
|
||||||
}
|
}
|
||||||
|
|
||||||
update() {
|
update() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user