Skip to content

Commit

Permalink
feat(topics): Add new 'Home' topic as an option in the tool
Browse files Browse the repository at this point in the history
  • Loading branch information
nina-py committed Aug 2, 2024
1 parent 6a07cf9 commit 3eec708
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
16 changes: 16 additions & 0 deletions src/api/generatedTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1889,6 +1889,19 @@ export type RescheduleScheduledCorpusItemInput = {
source: ScheduledItemSource;
};

/** Contains information about the human curator who reviewed the schedule for a given date and scheduled surface. */
export type ScheduleReview = {
__typename?: 'ScheduleReview';
/** A Unix timestamp of when the scheduled was last reviewed. */
reviewedAt: Scalars['Date'];
/** A single sign-on user identifier of the user who reviewed the schedule. */
reviewedBy: Scalars['String'];
/** The date of the schedule that was reviewed, in YYYY-MM-DD format. */
scheduledDate: Scalars['Date'];
/** The GUID of the scheduledSurface that was reviewed. */
scheduledSurfaceGuid: Scalars['ID'];
};

/**
* A scheduled entry for an Approved Item to appear on a Scheduled Surface.
* For example, a story that is scheduled to appear on December 31st, 2021 on the New Tab in Firefox for the US audience.
Expand Down Expand Up @@ -1935,6 +1948,8 @@ export type ScheduledCorpusItemsResult = {
collectionCount: Scalars['Int'];
/** An array of items for a given Scheduled Surface */
items: Array<ScheduledCorpusItem>;
/** The human review status of the schedule for the given scheduledSurfaceGuid & scheduledDate. */
scheduleReview?: Maybe<ScheduleReview>;
/** The date items are scheduled for, in YYYY-MM-DD format. */
scheduledDate: Scalars['Date'];
/** The number of syndicated articles for the scheduled date. */
Expand Down Expand Up @@ -2104,6 +2119,7 @@ export enum Topics {
Food = 'FOOD',
Gaming = 'GAMING',
HealthFitness = 'HEALTH_FITNESS',
Home = 'HOME',
Parenting = 'PARENTING',
PersonalFinance = 'PERSONAL_FINANCE',
Politics = 'POLITICS',
Expand Down
3 changes: 2 additions & 1 deletion src/curated-corpus/helpers/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface DropdownOption {
code: string;
name: string;
}
// This is a list of topics. The 15 "standard" topics + coronavirus.
// This is a list of topics. The 16 "standard" topics + coronavirus.
export const topics: DropdownOption[] = [
{ code: Topics.Business, name: 'Business' },
{ code: Topics.Career, name: 'Career' },
Expand All @@ -23,6 +23,7 @@ export const topics: DropdownOption[] = [
{ code: Topics.Food, name: 'Food' },
{ code: Topics.Gaming, name: 'Gaming' },
{ code: Topics.HealthFitness, name: 'Health & Fitness' },
{ code: Topics.Home, name: 'Home' },
{ code: Topics.Parenting, name: 'Parenting' },
{ code: Topics.PersonalFinance, name: 'Personal Finance' },
{ code: Topics.Politics, name: 'Politics' },
Expand Down
2 changes: 1 addition & 1 deletion src/curated-corpus/helpers/topics.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ describe('helper functions related to topics', () => {

it('returns a list of topics without "Coronavirus" if requested', () => {
const topics = getGroupedTopicData(data, true, false);
expect(topics).to.be.an('array').with.lengthOf(15);
expect(topics).to.be.an('array').with.lengthOf(16);
});

it('returns a full list of topics if requested', () => {
Expand Down

0 comments on commit 3eec708

Please sign in to comment.