Skip to content

Commit

Permalink
feat(openchallenges): add Team button to OC navbar (#2306)
Browse files Browse the repository at this point in the history
* Use routerLink for app pages in navbar and footer

* Fix navbar unit test

* Fix tests for the About and Not Found pages

* Update label
  • Loading branch information
tschaffter authored Nov 1, 2023
1 parent e01dcf7 commit c16aee2
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 9 deletions.
3 changes: 2 additions & 1 deletion libs/openchallenges/about/src/lib/about.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { HttpClientModule } from '@angular/common/http';
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { ConfigService } from '@sagebionetworks/openchallenges/config';
import { FooterComponent } from '@sagebionetworks/openchallenges/ui';
import { AboutComponent } from './about.component';
Expand All @@ -11,7 +12,7 @@ describe('AboutComponent', () => {

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [HttpClientModule, FooterComponent],
imports: [HttpClientModule, RouterTestingModule, FooterComponent],
providers: [ConfigService],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
}).compileComponents();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { HttpClientModule } from '@angular/common/http';
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { ConfigService } from '@sagebionetworks/openchallenges/config';

import { NotFoundComponent } from './not-found.component';
Expand All @@ -11,7 +12,7 @@ describe('NotFoundComponent', () => {

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [HttpClientModule, NotFoundComponent],
imports: [HttpClientModule, RouterTestingModule, NotFoundComponent],
providers: [ConfigService],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
}).compileComponents();
Expand Down
12 changes: 7 additions & 5 deletions libs/openchallenges/ui/src/lib/footer/footer.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,19 @@
alt="OpenChallenges"
/>
<ul class="footer-link-group">
<li><a href="/about">About</a></li>
<li><a href="/team">Meet Our Team</a></li>
<li><a routerLink="/about">About</a></li>
<li><a routerLink="/team">Meet Our Team</a></li>
<li>
<a
<a
[href]="apiDocsUrl"
title="Interactive documentation for OC API"
rel="noopener noreferrer"
target="_blank"
>API Docs</a></li>
>API Docs</a
>
</li>
<li>
<a
<a
href="https://github.com/Sage-Bionetworks/sage-monorepo/issues/new/choose"
title="Share feedback about the OC app"
rel="noopener noreferrer"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { HttpClientModule } from '@angular/common/http';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { FooterComponent } from './footer.component';

describe('FooterComponent', () => {
Expand All @@ -8,7 +9,7 @@ describe('FooterComponent', () => {

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [HttpClientModule],
imports: [HttpClientModule, RouterTestingModule],
}).compileComponents();
});

Expand Down
3 changes: 2 additions & 1 deletion libs/openchallenges/ui/src/lib/footer/footer.component.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { Component, Input } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule } from '@angular/router';

@Component({
selector: 'openchallenges-footer',
standalone: true,
imports: [CommonModule],
imports: [CommonModule, RouterModule],
templateUrl: './footer.component.html',
styleUrls: ['./footer.component.scss'],
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

<div class="flex-spacer"></div>

<a mat-button class="navbar-item" routerLink="/team">Meet Our Team</a>
<openchallenges-discord-button />

<!-- <a mat-button class="navbar-item" *ngIf="!isLoggedIn" routerLink="/login" aria-label="Log In">
Expand Down

0 comments on commit c16aee2

Please sign in to comment.