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
48 changes: 24 additions & 24 deletions src/config/featuredContent/featuredContentMetadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import GlobalConstants from 'GlobalConstants';
// related_terms: [
// { term: "prime-award", type: "glossary", label: "prime award" },
// { term: "subaward-data-quality", type: "atd", label: "subaward data quality" }
// ]
//

const articles = [
{
Expand All @@ -27,8 +27,8 @@ const articles = [
content_type: 'Featured Content',
title: "QAT ONLY Test",
banner_subtitle: "How People Use USAspending.gov Data",
created_date: "02/29/2026",
feature_sprint: 5,
created_date: "09/29/2025",
feature_sprint: 212,
feature_week: 1,
sections: ["Federal Spending Transparency and Accountability", "Market Research", "Grant Opportunities and Compliance", "Federal Spending Trends and Stories"],
description: "If you want to understand how you’re spending your own money, reviewing your bank statements and budget are a great place to start. If you want to understand",
Expand Down Expand Up @@ -56,7 +56,7 @@ const articles = [
title: "What is an Award?",
created_date: "04/30/2026",
description: "When you think of the word “award,” you might picture an actor receiving an Oscar, an athlete earning a medal at the Olympics, or even yourself earning a gold.",
feature_sprint: 9,
feature_sprint: 220,
feature_week: 1,
slug: "what-is-an-award",
explore_more: [
Expand Down Expand Up @@ -97,7 +97,7 @@ const articles = [
created_date: "09/29/2025",
description: "Behind every dollar the U.S. government spends, there is a story. But how can you discover that story? What tools do you need to understand it?",
slug: "exploring-americas-finances",
feature_sprint: 5,
feature_sprint: 216,
feature_week: 1,
related_terms: [],
explore_more: [
Expand Down Expand Up @@ -125,7 +125,7 @@ const articles = [
title: "Obligations vs. Outlays",
created_date: "05/21/2026",
description: "For this series, we asked our Transparency Experience Desk to answer the most commonly-asked questions about USAspending.gov’s open data.",
feature_sprint: 10,
feature_sprint: 221,
feature_week: 1,
slug: "obligations-vs-outlays",
explore_more: [
Expand Down Expand Up @@ -169,7 +169,7 @@ const articles = [
banner_subtitle: "How People Use USAspending.gov Data",
title: "Ways to Use Our Data",
created_date: "09/29/2025",
feature_sprint: 1,
feature_sprint: 212,
feature_week: 3,
description: "If you want to understand how you’re spending your own money, reviewing your bank statements and budget are a great place to start. If you want to understand",
slug: "ways-to-use-our-data",
Expand All @@ -194,7 +194,7 @@ const articles = [
banner_subtitle: "What makes our data different, where does it come from, and what makes it trustworthy?",
title: "Understanding Our Trusted Data",
created_date: "12/04/25",
feature_sprint: 2,
feature_sprint: 213,
feature_week: 1,
description: "USAspending.gov is the official source for tracking federal government spending—but what makes our data different, where does it come from, and what makes it",
slug: "understanding-our-trusted-data",
Expand All @@ -219,7 +219,7 @@ const articles = [
banner_subtitle: "How Does USAspending.gov Define Recipients?",
title: "What Is a Recipient",
created_date: "12/04/25",
feature_sprint: 2,
feature_sprint: 213,
feature_week: 1,
description: "When searching for government spending data on USAspending.gov, you’re very likely to see the word “recipient. Whether you’re using our filters to refine your",
slug: "what-is-a-recipient",
Expand Down Expand Up @@ -254,7 +254,7 @@ const articles = [
title: "Grants vs. Contracts",
banner_subtitle: "What's the Difference Between Grants and Contracts?",
created_date: "05/14/26",
feature_sprint: 9,
feature_sprint: 220,
feature_week: 3,
description: "If you want to build a house, you must know what kind of material to use. Lest you end up like two of the three little pigs, building a house out of straw or",
slug: "grants-vs-contracts",
Expand Down Expand Up @@ -289,7 +289,7 @@ const articles = [
title: "Discover How Government Spending Supports Causes You Care About",
banner_subtitle: "Explore How the Federal Government Spends Money on a Particular Topic",
created_date: "4/30/2026",
feature_sprint: 9,
feature_sprint: 220,
feature_week: 1,
description: "If you’re passionate about a cause—whether it’s education, environmental protection, public health, or national security—you can use Advanced Search to explore",
slug: "discover-how-government-spending-supports-causes-you-care-about",
Expand Down Expand Up @@ -334,7 +334,7 @@ const articles = [
title: "Exploring Spending in Your Community",
banner_subtitle: "Learn How to Search for Federal Spending Where You Live",
created_date: "01/15/26",
feature_sprint: 4,
feature_sprint: 215,
feature_week: 1,
description: "Federal government spending may seem like a distant or complicated topic – one that is best understood by government officials or journalists.",
slug: "exploring-spending-in-your-community",
Expand Down Expand Up @@ -369,7 +369,7 @@ const articles = [
title: "Understanding Four Government Data Source Systems",
banner_subtitle: "Learn Where USAspending.gov Data Comes From",
created_date: "05/28/26",
feature_sprint: 10,
feature_sprint: 221,
feature_week: 2,
description: "You might be wondering: where does the data on USAspending.gov come from? Since our goal is to promote open data and foster open government, we'd love to tell",
slug: "understanding-four-government-data-source-systems",
Expand Down Expand Up @@ -409,7 +409,7 @@ const articles = [
title: "John’s USAspending Search",
banner_subtitle: "Follow the Money Using USAspending.gov’s Spending Explorer",
created_date: "06/04/2026",
feature_sprint: 10,
feature_sprint: 221,
feature_week: 3,
description: "The reasons for visiting USAspending.gov are as unique and varied as the users themselves. Many of our users have specific, personalized searches",
slug: "johns-usaspending-search",
Expand Down Expand Up @@ -451,7 +451,7 @@ const articles = [
title: "Using Popular Filters on USAspending.gov",
banner_subtitle: "Unlocking the Power of USAspending’s Advanced Search",
created_date: "02/26/2026",
feature_sprint: 6,
feature_sprint: 217,
feature_week: 1,
sections: ["Federal Spending Transparency and Accountability", "Market Research", "Grant Opportunities and Compliance", "Federal Spending Trends and Stories"],
description: "USAspending’s Advanced Search is designed to change that. With a set of powerful filters, you can pinpoint exactly where and how federal dollars are spent.",
Expand Down Expand Up @@ -498,7 +498,7 @@ const articles = [
title: "Awarding Agency vs. Funding Agency",
banner_subtitle: "What's the Difference Between Awarding Agency and Funding Agency?",
created_date: "06/11/2026",
feature_sprint: 10,
feature_sprint: 222,
feature_week: 1,
sections: ["Federal Spending Transparency and Accountability", "Market Research", "Grant Opportunities and Compliance", "Federal Spending Trends and Stories"],
description: "In the “Agency” section of USAspending’s advanced search, you’ll see the option to search by Awarding Agency or Funding Agency. But what’s the difference?",
Expand Down Expand Up @@ -540,7 +540,7 @@ const articles = [
title: "The Story of Spending Transparency",
banner_subtitle: "Learn How USAspending.gov Came to Be",
created_date: "05/21/2026",
feature_sprint: 10,
feature_sprint: 221,
feature_week: 1,
description: "The U.S. is one of the few countries worldwide that makes federal spending data accessible to the public. But before USAspending.gov existed, much",
slug: "the-story-of-spending-transparency",
Expand All @@ -560,7 +560,7 @@ const articles = [
title: "Keon's USAspending Search",
banner_subtitle: "Learn How to Search Government Contracts for Local Businesses",
created_date: "03/19/2026",
feature_sprint: 7,
feature_sprint: 218,
feature_week: 1,
description: "In our feature, “My USAspending Search,” we highlight one of our users and their unique approach to searching government spending open data.",
slug: "keons-usaspending-search",
Expand Down Expand Up @@ -601,7 +601,7 @@ const articles = [
title: "Preserving America’s Story",
banner_subtitle: "How Federal Spending Protects America’s Parks and Monuments",
created_date: "04/09/2026",
feature_sprint: 8,
feature_sprint: 219,
feature_week: 1,
description: "When you hear the term federal spending, you may think of big-ticket items like military, healthcare, or social services. But did you know that every year,",
slug: "preserving-americas-story",
Expand Down Expand Up @@ -632,7 +632,7 @@ const articles = [
title: "What Is a Loan?",
banner_subtitle: "Learn About the Types of Loans on USAspending.gov",
created_date: "04/09/2026",
feature_sprint: 8,
feature_sprint: 219,
feature_week: 1,
description: "On USAspending's Advanced Search, loans are found under Award Type; users can search for two different types of loans: direct loans and guaranteed/insured loans",
slug: "what-is-a-loan",
Expand Down Expand Up @@ -673,7 +673,7 @@ const articles = [
title: "Celebrating Small Business Week",
banner_subtitle: "Small Business Spending on USAspending.gov",
created_date: "05/07/2026",
feature_sprint: 9,
feature_sprint: 220,
feature_week: 2,
description: "National Small Business Week shines a spotlight on the entrepreneurs and innovators who drive America’s economy. From neighborhood start-ups",
slug: "celebrating-small-business-week",
Expand Down Expand Up @@ -714,7 +714,7 @@ const articles = [
title: "Government Financial Transparency: From Parchment to Digital Data",
banner_subtitle: "Exploring the Foundations of Government Spending Data",
created_date: "06/11/2026",
feature_sprint: 10,
feature_sprint: 222,
feature_week: 1,
description: "The phrase “government transparency” has become a modern buzzword, dominating headlines and conversations across all forms of media and at every level of government.",
slug: "government-financial-transparency-from-parchment-to-digital-data",
Expand All @@ -739,7 +739,7 @@ const articles = [
title: "Building America: 250 Years of Investment",
banner_subtitle: "How U.S. Government Spending Shaped the Nation’s Icons",
created_date: "06/18/2026",
feature_sprint: 10,
feature_sprint: 222,
feature_week: 2,
description: "Whether you’re visiting an American icon like the Hoover Dam, traveling to a different state on a highway, or watching a tiny version of Earth from outer space",
slug: "building-america-250-years-of-investment",
Expand Down Expand Up @@ -780,7 +780,7 @@ const articles = [
title: "Michael’s USAspending Search",
banner_subtitle: "Using USAspending.gov for Market Research",
created_date: "06/25/2026",
feature_sprint: 10,
feature_sprint: 222,
feature_week: 3,
description: "In “My USAspending Search,” we highlight one of our users and their unique approach to searching government spending open data. Meet Michael LeJeune.",
slug: "michaels-usaspending-search",
Expand Down
17 changes: 10 additions & 7 deletions src/js/helpers/homepageFeaturedContentHelper.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import articles from "../../config/featuredContent/featuredContentMetadata";
import { transformString } from "./featuredContent/featuredContentHelper";

const publishedSprint = 211;
const publishedDate = '11/13/2025';

// TODO: move partition to a more general helper file
const partition = (array, isValid) => array.reduce(
([pass, fail], elem) => (isValid(elem) ?
Expand All @@ -9,11 +12,11 @@ const partition = (array, isValid) => array.reduce(
);

const fallbackMarketingArticle = {
title: "Exploring America's Finances Has Never Been Easier",
title: "Exploring America's Finances",
fill: '#1b2b85',
thumbnail_path: "../../img/featuredContent/thumbnails/exploring-americas-finances-has-never-been-easier-thumbnail.webp",
thumbnail_path: "../../img/featuredContent/thumbnails/exploring-americas-finances-thumbnail.webp",
taxonomy: "Exploring America's Finances",
slug: "exploring-americas-finances-has-never-been-easier"
slug: "exploring-americas-finances"
};

const fallbackOtherArticle = {
Expand Down Expand Up @@ -50,20 +53,20 @@ const getOtherArticle = (otherArticleCadence, otherArticles, featureWeekNum, fea
* @param dayOneString - determines the start date for the date calculations, new sprints start on Thursdays
* @returns {[(*&{url: string, title: *, overline: *})|(*&{url: string, overline: *})|*|{title: string, fill: string, thumbnail_path: string, taxonomy: string},(*&{url: string, title: *, overline: *})|(*&{url: string, overline: *})|*|{title: string, fill: string, thumbnail_path: string, taxonomy: string}]}
*/
const getCurrentArticles = (otherArticleCadence, dayOneString = '11/13/2025') => {
const getCurrentArticles = (otherArticleCadence, dayOneString = publishedDate) => {
/* eslint-enable max-len */
// get the sprint number and week number from today's date and start date
const today = new Date();
const dayOne = new Date(dayOneString);
const weekDifference = (today - dayOne) > 0 ?
Math.ceil(((today - dayOne) / 604800000)) :
1;
Math.ceil(((today - dayOne) / 604800000)) : 1;

const featureSprintNum = weekDifference > 0 ? Math.ceil(weekDifference / 3) : 1;
const featureWeekNum = weekDifference - ((featureSprintNum - 1) * 3);

// get the current sprint's articles and partition based on content_type === 'Marketing'
const currentArticles = articles
.filter((article) => article.feature_sprint === featureSprintNum);
.filter((article) => article.feature_sprint - publishedSprint === featureSprintNum);
const [marketingArticles, otherArticles] = partition(
currentArticles,
(article) => article.content_type === 'Marketing'
Expand Down
6 changes: 3 additions & 3 deletions tests/helpers/homepageFeaturedContentHelper-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ describe('getCurrentArticles', () => {
url, fill, thumbnail_path: thumbnailPath, taxonomy, title
} = marketing;

expect(url).toBe('/featured-content/exploring-americas-finances/exploring-americas-finances-has-never-been-easier');
expect(url).toBe('/featured-content/exploring-americas-finances/exploring-americas-finances');
expect(fill).toBe('#1b2b85');
expect(thumbnailPath).toBe('../../img/featuredContent/thumbnails/exploring-americas-finances-has-never-been-easier-thumbnail.webp');
expect(thumbnailPath).toBe('../../img/featuredContent/thumbnails/exploring-americas-finances-thumbnail.webp');
expect(taxonomy).toBe('Exploring America\'s Finances');
expect(title).toBe('Exploring America\'s Finances Has Never Been Easier');
expect(title).toBe('Exploring America\'s Finances');

const {
url: urlOther,
Expand Down
Loading