updated calls for new spec file endpoints

This commit is contained in:
alicia pritchett 2022-01-31 13:06:19 -05:00
parent 919f15493e
commit 0453c58915
2 changed files with 8 additions and 8 deletions

View File

@ -55,7 +55,7 @@ export class FileListComponent implements OnInit, OnChanges {
editFileMeta(fm: FileMeta) {
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);
this._openFileDialog(fm, file);
});
@ -85,7 +85,7 @@ export class FileListComponent implements OnInit, OnChanges {
// Fixme: This buisness rule does not belong here.
this.fileMetas.forEach(fm => {
fm.primary = (fmPrimary.id === fm.id);
this.api.updateSpecFileMeta(fm).subscribe(() => {
this.api.updateSpecFileMeta(this.workflowSpec, fm).subscribe(() => {
numUpdated++;
// Reload all fileMetas when all have been updated.
if (numUpdated === this.fileMetas.length) {
@ -124,7 +124,7 @@ export class FileListComponent implements OnInit, OnChanges {
if (isNumberDefined(data.fileMetaId)) {
// Update existing file
this.api.updateSpecFileData(newFileMeta, data.file).subscribe(() => {
this.api.updateSpecFileData(this.workflowSpec, newFileMeta, data.file).subscribe(() => {
this._loadFileMetas();
});
} else {
@ -137,7 +137,7 @@ export class FileListComponent implements OnInit, OnChanges {
}
private _deleteFile(fileMeta: FileMeta) {
this.api.deleteSpecFileMeta(fileMeta.id).subscribe(() => {
this.api.deleteSpecFileMeta(this.workflowSpec, fileMeta.id, fileMeta.name).subscribe(() => {
this._loadFileMetas();
this.snackBar.open(`Deleted file ${fileMeta.name}.`, 'Ok', {duration: 3000});
});

View File

@ -366,7 +366,7 @@ export class ModelerComponent implements AfterViewInit {
if (f.id === this.fileMetaId) {
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.onSubmitFileToOpen();
});
@ -394,8 +394,8 @@ export class ModelerComponent implements AfterViewInit {
if (this.workflowSpec && isNumberDefined(fileMetaId)) {
// Update existing file meta
this.api.updateSpecFileData(this.diagramFileMeta, this.diagramFile).subscribe(() => {
this.api.updateSpecFileMeta(this.diagramFileMeta).subscribe(() => {
this.api.updateSpecFileData(this.workflowSpec, this.diagramFileMeta, this.diagramFile).subscribe(() => {
this.api.updateSpecFileMeta(this.workflowSpec, this.diagramFileMeta).subscribe(() => {
this.loadFilesFromDb();
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.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.snackBar.open(`Saved changes to file metadata ${this.diagramFileMeta.name}.`, 'Ok', {duration: 5000});
});