mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
[ACS-8824] The user cannot edit node properties after failing... (#10420)
* [ACS-8824] The user cannot edit node properties after failing to change node name with special characters * [ACS-8824] fix formatting
This commit is contained in:
parent
70c59049c9
commit
4ab3040954
@ -389,6 +389,27 @@ describe('ContentMetadataComponent', () => {
|
|||||||
flush();
|
flush();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
it('should revert changes on unsuccessful save', fakeAsync(() => {
|
||||||
|
component.readOnly = false;
|
||||||
|
const property = { key: 'properties.property-key', value: 'original-value' } as CardViewBaseItemModel;
|
||||||
|
spyOn(nodesApiService, 'updateNode').and.returnValue(throwError(new Error('error message')));
|
||||||
|
spyOn(component, 'revertChanges').and.callThrough();
|
||||||
|
updateService.update(property, 'new-value');
|
||||||
|
tick(600);
|
||||||
|
|
||||||
|
fixture.detectChanges();
|
||||||
|
toggleEditModeForGeneralInfo();
|
||||||
|
tick(100);
|
||||||
|
clickOnGeneralInfoSave();
|
||||||
|
tick(100);
|
||||||
|
|
||||||
|
expect(component.revertChanges).toHaveBeenCalled();
|
||||||
|
expect(component.changedProperties).toEqual({});
|
||||||
|
expect(component.hasMetadataChanged).toBeFalse();
|
||||||
|
discardPeriodicTasks();
|
||||||
|
flush();
|
||||||
|
}));
|
||||||
|
|
||||||
it('should open the confirm dialog when content type is changed', fakeAsync(() => {
|
it('should open the confirm dialog when content type is changed', fakeAsync(() => {
|
||||||
component.readOnly = false;
|
component.readOnly = false;
|
||||||
const property = { key: 'nodeType', value: 'ft:sbiruli' } as CardViewBaseItemModel;
|
const property = { key: 'nodeType', value: 'ft:sbiruli' } as CardViewBaseItemModel;
|
||||||
|
@ -409,6 +409,7 @@ export class ContentMetadataComponent implements OnChanges, OnInit {
|
|||||||
this.cardViewContentUpdateService.updateElement(this.targetProperty);
|
this.cardViewContentUpdateService.updateElement(this.targetProperty);
|
||||||
this.handleUpdateError(err);
|
this.handleUpdateError(err);
|
||||||
this._saving = false;
|
this._saving = false;
|
||||||
|
this.revertChanges();
|
||||||
this.loadProperties(this.node);
|
this.loadProperties(this.node);
|
||||||
return of(null);
|
return of(null);
|
||||||
})
|
})
|
||||||
|
@ -45,7 +45,7 @@ export class BasicPropertiesService {
|
|||||||
key: 'properties.cm:name',
|
key: 'properties.cm:name',
|
||||||
editable: true,
|
editable: true,
|
||||||
validators: [
|
validators: [
|
||||||
new CardViewItemMatchValidator('[\\/\\*\\\\"\\\\]')
|
new CardViewItemMatchValidator('[\\/\\*\\\\"\\\\:]')
|
||||||
]
|
]
|
||||||
}),
|
}),
|
||||||
new CardViewTextItemModel({
|
new CardViewTextItemModel({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user