Skip to content

Commit

Permalink
Feature: Setup multi-seller auction table (#917)
Browse files Browse the repository at this point in the history
* Fix replacer function.

* Uplift multiseller state

* Memoise data for unnecessary side effects

* Add auction events for multi-seller.

* Use state instead of constant.

* Fix transformer.

* Fix Ad Unit Code and Ad Container Size in Bids tab in the bottom table shouldn’t be empty

* Update data for ad unit and time

---------

Co-authored-by: Amoghavarsha Kudaligi <[email protected]>
Co-authored-by: sayedtaqui <[email protected]>
  • Loading branch information
3 people authored Jan 21, 2025
1 parent 98e8c62 commit 5e1f565
Show file tree
Hide file tree
Showing 10 changed files with 268 additions and 159 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ const setUpAdUnitCode = (steps, index) => {
},
{
title: 'adunit-code',
description: 'div-200-1',
description: 'div-200-2',
type: 'box',
color: colors.box.browser,
},
{
title: 'adunit-code',
description: 'div-200-1',
description: 'div-200-3',
type: 'box',
color: colors.box.browser,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@ const setupBranches = (steps, index) => {
currentIndex: index,
branches: [
{
date: '2024-10-02',
time: '10:00:22PM',
date: 'Sun, 01 October 2023',
time: '6:30:00 GMT',
type: 'datetime',
},
{
date: '2024-10-03',
time: '11:00:22PM',
date: 'Sun, 01 October 2023',
time: '6:31:00 GMT',
type: 'datetime',
},
{
date: '2024-10-03',
time: '11:00:22PM',
date: 'Sun, 01 October 2023',
time: '6:32:00 GMT',
type: 'datetime',
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import React from 'react';
*/
import AuctionPanel from './panel';
import type { AuctionEventsType } from '../../../../stateProviders/protectedAudience/context';
import type { AdUnitLiteral } from '../explorableExplanation';
import type { AdUnitLiteral } from '../explorableExplanation/auctionEventTransformers';

interface AuctionsContainerProps {
auctionEvents: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
/**
* External dependencies.
*/
import React, { useEffect, useState } from 'react';
import React, { useEffect, useMemo, useState } from 'react';
import {
SIDEBAR_ITEMS_KEYS,
useSidebar,
Expand Down Expand Up @@ -65,6 +65,12 @@ const Auctions = () => {
updateSelectedItemKey: actions.updateSelectedItemKey,
}));

const auctionData = useMemo(() => {
return {
auctionData: auctionEvents,
};
}, [auctionEvents]);

if (!isUsingCDP) {
return (
<div className="w-full h-full flex items-center justify-center">
Expand Down Expand Up @@ -102,9 +108,7 @@ const Auctions = () => {
<Breakpoints />
<div className="overflow-auto flex-1">
<AuctionsContainer
auctionEvents={{
auctionData: auctionEvents,
}}
auctionEvents={auctionData}
sidebarData={sidebarData}
setSidebarData={setSidebarData}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import type { AuctionEventsType } from '../../../../../stateProviders/protectedA
import AuctionTable from '../table';
import AdunitPanel from '../adunitPanel';
import AdunitSubPanel from '../adunitPanel/panel';
import type { AdUnitLiteral } from '../../explorableExplanation';
import type { AdUnitLiteral } from '../../explorableExplanation/auctionEventTransformers';

interface AuctionPanelProps {
auctionEvents: {
Expand Down Expand Up @@ -78,7 +78,6 @@ const AuctionPanel = ({
...adUnitChildren[time]?.children,
} as SidebarItems;
const sellerUrl = Object.keys(auctionEventsData[adUnit][time])[0];

const entries = Object.entries(
auctionEventsData[adUnit][time][sellerUrl]
)
Expand Down
Loading

0 comments on commit 5e1f565

Please sign in to comment.