@@ -4,10 +4,12 @@ import { PayloadAndType } from "./types/PayloadAndType";
44import { neutral , palette , space } from "@guardian/source-foundations" ;
55import { GridStaticImageDisplay } from "./grid/gridStaticImageDisplay" ;
66import { GridDynamicSearchDisplay } from "./grid/gridDynamicSearchDisplay" ;
7- import { TelemetryContext , PINBOARD_TELEMETRY_TYPE } from "./types/Telemetry" ;
7+ import { PINBOARD_TELEMETRY_TYPE , TelemetryContext } from "./types/Telemetry" ;
88import { Tab } from "./types/Tab" ;
99import { FloatingClearButton } from "./floatingClearButton" ;
1010import { MamVideoDisplay } from "./mam/mamVideoDisplay" ;
11+ import { IMAGING_REQUEST_ITEM_TYPE } from "shared/octopusImaging" ;
12+ import { OctopusImagingOrderDisplay } from "./grid/octopusImagingOrderDisplay" ;
1113
1214interface PayloadDisplayProps {
1315 payloadAndType : PayloadAndType ;
@@ -22,7 +24,6 @@ export const PayloadDisplay = ({
2224 tab,
2325 shouldNotBeClickable,
2426} : PayloadDisplayProps ) => {
25- const { payload } = payloadAndType ;
2627 const sendTelemetryEvent = useContext ( TelemetryContext ) ;
2728 return (
2829 < div
@@ -58,26 +59,29 @@ export const PayloadDisplay = ({
5859 ` }
5960 draggable = { ! shouldNotBeClickable }
6061 onDragStart = { ( event ) => {
61- event . dataTransfer . setData ( "URL" , payload . embeddableUrl ) ;
62+ event . dataTransfer . setData (
63+ "URL" ,
64+ payloadAndType . payload . embeddableUrl
65+ ) ;
6266 event . dataTransfer . setData (
6367 // prevent grid from accepting these as drops, as per https://github.com/guardian/grid/commit/4b72d93eedcbacb4f90680764d468781a72507f5#diff-771b9da876348ce4b4e057e2d8253324c30a8f3db4e434d49b3ce70dbbdb0775R138-R140
6468 "application/vnd.mediaservice.kahuna.image" ,
6569 "true"
6670 ) ;
6771 sendTelemetryEvent ?.( PINBOARD_TELEMETRY_TYPE . DRAG_FROM_PINBOARD , {
68- assetType : payloadAndType ? .type ,
72+ assetType : payloadAndType . type ,
6973 ...( tab && { tab } ) ,
7074 } ) ;
7175 } }
7276 onClick = {
7377 shouldNotBeClickable
7478 ? undefined
7579 : ( ) => {
76- window . open ( payload . embeddableUrl , "_blank" ) ;
80+ window . open ( payloadAndType . payload . embeddableUrl , "_blank" ) ;
7781 sendTelemetryEvent ?.(
7882 PINBOARD_TELEMETRY_TYPE . GRID_ASSET_OPENED ,
7983 {
80- assetType : payloadAndType ? .type ,
84+ assetType : payloadAndType . type ,
8185 tab : tab as Tab ,
8286 }
8387 ) ;
@@ -106,6 +110,14 @@ export const PayloadDisplay = ({
106110 />
107111 ) }
108112
113+ { payloadAndType . type === IMAGING_REQUEST_ITEM_TYPE && (
114+ < OctopusImagingOrderDisplay
115+ type = { payloadAndType . type }
116+ payload = { payloadAndType . payload }
117+ isEditable = { ! ! clearPayloadToBeSent }
118+ />
119+ ) }
120+
109121 { clearPayloadToBeSent && (
110122 < FloatingClearButton clear = { clearPayloadToBeSent } />
111123 ) }
0 commit comments