Skip to content
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
8 changes: 4 additions & 4 deletions spa/src/app/files/project-detail/project-detail.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,13 @@ export class ProjectDetailComponent {

const projectSelected = this.isProjectSelected(selectedProjectIds, project.entryId);

const externalResourcesExist = project.supplementaryLinks.length > 0 && projectIntegrations.length > 0;
const externalResourcesExist = project.supplementaryLinks.length > 0 || projectIntegrations.length > 0;

return {
externalResourcesExist: externalResourcesExist,
project: project,
externalResourcesExist,
project,
projectInRelease,
projectSelected: projectSelected
projectSelected
};
})
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<h4 class="fontsize-m semi-bold">Supplementary Links</h4>
<p class="fontsize-xs">Supplementary links are provided by contributors and represent items such as additional data which can’t be hosted here; code that was used to analyze this data; or tools and visualizations associated with this specific dataset.</p>
<ng-container *ngIf="state.loaded">
<ng-container [ngSwitch]="state.project.supplementaryLinks">
<ng-container [ngSwitch]="isAnySupplementaryLinkAssociated(state.project.supplementaryLinks)">
<ng-container *ngSwitchCase="true">
<ng-container *ngFor="let supplementaryLink of state.project.supplementaryLinks; let i = index">
<p class="fontsize-xs max600 supplementary-link" *ngIf="isValidUrl(supplementaryLink)">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,17 @@ export class ProjectSupplementaryLinksComponent implements OnDestroy, OnInit {
*/
constructor(private activatedRoute: ActivatedRoute, private store: Store<AppState>) {}

/**
* Returns true if project has at least on supplementary link associated with it.
*
* @param {string[]} supplementaryLinks
* @returns {boolean}
*/
public isAnySupplementaryLinkAssociated(supplementaryLinks: string[]): boolean {

return supplementaryLinks && supplementaryLinks.length > 0;
}

/**
* Returns true if the link is a valid url.
*
Expand Down Expand Up @@ -83,6 +94,7 @@ export class ProjectSupplementaryLinksComponent implements OnDestroy, OnInit {
filter(project => !!project),
takeUntil(this.ngDestroy$)
).subscribe(project => {
console.log(project.supplementaryLinks)
this.state$.next({
loaded: true,
project
Expand Down