Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: save and replace external IIIF image (DEV-4227) #2013

Merged
merged 2 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading