Skip to content

Conversation

@eddie-rowe
Copy link
Contributor

@eddie-rowe eddie-rowe commented Jul 18, 2025

This pull request introduces changes to the ad management system, including backend enhancements for handling ad clicks, frontend updates for improved ad display and interactivity, and the addition of ad pages for "Cool Hats", "Discount Clothing", and "Nice Bags". Below is a summary of the most important changes:

Backend Enhancements for Ad Management:

  • Added a new clickUrl field to the Advertisement entity and updated the Advertisement class to include a new constructor and getter/setter methods for this field. This allows ads to have specific URLs for redirection. [1] [2]
  • Implemented a new /click/{id} endpoint in the AdsJavaApplication class to handle ad clicks. This endpoint logs the click, retrieves the ad by its ID, and redirects the user to the associated clickUrl or a default URL if none is set.
  • Enhanced the database initialization logic to include meaningful clickUrl values for ads and ensure existing ads are updated with the correct URLs.

Frontend Updates for Ad Interactivity:

  • Updated the Ad component in Ad.tsx to include a handleAdClick function that redirects users to the backend click endpoint when an ad is clicked. The ad banner now includes a cursor-pointer style and a title attribute for better user experience. [1] [2]
  • Refactored the Ad component to use a proper TypeScript interface (Advertisement) for better type safety and clarity.
  • Added pages for "Cool Hats", "Discount Clothing", and "Nice Bags".

How to test

  1. Checkout this branch.
  2. Run docker compose -f docker-compose.dev.yml up -d
  3. Navigate to http://localhost and click on the ads to ensure all three ads work as expected

@eddie-rowe eddie-rowe closed this Jul 18, 2025
@eddie-rowe eddie-rowe reopened this Aug 6, 2025
@eddie-rowe eddie-rowe self-assigned this Aug 6, 2025
@eddie-rowe eddie-rowe added the enhancement New feature or request label Aug 6, 2025
@eddie-rowe eddie-rowe changed the title new hats ad feature add [Feature] Add advertisement click functionality to ads-java service Aug 6, 2025
@eddie-rowe eddie-rowe marked this pull request as ready for review August 6, 2025 17:57
@eddie-rowe eddie-rowe requested review from a team as code owners August 6, 2025 17:57
Copy link
Collaborator

@arosenkranz arosenkranz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few small style tweaks, good stuff.

@eddie-rowe eddie-rowe merged commit b2e05ed into main Oct 2, 2025
1 check passed
@eddie-rowe eddie-rowe deleted the brown-bag-fun branch October 2, 2025 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants