Skip to content

Commit

Permalink
Add GuAP and GuReuters
Browse files Browse the repository at this point in the history
  • Loading branch information
bryophyta committed Jan 13, 2025
1 parent a7fdc90 commit 043a7f1
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 5 deletions.
1 change: 1 addition & 0 deletions newswires/app/conf/SourceFeedSupplierMapping.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ object SourceFeedSupplierMapping {

private val lookup = Map(
"REUTERS" -> List("REUTERS"),
"GUREUTERS" -> List("Reuters-Newswires"),
"AAP" -> List("AAP"),
"AP" -> List(
"ADVIS",
Expand Down
39 changes: 34 additions & 5 deletions newswires/client/src/SideNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
import { css } from '@emotion/react';
import { useCallback, useMemo, useState } from 'react';
import { SearchBox } from './SearchBox';
import { brandColours } from './sharedStyles';
import { AAPBrand, APBrand, PABrand, reutersBrand } from './sharedStyles';
import type { Query } from './sharedTypes';
import { useSearch } from './useSearch';

Expand All @@ -28,7 +28,36 @@ function decideLabelForQueryBadge(query: Query): string {
return labels.filter((label) => label.length > 0).join(' ');
}

const recognisedSuppliers = ['REUTERS', 'AP', 'AAP', 'PA', 'GuAP'];
const supplierData: Record<
string,
{
label: string;
colour: string;
}
> = {
REUTERS: { label: 'Reuters', colour: reutersBrand },
AP: {
label: 'AP',
colour: APBrand,
},
AAP: {
label: 'AAP',
colour: AAPBrand,
},
PA: {
label: 'PA',
colour: PABrand,
},
GuAP: {
label: 'AP (Gu)',
colour: APBrand,
},
GuReuters: {
label: 'Reuters (Gu)',
colour: reutersBrand,
},
};
const recognisedSuppliers = Object.keys(supplierData);
const buckets = [
{ id: 'no-sports', name: 'No Sports' },
{ id: 'pa-home', name: 'PA Home' },
Expand Down Expand Up @@ -98,11 +127,11 @@ export const SideNav = () => {
onClick: () => handleEnterQuery({ ...config.query, supplier: [] }),
colour: 'black',
},
...recognisedSuppliers.map((supplier) => ({
label: supplier,
...Object.entries(supplierData).map(([supplier, { label, colour }]) => ({
label,
isActive:
activeSuppliers.includes(supplier) || activeSuppliers.length === 0,
colour: brandColours.get(supplier) ?? 'black',
colour: colour,
onClick: () => toggleSupplier(supplier),
})),
],
Expand Down

0 comments on commit 043a7f1

Please sign in to comment.