mirror of
https://github.com/sartography/cr-connect-bpmn.git
synced 2025-01-11 17:44:32 +00:00
Saves file data along with file metadata
This commit is contained in:
parent
4e5d6cc1c6
commit
b21b55c79f
@ -312,6 +312,8 @@ describe('ModelerComponent', () => {
|
||||
};
|
||||
const updateFileMetaSpy = spyOn(component.api, 'updateFileMeta')
|
||||
.and.returnValue(of(mockFileMeta0));
|
||||
const updateFileDataSpy = spyOn(component.api, 'updateFileData')
|
||||
.and.returnValue(of(mockFileMeta0.file));
|
||||
const loadFilesFromDbSpy = spyOn(component, 'loadFilesFromDb').and.stub();
|
||||
const snackBarSpy = spyOn(component.snackBar, 'open').and.stub();
|
||||
const noDateOrVersion: FileMeta = {
|
||||
@ -326,7 +328,8 @@ describe('ModelerComponent', () => {
|
||||
component.draftXml = newXml;
|
||||
component._upsertFileMeta(data);
|
||||
expect(component.xml).toEqual(newXml);
|
||||
expect(updateFileMetaSpy).toHaveBeenCalledWith(mockWorkflowSpec0.id, noDateOrVersion);
|
||||
expect(updateFileMetaSpy).toHaveBeenCalledWith(noDateOrVersion);
|
||||
expect(updateFileDataSpy).toHaveBeenCalledWith(noDateOrVersion);
|
||||
expect(loadFilesFromDbSpy).toHaveBeenCalled();
|
||||
expect(snackBarSpy).toHaveBeenCalled();
|
||||
});
|
||||
|
@ -263,9 +263,11 @@ export class ModelerComponent implements AfterViewInit {
|
||||
|
||||
if (this.workflowSpec && isNumberDefined(fileMetaId)) {
|
||||
// Update existing file meta
|
||||
this.api.updateFileMeta(this.diagramFileMeta).subscribe(fileMeta => {
|
||||
this.loadFilesFromDb();
|
||||
this.snackBar.open(`Saved changes to file ${fileMeta.name}.`, 'Ok', {duration: 5000});
|
||||
this.api.updateFileData(this.diagramFileMeta).subscribe(() => {
|
||||
this.api.updateFileMeta(this.diagramFileMeta).subscribe(() => {
|
||||
this.loadFilesFromDb();
|
||||
this.snackBar.open(`Saved changes to file ${this.diagramFileMeta.name}.`, 'Ok', {duration: 5000});
|
||||
});
|
||||
});
|
||||
} else {
|
||||
// Add new file meta
|
||||
|
Loading…
x
Reference in New Issue
Block a user