mirror of
https://github.com/sartography/cr-connect-bpmn.git
synced 2025-01-13 02:24:39 +00:00
updated calls for new spec file endpoints
This commit is contained in:
parent
919f15493e
commit
0453c58915
@ -55,7 +55,7 @@ export class FileListComponent implements OnInit, OnChanges {
|
|||||||
|
|
||||||
editFileMeta(fm: FileMeta) {
|
editFileMeta(fm: FileMeta) {
|
||||||
if (fm && isNumberDefined(fm.id)) {
|
if (fm && isNumberDefined(fm.id)) {
|
||||||
this.api.getSpecFileData(fm.id).subscribe(response => {
|
this.api.getSpecFileData(this.workflowSpec, fm.id, fm.name).subscribe(response => {
|
||||||
const file = newFileFromResponse(fm, response);
|
const file = newFileFromResponse(fm, response);
|
||||||
this._openFileDialog(fm, file);
|
this._openFileDialog(fm, file);
|
||||||
});
|
});
|
||||||
@ -85,7 +85,7 @@ export class FileListComponent implements OnInit, OnChanges {
|
|||||||
// Fixme: This buisness rule does not belong here.
|
// Fixme: This buisness rule does not belong here.
|
||||||
this.fileMetas.forEach(fm => {
|
this.fileMetas.forEach(fm => {
|
||||||
fm.primary = (fmPrimary.id === fm.id);
|
fm.primary = (fmPrimary.id === fm.id);
|
||||||
this.api.updateSpecFileMeta(fm).subscribe(() => {
|
this.api.updateSpecFileMeta(this.workflowSpec, fm).subscribe(() => {
|
||||||
numUpdated++;
|
numUpdated++;
|
||||||
// Reload all fileMetas when all have been updated.
|
// Reload all fileMetas when all have been updated.
|
||||||
if (numUpdated === this.fileMetas.length) {
|
if (numUpdated === this.fileMetas.length) {
|
||||||
@ -124,7 +124,7 @@ export class FileListComponent implements OnInit, OnChanges {
|
|||||||
|
|
||||||
if (isNumberDefined(data.fileMetaId)) {
|
if (isNumberDefined(data.fileMetaId)) {
|
||||||
// Update existing file
|
// Update existing file
|
||||||
this.api.updateSpecFileData(newFileMeta, data.file).subscribe(() => {
|
this.api.updateSpecFileData(this.workflowSpec, newFileMeta, data.file).subscribe(() => {
|
||||||
this._loadFileMetas();
|
this._loadFileMetas();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@ -137,7 +137,7 @@ export class FileListComponent implements OnInit, OnChanges {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private _deleteFile(fileMeta: FileMeta) {
|
private _deleteFile(fileMeta: FileMeta) {
|
||||||
this.api.deleteSpecFileMeta(fileMeta.id).subscribe(() => {
|
this.api.deleteSpecFileMeta(this.workflowSpec, fileMeta.id, fileMeta.name).subscribe(() => {
|
||||||
this._loadFileMetas();
|
this._loadFileMetas();
|
||||||
this.snackBar.open(`Deleted file ${fileMeta.name}.`, 'Ok', {duration: 3000});
|
this.snackBar.open(`Deleted file ${fileMeta.name}.`, 'Ok', {duration: 3000});
|
||||||
});
|
});
|
||||||
|
@ -366,7 +366,7 @@ export class ModelerComponent implements AfterViewInit {
|
|||||||
|
|
||||||
if (f.id === this.fileMetaId) {
|
if (f.id === this.fileMetaId) {
|
||||||
this.diagramFileMeta = f;
|
this.diagramFileMeta = f;
|
||||||
this.api.getSpecFileData(f.id).subscribe(response => {
|
this.api.getSpecFileData(this.workflowSpec, f.id, f.name).subscribe(response => {
|
||||||
this.diagramFile = newFileFromResponse(f, response);
|
this.diagramFile = newFileFromResponse(f, response);
|
||||||
this.onSubmitFileToOpen();
|
this.onSubmitFileToOpen();
|
||||||
});
|
});
|
||||||
@ -394,8 +394,8 @@ export class ModelerComponent implements AfterViewInit {
|
|||||||
|
|
||||||
if (this.workflowSpec && isNumberDefined(fileMetaId)) {
|
if (this.workflowSpec && isNumberDefined(fileMetaId)) {
|
||||||
// Update existing file meta
|
// Update existing file meta
|
||||||
this.api.updateSpecFileData(this.diagramFileMeta, this.diagramFile).subscribe(() => {
|
this.api.updateSpecFileData(this.workflowSpec, this.diagramFileMeta, this.diagramFile).subscribe(() => {
|
||||||
this.api.updateSpecFileMeta(this.diagramFileMeta).subscribe(() => {
|
this.api.updateSpecFileMeta(this.workflowSpec, this.diagramFileMeta).subscribe(() => {
|
||||||
this.loadFilesFromDb();
|
this.loadFilesFromDb();
|
||||||
this.snackBar.open(`Saved changes to file ${this.diagramFileMeta.name}.`, 'Ok', {duration: 5000});
|
this.snackBar.open(`Saved changes to file ${this.diagramFileMeta.name}.`, 'Ok', {duration: 5000});
|
||||||
});
|
});
|
||||||
@ -419,7 +419,7 @@ export class ModelerComponent implements AfterViewInit {
|
|||||||
this.xml = this.draftXml;
|
this.xml = this.draftXml;
|
||||||
this.diagramFile = new File([this.xml], this.diagramFileMeta.name, {type: 'text/xml'});
|
this.diagramFile = new File([this.xml], this.diagramFileMeta.name, {type: 'text/xml'});
|
||||||
|
|
||||||
this.api.updateSpecFileData(this.diagramFileMeta, this.diagramFile).subscribe(newFileMeta => {
|
this.api.updateSpecFileData(this.workflowSpec, this.diagramFileMeta, this.diagramFile).subscribe(newFileMeta => {
|
||||||
this.diagramFileMeta = newFileMeta;
|
this.diagramFileMeta = newFileMeta;
|
||||||
this.snackBar.open(`Saved changes to file metadata ${this.diagramFileMeta.name}.`, 'Ok', {duration: 5000});
|
this.snackBar.open(`Saved changes to file metadata ${this.diagramFileMeta.name}.`, 'Ok', {duration: 5000});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user