Skip to content

Commit

Permalink
Partially revert PR #323
Browse files Browse the repository at this point in the history
justified by plan to change the thumbnail of logbook to the file hash rather than the id
  • Loading branch information
minottic committed Feb 5, 2024
1 parent 8a64c87 commit a25404b
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 16 deletions.
1 change: 0 additions & 1 deletion scilog/src/app/core/model/logbooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ export interface Logbooks extends Basesnippets {
name?: string;
description?: string;
thumbnail?: string;
thumbnailHash?: string;
location?: string;
readACL?: string[];
updateACL?: string[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,4 @@ describe('LogbookWidgetComponent', () => {
expect(isAnyEditAllowedSpy).toHaveBeenCalledTimes(1);
});

[undefined, 'hash'].forEach((t, i) => {
it(`should getImageFromService ${i}`, async () => {
logbookItemDataSpy.getImage.calls.reset();
component.logbook.thumbnail = 'abc'
component.logbook.thumbnailHash = t
spyOn(component, 'createImageFromBlob');
await component.getImageFromService();
expect(logbookItemDataSpy.getImage).toHaveBeenCalledOnceWith(t ?? 'abc');
});
});

});
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,7 @@ export class LogbookWidgetComponent implements OnInit {

async getImageFromService() {
this.isImageLoading = true;
let data = await this.logbookItemDataService.getImage(
this.logbook.thumbnailHash ??
this.logbook.thumbnail
);
let data = await this.logbookItemDataService.getImage(this.logbook.thumbnail);
this.createImageFromBlob(data);
this.isImageLoading = false;
}
Expand Down

0 comments on commit a25404b

Please sign in to comment.