Skip to content

Commit

Permalink
fix: save and replace external IIIF image (DEV-4227) (#2013)
Browse files Browse the repository at this point in the history
  • Loading branch information
irmastnt authored Dec 17, 2024
1 parent 1f1b80a commit e844083
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Component, Inject } from '@angular/core';
import { FormControl, FormGroup, Validators } from '@angular/forms';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { KnoraApiConnection } from '@dasch-swiss/dsp-js';
import { ThirdPartyIiifProps, ThirdPartyIiiifForm } from './edit-third-party-iiif-types';

@Component({
Expand All @@ -23,6 +22,7 @@ export class EditThirdPartyIiifFormComponent {

submitData() {
this.loading = true;
delete (this.thirdPartyIiifForm.value.fileValue as any)?.filename;
this.dialogRef.close(this.thirdPartyIiifForm.value.fileValue);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export class StillImageComponent implements OnChanges, AfterViewInit, OnDestroy
private _openExternal3iFImage(image: ReadStillImageExternalFileValue) {
const i3f = IIIFUrl.createUrl(image.externalUrl);
if (!i3f) {
throw new AppError('Error with IIIF URL');
throw new AppError("Can't open external IIIF URL");
}

this.osdService.viewer.open(i3f.infoJsonUrl);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ export class ThirdPartyIiifComponent implements ControlValueAccessor, OnInit, On
updateValue.id = this._initialFileValue.id;
return updateValue;
} else {
return new CreateStillImageExternalFileValue();
const fileValue = new CreateStillImageExternalFileValue();
delete (fileValue as any).filename;
return fileValue;
}
}

Expand Down

0 comments on commit e844083

Please sign in to comment.