mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-26 17:24:56 +00:00
[ADF-4522] Metadata value is not rolled back upon error (#5545)
This commit is contained in:
parent
22d2a52f68
commit
41597e271a
@ -147,10 +147,12 @@ describe('ContentMetadataComponent', () => {
|
||||
expect(logService.error).toHaveBeenCalledWith(new Error('My bad'));
|
||||
});
|
||||
|
||||
it('should raise error message', (done) => {
|
||||
it('should raise error message and reload the properties', (done) => {
|
||||
spyOn(contentMetadataService, 'getBasicProperties');
|
||||
const property = <CardViewBaseItemModel> { key: 'property-key', value: 'original-value' };
|
||||
|
||||
const sub = contentMetadataService.error.subscribe((err) => {
|
||||
expect(contentMetadataService.getBasicProperties).toHaveBeenCalledWith(node);
|
||||
expect(err.statusCode).toBe(0);
|
||||
expect(err.message).toBe('METADATA.ERRORS.GENERIC');
|
||||
sub.unsubscribe();
|
||||
|
@ -94,6 +94,7 @@ export class ContentMetadataComponent implements OnChanges, OnInit, OnDestroy {
|
||||
switchMap((changes) =>
|
||||
this.saveNode(changes).pipe(
|
||||
catchError((err) => {
|
||||
this.loadProperties(this.node);
|
||||
this.handleUpdateError(err);
|
||||
return of(null);
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user