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,OAAOC,cAAgB,GAC7CD,OAAOC,aAAaC,eAAcpF,EAAAA,EAAA,GACPkF,OAAOC,aAAaC,gBAAkB,IACtCA,UC1F3BE,EAAOC,QAAU1H,cCAjByH,EAAOC,QAAUC","sources":["webpack://Msdyn365.Commerce.Online/./src/actions/getProductInterchangeDetails.ts?a22c","webpack://Msdyn365.Commerce.Online/./src/actions/get-custom-product-interchange.action.ts?80c6","webpack://Msdyn365.Commerce.Online/./src/modules/genera-product-interchanges/genera-product-interchanges.props.autogenerated.ts?6293","webpack://Msdyn365.Commerce.Online/./src/modules/genera-product-interchanges/components/product-custom-specification-table-stucture.tsx?b803","webpack://Msdyn365.Commerce.Online/./src/modules/genera-product-interchanges/genera-product-interchanges.tsx?ea02","webpack://Msdyn365.Commerce.Online/./src/modules/genera-product-interchanges/genera-product-interchanges.view.tsx?3075","webpack://Msdyn365.Commerce.Online/./lib/genera-product-interchanges/module-registration.js?b284","webpack://Msdyn365.Commerce.Online/external var \"React\"?0d3b","webpack://Msdyn365.Commerce.Online/external var \"ReactDOM\"?853b"],"sourcesContent":["import { AsyncResult, callActionOrExecute, DataServiceQuery, IContext, IDataServiceRequest, IQueryResultSettings } from '@msdyn365-commerce/retail-proxy';\r\n// @ts-ignore\r\nimport * as EntityClasses from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceModels.g';\r\nimport * as DataServiceEntities from './AlternateItemsEntity.g';\r\n\r\nfunction getProductInterchangeDetailsQuery(): DataServiceQuery {\r\n return new DataServiceQuery();\r\n }\r\n\r\n\r\nexport function getProductInterchangeDetailsInput (\r\n queryResultSettings: IQueryResultSettings, productId:\r\n number\r\n): IDataServiceRequest {\r\nconst query = getProductInterchangeDetailsQuery().resultSettings(queryResultSettings);\r\nreturn query.createDataServiceRequestForOperation(\r\n 'GetProductInterchangeDetails',\r\n true,\r\n DataServiceEntities.ProductInterchangesEntityExtensionClass\r\n ,\r\n 'true',\r\n { bypassCache: 'get', returnEntity: 'DataServiceEntities.IProductInterchangesEntity' },\r\n {\r\n ProductId: productId\r\n }\r\n);\r\n}\r\n\r\nexport function getProductInterchangeDetailsAsync (\r\n context: IContext, productId:\r\n number\r\n ): AsyncResult {\r\n const request = getProductInterchangeDetailsInput(\r\n context.queryResultSettings || {}, productId);\r\n return callActionOrExecute(request, context.callerContext);\r\n }\r\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport {getSelectedProductIdFromActionInput } from '@msdyn365-commerce-modules/retail-actions';\n// import { IAny, ICreateActionContext, IGeneric } from '@msdyn365-commerce/core';\nimport { AttributeValue } from '@msdyn365-commerce/retail-proxy';\n// import {getByIdAsync, searchByCriteriaAsync} from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\n import {getProductInterchangeDetailsAsync} from './getProductInterchangeDetails';\n\n/**\n * GetCustomProductSpec Input Action\n */\nexport class GetCustomProductInterchangeInput implements Msdyn365.IActionInput {\n // TODO: Construct the input needed to run the action\n public productId: number;\n\n public channelId: number;\n\n public config: any;\n\n constructor(productId: number, channelId: number, config: any) {\n this.channelId = channelId;\n this.productId = productId;\n this.config = config;\n }\n\n // TODO: Determine if the results of this get action should cache the results and if so provide\n // a cache object type and an appropriate cache key\n public getCacheKey = () => `GetCustomProductInte${this.productId}`;\n public getCacheObjectType = () => 'Interchange';\n public dataCacheType = (): Msdyn365.CacheType => 'none';\n}\n\n// TODO: Create a data model here or import one to capture the response of the action\n// export interface IGetCustomProductSpecData {\n// text: string;\n// }\n\n/**\n * TODO: Use this function to create the input required to make the action call\n */\nconst createInput = (inputData: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\n const productId = getSelectedProductIdFromActionInput(inputData);\n if(productId)\n {\n return new GetCustomProductInterchangeInput(+productId, +inputData.requestContext.apiSettings.channelId, inputData.config);\n\n }\n throw new Error('Unable to create SelectedVariantInput, no productId found on module config or query');\n};\n\n/**\n * TODO: Use this function to call your action and process the results as needed\n */\nasync function action(input: GetCustomProductInterchangeInput, ctx: Msdyn365.IActionContext): Promise {\n const prodAttr:AttributeValue[] = new Array();\n const response = await getProductInterchangeDetailsAsync({callerContext: ctx},input.productId);\n if(response && response.length > 0)\n {\n // response = response.sort((x,y) => x.Interchange_Part_Number!.localeCompare(y.Interchange_Part_Number!));\n response.forEach(element =>{\n const attr:AttributeValue={AttributeValueId:element.Interchange_Id?+element.Interchange_Id:0,\n KeyName:element.Public_Display_Name,\n Name:element.Public_Display_Name,\n TextValue:element.Interchange_Part_Number\n ,DataTypeValue: 5 };\n prodAttr.push(attr);\n });\n }\n return prodAttr;\n}\n\nexport default Msdyn365.createObservableDataAction({\n action: >action,\n id: 'GetCustomProductInterchange',\n input: createInput\n});\n","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All rights reserved. See License.txt in the project root for license information.\r\n * IGeneraProductInterchanges contentModule Interface Properties\r\n * THIS FILE IS AUTO-GENERATED - MANUAL MODIFICATIONS WILL BE LOST\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\nexport const enum displayStyle {\r\n accordion = 'accordion',\r\n table = 'table'\r\n}\r\n\r\nexport interface IGeneraProductInterchangesConfig extends Msdyn365.IModuleConfig {\r\n heading?: IHeadingData;\r\n displayStyle?: displayStyle;\r\n className?: string;\r\n clientRender?: boolean;\r\n}\r\n\r\nexport interface IGeneraProductInterchangesResources {\r\n trueValueText: string;\r\n falseValueText: string;\r\n}\r\n\r\nexport const enum HeadingTag {\r\n h1 = 'h1',\r\n h2 = 'h2',\r\n h3 = 'h3',\r\n h4 = 'h4',\r\n h5 = 'h5',\r\n h6 = 'h6'\r\n}\r\n\r\nexport interface IHeadingData {\r\n text: string;\r\n tag?: HeadingTag;\r\n}\r\n\r\nexport interface IGeneraProductInterchangesProps extends Msdyn365.IModule {\r\n resources: IGeneraProductInterchangesResources;\r\n config: IGeneraProductInterchangesConfig;\r\n}\r\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\n/* eslint-disable no-duplicate-imports */\nimport { getRichTextHtml } from '@msdyn365-commerce/core';\nimport * as React from 'react';\n\n/**\n * Product specification table row.\n */\nexport interface IProductSpecificationTableRow {\n productName?: string;\n cellData?: React.ReactNode;\n className?: string;\n}\n\n/**\n * Product specification table row component.\n * @param props - For product specification table row.\n * @param props.productName - Product name.\n * @param props.cellData - Cell data.\n * @param props.className - Class name.\n * @returns - Returns JSX element.\n */\nexport const ProductSpecificationTableRow: React.FC = ({ productName, cellData, className }) => (\n \n \n \n \n \n { cellData }\n \n \n);\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as React from 'react';\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport classnames from 'classnames';\nimport { reaction } from 'mobx';\n// import { observer } from 'mobx-react';\nimport { AttributeValue } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { Drawer, IModuleProps, INodeProps, Module } from '@msdyn365-commerce-modules/utilities';\nimport { IGeneraProductInterchangesData } from './genera-product-interchanges.data';\nimport { displayStyle,IGeneraProductInterchangesProps } from './genera-product-interchanges.props.autogenerated';\nimport { ProductSpecificationTableRow } from './components/product-custom-specification-table-stucture';\n\nexport interface IProductInterchangesState {\n isDrawerOpen: boolean;\n drawerListId: number | undefined;\n}\n\nexport interface IGeneraProductInterchangesViewProps extends IGeneraProductInterchangesProps {\n ProductSpecification: IModuleProps;\n ProductSpecificationTableProps: INodeProps;\n ProductSpecificationTableBodyProps: INodeProps;\n productSpecificationResult?: (JSX.Element | null)[];\n title?: React.ReactNode;\n isAccrodion?: boolean;\n handleText?(event: Msdyn365.ContentEditableEvent): void;\n}\n\nexport interface IGeneraProductInterchangesExtentedProps extends IGeneraProductInterchangesProps {\n displayStyle?: displayStyle;\n}\n\n\n/**\n *\n * GeneraProductInterchanges component\n * @extends {React.PureComponent>}\n */\nclass GeneraProductInterchanges extends React.PureComponent {\n public constructor(props: IGeneraProductInterchangesExtentedProps) {\n super(props);\n this.state = {\n isDrawerOpen: false,\n drawerListId: undefined\n };\n }\n\n public async componentDidMount(): Promise {\n const { context, data } = this.props;\n // const catalogId = Msdyn365.getCatalogId(this.props.context.request);\n reaction(\n () => (data.product.result ? data.product.result.RecordId : null),\n () => {\n if (context && data.product.result) {\n\n // getProductSpecificationDetailsAsync({callerContext: this.props.context.actionContext},data.product.result.RecordId).catch((error: Error) => {\n // telemetry.error(error.message);\n // telemetry.debug('Unable to update attributes for Product');\n // telemetry.error(error.message);\n // });\n }\n }\n );\n }\n\n public shouldComponentUpdate(nextProps: IGeneraProductInterchangesExtentedProps,\n nextState: IProductInterchangesState): boolean {\n if (this.state === nextState && this.props.data === nextProps.data) {\n return false;\n }\n return true;\n }\n\n public render(): JSX.Element | null {\n let data: IGeneraProductInterchangesData;\n try {\n data = this.props.data;\n } catch (error) {\n this.props.telemetry.error(`Something went wrong ------${error}`);\n return (
\n {error}\n
);\n }\n\n if (!data.generaProductInterchangeData || (!data.generaProductInterchangeData.result || data.generaProductInterchangeData.result.length <= 0)) {\n this.props.telemetry.error('Product specification content is empty, module wont render.');\n return null;\n }\n\n const { heading, className } = this.props.config;\n const { generaProductInterchangeData } = this.props.data;\n const isAccrodion = this.props.config.displayStyle === displayStyle.accordion;\n const viewProps = {\n ...this.props,\n handleText: this.handleHeadingChange,\n ProductSpecification: {\n moduleProps: this.props,\n className: classnames('ms-product-specification', className)\n },\n ProductSpecificationTableProps: isAccrodion ? {\n moduleProps: this.props,\n className: classnames('ms-product-specification__accordion', className)\n } : {\n className: classnames('ms-product-specification__table table-striped table-bordered'),\n tag: 'table'\n },\n isAccrodion,\n ProductSpecificationTableBodyProps: isAccrodion ? {} : {\n className: '',\n tag: 'tbody'\n },\n title: heading?.text && (\n ),\n\n productSpecificationResult: isAccrodion ? generaProductInterchangeData.result && this._createDrawerBody(data) : generaProductInterchangeData.result && this._createTableBody(data)\n } as IGeneraProductInterchangesViewProps;\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n /**\n * Handle Heading Text Change.\n * @param event - Current event.\n */\n public handleHeadingChange = (event: Msdyn365.ContentEditableEvent): void => {\n this.props.config.heading!.text = event.target.value;\n };\n\n private _createTableBody(content: IGeneraProductInterchangesData): (JSX.Element | null)[] {\n return content.generaProductInterchangeData && content.generaProductInterchangeData.result && content.generaProductInterchangeData.result.length > 0 ?content.generaProductInterchangeData.result.map((product, index) => {\n const cellData: JSX.Element | null = this._renderProductCell(product);\n\n if (!cellData) {\n return null;\n }\n\n return (\n \n );\n }) : [];\n }\n\n private _createDrawerBody(content: IGeneraProductInterchangesData): (JSX.Element | null)[] {\n const accordionItemContainer: IModuleProps = {\n moduleProps: this.props,\n className: 'ms-product-specification-title'\n };\n return content.generaProductInterchangeData.result!.map((product) => {\n const cellData: JSX.Element | null = this._renderProductCell(product);\n if (!cellData) {\n return null;\n }\n return (\n \n \n
\n {cellData}\n
\n \n
\n );\n });\n }\n\n private readonly _toggle = (drawerListId: number | undefined) => (): void => {\n if (this.state.drawerListId !== drawerListId) {\n this.setState({ drawerListId, isDrawerOpen: true });\n } else {\n this.setState({ drawerListId: undefined, isDrawerOpen: false });\n }\n };\n\n private _renderProductCell(product: AttributeValue): JSX.Element | null {\n switch (product.DataTypeValue) {\n case 0: // None\n // Return span here instead of null so the row still shows\n return ;\n case 1: // Currency\n return this._renderCurrencyCell(product);\n case 2: // DateTime\n return this._renderDateTimeCell(product);\n case 3: // Decimal\n return this._renderDecimalCell(product);\n case 4: // Integer\n return this._renderIntegerCell(product);\n case 5: // Text\n return this._renderTextCell(product);\n case 6: // TrueFalse\n return this._renderTrueFalseCell(product);\n case 40: // Video\n this.props.telemetry.warning('Got video specification type, not supported yet so skipping line');\n return null;\n case 41: // Image\n this.props.telemetry.warning('Got image specification type, not supported yet so skipping line');\n return null;\n default:\n this.props.telemetry.warning(`Got unknown specification type ${product.DataTypeValue} so skipping line`);\n return null;\n }\n }\n\n private _renderCurrencyCell(product: AttributeValue): JSX.Element | null {\n if (product.CurrencyValue !== null && product.CurrencyValue !== undefined) {\n return (\n \n {product.CurrencyCode}\n {product.CurrencyValue}\n \n );\n }\n\n return null;\n }\n\n private _renderDateTimeCell(product: AttributeValue): JSX.Element | null {\n if (product.DateTimeOffsetValue?.toUTCString) {\n return (\n {product.DateTimeOffsetValue.toUTCString()}\n );\n }\n\n return null;\n }\n\n private _renderIntegerCell(product: AttributeValue): JSX.Element | null {\n if (product.IntegerValue !== null && product.IntegerValue !== undefined) {\n return (\n {product.IntegerValue}\n );\n }\n\n return null;\n }\n\n private _renderDecimalCell(product: AttributeValue): JSX.Element | null {\n if (product.FloatValue !== null && product.FloatValue !== undefined) {\n return (\n {product.FloatValue}\n );\n }\n\n return null;\n }\n\n private _renderTextCell(product: AttributeValue): JSX.Element | null {\n if (product.TextValue !== null && product.TextValue !== undefined) {\n return ;\n }\n\n return null;\n }\n\n private _renderTrueFalseCell(product: AttributeValue): JSX.Element | null {\n // TODO 20369885 setting to default value is needed to work around a platform bug where\n // config string value does not get its default value.\n if (product.BooleanValue) {\n return (\n {this.props.resources.trueValueText ? this.props.resources.trueValueText : 'Yes'}\n );\n }\n return (\n {this.props.resources.falseValueText ? this.props.resources.falseValueText : 'No'}\n );\n\n }\n}\n\nexport default GeneraProductInterchanges;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ArrayExtensions, ObjectExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IGeneraProductInterchangesViewProps } from './genera-product-interchanges';\n\nconst ProductInterchangeView: React.FC = props => {\n const { ProductSpecification, ProductSpecificationTableProps, ProductSpecificationTableBodyProps, productSpecificationResult } = props;\n const rowdata = productSpecificationResult &&\n ArrayExtensions.hasElements(productSpecificationResult) &&\n productSpecificationResult.filter((row) => !ObjectExtensions.isNullOrUndefined(row));\n\n return (\n rowdata && ArrayExtensions.hasElements(rowdata) ? (\n \n {props.title}\n \n \n { rowdata }\n \n \n ) : null\n );\n};\n\n\nexport default ProductInterchangeView;","const binding = { modules: {}, dataActions: {} };\n\n const registerActionId = (actionPath) => {\n if (binding.dataActions[actionPath] &&\n binding.dataActions[actionPath].default &&\n binding.dataActions[actionPath].default.prototype &&\n binding.dataActions[actionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[actionPath].default.prototype.id] = binding.dataActions[actionPath];\n } else {\n Object.keys(binding.dataActions[actionPath] || {}).forEach(exportName => {\n if (binding.dataActions[actionPath][exportName] &&\n binding.dataActions[actionPath][exportName].prototype &&\n binding.dataActions[actionPath][exportName].prototype.Action) {\n binding.dataActions[binding.dataActions[actionPath][exportName].prototype.id] = binding.dataActions[actionPath][exportName];\n }\n })\n }\n };\n\n const registerSanitizedActionPath = (sanitizedActionPath, dataAction) => {\n if (process.env.NODE_ENV === 'development') {\n if (!dataAction.default) {\n throw new Error('Data action path does not have a default export');\n }\n if (!(dataAction.default.prototype.id && binding.dataActions[dataAction.default.prototype.id]) || !binding.dataActions[sanitizedActionPath]) {\n binding.dataActions[sanitizedActionPath] = dataAction;\n }\n } else {\n binding.dataActions[sanitizedActionPath] = dataAction;\n if (!binding.dataActions[sanitizedActionPath].default) {\n throw new Error('Data action path ' + sanitizedActionPath + ' does not have a default export');\n }\n binding.dataActions[sanitizedActionPath].default.prototype.RegistrationId = sanitizedActionPath;\n if (binding.dataActions[sanitizedActionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[sanitizedActionPath].default.prototype.id] = sanitizedActionPath;\n }\n }\n };\n \n\n (binding.modules['genera-product-interchanges'] = {\n c: () => require('partner/modules/genera-product-interchanges/genera-product-interchanges.tsx'),\n $type: 'contentModule',\n da: [{name:'generaProductInterchangeData', path:'actions/get-custom-product-interchange.action', runOn: 0},{name:'product', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant', runOn: 0}],\n \n iNM: false,\n ns: '__local__',\n n: 'genera-product-interchanges',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/genera-product-interchanges'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'actions/get-custom-product-interchange.action';\n let dataAction = require('partner/actions/get-custom-product-interchange.action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n \n window.__bindings__ = window.__bindings__ || {};\n window.__bindings__.modules = {\n ...window.__bindings__.modules || {},\n ...binding.modules\n };\n \n window.__bindings__.dataActions = {\n ...window.__bindings__.dataActions || {},\n ...binding.dataActions\n };\n export const viewDictionary = {};\n viewDictionary['__local__|__local__|modules|genera-product-interchanges|genera-product-interchanges'] = {\n c: () => require('partner/modules/genera-product-interchanges/genera-product-interchanges.view.tsx'),\n cn: '__local__-__local__-genera-product-interchanges'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","module.exports = React;","module.exports = ReactDOM;"],"names":["getProductInterchangeDetailsInput","queryResultSettings","productId","DataServiceQuery","resultSettings","createDataServiceRequestForOperation","DataServiceEntities","bypassCache","returnEntity","ProductId","GetCustomProductInterchangeInput","constructor","channelId","config","getCacheKey","this","getCacheObjectType","dataCacheType","Msdyn365","action","async","input","ctx","prodAttr","Array","response","context","request","callActionOrExecute","callerContext","getProductInterchangeDetailsAsync","length","forEach","element","attr","AttributeValueId","Interchange_Id","KeyName","Public_Display_Name","Name","TextValue","Interchange_Part_Number","DataTypeValue","push","id","inputData","getSelectedProductIdFromActionInput","requestContext","apiSettings","Error","displayStyle","HeadingTag","ProductSpecificationTableRow","_ref","productName","cellData","className","React","scope","dangerouslySetInnerHTML","getRichTextHtml","GeneraProductInterchanges","props","super","handleHeadingChange","event","heading","text","target","value","_toggle","drawerListId","state","setState","isDrawerOpen","undefined","data","reaction","product","result","RecordId","shouldComponentUpdate","nextProps","nextState","render","_heading$tag","error","telemetry","generaProductInterchangeData","isAccrodion","accordion","viewProps","_objectSpread","handleText","ProductSpecification","moduleProps","classnames","ProductSpecificationTableProps","tag","ProductSpecificationTableBodyProps","title","editProps","onEdit","productSpecificationResult","_createDrawerBody","_createTableBody","renderView","content","map","index","_renderProductCell","key","accordionItemContainer","_product$Name","Module","Object","assign","Drawer","collapseProps","timeout","isOpen","openGlyph","closeGlyph","glyphPlacement","toggleButtonText","onToggle","_renderCurrencyCell","_renderDateTimeCell","_renderDecimalCell","_renderIntegerCell","_renderTextCell","_renderTrueFalseCell","warning","CurrencyValue","CurrencyCode","_product$DateTimeOffs","DateTimeOffsetValue","toUTCString","IntegerValue","FloatValue","BooleanValue","resources","trueValueText","falseValueText","rowdata","ArrayExtensions","hasElements","filter","row","ObjectExtensions","isNullOrUndefined","Node","binding","modules","dataActions","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","prototype","RegistrationId","c","require","$type","da","name","path","runOn","iNM","ns","n","p","pdp","md","window","__bindings__","viewDictionary","cn","module","exports","ReactDOM"],"sourceRoot":""}