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

Major release v6.0.1 #212

Merged
merged 14 commits into from
Jan 12, 2025
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,037 changes: 5,119 additions & 2,918 deletions frontend/package-lock.json

Large diffs are not rendered by default.

13 changes: 9 additions & 4 deletions frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"name": "@conorheffron/ironoc-frontend",
"version": "5.5.9",
"version": "6.0.1",
"private": false,
"dependencies": {
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"axios": "^0.21.1",
"bootstrap": "5.1",
"react": "^18.3.1",
"react-bootstrap": "^2.10.5",
Expand All @@ -15,7 +14,6 @@
"react-cookie": "^7.2.2",
"react-dom": "^18.3.1",
"react-router-dom": "^5.3.0",
"react-scripts": "^5.0.1",
"reactstrap": "^8.10.0",
"web-vitals": "^4.2.3"
},
Expand Down Expand Up @@ -45,6 +43,13 @@
},
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.1.0",
"jest": "^27.5.1",
"react-scripts": "^5.0.1",
"web-vitals": "^4.2.3"
},
"resolutions": {
"react-scripts/@svgr/webpack": "^6.2.1"
}
}
21 changes: 21 additions & 0 deletions frontend/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,24 @@
height: 13;
width: 51;
}

.carousel-caption h3, h5 {
color: navy;
}

p a {
color: yellow;
}

.carousel-caption h3, h5 {
background-color:yellow;
width: 50%;
height: auto;
margin: 0 auto;
}

