Skip to content

Commit

Permalink
Merge pull request #315 from cns-iu/Call-for-submissions-thumbnail-im…
Browse files Browse the repository at this point in the history
…provements

Use placeholder thumbnail if not using previous macroscopes
  • Loading branch information
edlu77 authored Jan 27, 2025
2 parents c61db6b + 972a551 commit 13e87d7
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
<h1 class="header1"> Call for Submissions </h1>
<div class="image-content">
<!-- <div class="thumbnail desktop" *ngFor="let thumbnail of lastIterationThumbnails">
<div class="thumbnail desktop" *ngFor="let thumbnail of lastIterationThumbnails">
<img class="thumbnail-image" [src]="thumbnail.image" [alt]="thumbnail.image">
</div>

<div class="thumbnail mobile" *ngFor="let thumbnail of lastIterationThumbnails">
<img class="thumbnail-image" [src]="thumbnail.image" [alt]="thumbnail.image">
</div> -->

<div class="thumbnail desktop">
<img class="thumbnail-image" [src]="'assets/content/site/home/image008.png'" [alt]="'assets/content/site/home/image008.png'">
</div>

<div class="thumbnail mobile">
<img class="thumbnail-image" [src]="'assets/content/site/home/image008.png'" [alt]="'assets/content/site/home/image008.png'">
</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,18 @@ describe('CallForMacroscopesComponent', () => {
);
});
it('should select correct last macroscope', () => {
component.lastIteration = 2;
fixture.detectChanges();
expect(component.lastIterationThumbnails).toEqual(
macroscopes[1].thumbnails
);
});

it('should select a placeholder thumbnail if lastIteration is undefined', () => {
component.lastIteration = undefined;
fixture.detectChanges();
expect(component.lastIterationThumbnails[0].image).toEqual(
'assets/content/site/home/image008.png'
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class CallForMacroscopesComponent implements OnInit {
lastIterationThumbnails: { image: string; title: string }[] = [];
activePageTab = 0;
showDrawer = false;
lastIteration = 20;
lastIteration?: number;
importantDates: Array<[string, Date]> = [];

submitURL = '';
Expand Down Expand Up @@ -44,7 +44,9 @@ export class CallForMacroscopesComponent implements OnInit {
});
}
// other keys
this.lastIteration = lastIteration;
if (this.lastIteration) {
this.lastIteration = lastIteration;
}
this.submitURL = submitURL;
this.pdfLink = pdfLink;
this.allowSubmission = allowSubmission;
Expand All @@ -62,6 +64,13 @@ export class CallForMacroscopesComponent implements OnInit {
});
if (lastmacroscope) {
this.lastIterationThumbnails = lastmacroscope.thumbnails;
} else {
this.lastIterationThumbnails = [
{
image: 'assets/content/site/home/image008.png',
title: 'placeholder',
},
];
}
}
});
Expand Down

0 comments on commit 13e87d7

Please sign in to comment.