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

Enhancement: Update synthetic data for distinction #918

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
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
5 changes: 4 additions & 1 deletion packages/explorable-explanations/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,7 @@ export {
interestGroupSketch,
sketch,
} from './protectedAudience';
export { default as config } from './protectedAudience/config.js';
export {
default as config,
publisherData,
} from './protectedAudience/config.js';
49 changes: 49 additions & 0 deletions packages/explorable-explanations/src/protectedAudience/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,13 @@ const config = {
visited: false,
visitedIndex: null,
},
{
type: 'publisher',
website: 'pub3.com',
datetime: '2023-10-01 16:00',
visited: false,
visitedIndex: null,
},
],
colors: {
visitedBlue: '#1A73E8',
Expand Down Expand Up @@ -138,3 +145,45 @@ const config = {
};

export default config;

export const publisherData = {
'pub1.com': {
branches: [
{ date: 'Sun, 01 October 2023', time: '12:00:00 GMT', type: 'datetime' },
{ date: 'Sun, 01 October 2023', time: '12:01:00 GMT', type: 'datetime' },
{ date: 'Sun, 01 October 2023', time: '12:02:00 GMT', type: 'datetime' },
],
adunits: ['div-200-1', 'div-200-2', 'div-200-3'],
ssps: [
['SSP A', 'https://ssp-a.com'],
['SSP B', 'https://ssp-b.com'],
['SSP C', 'https://ssp-c.com'],
],
},
'pub2.com': {
branches: [
{ date: 'Sun, 01 October 2023', time: '14:00:00 GMT', type: 'datetime' },
{ date: 'Sun, 01 October 2023', time: '14:01:00 GMT', type: 'datetime' },
{ date: 'Sun, 01 October 2023', time: '14:02:00 GMT', type: 'datetime' },
],
adunits: ['div-400-1', 'div-400-2', 'div-400-3'],
ssps: [
['SSP D', 'https://ssp-d.com'],
['SSP E', 'https://ssp-e.com'],
['SSP F', 'https://ssp-f.com'],
],
},
'pub3.com': {
branches: [
{ date: 'Sun, 01 October 2023', time: '16:00:00 GMT', type: 'datetime' },
{ date: 'Sun, 01 October 2023', time: '16:01:00 GMT', type: 'datetime' },
{ date: 'Sun, 01 October 2023', time: '16:02:00 GMT', type: 'datetime' },
],
adunits: ['div-600-1', 'div-600-2', 'div-600-3'],
ssps: [
['SSP G', 'https://ssp-g.com'],
['SSP H', 'https://ssp-h.com'],
['SSP I', 'https://ssp-i.com'],
],
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ auction.setUp = (index) => {
if (app.isMultiSeller) {
setUpMultiSellerFirstSSPTagFlow(steps);
setUpPublisherAdServerFlow(steps);
setUpComponentAuctions(steps);
setUpComponentAuctions(steps, index);
} else {
setUpSingleSellerFirstSSPTagFlow(steps);
setUpRunadAuction(steps);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* Internal dependencies.
*/
import app from '../../../app';
import config from '../../../config';
import config, { publisherData } from '../../../config';
import { Box, ProgressLine, Text, Custom } from '../../../components';
import setUpRunadAuction from '../setUpRunadAuction';

Expand All @@ -29,8 +29,9 @@ const BOX_COLUMN_MARGIN = 390;

const boxCordinates = {};

const setUpComponentAuctions = (steps) => {
const setUpComponentAuctions = (steps, index) => {
const { box } = config.flow;
const publisher = config.timeline.circles[index].website;

steps.push({
component: ProgressLine,
Expand Down Expand Up @@ -76,7 +77,7 @@ const setUpComponentAuctions = (steps) => {
BORDER_BOX_MARGIN * 2 +
20,
y: () => app.auction.nextTipCoordinates?.y - 225 - 15,
ssp: 'SSP A',
ssp: publisherData[publisher].ssps[0][0],
config: {
bidValue: '$10',
},
Expand All @@ -89,7 +90,7 @@ const setUpComponentAuctions = (steps) => {
BOX_HEIGHT +
BORDER_BOX_MARGIN * 2 +
15,
ssp: 'SSP B',
ssp: publisherData[publisher].ssps[1][0],
config: {
bidValue: '$8',
},
Expand All @@ -102,19 +103,19 @@ const setUpComponentAuctions = (steps) => {
BOX_HEIGHT +
BORDER_BOX_MARGIN * 2 +
15,
ssp: 'SSP C',
ssp: publisherData[publisher].ssps[2][0],
config: {
bidValue: '$6',
},
},
];

componentAuctions.forEach((componentAuction, index) => {
componentAuctions.forEach((componentAuction, idx) => {
setUpComponentAuction(
steps,
componentAuction,
componentAuction.config,
index
idx
);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@
* Internal dependencies.
*/
import app from '../../app';
import config from '../../config';
import config, { publisherData } from '../../config';
import flow from '../flow';
import { Branches } from '../../components';

const setUpAdUnitCode = (steps, index) => {
const { colors } = config.flow;
const { x, y } = flow.getTimelineCircleCoordinates(index);
const publisher = config.timeline.circles[index].website;

// Setup Ad unit codes
steps.push({
Expand All @@ -35,19 +36,19 @@ const setUpAdUnitCode = (steps, index) => {
branches: [
{
title: 'adunit-code',
description: 'div-200-1',
description: publisherData[publisher].adunits[0],
type: 'box',
color: colors.box.browser,
},
{
title: 'adunit-code',
description: 'div-200-2',
description: publisherData[publisher].adunits[1],
type: 'box',
color: colors.box.browser,
},
{
title: 'adunit-code',
description: 'div-200-3',
description: publisherData[publisher].adunits[2],
type: 'box',
color: colors.box.browser,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@
*/
import app from '../../app';
import { Branches } from '../../components';
import config, { publisherData } from '../../config';

const setupBranches = (steps, index) => {
const publisher = config.timeline.circles[index].website;

steps.push({
component: Branches,
props: {
Expand All @@ -28,18 +31,18 @@ const setupBranches = (steps, index) => {
currentIndex: index,
branches: [
{
date: 'Sun, 01 October 2023',
time: '6:30:00 GMT',
date: publisherData[publisher].branches[0].date,
time: publisherData[publisher].branches[0].time,
type: 'datetime',
},
{
date: 'Sun, 01 October 2023',
time: '6:31:00 GMT',
date: publisherData[publisher].branches[1].date,
time: publisherData[publisher].branches[1].time,
type: 'datetime',
},
{
date: 'Sun, 01 October 2023',
time: '6:32:00 GMT',
date: publisherData[publisher].branches[2].date,
time: publisherData[publisher].branches[2].time,
type: 'datetime',
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ const AuctionPanel = ({
props: {
auctionEvents: events,
parentOrigin: events[0]?.auctionConfig?.seller,
startDate: time,
},
},
children: {},
Expand All @@ -114,6 +115,7 @@ const AuctionPanel = ({
parentOrigin:
auctionEventsData[adUnit][time][sellerUrl][sellerUrl][0]
?.auctionConfig?.seller,
startDate: time,
},
},
children,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@ import BottomTray from './bottomTray';
interface AuctionTableProps {
auctionEvents: singleAuctionEvent[];
parentOrigin?: string;
startDate?: string;
}

const AuctionTable = ({
auctionEvents,
parentOrigin = '',
startDate = '',
}: AuctionTableProps) => {
const [selectedJSON, setSelectedJSON] = useState<singleAuctionEvent | null>(
null
Expand Down Expand Up @@ -179,7 +181,11 @@ const AuctionTable = ({
>
<div className="flex justify-between items-center p-2">
<p>Started by: {auctionEvents?.[0]?.auctionConfig?.seller}</p>
<p>{new Date(auctionEvents?.[0]?.time * 1000 || '').toUTCString()}</p>
<p>
{startDate
? startDate
: new Date(auctionEvents?.[0]?.time * 1000 || '').toUTCString()}
</p>
</div>
<div className="flex-1 border border-american-silver dark:border-quartz overflow-auto">
<TableProvider
Expand Down
Loading
Loading