.carousel-item img {
width: 50%;
height: auto;
margin: 0 auto;
}
2 changes: 2 additions & 0 deletions frontend/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { Component } from 'react';
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
import './App.css';
import Home from './components/Home';
import CoffeeHome from './components/CoffeeHome';
import NotFound from './components/NotFound';
import About from './components/About';
import RepoDetails from './components/RepoDetails';
Expand All @@ -19,6 +20,7 @@ class App extends Component {
<Route path='/projects' exact={true} component={RepoDetails}/>
<Route path='/projects/:id' component={RepoDetails}/>
<Route path='/issues/:id/:repo' component={RepoIssues}/>
<Route path='/brews' exact={true} component={CoffeeHome}/>
<Route path="*" component={NotFound} />
</Switch>
</Router>
Expand Down
91 changes: 90 additions & 1 deletion frontend/src/App.test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,97 @@
import { render, screen } from '@testing-library/react';
import React from 'react';
import { render, screen, waitFor } from '@testing-library/react';
import '@testing-library/jest-dom';
import Home from './components/Home';
import axios from 'axios';
import App from './App';
import CoffeeCarousel from './components/CoffeeCarousel';
import CoffeeHome from './components/CoffeeHome';
import NotFound from './components/NotFound';

// Mocking axios
jest.mock('axios');

test('renders learn react link', () => {
render(<Home />);
const element = screen.getByText(/Home/i);
expect(element).toBeInTheDocument();
});

// Sample data for testing
const coffeeItems = [
{
title: 'Espresso',
ingredients: ['Water', 'Coffee beans'],
image: 'https://example.com/espresso.jpg',
},
{
title: 'Cappuccino',
ingredients: ['Espresso', 'Steamed milk', 'Foam milk'],
image: 'https://example.com/cappuccino.jpg',
},
];

describe('CoffeeCarousel', () => {
test('renders carousel with coffee items', () => {
render(<CoffeeCarousel items={coffeeItems} />);

// Check that the carousel items are rendered
coffeeItems.forEach((item) => {
expect(screen.getByText(item.title)).toBeInTheDocument();
expect(screen.getByAltText(item.title)).toBeInTheDocument();
expect(screen.getByText(item.ingredients.join(', '))).toBeInTheDocument();
});
});

test('renders carousel with correct number of items', () => {
render(<CoffeeCarousel items={coffeeItems} />);

// Check that the correct number of carousel items are rendered
const carouselItems = screen.getAllByRole('img');

expect(carouselItems.length).toBe(coffeeItems.length);
});
});

describe('CoffeeHome', () => {
beforeEach(() => {
axios.get.mockResolvedValue({ data: coffeeItems });
});

test('renders AppNavbar component', () => {
render(<App />);
expect(screen.getByRole('banner')).toBeInTheDocument();
});

test('displays loading state initially', () => {
render(<CoffeeHome />);
expect(screen.getByText('Loading...')).toBeInTheDocument();
});

test('renders CoffeeCarousel component with coffee items', async () => {
render(<CoffeeHome />);

// Wait for the coffee items to be fetched and rendered
await waitFor(() => {
expect(screen.getByText('Espresso')).toBeInTheDocument();
expect(screen.getByText('Cappuccino')).toBeInTheDocument();
});
});
});

describe('NotFound', () => {
test('renders AppNavbar component', () => {
render(<NotFound />);
expect(screen.getByRole('banner')).toBeInTheDocument();
});

test('displays 404 error message', () => {
render(<NotFound />);
expect(screen.getByText('404 - Page Not Found')).toBeInTheDocument();
});

test('displays the apology message', () => {
render(<NotFound />);
expect(screen.getByText('Sorry, the page you are looking for could not be found.')).toBeInTheDocument();
});
});
1 change: 1 addition & 0 deletions frontend/src/AppNavbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export default function AppNavBar() {
<DropdownMenu end>
<DropdownItem href="/about">About</DropdownItem>
<DropdownItem href="/portfolio">Portfolio</DropdownItem>
<DropdownItem href="/brews">Brews</DropdownItem>
<DropdownItem divider />
<DropdownItem href="https://linktr.ee/conorheffron" target="_blank" rel="noreferrer">Link Tree</DropdownItem>
</DropdownMenu>
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/components/About.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,16 @@ class About extends Component {
<br /><br />
I believe in continuous learning & practical skills that can be demonstrated in a positive & collaborative
manner (open source is great!). When not learning or working, I like jogging/cycling, music, cooking,
pretending to be a caffeine connoisseur, & searching for new forms of salsa verde / green sauce!
pretending to be a <a href="/brews">caffeine connoisseur</a>, & searching for new forms of
salsa verde / green sauce!
<br /><br />
Let's connect and explore exciting
opportunities together! See above & beyond for contact details and further information.
</p><br />
<a class="strava-badge" href='https://strava.com/athletes/2582329' target="_clean">
Follow me on
<img class="strava-badge-img" src='https://badges.strava.com/logo-strava.png' alt='Strava' />
</a>
</a><br />
</header>
</Container>
<Footer/>
Expand Down
21 changes: 21 additions & 0 deletions frontend/src/components/CoffeeCarousel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React from 'react';
import { Carousel } from 'react-bootstrap';
import '.././App.css';

const CoffeeCarousel = ({ items }) => {
return (
<Carousel className="App-header">
{items.map((item, index) => (
<Carousel.Item key={index}>
<img src={item.image} alt={item.title}/>
<Carousel.Caption>
<h3>{item.title}</h3>
<h5>{item.ingredients.join(', ')}</h5>
</Carousel.Caption>
</Carousel.Item>
))}
</Carousel>
);
};

export default CoffeeCarousel;
33 changes: 33 additions & 0 deletions frontend/src/components/CoffeeHome.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import React, { useEffect, useState } from 'react';
import { Button, Container, InputGroup, Table } from 'reactstrap';
import axios from 'axios';
import AppNavbar from '.././AppNavbar';
import CoffeeCarousel from './CoffeeCarousel';
import Footer from '.././Footer';

function CoffeeHome() {
const [coffeeItems, setCoffeeItems] = useState([]);

useEffect(() => {
axios.get('/coffees')
.then(response => setCoffeeItems(response.data))
.catch(error => console.error('Error fetching coffee details:', error));
}, []);

return (
<div className="App">
<AppNavbar/>
<Container>
<h1>Coffee Carousel</h1>
{coffeeItems.length > 0 ? (
<CoffeeCarousel items={coffeeItems} />
) : (
<div>Loading...</div>
)}
</Container>
<Footer/>
</div>
);
}

export default CoffeeHome;
16 changes: 8 additions & 8 deletions frontend/src/components/ControlledCarousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ControlledCarousel extends Component {
<h1><u>ironoc-db</u></h1>
<h2>Sample Data Manager Service with UI</h2>
<br /><br />
<h3>Tech Stack:</h3>
<h4>Tech Stack:</h4>
<h4>Java & Spring Boot, Thymeleaf Templating Engine, & MySQL.</h4>
</Carousel.Caption>
</a>
Expand All @@ -36,19 +36,19 @@ class ControlledCarousel extends Component {
<h1><u>booking-sys</u></h1>
<h2>Sample Reservations & Viewer System</h2>
<br /><br />
<h3>Tech Stack:</h3>
<h4>Tech Stack:</h4>
<h4>Python & Django Web App, JavaScript, SQLite3 or MySQL database.</h4>
</Carousel.Caption>
</a>
</Carousel.Item>
<Carousel.Item interval={500}>
<a href="https://github.com/cph33/nba-stats" target="_blank" rel="noreferrer">
<a href="https://github.com/cph43/nba-stats" target="_blank" rel="noreferrer">
<img className="d-block w-100" src={navy} alt="navy3" />
<Carousel.Caption>
<h1><u>nba-stats</u></h1>
<h2>NBA Analytics (Seasons 2015 - 2023): Player Statistics</h2>
<br /><br />
<h3>Tech Stack:</h3>
<h4>Tech Stack:</h4>
<h4>Jupyter Notebooks, Python, Pandas, & Requests / JSON API.</h4>
</Carousel.Caption>
</a>
Expand All @@ -60,7 +60,7 @@ class ControlledCarousel extends Component {
<h1><u>cbio-skin-canc</u></h1>
<h2>Skin Cancer Dataset Analysis</h2>
<br /><br />
<h3>Tech Stack:</h3>
<h4>Tech Stack:</h4>
<h4>R, dplyr, plotly, knitr, testthat, covr, GIT.</h4>
</Carousel.Caption>
</a>
Expand All @@ -72,7 +72,7 @@ class ControlledCarousel extends Component {
<h1><u>gene-expr</u></h1>
<h2>Breast Cancer Dataset Analysis</h2>
<br /><br />
<h3>Tech Stack:</h3>
<h4>Tech Stack:</h4>
<h4>R, ggplot2, dplyr, deseq2-analysis, & R markdown.</h4>
</Carousel.Caption>
</a>
Expand All @@ -84,7 +84,7 @@ class ControlledCarousel extends Component {
<h1><u>bio-cell-red-edge</u></h1>
<h2>Edge Detection of Biological Cell (Image Processing Script)</h2>
<br /><br />
<h3>Tech Stack:</h3>
<h4>Tech Stack:</h4>
<h4>Python, sci-kit-image, matplotlib.pyplot, & scipy.ndimage.</h4>
</Carousel.Caption>
</a>
Expand All @@ -96,7 +96,7 @@ class ControlledCarousel extends Component {
<h1><u>global-max-sim-matrix</u></h1>
<h2>Compute Global Maximum Similarity Matrix</h2>
<br /><br />
<h3>Tech Stack:</h3>
<h4>Tech Stack:</h4>
<h4>R Package, testthat, stringr, & devtools.
</h4>
</Carousel.Caption>
Expand Down
13 changes: 7 additions & 6 deletions frontend/src/components/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,19 @@ class Home extends Component {
<br /><br />
<a href="/"><img src={logo} className="App-logo" alt="iRonoc"/></a>
<p id="my-intro"> Welcome to my personal portfolio site.<br />
Please use the navigation bar to view different features such as about me, my link tree, a carousel
that scrolls through highlighted projects & the GitHub project manager (PM) tool which is built
Please use the navigation bar to view different features such as <a href="/about">about</a> me, my
&nbsp;<a href="https://linktr.ee/conorheffron">link tree</a>, a <a href="/portfolio">carousel</a>
&nbsp;that scrolls through highlighted projects & the GitHub project manager (PM) tool which is built
against the iRonoc API.
<br /><br />
The GitHub PM tool allows you to view & navigate the backlog of issues & bugs for a given project
repository for the corresponding user or organisation account. There is an option to search by user ID
or to drill down to a specific repository name via search or 'List Issues' icon in the 'Actions' column
of the <a href="https://www.ironoc.net/projects/conorheffron">projects component view</a>.
of the <a href="/projects/conorheffron">projects component view</a>.
<br /><br />
The ironoc API is documented with <a href="https://www.ironoc.net/swagger-ui-ironoc.html">Open API</a>
& sample GET requests that return raw JSON responses are available for demonstration purposes only i.e.
<a href="https://www.ironoc.net/get-repo-issue/conorheffron/ironoc/">Issues JSON Sample</a>.</p>
The ironoc API is documented with &nbsp;<a href="/swagger-ui-ironoc.html">Open API</a>
&nbsp; & sample GET requests that return raw JSON responses are available for demonstration
purposes only i.e. &nbsp;<a href="/get-repo-issue/conorheffron/ironoc/">Issues JSON Sample</a>.</p>
</header>
</Container>
<Footer/>
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>conorheffron</groupId>
<artifactId>ironoc</artifactId>
<version>5.5.9</version>
<version>6.0.1</version>
<packaging>war</packaging>

<distributionManagement>
Expand Down Expand Up @@ -136,7 +136,7 @@
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.7.0</version>
<version>2.8.0</version>
</dependency>
<dependency>
<groupId>io.swagger.core.v3</groupId>
Expand All @@ -147,7 +147,7 @@
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java</artifactId>
<version>2.29.43</version>
<version>2.29.45</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
Expand Down
Binary file added src/main/.DS_Store
Binary file not shown.
Loading
Loading