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A,EAAqBrF,aAE1B,0BACI,4BACKyJ,EAEE,KACNpE,MAAAA,OALL,EAKKA,EAAqBlF,eAE1B,0BACI,4BACKwJ,EAEE,KACN,IACAtE,MAAAA,OANL,EAMKA,EAAqBpL,cAE1B,0BACI,4BACK2P,EAEE,KACN,IACAvE,MAAAA,OANL,EAMKA,EAAqBjF,sBAE1B,0BACI,4BACKyJ,EAEE,KACNxE,MAAAA,OALL,EAKKA,EAAqBhF,qBAEzBoI,GAAyB,0BACrBA,KAIb,gBAAC,KAAW,KACR,gBAAC,KAAM,CAACzjB,QAASymB,GACZd","sources":["webpack://@msdyn365-commerce-partners/fabrikam/./src/modules/order-template-list/components/order-template-list.tsx?86c4","webpack://@msdyn365-commerce-partners/fabrikam/./src/modules/order-template-list/components/orderTemplateList-status-message.tsx?183c","webpack://@msdyn365-commerce-partners/fabrikam/./src/modules/order-template-list/components/create-order-template.tsx?ea38","webpack://@msdyn365-commerce-partners/fabrikam/./src/modules/order-template-list/order-template-list.tsx?18d0","webpack://@msdyn365-commerce-partners/fabrikam/./src/modules/order-template-list/order-template-list.view.tsx?103b","webpack://@msdyn365-commerce-partners/fabrikam/./src/modules/order-template/actions/get-order-template.ts?077e","webpack://@msdyn365-commerce-partners/fabrikam/./src/modules/order-template/components/add-line/spinner.tsx?b423","webpack://@msdyn365-commerce-partners/fabrikam/./src/modules/order-template/components/add-line/add-line.tsx?5f8a","webpack://@msdyn365-commerce-partners/fabrikam/./src/modules/order-template/components/add-line/dropdown.tsx?1cba","webpack://@msdyn365-commerce-partners/fabrikam/./src/modules/order-template/components/add-line/not-found.tsx?392d","webpack://@msdyn365-commerce-partners/fabrikam/./src/modules/order-template/components/common/order-template-quantity.tsx?99a1","webpack://@msdyn365-commerce-partners/fabrikam/./src/modules/order-template/components/add-line/product-configuration.tsx?b256","webpack://@msdyn365-commerce-partners/fabrikam/./src/modules/order-template/components/add-line/product-list.tsx?4284","webpack://@msdyn365-commerce-partners/fabrikam/./src/modules/order-template/components/bulk-actions.tsx?dbe8","webpack://@msdyn365-commerce-partners/fabrikam/./src/modules/order-template/components/order-template-actions.tsx?8136","webpack://@msdyn365-commerce-partners/fabrikam/./src/modules/order-template/components/order-template-lines.tsx?3703","webpack://@msdyn365-commerce-partners/fabrikam/./src/modules/order-template/components/order-template-lines-status-message.tsx?2986","webpack://@msdyn365-commerce-partners/fabrikam/./src/modules/order-template/components/order-template-table-heading.tsx?665c","webpack://@msdyn365-commerce-partners/fabrikam/./src/modules/order-template/order-template.tsx?4ecb","webpack://@msdyn365-commerce-partners/fabrikam/./src/modules/order-template/order-template.view.tsx?a45e"],"sourcesContent":["/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { AddOrderTemplateToCartComponent, ILinesAddedToCartDialogResources } from '@msdyn365-commerce/components';\nimport { getUrlSync, ICoreContext, IImageSettings, Image, ITelemetry } from '@msdyn365-commerce/core';\nimport { ProductList } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { getFallbackImageUrl, getProductUrlSync, OrderTemplate, OrderTemplateLine } from '@msdyn365-commerce-modules/retail-actions';\nimport { Alert, Button, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IOrderTemplateActionMessageState } from '../order-template-list';\n\nexport interface ISingleOrderTemplateProps extends ProductList {\n orderTemplateState: IOrderTemplateActionMessageState;\n name?: string;\n orderTemplate: OrderTemplate;\n context: ICoreContext;\n imageSettings?: IImageSettings;\n enableImageProductLink?: boolean;\n removeFromOrderTemplateListText: string;\n addToBagText: string;\n index: number;\n itemKey: string;\n telemetry: ITelemetry;\n moduleId: string;\n moduleTypeName: string;\n handlers: {\n onRemoveOrderTemplate(id: string): void | undefined;\n onDismiss(): void;\n };\n resources: {\n closeWindowButtonText: string;\n addToCartFailureMessage: string;\n addToCartSuccessMessage: string;\n addToCartProcessMessage: string;\n linesAddedToCartDialogResources: ILinesAddedToCartDialogResources;\n };\n telemetryContent?: ITelemetryContent;\n}\n\nexport interface ISingleOrderTemplateViewProps {\n key: string;\n orderTemplateImage: React.ReactNode;\n addToCartButton?: React.ReactNode;\n removeButton?: React.ReactNode;\n orderTemplateStatusMessage?: React.ReactNode;\n orderTemplateName?: React.ReactNode;\n orderTemplateAriaLabel?: string;\n orderTemplateHeaderDivider?: React.ReactNode;\n}\n\nconst _removeItemFromOrderTemplateList = (props: ISingleOrderTemplateProps): void => {\n const { onRemoveOrderTemplate } = props.handlers;\n const { itemKey } = props;\n\n onRemoveOrderTemplate && itemKey && onRemoveOrderTemplate(itemKey);\n};\n\nconst OrderTemplateActions = {\n removeOrderTemplate: _removeItemFromOrderTemplateList\n};\n\n/**\n * Remove order template action.\n * @param input -Single order template props.\n * @returns Set remove order template.\n */\nconst removeOrderTemplateActionHandler = (input: ISingleOrderTemplateProps) => () => {\n OrderTemplateActions.removeOrderTemplate(input);\n};\n\nexport const OrderTemplateRender = (input: ISingleOrderTemplateProps): ISingleOrderTemplateViewProps | null => {\n const { Id, orderTemplate, removeFromOrderTemplateListText, orderTemplateState, handlers, name, imageSettings, context, telemetryContent, enableImageProductLink } = input;\n\n if (!Id) {\n return null;\n }\n\n const _getOrderTemplatePageUrl = (): string => {\n const url = getUrlSync('ordertemplate', context.actionContext) ?? '';\n const separator = url.includes('?') ? '&' : '?';\n if (Id) {\n return `${url}${separator}id=${Id}`;\n }\n return '';\n\n };\n\n const { onDismiss } = handlers;\n\n return {\n key: `${Id}-template`,\n orderTemplateImage: _renderOrderTemplateImages(context, orderTemplate.orderTemplateLines, imageSettings, enableImageProductLink),\n orderTemplateAriaLabel: _renderAriaLabel(input),\n orderTemplateName:\n (\n
\n
\n \n {name}\n \n
\n
\n {orderTemplate.totalLines}\n {' '}\n line items\n
\n
\n
\n ),\n addToCartButton:\n (\n
\n \n
\n ),\n removeButton:\n (\n \n ),\n orderTemplateStatusMessage: orderTemplateState && orderTemplateState.isOpen && orderTemplateState.userMessage &&\n (\n
\n \n \n {orderTemplateState.userMessage}\n \n \n
\n )\n\n };\n\n};\n\n/**\n * On image click handler.\n * @param productUrl -Product url value.\n * @returns Assign window location.\n */\nconst onClickHandler = (productUrl: string) => () => {\n window.location.assign(productUrl);\n};\n\nconst _renderOrderTemplateImages = (context: ICoreContext, orderTemplateLines?: OrderTemplateLine[],\n imageSettings?: IImageSettings, enableImageProductLink?: boolean): JSX.Element | null => {\n const defaultImageSettings: IImageSettings = {\n viewports: {\n xs: { q: 'w=140&h=140&m=6', w: 0, h: 0 },\n lg: { q: 'w=140&h=140&m=6', w: 0, h: 0 },\n xl: { q: 'w=140&h=140&m=6', w: 0, h: 0 }\n },\n lazyload: true\n };\n\n if (orderTemplateLines) {\n const count = orderTemplateLines.length < 4 ? orderTemplateLines.length : 4;\n\n return (\n
\n {orderTemplateLines?.slice(0, count).map(line => {\n const productUrl = line.fullProduct ? getProductUrlSync(line.fullProduct.ProductDetails, context.actionContext, undefined) : '';\n\n return ();\n })}\n
\n );\n }\n return (\n
\n );\n\n};\n\nconst _renderAriaLabel = (props: ISingleOrderTemplateProps): string => {\n const { name } = props;\n return (`${name}`);\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nimport { orderTemplateListStatus } from '../order-template-list';\n\nexport interface IOrderTemplateListStatusMessageProps {\n className?: string;\n errorType: orderTemplateListStatus;\n text?: string;\n}\n\nexport const OrderTemplateListStatusMessage: React.FC = ({ className, errorType, text }) => {\n switch (errorType) {\n case 'EMPTY':\n return (\n

\n { text }\n

\n );\n case 'FAILED':\n return (\n

\n { text }\n

\n );\n case 'LOADING':\n default:\n return (\n

\n { text }\n

\n );\n }\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { IOrderTemplateNameDialogResources, OrderTemplateNameDialog } from '@msdyn365-commerce/components';\nimport { IComponentProps } from '@msdyn365-commerce/core';\nimport React, { useState } from 'react';\n\nconst modalCloseButtonReference: React.RefObject = React.createRef();\n\n/**\n * The Create Order Template Button Props.\n */\nexport interface ICreateOrderTemplateButtonProps extends IComponentProps {\n\n /**\n * The label for create order template.\n */\n createOrderTemplateText: string;\n\n /**\n * The create order template dialog resources.\n */\n createOrderTemplateDialogResources: IOrderTemplateNameDialogResources;\n\n /**\n * The delegate to fire when dialog captured any user entry.\n */\n onOrderTemplateCreated(): Promise;\n}\n\nconst CreateOrderTemplateButton: React.FC = (props) => {\n const onCancelHandler = React.useCallback(() => {\n return;\n }, []);\n const [isCreateOrderTemplateDialogOpen, setOrderTemplateNameDialogOpen] = useState(false);\n const onCreateButtonClick = React.useCallback(() => {\n setOrderTemplateNameDialogOpen(true);\n }, []);\n\n return (\n <>\n \n {props.createOrderTemplateText}\n \n \n \n );\n};\n\nexport default CreateOrderTemplateButton;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { IOrderTemplateNameDialogResources } from '@msdyn365-commerce/components';\nimport { deleteAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductListsDataActions.g';\nimport { OrderTemplate } from '@msdyn365-commerce-modules/retail-actions';\nimport { Alert, Heading, IModuleProps, INodeProps } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\nimport { ISingleOrderTemplateProps, ISingleOrderTemplateViewProps, OrderTemplateListStatusMessage, OrderTemplateRender } from './components';\nimport CreateNewTemplateButtonComponent from './components/create-order-template';\nimport { IOrderTemplateListData } from './order-template-list.data';\nimport { HeadingTag, IOrderTemplateListProps, IOrderTemplateListResources } from './order-template-list.props.autogenerated';\n\nexport interface IOrderTemplateActionMessageState {\n itemKey: string;\n userMessage: string;\n statusCssString: string;\n messageGlyph: string;\n isOpen: boolean;\n headerStatusMessage: string;\n}\n\nexport type orderTemplateListStatus = 'LOADING' | 'SUCCESS' | 'FAILED' | 'EMPTY';\n\nexport interface IOrderTemplateListViewProps extends IOrderTemplateListProps {\n OrderTemplateList: IModuleProps;\n status?: orderTemplateListStatus;\n statusMessage?: React.ReactNode;\n heading?: React.ReactNode;\n OrderTemplates?: INodeProps;\n OrderTemplate?: INodeProps;\n orderTemplates?: ISingleOrderTemplateViewProps[];\n createOrderTemplateButton?: React.ReactNode;\n templateHeaderStatusMessage?: React.ReactNode;\n}\n\n/**\n *\n * OrderTemplateList component.\n * @extends {React.PureComponent, IOrderTemplateListActionMessageState>}\n */\n@observer\nclass OrderTemplateList extends React.Component, IOrderTemplateActionMessageState> {\n\n constructor(props: IOrderTemplateListProps) {\n super(props);\n this.state = {\n itemKey: '',\n userMessage: '',\n headerStatusMessage: '',\n statusCssString: 'success',\n messageGlyph: 'fas fa-check',\n isOpen: false\n };\n }\n\n public async componentDidMount(): Promise {\n this.setState({});\n }\n\n public shouldComponentUpdate(nextProps: IOrderTemplateListProps,\n nextState: IOrderTemplateActionMessageState): 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 const { className, heading } = this.props.config;\n const { emptyOrderTemplateText, createNewTemplateButtonText } = this.props.resources;\n const { orderTemplates } = this.props.data;\n const orderTemplatesData = orderTemplates && (orderTemplates).result;\n const orderTemplateListHeading = heading?.text ?? this.props.resources.orderTemplateListTitle;\n\n if (orderTemplates.status === 'LOADING') {\n const errorProps: IOrderTemplateListViewProps = {\n ...(this.props as IOrderTemplateListProps),\n OrderTemplateList: {\n moduleProps: this.props,\n className: classnames('ms-order-template', className)\n },\n status: 'LOADING',\n statusMessage: ,\n heading: (\n \n )\n };\n return this.props.renderView(errorProps);\n }\n\n if (orderTemplatesData && orderTemplatesData.length === 0) {\n // When no order templates are found for customer\n const emptyViewProps: IOrderTemplateListViewProps = {\n ...(this.props as IOrderTemplateListProps),\n OrderTemplateList: {\n moduleProps: this.props,\n className: classnames('ms-order-template', className)\n },\n status: 'EMPTY',\n statusMessage: ,\n heading: (\n \n )\n };\n\n return this.props.renderView(emptyViewProps);\n }\n\n const viewProps: IOrderTemplateListViewProps = {\n ...(this.props as IOrderTemplateListProps),\n OrderTemplateList: {\n moduleProps: this.props,\n className: classnames('ms-order-template', className)\n },\n status: 'SUCCESS',\n heading: (\n \n ),\n createOrderTemplateButton: (\n \n ),\n templateHeaderStatusMessage: this.state.isOpen && this.state.headerStatusMessage && (\n
\n \n \n {this.state.headerStatusMessage}\n \n \n
\n ),\n OrderTemplates: {\n className: 'ms-order-template__list-item',\n tag: 'ul'\n },\n OrderTemplate: {\n className: 'ms-order-template__tile',\n tag: 'li'\n },\n orderTemplates: orderTemplatesData && this._renderOrderTemplateList(orderTemplatesData)\n };\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n private _generateOrderTemplateNameDialogResources(resources: IOrderTemplateListResources): IOrderTemplateNameDialogResources {\n return {\n orderTemplateHeaderLabel: resources.createOrderTemplateHeader,\n orderTemplateTitleLabel: resources.orderTemplateTitle,\n orderTemplateNameAriaLabel: resources.orderTemplateNameAriaLabel,\n orderTemplateDescription: resources.createOrderTemplateDescription,\n\n defaultOrderTemplateName: resources.defaultOrderTemplateName,\n\n orderTemplateButtonLabel: resources.createOrderTemplateButtonText,\n orderTemplateCancelButtonLabel: resources.cancelNewOrderTemplateCreationButtonText\n };\n }\n\n private _renderOrderTemplateList(orderTemplates: OrderTemplate[]): ISingleOrderTemplateViewProps[] {\n const { context, telemetry } = this.props;\n const { imageSettings, enableImageProductLink } = this.props.config;\n return orderTemplates.map((orderTemplate: OrderTemplate, index) => {\n const currentTemplateProps: ISingleOrderTemplateProps = {\n orderTemplateState: this.state,\n Id: orderTemplate.productList.Id,\n name: orderTemplate.productList.Name,\n orderTemplate,\n context,\n imageSettings,\n enableImageProductLink,\n removeFromOrderTemplateListText: 'remove',\n addToBagText: this.props.resources.addToBagButtonText,\n index,\n itemKey: orderTemplate.productList.Id,\n telemetry,\n moduleId: this.props.id,\n moduleTypeName: this.props.typeName,\n handlers: {\n onRemoveOrderTemplate: this._onRemoveFromOrderTemplateList,\n onDismiss: this._onDismiss\n },\n resources: {\n closeWindowButtonText: this.props.resources.closeWindowButtonText,\n addToCartFailureMessage: this.props.resources.addToCartFailureMessage,\n addToCartSuccessMessage: this.props.resources.addToCartSuccessMessage,\n addToCartProcessMessage: this.props.resources.addToCartProcessMessage,\n linesAddedToCartDialogResources: {\n viewCartButtonText: this.props.resources.viewCartButtonText,\n orderTemplateCloseButtonText: this.props.resources.orderTemplateCloseButtonText,\n linesAddedToCartHeaderItemsOneText: this.props.resources.linesAddedToCartHeaderItemsOneText,\n linesAddedToCartHeaderLinesOneText: this.props.resources.linesAddedToCartHeaderLinesOneText,\n linesAddedToCartHeaderLinesFormatText: this.props.resources.linesAddedToCartHeaderLinesFormatText,\n linesAddedToCartHeaderMessageText: this.props.resources.linesAddedToCartHeaderMessageText\n }\n }\n };\n\n return (\n OrderTemplateRender(currentTemplateProps)!\n );\n });\n }\n\n private readonly _onDismiss = () => {\n this.setState({\n isOpen: false\n });\n };\n\n private readonly _reloadPage = async () => {\n window.location.reload();\n };\n\n private readonly _onRemoveFromOrderTemplateList = (productListId: string): void | undefined => {\n const { context, data, telemetry, resources } = this.props;\n const { orderTemplates } = data;\n\n if (context && context.actionContext) {\n const userToken = context.request.user.isAuthenticated && context.request.user.token;\n if (userToken && orderTemplates.result && orderTemplates.result[0] && productListId) {\n const orderTemplate = orderTemplates.result.find(p => p.productList.Id === productListId);\n if (orderTemplate) {\n deleteAsync({ callerContext: context.actionContext }, orderTemplate.productList)\n .then()\n .catch((error: string) => {\n telemetry.warning('[order-template-list] Unable to delete order template.');\n telemetry.error(error);\n this.setState({\n itemKey: productListId,\n headerStatusMessage: resources.deleteOrderTemplateFailedText,\n statusCssString: 'danger',\n messageGlyph: 'fas fa-exclamation-triangle',\n isOpen: true\n });\n }).then(this._reloadPage);\n } else {\n telemetry.warning('[order-template-list] Failed to delete order template. Order template was not found');\n }\n } else {\n telemetry.warning('[order-template-list] Failed to delete order template.');\n }\n }\n };\n\n}\n\nexport default OrderTemplateList;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { INodeProps, Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { ISingleOrderTemplateViewProps } from './components';\nimport { IOrderTemplateListViewProps } from './order-template-list';\n\nexport const OrderTemplateListView: React.FC = props => {\n const { OrderTemplateList, status, statusMessage, heading, OrderTemplates, orderTemplates, OrderTemplate, createOrderTemplateButton, templateHeaderStatusMessage } = props;\n\n return (\n \n {heading}\n {status !== 'SUCCESS' && statusMessage}\n \n {createOrderTemplateButton}\n {templateHeaderStatusMessage}\n \n { OrderTemplates && orderTemplates && orderTemplates.length > 0 &&\n \n {orderTemplates && orderTemplates.map((orderTemplate) => {\n return _renderOrderTemplate(orderTemplate, OrderTemplate);\n })}\n }\n \n );\n};\n\nconst _renderOrderTemplate = (orderTemplate: ISingleOrderTemplateViewProps, OrderTemplate?: INodeProps): JSX.Element | null => {\n\n const { key, addToCartButton, orderTemplateImage, orderTemplateStatusMessage, removeButton, orderTemplateName } = orderTemplate;\n return (\n \n {orderTemplateName}\n {orderTemplateImage}\n {addToCartButton}\n {removeButton}\n {orderTemplateStatusMessage}\n \n );\n};\n\nexport default OrderTemplateListView;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport {\n CacheType,\n createObservableDataAction,\n IAction,\n IActionContext,\n IActionInput,\n ICreateActionContext,\n IRequestContext\n} from '@msdyn365-commerce/core';\nimport { IQueryResultSettings } from '@msdyn365-commerce/retail-proxy';\nimport {\n buildCacheKeyWithUrlTokens,\n getFullOrderTemplate,\n GetFullOrderTemplateInput,\n IQueryResultSettingsModuleConfig,\n OrderTemplate,\n QueryResultSettingsProxy\n} from '@msdyn365-commerce-modules/retail-actions';\n\n/**\n * Input class for getActiveOrderTemplateLines data action.\n */\nexport class ActiveOrderTemplateLinesInput implements IActionInput {\n public requestContext: IRequestContext;\n\n public orderTemplateId: string;\n\n public queryResultSettings: IQueryResultSettings;\n\n constructor(requestContext: IRequestContext, config: IQueryResultSettingsModuleConfig) {\n if (!requestContext.query?.id) {\n throw new Error('Failed to get order template id from the query.');\n }\n if (!config) {\n throw new Error('Failed to get order template module configuration');\n }\n this.orderTemplateId = requestContext.query.id;\n this.queryResultSettings = QueryResultSettingsProxy.fromModuleData(requestContext, config).QueryResultSettings;\n\n this.queryResultSettings.count = true;\n this.requestContext = requestContext;\n }\n\n public getCacheKey = (): string => buildCacheKeyWithUrlTokens('ActiveOrderTemplateLines', this.requestContext);\n\n public getCacheObjectType = (): string => 'ActiveOrderTemplateLines';\n\n public dataCacheType = (): CacheType => 'instance';\n\n public shouldCacheOutput = () => false;\n}\n\n/**\n * Calls the Retail API and returns a ProductList object based on the passed GetCartInput.\n * @param input\n * @param context\n */\nexport async function getActiveOrderTemplateLines(input: ActiveOrderTemplateLinesInput, context: IActionContext): Promise {\n return getFullOrderTemplate(new GetFullOrderTemplateInput(input.orderTemplateId, input.queryResultSettings), context);\n}\n\nexport const getActiveOrderTemplateLinesDataAction = createObservableDataAction({\n id: '@msdyn365-commerce-modules/order-template/order-template/get-order-template-lines',\n action: >getActiveOrderTemplateLines,\n input: (context: ICreateActionContext) => {\n if (!context.config) {\n throw new Error('Failed to get order template module configuration');\n }\n return new ActiveOrderTemplateLinesInput(context.requestContext, context.config);\n }\n});\n\nexport default getActiveOrderTemplateLinesDataAction;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport * as React from 'react';\n\nexport default (props: { className: string; msg?: string }) => (\n <>\n
\n {props?.msg &&
\n {props?.msg}\n
}\n \n);\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { ProductDimensionFull } from '@msdyn365-commerce/commerce-entities';\nimport { ICoreContext, IImageSettings } from '@msdyn365-commerce/core';\nimport { ProductListLine, ProductSearchCriteria, ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\nimport { searchByCriteriaAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport {\n addItemToOrderTemplate,\n AddItemToOrderTemplateInput,\n getDimensionsForSelectedVariant,\n GetDimensionsForSelectedVariantInput,\n getSelectedVariant,\n SelectedVariantInput\n} from '@msdyn365-commerce-modules/retail-actions';\nimport { Modal, ModalBody, ModalHeader } from '@msdyn365-commerce-modules/utilities';\nimport { get } from 'lodash';\nimport { computed } from 'mobx';\nimport React from 'react';\n\nimport { IProductConfigurationState, NotFoundComponent, ProductConfiguration, ProductList } from '.';\nimport Spinner from './spinner';\n\nexport interface IAddLineToTemplateProps {\n context: ICoreContext;\n resources: IAddLineToTemplateResources;\n orderTemplateId: string;\n imageSettings?: IImageSettings;\n}\n\nexport interface IAddLineToTemplateResources {\n addLineModalLinkText: string;\n searchButtonAriaLabel: string;\n searchInputAriaLabel: string;\n searchModalPlaceholderText: string;\n selectProductButtonText: string;\n addItemToTemplateText: string;\n addLineProductUnitPricePrefix: string;\n backButtonText: string;\n decrementButtonAriaLabel: string;\n incrementButtonAriaLabel: string;\n quantitySelectLabel: string;\n addLineProductUnitOfMeasurePrefix: string;\n notFoundSearchErrorNotice: string;\n notFoundSearchErrorRedediation: string;\n searchErrorMessage: string;\n productDimensionTypeColor: string;\n productDimensionTypeConfiguration: string;\n productDimensionTypeSize: string;\n productDimensionTypeStyle: string;\n searchResultsCountVerbage: string;\n searchResultsCountSubject: string;\n addToTemplateConfirmation: string;\n totalPriceLabel: string;\n progressNotificationText: string;\n addToTemplateDuplicateError: string;\n addToTemplateGenericError: string;\n dimensionMissingError: string;\n backToResultsText?: string;\n}\n\nenum CONTENT {\n Search,\n ProductList,\n ProductConfiguration,\n NotFound,\n Error,\n Loading\n}\n\ninterface IAddLineToTemplateState {\n isOpen: boolean;\n query: string;\n products: ProductSearchResult[];\n content: number;\n selectedProduct: SimpleProduct | null;\n selectedProductDimensions?: ProductDimensionFull[];\n selectedQuantity?: number;\n reloadPage?: boolean;\n}\n\n/**\n * Add Lines to order template.\n */\nexport class AddLineToTemplate extends React.Component {\n public state: IAddLineToTemplateState = {\n isOpen: false,\n query: '',\n products: [],\n content: CONTENT.Search,\n selectedProduct: null\n };\n\n public defaultImageSettings: IImageSettings = {\n viewports: {\n xs: { q: 'w=64&h=64&m=6', w: 0, h: 0 },\n lg: { q: 'w=64&h=64&m=6', w: 0, h: 0 },\n xl: { q: 'w=64&h=64&m=6', w: 0, h: 0 }\n },\n lazyload: true\n };\n\n public searchTextInput: React.RefObject = React.createRef();// @TODO public/private\n\n private readonly addLineButtonRef: React.RefObject = React.createRef();\n\n constructor(props: IAddLineToTemplateProps) {\n super(props);\n }\n\n public onComponentDidMount(): void {\n this.searchTextInput.current?.focus();\n }\n\n public onComponentDidUpdate(): void {\n this.searchTextInput.current?.focus();\n }\n\n @computed get showBackArrow(): boolean {\n return this.state.content === CONTENT.ProductConfiguration;\n }\n\n public shouldComponentUpdate(nextProps: IAddLineToTemplateProps,\n nextState: IAddLineToTemplateState): boolean {\n if (this.state === nextState && this.props === nextProps) {\n return false;\n }\n return true;\n }\n\n public render(): JSX.Element {\n const {\n resources: { addLineModalLinkText, backToResultsText }\n } = this.props;\n\n const modalProps = {\n ...this.props,\n className: 'msc-add-line-to-template',\n toggle: this._toggleModalHandler,\n isOpen: this.state.isOpen,\n ariaLabel: addLineModalLinkText\n };\n\n return (\n <>\n \n \n {this.showBackArrow && }\n {addLineModalLinkText}\n \n {this._renderContent()}\n \n \n \n {addLineModalLinkText}\n \n \n );\n }\n\n private readonly _renderSearchForm = () => {\n const {\n resources: { searchButtonAriaLabel, searchModalPlaceholderText }\n } = this.props;\n\n return (\n \n \n \n \n );\n };\n\n private readonly _onSearchSubmit = (event: React.FormEvent): void => {\n event.preventDefault();\n\n const query = get(this, 'searchTextInput.current.value', null);\n\n if (!query) {\n return;\n }\n\n this.setState({\n content: CONTENT.Loading\n });\n\n this._getSearchResults(query)\n .then(result => {\n if (result.length === 0) {\n this.setState({\n products: result,\n content: CONTENT.NotFound\n });\n } else {\n this.setState({\n products: result,\n content: CONTENT.ProductList\n });\n }\n })\n .catch(error => {\n this.setState({\n content: CONTENT.Error\n });\n });\n };\n\n private readonly _onQuantityChangeHandler = (event: React.ChangeEvent) => {\n this.setState({\n selectedQuantity: +event.target.value\n });\n };\n\n private readonly _onSelectItem = async (product: ProductSearchResult): Promise => {\n const {\n actionContext,\n request: {\n apiSettings: { channelId }\n }\n } = this.props.context;\n const varianteInput = new SelectedVariantInput(product.RecordId, channelId, []);\n const productVariant = await getSelectedVariant(varianteInput, actionContext);\n\n if (!productVariant) {\n this.props.context.telemetry.error('Error retrieving product variant');\n return Promise.resolve([]);\n }\n\n const dimensions = await this._getProductDimensions(product as SimpleProduct);\n\n this.setState({\n selectedProductDimensions: dimensions,\n content: CONTENT.ProductConfiguration,\n selectedProduct: productVariant\n });\n\n return dimensions;\n };\n\n private readonly _onInputChange = (event: React.ChangeEvent): void => {\n this.setState({\n query: event.target.value\n });\n };\n\n private readonly _onBackButtonClickHandler = (): void => {\n this.setState({\n content: CONTENT.ProductList\n });\n };\n\n private readonly _highlightSearchTerm = (name: string) => {\n const parsedName = name && unescape(name.replace(new RegExp(this.state.query, 'i'), '$&'));\n\n return
;\n };\n\n private readonly _resultCountText = (): string => {\n return this.props.resources.searchResultsCountVerbage\n .replace('{count}', this.state.products.length.toString())\n .replace('{subject}', `${this.props.resources.searchResultsCountSubject}${(this.state.products.length > 1 ? 's' : '')}`);\n };\n\n private _renderContent(): React.ReactNode | null {\n switch (this.state.content) {\n case CONTENT.ProductConfiguration:\n const { selectedProduct, selectedProductDimensions } = this.state;\n const viewProps = {\n ...this.props,\n imageSettings: this.props.imageSettings || this.defaultImageSettings,\n product: selectedProduct!,\n dimensions: selectedProductDimensions!,\n addToTemplateHandler: this._addItemToTemplateHandler,\n onQuantityChangeHandler: this._onQuantityChangeHandler,\n highlightSearchTerm: this._highlightSearchTerm,\n searchForm: this._renderSearchForm()\n };\n\n return ;\n\n case CONTENT.ProductList:\n const productProps = {\n ...this.props,\n imageSettings: this.props.imageSettings || this.defaultImageSettings,\n clickHandler: this._onSelectItem,\n products: this.state.products,\n highlightSearchTerm: this._highlightSearchTerm,\n searchForm: this._renderSearchForm(),\n renderResultCountText: this._resultCountText\n };\n\n return (\n \n \n \n );\n\n case CONTENT.Loading:\n return (\n \n {this._renderSearchForm()}\n \n \n );\n\n case CONTENT.NotFound:\n const { notFoundSearchErrorNotice, notFoundSearchErrorRedediation } = this.props.resources;\n\n return (\n \n

\n {this._resultCountText()}\n

\n {this._renderSearchForm()}\n \n
\n );\n\n case CONTENT.Error:\n return (\n \n {this._renderSearchForm()}\n
\n {this.props.resources.searchErrorMessage}\n
\n
\n );\n\n default:\n return (\n \n {this._renderSearchForm()}\n \n );\n }\n }\n\n private readonly _addItemToTemplateHandler = async (config: IProductConfigurationState): Promise => {\n const { orderTemplateId, context: { actionContext } } = this.props;\n const input = new AddItemToOrderTemplateInput(\n orderTemplateId,\n config.product.RecordId,\n config.quantity,\n config.product.DefaultUnitOfMeasure || 'ea'\n );\n\n const result = await addItemToOrderTemplate(input, actionContext);\n\n this.setState({\n reloadPage: true\n });\n\n return result;\n };\n\n private _getSearchResults(searchText: string): Promise {\n const {\n context: {\n actionContext,\n request: {\n apiSettings: { channelId, catalogId }\n }\n }\n } = this.props;\n const searchCriteriaInput: ProductSearchCriteria = {};\n\n searchCriteriaInput.Context = {\n ChannelId: channelId,\n CatalogId: catalogId\n };\n searchCriteriaInput.IncludeAttributes = true;\n searchCriteriaInput.SearchCondition = searchText;\n\n return searchByCriteriaAsync({ callerContext: actionContext }, searchCriteriaInput);\n }\n\n private async _getProductDimensions(product: SimpleProduct): Promise {\n const {\n context: {\n actionContext,\n request: {\n apiSettings: { channelId }\n }\n }\n } = this.props;\n const id = product.MasterProductId ? product.MasterProductId : product.RecordId;\n\n return getDimensionsForSelectedVariant(\n new GetDimensionsForSelectedVariantInput(id, channelId, []),\n actionContext\n );\n }\n\n private readonly _toggleModalHandler = () => {\n\n if (this.state.isOpen) {\n this.addLineButtonRef.current!.focus();\n }\n\n this.setState({\n isOpen: !this.state.isOpen,\n content: CONTENT.Search\n });\n\n if (this.state.reloadPage) {\n window.location.reload();\n this.setState({\n reloadPage: false\n });\n }\n };\n}\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\ninterface IDropdownState {\n\n /**\n * @friendlyName selectedIndex\n * @description Selected index.\n */\n selectedIndex: string;\n}\n\nexport interface IDropdownProps {\n dropdownId: number;\n dropdownName: string;\n dropdownList: IDropdownItemProps[];\n telemetryContent?: ITelemetryContent;\n onChange?(selection: IDropdownOnSelection): void;\n}\n\nexport interface IDropdownItemProps {\n value: string;\n id: number;\n}\n\nexport interface IDropdownOnSelection {\n dropdownId: number;\n selectId: string;\n selectedValue: string;\n}\n\n/**\n *\n * DropDown component.\n * @extends {React.PureComponent}\n */\nexport class Dropdown extends React.PureComponent {\n private readonly selectMenu: React.RefObject = React.createRef();\n\n constructor(props: IDropdownProps, state: IDropdownState) {\n super(props);\n this.state = {\n selectedIndex: ''\n };\n }\n\n public componentDidMount(): void {\n if (this.selectMenu.current) {\n this.selectMenu.current.selectedIndex = 0;\n }\n }\n\n public render(): JSX.Element {\n const { dropdownId, dropdownList, dropdownName } = this.props;\n\n return (\n \n {dropdownList.map((item: IDropdownItemProps) => (item &&\n \n {item.value}\n \n ))}\n \n );\n }\n\n private readonly _onChanged = (event: React.ChangeEvent): void => {\n this.setState({ selectedIndex: event.target.value });\n\n if (this.props.onChange) {\n this.props.onChange({\n dropdownId: this.props.dropdownId,\n selectId: event.target.value,\n selectedValue: event.target.innerText\n });\n }\n };\n}\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport * as React from 'react';\n\nexport const NotFoundComponent = (props: { error: string; msg: string }) => (\n <>\n
\n
\n {props.error}\n
\n
\n {props.msg}\n
\n \n);\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { debounce } from 'lodash';\nimport { reaction } from 'mobx';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\ninterface IQuantityProps {\n min?: number;\n max: number;\n currentCount?: number;\n disabled?: boolean;\n incrementGlyphClass?: string;\n decrementGlyphClass?: string;\n decrementButtonAriaLabel?: string;\n incrementButtonAriaLabel?: string;\n inputQuantityAriaLabel?: string;\n id?: string;\n onChange?(newValue: number): void;\n}\n\ninterface IQuantityState {\n currentInput: number;\n}\n\n/**\n * Quantity Component - This component is used to add or remove quantity.\n */\n@observer\nexport default class OrderTemplateQuantity extends React.PureComponent {\n public static defaultProps: Partial = {\n min: 1,\n decrementGlyphClass: 'fas fa-minus',\n incrementGlyphClass: 'fas fa-plus'\n };\n\n private readonly inputRef: React.RefObject = React.createRef();\n\n constructor(props: IQuantityProps) {\n super(props);\n this.state = { currentInput: props.currentCount || 1 };\n this._handleChange = this._handleChange.bind(this);\n\n reaction(\n () => this.props.currentCount,\n () => {\n this.setState({ currentInput: this.props.currentCount || 1 });\n }\n );\n }\n\n public render(): JSX.Element {\n const glyphMinusClassName: string = `${this.props.decrementGlyphClass!} quantity__controls-glyph`;\n const glyphPlusClassName: string = `${this.props.incrementGlyphClass!} quantity__controls-glyph`;\n const disabled = this.props.currentCount === this.props.min;\n const incDisabled = this.props.currentCount === this.props.max;\n const currentValue = this.state.currentInput;\n let extraClass = '';\n if (disabled) {\n // The quantity has reached its boundaries (max or min)\n extraClass = 'disabled';\n\n } else if (this.props.disabled) {\n // This.props.disabled shows if the state is not succeded yet\n extraClass = 'transition';\n }\n const getChangeHandler = (amount: number) => () => {\n this._onIncrementalChange(amount);\n };\n\n return (\n
\n \n \n \n \n \n \n \n
\n );\n }\n\n private _onIncrementalChange(amount: number): void {\n const updatedQuantity = this.state.currentInput + amount;\n\n if (updatedQuantity >= 1 && updatedQuantity <= this.props.max) {\n this.props.onChange && this.props.onChange(updatedQuantity);\n }\n }\n\n private _handleChange(e: React.ChangeEvent): void {\n const currentValue = Number.parseInt((e.target.value), 10);\n const minValue = this.props.min === undefined ? 1 : this.props.min;\n const inputElement = this.inputRef && this.inputRef.current && this.inputRef.current instanceof HTMLInputElement && this.inputRef.current;\n\n if (currentValue > this.props.max) {\n this.setState(\n { currentInput: this.props.max },\n () => {\n debounce(\n () => {\n this.props.onChange && this.props.onChange(this.state.currentInput);\n },\n 200)();\n }\n );\n } else {\n this.setState(\n { currentInput: currentValue },\n () => {\n debounce(\n () => {\n if (!isNaN(this.state.currentInput) && !(this.state.currentInput < minValue)) {\n this.props.onChange && this.props.onChange(this.state.currentInput);\n\n if (inputElement) {\n inputElement.setAttribute('aria-valuenow', currentValue.toString());\n inputElement.setAttribute('value', currentValue.toString());\n }\n }\n },\n 200)();\n }\n );\n }\n }\n\n private readonly _validateMin = (): void => {\n const minValue = this.props.min === undefined ? 1 : this.props.min;\n\n if (isNaN(this.state.currentInput) || (this.state.currentInput < minValue)) {\n this.props.onChange && this.props.onChange(minValue);\n } else {\n this.props.onChange && this.props.onChange(this.state.currentInput);\n }\n };\n}\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { ProductDimensionFull } from '@msdyn365-commerce/commerce-entities';\nimport { IImageSettings, Image } from '@msdyn365-commerce/core';\nimport { ProductDimensionValue, ProductListLine } from '@msdyn365-commerce/retail-proxy';\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport {\n getDimensionsForSelectedVariant,\n GetDimensionsForSelectedVariantInput,\n getFallbackImageUrl,\n getPriceForSelectedVariant,\n getProductAvailabilitiesForSelectedVariant,\n getSelectedVariant,\n IProductInventoryInformation,\n PriceForSelectedVariantInput,\n ProductAvailabilitiesForSelectedVariantInput,\n SelectedVariantInput\n} from '@msdyn365-commerce-modules/retail-actions';\nimport { Alert, Button, ITelemetryContent, ModalBody, ModalFooter } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport React from 'react';\n\nimport OrderTemplateQuantity from '../common/order-template-quantity';\nimport { Dropdown, IAddLineToTemplateProps, IAddLineToTemplateResources, IDropdownItemProps, IDropdownOnSelection } from '.';\n\nexport interface IProductCnnfigurationProps extends IAddLineToTemplateProps {\n product: SimpleProduct;\n dimensions: ProductDimensionFull[];\n imageSettings: IImageSettings;\n telemetryContent?: ITelemetryContent;\n searchForm: React.ReactNode;\n addToTemplateHandler(params: IProductConfigurationState): Promise;\n highlightSearchTerm(name: string): React.ReactNode;\n}\n\nexport interface IProductConfigurationState {\n quantity: number;\n unitPrice: number;\n totalPrice: number;\n product: SimpleProduct;\n dimensions: ProductDimensionFull[];\n selectedDimensions: {};\n productAvailableQuantity?: IProductInventoryInformation;\n buttonDisabled: boolean;\n showAddConfirmation: boolean;\n errorMessage?: string;\n isBusy: boolean;\n errors: { dimension?: string[]; add?: string };\n}\n\n/**\n * Configure selected product for addition to order template.\n */\nexport class ProductConfiguration extends React.Component {\n private selectedDimensions: {} = {};\n\n constructor(props: IProductCnnfigurationProps) {\n super(props);\n\n this.state = {\n quantity: 1,\n unitPrice: props.product.Price,\n totalPrice: props.product.Price,\n product: props.product,\n dimensions: props.dimensions.sort((a, b) => a.DimensionTypeValue - b.DimensionTypeValue),\n selectedDimensions: {},\n buttonDisabled: false,\n showAddConfirmation: false\n } as IProductConfigurationState;\n }\n\n public shouldComponentUpdate(nextProps: IProductCnnfigurationProps,\n nextState: IProductConfigurationState): boolean {\n if (this.state === nextState && this.props === nextProps) {\n return false;\n }\n return true;\n }\n\n public render(): JSX.Element {\n const {\n context: {\n actionContext: {\n requestContext: { apiSettings }\n },\n request: { gridSettings }\n },\n resources: {\n addItemToTemplateText,\n addLineProductUnitPricePrefix,\n decrementButtonAriaLabel,\n incrementButtonAriaLabel,\n quantitySelectLabel,\n addLineProductUnitOfMeasurePrefix,\n totalPriceLabel\n },\n imageSettings,\n highlightSearchTerm\n } = this.props;\n const { buttonDisabled, product, quantity, unitPrice, totalPrice, showAddConfirmation, errors } = this.state;\n\n return (\n <>\n \n {this.props.searchForm}\n
\n
\n
\n \n
\n
\n {product?.ItemId}\n
\n {highlightSearchTerm(product?.Name ?? '')}\n
\n {addLineProductUnitPricePrefix}\n {' '}\n {this._formatPrice(unitPrice)}\n
\n
\n {addLineProductUnitOfMeasurePrefix}\n {' '}\n {product?.DefaultUnitOfMeasure}\n
\n
\n
\n
\n {this._getDimensionsNodes()}\n
\n
\n
\n
\n {quantitySelectLabel}\n
\n \n
\n
\n
\n {totalPriceLabel}\n {' '}\n {this._formatPrice(totalPrice)}\n
\n
\n \n {showAddConfirmation && \n
}\n {errors?.add &&
\n
}\n \n {addItemToTemplateText}\n \n \n \n );\n }\n\n private _getConfirmationMessage(): string {\n const selectedDimensionNames = this.state.dimensions.map(dimension => {\n let variant = dimension.DimensionValues?.find(value => value.RecordId === this.selectedDimensions[dimension.DimensionTypeValue])?.Value;\n if (dimension.DimensionTypeValue === 3) {\n variant = `size ${variant}`;\n }\n return variant;\n }).filter(value => value);\n\n return this.props.resources.addToTemplateConfirmation\n .replace('{count}', this.state.quantity.toString())\n .replace('{productAndDimensions}', `${this.state.product.Name}, ${Object.values(selectedDimensionNames).join(', ')}`);\n\n }\n\n private _getDimensionsNodes(): React.ReactElement[] {\n const { dimensions } = this.state;\n const { resources } = this.props;\n\n return dimensions?.map((dimension: ProductDimensionFull) => {\n const { DimensionValues, DimensionTypeValue } = dimension;\n const mapDimensions = (value: ProductDimensionValue): IDropdownItemProps => ({\n id: value.RecordId,\n value: value.Value || ''\n });\n const dimensionName = this._getDropdownName(DimensionTypeValue, resources);\n const dropdownList: IDropdownItemProps[] = DimensionValues ? DimensionValues.map(mapDimensions) : [];\n dropdownList.unshift({ id: 0, value: `Choose a ${dimensionName}` });\n\n return (\n
\n
\n {dimensionName}\n
\n {this.state.errors?.dimension?.includes(DimensionTypeValue.toString()) && (\n \n \n \n )}\n \n
\n );\n });\n }\n\n private readonly _getDimensionsError = (dimensionName: string) => this.props.resources.dimensionMissingError.replace(/{dimensionName}/g, dimensionName);\n\n private readonly _addToTemplateHandler = async (event: React.MouseEvent) => {\n // Hide confirmation of previous addition when adding multiple items\n this.setState({\n isBusy: true,\n showAddConfirmation: false,\n errors: { ...this.state.errors, add: undefined }\n });\n\n const missingDimensions = this.state.dimensions.map(dimension => dimension.DimensionTypeValue.toString()).filter(type => !this.selectedDimensions[type]);\n\n this.setState({\n errors: { dimension: missingDimensions }\n });\n if (missingDimensions.length > 0) {\n this.setState({\n isBusy: false\n });\n return;\n }\n\n this.props.addToTemplateHandler({ ...this.state })\n .then(status => {\n // Validate against the existance of a ProductListId\n if (status.ProductListId) {\n this.setState({\n isBusy: false,\n showAddConfirmation: true\n });\n }\n })\n .catch(error => {\n const { addToTemplateDuplicateError, addToTemplateGenericError } = this.props.resources;\n let errorMessage;\n\n if (error.error.name === 'Microsoft_Dynamics_Commerce_Runtime_DuplicateObject') {\n errorMessage = addToTemplateDuplicateError;\n } else {\n errorMessage = addToTemplateGenericError;\n }\n\n this.setState({\n isBusy: false,\n errors: { ...this.state.errors, add: errorMessage }\n });\n this.props.context.telemetry.error('Error adding item to order template');\n });\n };\n\n private readonly _onQuantityChange = (newValue: number) => {\n this.setState({\n quantity: newValue,\n totalPrice: newValue * this.props.product.Price\n });\n };\n\n private readonly _updateDimensionValue = (productDimensionFull: ProductDimensionFull, newValueId: string | undefined): ProductDimensionValue | undefined => {\n if (newValueId && productDimensionFull.DimensionValues) {\n return productDimensionFull.DimensionValues.find(dimension => dimension.RecordId === +newValueId);\n }\n\n return undefined;\n };\n\n // Rehydrate the selected variants price, available dimensions & sizes\n private readonly _onDimensionChanged = async (selection: IDropdownOnSelection): Promise => {\n const { product, dimensions, context } = this.props;\n const {\n actionContext,\n request: { apiSettings: { channelId } }\n } = context;\n\n // Remaining error notifications for missing dimensions\n const remainingDimensionsErrors = this.state.errors?.dimension?.filter(id => id !== selection.dropdownId.toString());\n\n this.setState({\n isBusy: false,\n showAddConfirmation: false,\n buttonDisabled: true,\n errors: { add: undefined, dimension: remainingDimensionsErrors }\n });\n\n // Update currently selected dimensions\n this.selectedDimensions[selection.dropdownId] = +selection.selectId;\n\n const mappedDimensions = dimensions?.map(dimension => {\n return {\n DimensionTypeValue: dimension.DimensionTypeValue,\n DimensionValue: this._updateDimensionValue(dimension, this.selectedDimensions[dimension.DimensionTypeValue]) || dimension.DimensionValue,\n ExtensionProperties: dimension.ExtensionProperties\n };\n }).filter(dimension => {\n return dimension && dimension.DimensionValue;\n });\n\n const variantProduct = (await getSelectedVariant(\n new SelectedVariantInput(\n product.MasterProductId ? product.MasterProductId : product.RecordId,\n channelId,\n mappedDimensions\n ),\n actionContext\n ));\n\n if (!variantProduct) {\n this.props.context.telemetry.error(`Error retrieving variant product for product ${product.MasterProductId ? product.MasterProductId : product.RecordId}`);\n return;\n }\n\n const dimensionInput = new GetDimensionsForSelectedVariantInput(\n variantProduct.RecordId,\n channelId,\n mappedDimensions\n );\n const variantDimensions = await getDimensionsForSelectedVariant(dimensionInput, actionContext);\n\n if (!variantDimensions) {\n this.props.context.telemetry.error('Error retrieving dimensions for reconfigured product variant');\n this.setState({\n buttonDisabled: false\n });\n return;\n }\n\n const availabilityInput = new ProductAvailabilitiesForSelectedVariantInput(\n product.MasterProductId ? product.MasterProductId : product.RecordId,\n channelId\n );\n\n // @TODO sync UX quantity w/ actual availability\n const newAvailableQuantity = await getProductAvailabilitiesForSelectedVariant(availabilityInput, actionContext);\n const priceInput = new PriceForSelectedVariantInput(product.RecordId, channelId);\n const productPrice = await getPriceForSelectedVariant(priceInput, actionContext);\n\n if (!productPrice) {\n this.props.context.telemetry.error('Error retrieving price for reconfigured product variant');\n this.setState({\n buttonDisabled: false\n });\n return;\n }\n\n this.setState({\n buttonDisabled: false,\n productAvailableQuantity: newAvailableQuantity && newAvailableQuantity[0] || undefined,\n unitPrice: +(productPrice.BasePrice || product.Price),\n dimensions: variantDimensions.sort((a, b) => a.DimensionTypeValue - b.DimensionTypeValue),\n product: variantProduct\n });\n };\n\n private readonly _getDropdownName = (dimensionType: number, resources: IAddLineToTemplateResources): string => {\n switch (dimensionType) {\n case 1: // Color\n return resources.productDimensionTypeColor;\n case 2: // Configuration\n return resources.productDimensionTypeConfiguration;\n case 3: // Size\n return resources.productDimensionTypeSize;\n case 4: // Style\n return resources.productDimensionTypeStyle;\n default:\n return '';\n }\n };\n\n private _formatPrice(price: number): string {\n const {\n context: {\n cultureFormatter: {\n formatCurrency,\n\n // @ts-expect-error\n currencyCode\n }\n }\n } = this.props;\n\n return formatCurrency(price.toFixed(2), currencyCode);\n }\n}\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { ProductDimensionFull } from '@msdyn365-commerce/commerce-entities';\nimport { IImageSettings, Image } from '@msdyn365-commerce/core';\nimport { ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\nimport { getFallbackImageUrl } from '@msdyn365-commerce-modules/retail-actions';\nimport { Button } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport React, { useState } from 'react';\n\nimport { IAddLineToTemplateProps } from '.';\n\nexport interface IProductListProps extends IAddLineToTemplateProps {\n products: ProductSearchResult[];\n imageSettings: IImageSettings;\n searchForm: React.ReactNode;\n clickHandler(product: ProductSearchResult): Promise;\n highlightSearchTerm(name: string): React.ReactNode;\n renderResultCountText(): string;\n}\n\nexport const ProductList = (props: IProductListProps) => {\n const {\n products,\n context: {\n actionContext: {\n requestContext: { apiSettings }\n },\n request: {\n gridSettings\n },\n cultureFormatter: {\n formatCurrency,\n\n // @ts-expect-error\n currencyCode\n }\n },\n clickHandler,\n highlightSearchTerm,\n renderResultCountText,\n resources: { selectProductButtonText },\n imageSettings\n } = props;\n\n return (\n <>\n

\n {renderResultCountText()}\n

\n {props.searchForm}\n
\n {products.map((product: ProductSearchResult, index: number) => {\n const { Price, ItemId, Name, PrimaryImageUrl } = product;\n const price = formatCurrency(Price.toFixed(2), currencyCode);\n const fallBackImg = getFallbackImageUrl(ItemId, apiSettings) ?? '';\n\n return (\n
\n
\n \n
\n
\n {ItemId}\n
\n {highlightSearchTerm(Name ?? '')}\n
\n
\n
\n \n {price}\n \n \n
\n
\n );\n })}\n
\n \n );\n};\n\ninterface IProductSelectButton {\n product: ProductSearchResult;\n buttonText: string;\n clickHandler(product: ProductSearchResult): Promise;\n}\n\nconst ProductSelectButton = (props: IProductSelectButton) => {\n const [isBusy, setBusy] = useState(false);\n const { product, buttonText, clickHandler } = props;\n const getClickHandler = React.useCallback(async () => {\n setBusy(!isBusy);\n await clickHandler(product);\n setBusy(!isBusy);\n }, [clickHandler, isBusy, product]);\n\n return (\n \n {buttonText}\n \n );\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { Button } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IOrderTemplateLineViewModel } from '../order-template';\nimport { IOrderTemplateData } from '../order-template.data';\nimport { IOrderTemplateProps } from '../order-template.props.autogenerated';\nimport { AddLineToTemplate } from '.';\n\ninterface IOrderTemplateBulkActionsProps extends IOrderTemplateProps {\n orderTemplateId: string;\n selectedLines: IOrderTemplateLineViewModel[];\n isMinifiedView: boolean;\n onAddSelectionToBag(): void;\n onRemoveSelection(): void;\n}\n\ninterface IOrderTemplateBulkActionsState {\n isAddDisabled: boolean;\n isRemoveDisabled: boolean;\n}\n\n/**\n * Bulk Order Template line actions.\n */\nexport class OrderTemplateBulkActions extends React.PureComponent {\n\n public state: IOrderTemplateBulkActionsState = {\n isAddDisabled: true,\n isRemoveDisabled: true\n };\n\n public static getDerivedStateFromProps(props: IOrderTemplateBulkActionsProps,\n state: IOrderTemplateBulkActionsState): IOrderTemplateBulkActionsState {\n const selectedLines = props.selectedLines.length;\n let nextState = { ...state };\n nextState = {\n isAddDisabled: selectedLines === 0,\n isRemoveDisabled: selectedLines === 0\n };\n return nextState;\n }\n\n public render(): JSX.Element {\n const { addLineModalLinkText,\n searchButtonAriaLabel,\n searchInputAriaLabel,\n searchModalPlaceholderText,\n selectProductButtonText,\n addItemToTemplateText,\n addLineProductUnitPricePrefix,\n backButtonText,\n decrementButtonAriaLabel,\n incrementButtonAriaLabel,\n quantitySelectLabel,\n addLineProductUnitOfMeasurePrefix,\n notFoundSearchErrorNotice,\n notFoundSearchErrorRedediation,\n searchErrorMessage,\n productDimensionTypeColor,\n productDimensionTypeConfiguration,\n productDimensionTypeSize,\n productDimensionTypeStyle,\n addSelectedToBagButtonText,\n removeSelectedToBagButtonText,\n searchResultsCountVerbage,\n searchResultsCountSubject,\n addToTemplateConfirmation,\n totalPriceLabel,\n progressNotificationText,\n addToTemplateDuplicateError,\n addToTemplateGenericError,\n dimensionMissingError\n } = this.props.resources;\n const addLineProps = {\n context: this.props.context,\n resources: {\n addLineModalLinkText,\n searchButtonAriaLabel,\n searchInputAriaLabel,\n searchModalPlaceholderText,\n selectProductButtonText,\n addItemToTemplateText,\n addLineProductUnitPricePrefix,\n backButtonText,\n decrementButtonAriaLabel,\n incrementButtonAriaLabel,\n quantitySelectLabel,\n addLineProductUnitOfMeasurePrefix,\n notFoundSearchErrorNotice,\n notFoundSearchErrorRedediation,\n searchErrorMessage,\n productDimensionTypeColor,\n productDimensionTypeConfiguration,\n productDimensionTypeSize,\n productDimensionTypeStyle,\n searchResultsCountVerbage,\n searchResultsCountSubject,\n addToTemplateConfirmation,\n totalPriceLabel,\n progressNotificationText,\n addToTemplateDuplicateError,\n addToTemplateGenericError,\n dimensionMissingError\n },\n imageSettings: this.props.config.imageSettings,\n orderTemplateId: this.props.orderTemplateId\n };\n\n return (\n <>\n \n \n \n {!this.props.isMinifiedView && addSelectedToBagButtonText}\n \n \n \n {!this.props.isMinifiedView && removeSelectedToBagButtonText}\n \n \n );\n }\n\n private readonly addHandler = (event: React.MouseEvent) => {\n this.setState({\n isAddDisabled: true\n });\n\n this.props.onAddSelectionToBag();\n\n this.setState({\n isAddDisabled: false\n });\n };\n\n private readonly removeHandler = (event: React.MouseEvent) => {\n this.setState({\n isRemoveDisabled: true\n });\n\n this.props.onRemoveSelection();\n };\n\n}\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { AddOrderTemplateToCartComponent, ILinesAddedToCartDialogResources, IOrderTemplateNameDialogResources, RenameOrderTemplateComponent } from '@msdyn365-commerce/components';\nimport { IComponentProps, ICoreContext } from '@msdyn365-commerce/core';\nimport { ProductList } from '@msdyn365-commerce/retail-proxy';\nimport { OrderTemplate } from '@msdyn365-commerce-modules/retail-actions';\nimport { Button, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nexport interface IOrderTemplateActionsData {\n orderTemplate: OrderTemplate;\n}\n\nexport interface IOrderTemplateActionsProps extends IComponentProps {\n context: ICoreContext;\n telemetryContent?: ITelemetryContent;\n handlers: {\n onRemoveTemplate(orderTemplateId: string): void;\n onRenameTemplate(orderTemplate: ProductList): Promise;\n };\n renameOrderTemplateDialogStrings: IOrderTemplateNameDialogResources;\n resources: {\n addTemplateToBagButtonText: string;\n renameTemplateButtonText: string;\n deleteTemplateButtonText: string;\n closeWindowButtonText: string;\n addToCartFailureMessage: string;\n addToCartSuccessMessage: string;\n addToCartProcessMessage: string;\n linesAddedToCartDialogResources: ILinesAddedToCartDialogResources;\n };\n}\n\nexport interface IOrderTemplateActionsViewProps {\n addTemplateToBag: React.ReactNode;\n renameTemplate?: React.ReactNode;\n removeTemplate?: React.ReactNode;\n}\n\n/**\n * Remove Order Action.\n * @param props -Order template action props.\n * @returns Remove order template.\n */\nconst removeOrderActionHandler = (props: IOrderTemplateActionsProps) => () => {\n _removeOrderTemplate(props);\n};\n\nexport const OrderTemplateActionsView = (props: IOrderTemplateActionsProps): IOrderTemplateActionsViewProps => {\n const { resources } = props;\n const { deleteTemplateButtonText } = resources;\n\n return {\n addTemplateToBag: _getOrderTemplateAddToCartDialog(props),\n renameTemplate: _getOrderTemplateRenameControl(props),\n removeTemplate: (\n \n )\n };\n};\n\nconst _removeOrderTemplate = (props: IOrderTemplateActionsProps): void => {\n const { data: { orderTemplate }, handlers } = props;\n const { onRemoveTemplate } = handlers;\n\n if (onRemoveTemplate) {\n onRemoveTemplate(orderTemplate.productList.Id);\n }\n};\n\nconst _getOrderTemplateAddToCartDialog = (props: IOrderTemplateActionsProps): React.ReactNode => {\n const { data: { orderTemplate }, typeName, id, context, telemetryContent, resources } = props;\n const {\n addTemplateToBagButtonText,\n closeWindowButtonText,\n addToCartFailureMessage,\n addToCartSuccessMessage,\n addToCartProcessMessage,\n linesAddedToCartDialogResources\n } = resources;\n\n const dialogStrings = {\n closeWindowButtonText,\n addToCartFailureMessage,\n addToCartSuccessMessage,\n addToCartProcessMessage,\n linesAddedToCartDialogResources\n };\n\n return (\n \n );\n};\n\nconst _getOrderTemplateRenameControl = (props: IOrderTemplateActionsProps): React.ReactNode => {\n const { renameOrderTemplateDialogStrings, resources, context, handlers } = props;\n return (\n \n );\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { PriceComponent } from '@msdyn365-commerce/components';\nimport { ICoreContext, IImageSettings, Image, ITelemetry } from '@msdyn365-commerce/core';\nimport { ProductListLine } from '@msdyn365-commerce/retail-proxy';\nimport { ProductPrice, SimpleProduct } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { getFallbackImageUrl } from '@msdyn365-commerce-modules/retail-actions';\nimport { Button, INodeProps } from '@msdyn365-commerce-modules/utilities';\nimport React, { useState } from 'react';\n\nimport { IOrderTemplateLineViewModel } from '../order-template';\nimport OrderTemplateQuantity from './common/order-template-quantity';\n\nexport interface IOrderTemplateLineProps extends ProductListLine {\n orderTemplateLine: IOrderTemplateLineViewModel;\n productListLine: ProductListLine;\n price?: ProductPrice;\n context: ICoreContext;\n productUrl: string;\n imageSettings?: IImageSettings;\n telemetry: ITelemetry;\n moduleId: string;\n moduleTypeName: string;\n quantity: number;\n handlers: {\n onAddToBag(product: SimpleProduct, quantity: number, itemKey: string): void;\n onRemoveItem(line: IOrderTemplateLineViewModel): void | undefined;\n onChangeQuantity(orderTemplateLineId: string, quantity: number, props?: IOrderTemplateLineProps): void;\n onSelect(line: IOrderTemplateLineViewModel, isChecked: boolean): void;\n };\n resources: {\n selectOneRowText?: string;\n moreButtonText?: string;\n viewProductDetailsText?: string;\n productDimensionTypeColor: string;\n productDimensionTypeSize: string;\n productDimensionTypeStyle: string;\n originalPriceText: string;\n currentPriceText: string;\n freePriceText: string;\n inputQuantityAriaLabel: string;\n removeFromOrderTemplateLinesText: string;\n addToBagButtonText: string;\n deleteButtonText: string;\n incrementButtonAriaLabel?: string;\n decrementButtonAriaLabel?: string;\n };\n index: number;\n isMobile: boolean;\n productQuantityView?: React.ReactNode;\n addToBagButton?: React.ReactNode;\n removeButton?: React.ReactNode;\n toggleDetailsDisplayed(props: IOrderTemplateLineProps): void;\n}\n\nexport interface IOrderTemplateLineViewProps {\n key?: string;\n productImage: React.ReactNode;\n productPrice?: React.ReactNode;\n addToBagButton?: React.ReactNode;\n removeButton?: React.ReactNode;\n productName?: string;\n productNumber?: React.ReactNode;\n productInfo?: React.ReactNode;\n productLabel?: React.ReactNode;\n productUnitOfMeasure?: React.ReactNode;\n productQuantity?: number;\n productQuantityView?: React.ReactNode;\n productListId?: string;\n selectLine?: React.ReactNode;\n popUp?: JSX.Element;\n isMobile?: boolean;\n}\n\ninterface IEventHandlerFactory {\n getAddToBag(): (event: React.MouseEvent) => void;\n getRemoveItem(): (event: React.MouseEvent) => void;\n}\n\nconst OrderTemplateLineActions = (props: IOrderTemplateLineProps): IEventHandlerFactory => {\n const { orderTemplateLine, productListLine, quantity, handlers } = props;\n const { LineId } = productListLine;\n const { onAddToBag, onRemoveItem } = handlers;\n\n return {\n getAddToBag: () => (event: React.MouseEvent) => {\n LineId && orderTemplateLine.fullProduct && onAddToBag(orderTemplateLine.fullProduct.ProductDetails, quantity, LineId);\n },\n getRemoveItem: () => (event: React.MouseEvent) => LineId && onRemoveItem(props.orderTemplateLine)\n };\n};\n\ninterface IPopupProps extends IOrderTemplateLineProps {\n addButtonClassName: string;\n removeButtonClassName: string;\n}\n\nconst PopUp = (props: IPopupProps): JSX.Element | null => {\n const { addToBagButtonText, removeFromOrderTemplateLinesText, moreButtonText, viewProductDetailsText } = props.resources;\n const [showMobile, setShowMobile] = useState(false);\n const componentClassName = 'ms-table';\n\n const getViewHandler = () => (event: React.MouseEvent) => {\n props.toggleDetailsDisplayed(props);\n };\n\n const toggle = React.useCallback(() => {\n setShowMobile(!showMobile);\n }, [showMobile]);\n\n return (\n
\n \n {showMobile &&\n
\n \n View\n \n {getActionButton(props.isMobile, props.removeButtonClassName,\n removeFromOrderTemplateLinesText, OrderTemplateLineActions(props).getRemoveItem())}\n {getActionButton(props.isMobile, props.addButtonClassName, addToBagButtonText, OrderTemplateLineActions(props).getAddToBag())}\n
}\n
\n );\n};\n\nconst getActionButton = (isMobile: boolean, className: string, buttonText: string, clickHandler: (event: React.MouseEvent) => void): React.ReactNode => (\n \n {isMobile ? buttonText : ''}\n \n);\n\n/**\n * On Select line function.\n * @param orderTemplateLine -Order template line.\n * @param input -Order template line props.\n * @returns Set on select order template.\n */\nconst onSelectLineHandler = (\n orderTemplateLine: IOrderTemplateLineViewModel,\n input: IOrderTemplateLineProps) => (event: React.ChangeEvent) => {\n orderTemplateLine.isChecked = !orderTemplateLine.isChecked;\n\n input.handlers.onSelect(orderTemplateLine, event.target.checked);\n};\n\nexport const OrderTemplateLineView = (input: IOrderTemplateLineProps): IOrderTemplateLineViewProps | null => {\n const { orderTemplateLine, productListLine, price, context, imageSettings, quantity, resources, isMobile } = input;\n const product = orderTemplateLine.fullProduct;\n const { LineId, UnitOfMeasure } = productListLine;\n const { removeFromOrderTemplateLinesText, addToBagButtonText, selectOneRowText } = resources;\n if (!product) {\n return null;\n }\n\n const { ItemId, Name, PrimaryImageUrl } = product.ProductDetails;\n const fallbackImage = getFallbackImageUrl(ItemId, context.actionContext.requestContext.apiSettings);\n const addButtonClassName = input.isMobile ? 'ms-table__row-links-add' : 'ms-order-template-table-line__product-add-button';\n const removeButtonClassName = input.isMobile ? 'ms-table__row-links-delete' : 'ms-order-template-table-line__product-remove-button';\n\n return {\n isMobile,\n selectLine: (\n \n ),\n key: LineId!,\n productImage: PrimaryImageUrl && Name && (\n _renderProductImage('ms-order-template-table-line__product-image', context, product.ProductDetails.Name!, PrimaryImageUrl, fallbackImage, imageSettings)\n ),\n productInfo: renderProductInfo(input),\n productPrice: price && _renderPrice(input),\n productNumber: product &&
\n {ItemId}\n
,\n productUnitOfMeasure: price ? (\n
\n {UnitOfMeasure || price.UnitOfMeasure}\n
\n ) : (\n undefined\n ),\n productListId: LineId!,\n removeButton: getActionButton(input.isMobile, removeButtonClassName, removeFromOrderTemplateLinesText, OrderTemplateLineActions(input).getRemoveItem()),\n productQuantityView:
\n {_generateQuantity(input, LineId!)}\n
,\n productQuantity: quantity,\n addToBagButton: getActionButton(input.isMobile, addButtonClassName, addToBagButtonText, OrderTemplateLineActions(input).getAddToBag()),\n popUp: (\n \n )\n };\n};\n\nexport const OrderTemplateMobileLineView = (input: IOrderTemplateLineProps): IOrderTemplateLineViewProps | undefined => {\n const { orderTemplateLine, productListLine, price, context, imageSettings } = input;\n const product = orderTemplateLine.fullProduct;\n const { LineId, UnitOfMeasure } = productListLine;\n if (!product) {\n return;\n }\n const { ItemId, Name, PrimaryImageUrl } = product.ProductDetails;\n const fallbackImage = getFallbackImageUrl(ItemId, context.actionContext.requestContext.apiSettings);\n\n return {\n productImage: PrimaryImageUrl && Name && (\n _renderProductImage('thumbnail', context, product.ProductDetails.Name!, PrimaryImageUrl, fallbackImage, imageSettings)\n ),\n productInfo: renderProductInfo(input),\n productPrice: price && _renderPrice(input),\n productNumber: ItemId,\n productUnitOfMeasure: UnitOfMeasure || price?.UnitOfMeasure,\n productQuantityView: _generateQuantity(input, LineId!)\n };\n};\n\nexport interface IOrderTemplateProductQuantityViewProps {\n ContainerProps: INodeProps;\n input: React.ReactNode;\n}\n\n/**\n * On Change function.\n * @param onChangeQuantity -On change quantity function.\n * @param itemKey -String.\n * @param props -Order template line props.\n * @returns Set change quantity.\n */\nconst onChangeHandler = (onChangeQuantity: (orderTemplateLineId: string,\n quantity: number, props?: IOrderTemplateLineProps | undefined) => void,\nitemKey: string, props: IOrderTemplateLineProps) => (newValue: number) => {\n if (onChangeQuantity) {\n onChangeQuantity(itemKey, newValue, props);\n }\n};\n\nconst _generateQuantity = (props: IOrderTemplateLineProps, itemKey: string): React.ReactNode => {\n const { handlers, resources, quantity } = props;\n const { onChangeQuantity } = handlers;\n return (\n \n );\n};\n\nexport const _renderProductImage = (\n className: string,\n context: ICoreContext,\n heading: string,\n image?: string,\n fallbackImage?: string,\n imageSettings?: IImageSettings\n): JSX.Element | null => {\n const defaultImageSettings: IImageSettings = {\n viewports: {\n xs: { q: 'w=64&h=64&m=6', w: 0, h: 0 },\n lg: { q: 'w=64&h=64&m=6', w: 0, h: 0 },\n xl: { q: 'w=64&h=64&m=6', w: 0, h: 0 }\n },\n lazyload: true\n };\n\n if (image) {\n return (\n \n );\n }\n return null;\n};\n\nconst _renderPrice = (props: IOrderTemplateLineProps): JSX.Element | null => {\n const { price, context, moduleId, moduleTypeName, resources } = props;\n\n if (price) {\n return (\n \n );\n }\n return null;\n};\n\nconst _renderProductDimensions = (props: IOrderTemplateLineProps): (string | undefined)[] => {\n const { orderTemplateLine } = props;\n\n if (!orderTemplateLine.fullProduct || !orderTemplateLine.fullProduct.ProductDetails.Dimensions) {\n return [];\n }\n\n return orderTemplateLine.fullProduct.ProductDetails.Dimensions.map((dimension) => {\n if (!dimension.DimensionValue || !dimension.DimensionValue.Value) {\n return undefined;\n }\n\n return dimension.DimensionValue.Value;\n });\n};\n\nexport const renderProductInfo = (props: IOrderTemplateLineProps): React.ReactNode | undefined => {\n const { orderTemplateLine, productUrl } = props;\n const name = orderTemplateLine.fullProduct?.ProductDetails.Name;\n\n const dimensions = _renderProductDimensions(props);\n if (!orderTemplateLine.fullProduct) {\n return [];\n }\n\n const productName = productUrl ? (\n \n {name}\n \n ) : (\n
\n {name}\n
\n );\n\n const dimensionsLine: string = dimensions.join(', ');\n\n return (\n
\n
\n {productName}\n
\n
\n {dimensionsLine}\n
\n
\n );\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nimport { orderTemplateLinesStatus } from '../order-template';\n\nexport interface IOrderTemplateLinesStatusMessageProps {\n className?: string;\n errorType: orderTemplateLinesStatus;\n text?: string;\n}\n\nexport const OrderTemplateLinesStatusMessage: React.FC = ({ className, errorType, text }) => {\n switch (errorType) {\n case 'EMPTY':\n return (\n

\n { text }\n

\n );\n case 'FAILED':\n return (\n

\n { text }\n

\n );\n case 'LOADING':\n default:\n return (\n

\n { text }\n

\n );\n }\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport * as React from 'react';\n\nimport { IOrderTemplateLineViewModel } from '../order-template';\n\nexport interface IOrderTemplateTableHeadingProps {\n selectAllRowsText?: string;\n productNumber: string;\n productName: string;\n productUnitPrice: string;\n productUOM: string;\n productQuantity: string;\n productActions: string;\n lines: IOrderTemplateLineViewModel[];\n isMobile: boolean;\n clickHandler(isChecked: boolean): void;\n}\n\n/**\n * Order Template's table state.\n */\nexport interface IOrderTemplateTableHeadingState {\n isChecked: boolean;\n}\n\nexport interface IOrderTemplateTableShortHeading {\n productNumber: string;\n productActions: string;\n}\n\n/**\n * Order Template's table heading.\n */\nexport class OrderTemplateTableHeading extends React.PureComponent {\n public state: IOrderTemplateTableHeadingState = {\n isChecked: false\n };\n\n private readonly componentClassName: string = 'ms-table';\n\n public static getDerivedStateFromProps(props: IOrderTemplateTableHeadingProps, state: IOrderTemplateTableHeadingState): IOrderTemplateTableHeadingState {\n const checkedLines = props.lines.filter(line => !line.isChecked).length;\n let nextState = { ...state };\n nextState = { isChecked: checkedLines === 0 };\n return nextState;\n }\n\n public getOnChange = () => (event: React.ChangeEvent) => {\n this.setState({\n isChecked: this.state.isChecked\n }, () => {\n this.props.clickHandler(!this.state.isChecked);\n });\n };\n\n public render(): JSX.Element {\n return (\n \n \n \n \n \n \n  \n \n \n {this.props.productNumber}\n \n {!this.props.isMobile ? \n {this.props.productName}\n : null}\n {!this.props.isMobile ? \n {this.props.productUnitPrice}\n : null}\n {!this.props.isMobile ? \n {this.props.productUOM}\n : null}\n {!this.props.isMobile ? \n {this.props.productQuantity}\n : null}\n {!this.props.isMobile ? \n {this.props.productActions}\n : }\n \n \n );\n }\n}\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { IItemAddedToCartDialogData, IItemAddedToCartDialogResources, ILinesAddedToCartDialogResources, IOrderTemplateNameDialogResources, ItemAddedToCartDialog } from '@msdyn365-commerce/components';\nimport MsDyn365, { AsyncResult, getUrlSync, IRequestContext } from '@msdyn365-commerce/core';\nimport { getCartState, ICartActionResult } from '@msdyn365-commerce/global-state';\nimport { CartLine, ProductList, ProductListLine } from '@msdyn365-commerce/retail-proxy';\nimport { addCartLinesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\nimport {\n deleteAsync,\n removeProductListLinesAsync,\n updateProductListLinesAsync\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductListsDataActions.g';\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport {\n getPriceForSelectedVariant, getProductUrlSync, ObjectExtensions,\n OrderTemplate, OrderTemplateLine, PriceForSelectedVariantInput\n} from '@msdyn365-commerce-modules/retail-actions';\nimport { Alert, getTelemetryObject, Heading, IModuleProps, INodeProps, ITelemetryContent, UncontrolledPagination } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport debounce from 'lodash/debounce';\nimport { action, computed, observable } from 'mobx';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\nimport { IOrderTemplateActionsProps, IOrderTemplateActionsViewProps, IOrderTemplateLineProps, IOrderTemplateLineViewProps, IOrderTemplateTableHeadingProps, OrderTemplateActionsView, OrderTemplateLinesStatusMessage, OrderTemplateLineView, OrderTemplateMobileLineView, OrderTemplateTableHeading } from '../..';\nimport { ActiveOrderTemplateLinesInput } from './actions/get-order-template';\nimport { OrderTemplateBulkActions } from './components/bulk-actions';\nimport { IOrderTemplateData } from './order-template.data';\nimport { IOrderTemplateProps, IOrderTemplateResources } from './order-template.props.autogenerated';\n\nexport interface IOrderTemplateLineActionMessageState {\n itemKey: string;\n userMessage: string;\n statusCssString: string;\n messageGlyph: string;\n isOpen: boolean;\n isItemAddedToOrderTemplateOpen: boolean;\n isConfirmAddSelectionToBagModalOpen: boolean;\n itemAddedToCartDialogData?: IItemAddedToCartDialogData;\n productSelection: IOrderTemplateLineViewModel[];\n isDetailsDisplayed: boolean;\n detailedProductView?: IOrderTemplateLineViewProps;\n}\n\nexport type orderTemplateLinesStatus = 'LOADING' | 'SUCCESS' | 'FAILED' | 'EMPTY';\ntype GridSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\nexport interface IOrderTemplateViewProps extends IOrderTemplateProps {\n OrderTemplateLines: IModuleProps;\n callbacks?: IOrderTemplateLinesCallbacks;\n status?: orderTemplateLinesStatus;\n statusMessage?: React.ReactNode;\n heading?: React.ReactNode;\n OrderTemplateActions?: INodeProps;\n ProductsTable?: INodeProps;\n ProductsTableRow?: INodeProps;\n ProductsTableHeading?: React.ReactNode;\n ProductDetails?: INodeProps;\n orderLines?: IOrderTemplateLineViewProps[];\n productListLines?: ProductListLine[];\n productsStatusMessage?: React.ReactNode;\n orderActions?: IOrderTemplateActionsViewProps | null;\n resources: IOrderTemplateResources;\n pagination?: React.ReactNode;\n itemAddedToCartDialog?: React.ReactNode;\n bulkOrderLineActions?: React.ReactNode;\n isDetailsDisplayed?: boolean;\n detailedProduct?: IOrderTemplateLineProps;\n detailedProductView?: IOrderTemplateLineViewProps;\n productQuantityView?: React.ReactNode;\n addButton?: React.ReactNode;\n isMobile?: boolean;\n toggleDetailsDisplayed?(props: IOrderTemplateLineProps | undefined): void;\n}\n\nexport interface IOrderTemplateLinesCallbacks {\n updateQuantity(itemKey: string, quantity: number): void;\n}\n\nexport interface IOrderTemplateLineViewModel extends OrderTemplateLine {\n isChecked: boolean;\n productQuantityView: React.ReactNode;\n}\n\n/**\n *\n * OrderTemplateLines component.\n * @extends {React.PureComponent, IOrderTemplateLineActionMessageState>}\n */\n@observer\nclass OrderTemplateLines extends React.Component, IOrderTemplateLineActionMessageState> {\n private readonly className: string;\n\n private readonly telemetryContent?: ITelemetryContent;\n\n @observable\n private _viewport: GridSize;\n\n @computed get isMobile(): boolean {\n return (this._viewport === 'xs' || this._viewport === 'sm');\n }\n\n constructor(props: IOrderTemplateProps, state: IOrderTemplateLineActionMessageState) {\n super(props);\n this.className = 'ms-order-template';\n this._viewport = props.context.request && props.context.request.device && props.context.request.device.Type === 'Mobile' ? 'xs' : 'lg';\n this._updateViewport = this._updateViewport.bind(this);\n\n this.state = {\n itemKey: '',\n userMessage: '',\n statusCssString: 'success',\n messageGlyph: 'fas fa-check',\n isOpen: false,\n isItemAddedToOrderTemplateOpen: false,\n isConfirmAddSelectionToBagModalOpen: false,\n productSelection: [],\n isDetailsDisplayed: false\n };\n this.telemetryContent = getTelemetryObject(this.props.context.request.telemetryPageName!, this.props.friendlyName, this.props.telemetry);\n this._updateViewport();\n\n if (MsDyn365.isBrowser && !this.props.context.request.user.isAuthenticated) {\n window.location.assign(this.props.context.request.user.signInUrl || '/');\n }\n }\n\n @action\n public async componentDidMount(): Promise {\n this.setState({});\n const orderTemplate = await this.props.data.orderTemplate;\n this.props.config.heading!.text = orderTemplate?.productList.Name || '';\n this.setState({\n productSelection: orderTemplate?.orderTemplateLines as IOrderTemplateLineViewModel[]\n });\n\n if (MsDyn365.isBrowser) {\n window.addEventListener('resize', this._updateViewport);\n this._updateViewport();\n }\n }\n\n public componentWillUnmount(): void {\n if (MsDyn365.isBrowser) {\n window.removeEventListener('resize', this._updateViewport);\n }\n }\n\n public shouldComponentUpdate(nextProps: IOrderTemplateProps,\n nextState: IOrderTemplateLineActionMessageState): boolean {\n if (this.state === nextState && this.props === nextProps) {\n return false;\n }\n return true;\n }\n\n public render(): JSX.Element | null {\n const { heading, className } = this.props.config;\n const { emptyOrderTemplateLinesText, errorGettingOrderTemplateLines } = this.props.resources;\n const { orderTemplate, cart } = this.props.data;\n\n if (cart.status === 'LOADING' || ObjectExtensions.isNullOrUndefined(orderTemplate) || orderTemplate.status === 'LOADING') {\n const errorProps: IOrderTemplateViewProps = {\n ...(this.props as IOrderTemplateProps),\n OrderTemplateLines: {\n moduleProps: this.props,\n className: classnames(this.className, className)\n },\n status: 'LOADING',\n statusMessage: ,\n heading: heading && ,\n resources: this.props.resources\n };\n return this.props.renderView(errorProps);\n }\n\n if (cart.status === 'FAILED' || orderTemplate.status === 'FAILED') {\n const errorProps: IOrderTemplateViewProps = {\n ...(this.props as IOrderTemplateProps),\n OrderTemplateLines: {\n moduleProps: this.props,\n className: classnames(`${this.className}`, className)\n },\n status: 'FAILED',\n statusMessage: ,\n heading: heading && ,\n resources: this.props.resources\n };\n\n return this.props.renderView(errorProps);\n }\n\n const orderTemplateResult = orderTemplate && orderTemplate.result;\n const orderTemplateLines = orderTemplateResult && orderTemplateResult.orderTemplateLines;\n\n if (!orderTemplateResult || !orderTemplateLines || orderTemplateLines.length === 0) {\n if (orderTemplateResult && !this._isFirstPage() && MsDyn365.isBrowser) {\n window.location.href = this._getOrderTemplatePageUrl();\n return null;\n }\n\n const emptyViewProps: IOrderTemplateViewProps = {\n ...(this.props as IOrderTemplateProps),\n OrderTemplateLines: {\n moduleProps: this.props,\n className: classnames(`${this.className}`, className)\n },\n status: 'EMPTY',\n statusMessage: ,\n heading: heading && ,\n resources: this.props.resources\n };\n\n return this.props.renderView(emptyViewProps);\n }\n\n const viewProps: IOrderTemplateViewProps = {\n ...(this.props as IOrderTemplateProps),\n OrderTemplateLines: {\n moduleProps: this.props,\n className: classnames(`${this.className}`, className)\n },\n status: 'SUCCESS',\n productsStatusMessage: this.state.isOpen && (\n
\n \n \n {this.state.userMessage}\n \n \n
\n ),\n heading: heading && ,\n OrderTemplateActions: {\n className: `${this.className}-action-bar`,\n tag: 'div'\n },\n ProductsTable: {\n className: `${this.className}__table`,\n tag: 'table',\n role: 'grid'\n },\n ProductsTableRow: {\n className: `${this.className}-table-line`,\n tag: 'tr'\n },\n ProductsTableHeading: this._renderProductListHeader(this.props.resources),\n ProductDetails: {\n className: `${this.className}-table-line__link`,\n tag: 'a'\n },\n orderLines: this._renderProductList(),\n callbacks: { updateQuantity: debounce(this._changeQuantity, 2000) },\n orderActions: this._renderOrderTemplateActions(orderTemplateResult),\n pagination: this._renderPagination(),\n itemAddedToCartDialog: this._renderItemAddedToCartDialog(),\n bulkOrderLineActions: this._getOrderTemplateLineActions(orderTemplateResult.productList.Id),\n isDetailsDisplayed: this.state.isDetailsDisplayed,\n toggleDetailsDisplayed: this._toggleDetailsDisplayed,\n detailedProductView: this.state.detailedProductView,\n isMobile: this.isMobile\n };\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n public onSelect(line: IOrderTemplateLineViewModel, isChecked: boolean): void {\n line.isChecked = isChecked;\n\n const updated = this.state.productSelection.map(product => {\n if (product.fullProduct?.ProductDetails.ItemId === line.fullProduct?.ProductDetails.ItemId) {\n line.isChecked = isChecked;\n }\n return product;\n }) || [];\n\n this.setState({\n productSelection: updated\n });\n }\n\n public onSelectAll(isChecked: boolean): void {\n const updated = this.state.productSelection.map(line => {\n line.isChecked = isChecked;\n return line;\n }) || [];\n\n this.setState({\n productSelection: updated\n });\n }\n\n private _renderProductListHeader(resources: IOrderTemplateResources): React.ReactNode {\n const { productNumberText, productText, productUnitPriceText, productUOMText, productQuantityText, productActionsText, selectAllRowsText } = resources;\n const headers: IOrderTemplateTableHeadingProps = {\n productNumber: productNumberText,\n productName: productText,\n productUnitPrice: productUnitPriceText,\n productUOM: productUOMText,\n productQuantity: productQuantityText,\n productActions: productActionsText,\n selectAllRowsText,\n lines: this.state.productSelection,\n isMobile: this.isMobile,\n clickHandler: (isChecked: boolean) => {\n this.onSelectAll(isChecked);\n }\n };\n\n return ;\n }\n\n private _getOrderTemplateLineActions(orderTemplateId: string): React.ReactNode {\n return (\n line.isChecked)}\n onAddSelectionToBag={this._onAddSelectionToBag}\n onRemoveSelection={this._onRemoveSelection}\n isMinifiedView={this.isMobile}\n />\n );\n }\n\n private _generateLinesAddedToCartDialogResources(): ILinesAddedToCartDialogResources {\n return {\n viewCartButtonText: this.props.resources.viewCartButtonText,\n orderTemplateCloseButtonText: this.props.resources.orderTemplateCloseButtonText,\n linesAddedToCartHeaderItemsOneText: this.props.resources.linesAddedToCartHeaderItemsOneText,\n linesAddedToCartHeaderLinesOneText: this.props.resources.linesAddedToCartHeaderLinesOneText,\n linesAddedToCartHeaderLinesFormatText: this.props.resources.linesAddedToCartHeaderLinesFormatText,\n linesAddedToCartHeaderMessageText: this.props.resources.linesAddedToCartHeaderMessageText\n };\n }\n\n private _generateItemAddedToCartDialogResources(): IItemAddedToCartDialogResources {\n return {\n viewCartButtonText: this.props.resources.viewCartButtonText,\n orderTemplateCloseButtonText: this.props.resources.orderTemplateCloseButtonText,\n itemAddedToCartHeaderItemOneText: this.props.resources.itemAddedToCartHeaderItemOneText,\n itemAddedToCartHeaderItemFormatText: this.props.resources.itemAddedToCartHeaderItemFormatText,\n itemAddedToCartHeaderMessageText: this.props.resources.itemAddedToCartHeaderMessageText,\n freePriceText: this.props.resources.freePriceText,\n originalPriceText: this.props.resources.originalPriceText,\n currentPriceText: this.props.resources.currentPriceText\n };\n }\n\n private readonly _onRemoveSelection = (): void => {\n const { context, resources } = this.props;\n const { telemetry } = context;\n const { removeSelectedFailureMessage, removeSelectedSuccessMessage } = resources;\n const lines = this.state.productSelection;\n const productListLines = lines && lines.length && lines\n .filter(line => line.isChecked)\n .map(line => line.productListLine);\n\n if (productListLines && productListLines.length > 0) {\n const productListId = productListLines[0].ProductListId;\n\n removeProductListLinesAsync({ callerContext: context.actionContext }, productListId!, productListLines)\n .then(() => {\n this.setState({\n userMessage: removeSelectedSuccessMessage,\n statusCssString: 'success',\n messageGlyph: 'fas fa-check',\n isOpen: true\n });\n window.location.reload();\n })\n .catch(error => {\n telemetry.warning('[order-template-lines] Unable remove items from the order template lines');\n telemetry.error(error);\n this.setState({\n userMessage: removeSelectedFailureMessage,\n statusCssString: 'success',\n messageGlyph: 'fas fa-check',\n isOpen: true\n });\n });\n }\n };\n\n private readonly _getOrderTemplatePageUrl = (): string => {\n let url = getUrlSync('ordertemplate', this.props.context.actionContext) || '';\n url = url.includes('?') ? url.substr(0, url.indexOf('?')) : url;\n if (this.props.data.orderTemplate?.result?.productList.Id) {\n return `${url}?id=${this.props.data.orderTemplate.result.productList.Id}`;\n }\n return '';\n\n };\n\n private readonly _onAddSelectionToBag = async (): Promise => {\n const { context, resources } = this.props;\n const { addedToCartFailureMessage, addedToCartSuccessMessage } = resources;\n const lines = this.state.productSelection;\n const cartState = await getCartState(context.actionContext);\n const selectedLines = lines.filter(line => line.isChecked);\n\n if (selectedLines.length > 0) {\n const cartLines = selectedLines.map(productLine => {\n return {\n ItemId: productLine.fullProduct?.ProductDetails.ItemId,\n ProductId: productLine.productListLine.ProductId,\n Quantity: productLine.productListLine.Quantity || 1,\n TrackingId: '',\n UnitOfMeasureSymbol: productLine.productListLine.UnitOfMeasure || productLine.fullProduct?.ProductDetails.DefaultUnitOfMeasure\n } as CartLine;\n }) || [];\n\n return addCartLinesAsync({ callerContext: context.actionContext }, cartState.cart.Id, cartLines, cartState.cart.Version)\n .then(async res => {\n context.telemetry.trace(`Order template; selected line items (${cartLines.map(line => line.ItemId).join(',')}) added to cart: ${cartState.cart.Id}`);\n await cartState.refreshCart({});\n this.setState({\n userMessage: addedToCartSuccessMessage,\n statusCssString: 'success',\n messageGlyph: 'fas fa-check',\n isOpen: true\n });\n })\n .catch(error => {\n context.telemetry.trace('Unable to add order template to cart.');\n this.setState({\n userMessage: addedToCartFailureMessage,\n statusCssString: 'danger',\n messageGlyph: 'fas fa-exclamation-triangle',\n isOpen: true\n });\n });\n }\n\n return Promise.resolve(void (0));\n };\n\n private _renderOrderTemplateActions(orderTemplate: OrderTemplate): IOrderTemplateActionsViewProps {\n const { id, typeName, context, resources } = this.props;\n const {\n addTemplateToBagButtonText,\n renameTemplateButtonText,\n deleteTemplateButtonText,\n closeWindowButtonText,\n addToCartFailureMessage,\n addToCartSuccessMessage,\n addToCartProcessMessage\n } = resources;\n\n const orderTemplateActions: IOrderTemplateActionsProps = {\n data: { orderTemplate },\n id,\n typeName,\n context,\n telemetryContent: this.telemetryContent,\n handlers: {\n onRenameTemplate: this._renameTemplate,\n onRemoveTemplate: this._removeTemplate\n },\n renameOrderTemplateDialogStrings: this._generateOrderTemplateNameDialogResources(resources),\n resources: {\n addTemplateToBagButtonText,\n renameTemplateButtonText,\n deleteTemplateButtonText,\n addToCartFailureMessage,\n addToCartSuccessMessage,\n addToCartProcessMessage,\n closeWindowButtonText,\n linesAddedToCartDialogResources: this._generateLinesAddedToCartDialogResources()\n }\n };\n\n return OrderTemplateActionsView(orderTemplateActions);\n }\n\n private _generateOrderTemplateNameDialogResources(resources: IOrderTemplateResources): IOrderTemplateNameDialogResources {\n return {\n orderTemplateHeaderLabel: resources.renameOrderTemplateTitleText,\n orderTemplateTitleLabel: resources.orderTemplateTitle,\n orderTemplateNameAriaLabel: resources.orderTemplateTitle,\n orderTemplateDescription: '',\n defaultOrderTemplateName: resources.defaultOrderTemplateName,\n orderTemplateButtonLabel: resources.renameOrderTemplateButtonText,\n orderTemplateCancelButtonLabel: resources.cancelBtnLabel\n };\n }\n\n private readonly _getCurrentUrl = (reqContext: IRequestContext): URL => {\n if (MsDyn365.isBrowser) {\n return new URL(window.location.href);\n }\n return new URL(reqContext.url.requestUrl.href);\n };\n\n /**\n * On close handler.\n */\n private readonly onCloseHandler = () => {\n this.setState({\n itemKey: this.state.itemKey,\n userMessage: this.state.userMessage,\n statusCssString: this.state.statusCssString,\n messageGlyph: this.state.messageGlyph,\n isOpen: this.state.isOpen,\n isItemAddedToOrderTemplateOpen: false\n });\n };\n\n private readonly _renderItemAddedToCartDialog = (): React.ReactNode | null => {\n if (!this.state.itemAddedToCartDialogData) {\n return null;\n }\n\n return (\n \n );\n };\n\n private _isFirstPage(): boolean {\n return this._getCurrentPageNumber() === 0;\n }\n\n private _getCurrentPageNumber(): number {\n const itemsPerPage = this.props.config.itemsPerPage || 50;\n return this.props.context.request.query && (+this.props.context.request.query.skip / itemsPerPage) || 0;\n }\n\n private readonly _renderPagination = (): React.ReactNode | null => {\n const { config, context, data, resources } = this.props;\n const orderTemplate = data && data.orderTemplate && data.orderTemplate.result;\n if (!orderTemplate) {\n return null;\n }\n\n const fullUrl = this._getCurrentUrl(context.request);\n const itemsPerPage = config.itemsPerPage || 50;\n const currentPageNumber = this._getCurrentPageNumber();\n const skipCount = currentPageNumber * itemsPerPage;\n const totalItems = orderTemplate && orderTemplate.totalLines;\n const previousText = resources.flipperPrevious;\n const nextText = resources.flipperNext;\n\n if (totalItems <= itemsPerPage) {\n return null;\n }\n\n return (\n \n );\n };\n\n private _renderProductList(): IOrderTemplateLineViewProps[] {\n const {\n selectOneRowText,\n moreButtonText,\n viewProductDetailsText,\n priceFree,\n originalPriceText,\n currentPriceText,\n addOrderTemplateItemToBagButtonText,\n removeItemFromOrderTemplateButtonText,\n productDimensionTypeColor,\n productDimensionTypeSize,\n productDimensionTypeStyle,\n inputQuantityAriaLabel,\n deleteButtonText,\n incrementButtonAriaLabel,\n decrementButtonAriaLabel\n } = this.props.resources;\n\n const { context, telemetry } = this.props;\n const { imageSettings } = this.props.config;\n\n return this.state.productSelection.map((line, index) => {\n const currentProductProps: IOrderTemplateLineProps = {\n orderTemplateLine: line,\n productListLine: line.productListLine,\n price: line.fullProduct?.ProductPrice,\n context,\n productUrl: line.fullProduct ? getProductUrlSync(line.fullProduct.ProductDetails, context.actionContext, undefined) : '',\n imageSettings,\n telemetry,\n moduleId: this.props.id,\n moduleTypeName: this.props.typeName,\n quantity: line.productListLine.Quantity!,\n handlers: {\n onAddToBag: this._addItemToBag,\n onRemoveItem: this._removeItemFromOrderTemplateLines,\n onChangeQuantity: this._changeQuantity,\n onSelect: this.onSelect.bind(this)\n },\n resources: {\n selectOneRowText,\n moreButtonText,\n viewProductDetailsText,\n productDimensionTypeColor,\n productDimensionTypeSize,\n productDimensionTypeStyle,\n freePriceText: priceFree,\n originalPriceText,\n currentPriceText,\n inputQuantityAriaLabel,\n removeFromOrderTemplateLinesText: removeItemFromOrderTemplateButtonText,\n addToBagButtonText: addOrderTemplateItemToBagButtonText,\n deleteButtonText,\n incrementButtonAriaLabel,\n decrementButtonAriaLabel\n },\n index,\n isMobile: this.isMobile,\n toggleDetailsDisplayed: this._toggleDetailsDisplayed\n };\n\n return OrderTemplateLineView(currentProductProps)!;\n });\n }\n\n private readonly _toggleDetailsDisplayed = (props: IOrderTemplateLineProps): void => {\n let state = {\n isDetailsDisplayed: !this.state.isDetailsDisplayed\n };\n if (props) {\n state = { ...state, ...{\n detailedProductView: OrderTemplateMobileLineView(props)\n } };\n }\n this.setState(state);\n };\n\n // Dismiss alert when addingToCart/removeItem\n private readonly _onDismiss = () => {\n this.setState({\n isOpen: false\n });\n };\n\n private readonly _changeQuantity = (itemKey: string, quantity: number, props?: IOrderTemplateLineProps) => {\n const { context, data, telemetry, config } = this.props;\n const { orderTemplate } = data;\n\n if (context) {\n if (orderTemplate?.result) {\n const orderTemplateLinesData = orderTemplate.result.orderTemplateLines;\n if (orderTemplateLinesData) {\n const orderLineIndex = orderTemplateLinesData.findIndex((lines: OrderTemplateLine) => lines.productListLine.LineId === itemKey);\n const newProductListLine = { ...orderTemplateLinesData[orderLineIndex] };\n if (orderTemplateLinesData[orderLineIndex].productListLine.Quantity === quantity) {\n return;\n }\n const prevQuantity = newProductListLine.productListLine.Quantity;\n newProductListLine.productListLine.Quantity = quantity;\n const { fullProduct, ...line } = newProductListLine;\n\n // Update mobile modal\n if (props) {\n props.quantity = quantity;\n this.setState({\n detailedProductView: OrderTemplateMobileLineView(props)\n });\n }\n\n updateProductListLinesAsync({ callerContext: context.actionContext }, orderTemplate.result.productList.Id, [line.productListLine])\n .then(list => {\n this.setState({\n itemKey,\n userMessage: '',\n statusCssString: 'success',\n messageGlyph: 'fas fa-check',\n isOpen: false\n });\n if (list) {\n const newLine = list.find(lines => lines.LineId === itemKey);\n orderTemplateLinesData[orderLineIndex].productListLine = newLine!;\n const updatedLines = [...orderTemplateLinesData];\n updatedLines[orderLineIndex] = { fullProduct, productListLine: newLine! };\n const updatedOrderTemplate = { ...orderTemplate.result, ProductListLines: updatedLines };\n context.actionContext.update(new ActiveOrderTemplateLinesInput(context.actionContext.requestContext, config), updatedOrderTemplate);\n }\n })\n .catch(error => {\n telemetry.warning('[order-template-lines] Unable to update product quantity.');\n telemetry.error(error);\n const userMessage = 'Failed to update quantity value.';\n if (props) {\n props && (props.productListLine.Quantity = prevQuantity);\n this.setState({\n itemKey,\n userMessage,\n statusCssString: 'danger',\n messageGlyph: 'fas fa-exclamation-triangle',\n isOpen: true,\n detailedProductView: OrderTemplateMobileLineView(props)\n });\n } else {\n newProductListLine.productListLine.Quantity = prevQuantity;\n this.setState({\n itemKey,\n userMessage,\n statusCssString: 'danger',\n messageGlyph: 'fas fa-exclamation-triangle',\n isOpen: true\n });\n }\n });\n }\n }\n }\n };\n\n private readonly _addItemToBag = (product: SimpleProduct, quantity: number, itemKey: string): void => {\n const { context, data, resources, telemetry } = this.props;\n const { cart } = data;\n const { maxQuantityLimitText, addedToCartFailureMessage } = resources;\n\n if (context) {\n if (cart.result) {\n const addProductToCartInput = {\n product,\n count: quantity\n };\n\n cart.result\n .addProductToCart(addProductToCartInput)\n .then((result: ICartActionResult) => {\n if (result.status === 'SUCCESS') {\n return getPriceForSelectedVariant(\n new PriceForSelectedVariantInput(\n product.RecordId,\n this.props.context.actionContext.requestContext.apiSettings.channelId,\n product),\n this.props.context.actionContext).then(priceResult => {\n if (!priceResult) {\n return AsyncResult.reject('Failed to retrieve product price');\n }\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- read config file.\n const isMiniCart = context.app.config.addToCartBehavior === 'showMiniCart';\n this.setState({\n itemKey,\n userMessage: '',\n statusCssString: 'success',\n messageGlyph: 'fas fa-check',\n isOpen: false,\n isItemAddedToOrderTemplateOpen: !isMiniCart,\n itemAddedToCartDialogData: {\n product,\n productPrice: priceResult,\n quantity\n },\n isDetailsDisplayed: false\n });\n return AsyncResult.resolve();\n });\n } else if (result.substatus === 'MAXQUANTITY') {\n this.setState({\n itemKey,\n userMessage:\n maxQuantityLimitText\n .replace('{curQuantity}', quantity.toString())\n .replace('{maxQuantity}', context.app.config.maxQuantityForProductListLineItem.toString()) ||\n `You can only add ${context.app.config.maxQuantityForProductListLineItem} of this item to your shopping bag`,\n statusCssString: 'danger',\n messageGlyph: 'fas fa-exclamation-triangle',\n isOpen: true\n });\n return AsyncResult.resolve();\n }\n telemetry.debug('[order-template-lines] Unable to Update Cart Line from the order template lines');\n this.setState({\n itemKey,\n userMessage: addedToCartFailureMessage,\n statusCssString: 'danger',\n messageGlyph: 'fas fa-exclamation-triangle',\n isOpen: true\n });\n return AsyncResult.resolve();\n\n })\n .catch((error: Error) => {\n telemetry.warning(error.message);\n telemetry.debug('[order-template-lines] Error trying to Update Cart Line from the order template lines');\n this.setState({\n itemKey,\n userMessage: addedToCartFailureMessage,\n statusCssString: 'danger',\n messageGlyph: 'fas fa-exclamation-triangle',\n isOpen: true\n });\n });\n }\n }\n };\n\n private readonly _removeItemFromOrderTemplateLines = (line: IOrderTemplateLineViewModel): void | undefined => {\n const { context, data, telemetry } = this.props;\n const { orderTemplate } = data;\n\n if (context && context.actionContext) {\n const userToken = context.request.user.isAuthenticated && context.request.user.token;\n if (userToken && orderTemplate?.result && line) {\n removeProductListLinesAsync({ callerContext: context.actionContext }, line.productListLine.ProductListId!, [line.productListLine])\n .then(() => {\n window.location.reload(false);\n })\n .catch(error => {\n telemetry.warning('[order-template-lines] Unable remove items from the order template lines');\n telemetry.error(error);\n });\n } else {\n telemetry.warning(\n '[order-template-lines] Unable remove items from the order template lines user token or lineItemID was not found'\n );\n }\n }\n };\n\n private readonly _renameTemplate = async (_template: ProductList): Promise => {\n window.location.reload();\n return Promise.resolve();\n };\n\n private readonly _removeTemplate = () => {\n const { context, data, telemetry, resources } = this.props;\n const { orderTemplate } = data;\n\n if (context && context.actionContext) {\n const userToken = context.request.user.isAuthenticated && context.request.user.token;\n if (userToken && orderTemplate && orderTemplate.result) {\n deleteAsync({ callerContext: context.actionContext }, orderTemplate.result.productList)\n .then()\n .catch((error: string) => {\n telemetry.warning('[order-template] Unable to delete order template.');\n telemetry.error(error);\n this.setState({\n itemKey: orderTemplate.result?.productList.Id || '',\n userMessage: resources.deleteOrderTemplateFailedText,\n statusCssString: 'danger',\n messageGlyph: 'fas fa-exclamation-triangle',\n isOpen: true\n });\n });\n const newLink = getUrlSync('ordertemplatelist', this.props.context.actionContext);\n if (newLink) {\n window.location.assign(newLink);\n }\n } else {\n telemetry.warning('[order-template] Failed to delete order template. Order template was not found');\n }\n } else {\n telemetry.warning('[order-template] Failed to delete order template.');\n }\n };\n\n private _updateViewport(): void {\n this._viewport = this._getViewport();\n }\n\n private readonly _getViewport = (): GridSize => {\n const { context } = this.props;\n\n // Always render in mobile viewport on a mobile device\n if (context.request && context.request.device && context.request.device.Type === 'Mobile') {\n return 'xs';\n }\n\n if (MsDyn365.isBrowser && window.innerWidth) {\n const gridSettings = context.request.gridSettings;\n if (gridSettings) {\n if (gridSettings.xs && window.innerWidth <= gridSettings.xs.w) {\n return 'xs';\n } else if (gridSettings.sm && window.innerWidth <= gridSettings.sm.w) {\n return 'sm';\n } else if (gridSettings.md && window.innerWidth <= gridSettings.md.w) {\n return 'md';\n } else if (gridSettings.lg && window.innerWidth <= gridSettings.lg.w) {\n return 'lg';\n }\n return 'xl';\n\n }\n }\n\n return 'xs';\n };\n\n /**\n * Renders a Pagination previous text.\n * @param paginationPreviousText - Pagination previous text from resources.\n * @returns Previous text and flipper icon.\n */\n private readonly _renderPrev = (paginationPreviousText: string) => {\n return (\n
\n
\n );\n };\n\n /**\n * Renders a Pagination next text.\n * @param paginationNextText - Pagination next text from resources.\n * @returns Next text and flipper icon.\n */\n private readonly _renderNext = (paginationNextText: string) => {\n return (\n
\n \n {paginationNextText}\n \n
\n );\n };\n}\n\nexport default OrderTemplateLines;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { Button, INodeProps, Modal, ModalBody, ModalFooter, ModalHeader, Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IOrderTemplateLineViewProps } from './components';\nimport { IOrderTemplateViewProps } from './order-template';\n\nconst OrderTemplateLinesView: React.FC = (props: IOrderTemplateViewProps) => {\n const {\n OrderTemplateLines,\n status,\n statusMessage,\n heading,\n ProductsTable,\n ProductsTableHeading,\n orderLines,\n ProductsTableRow,\n productsStatusMessage,\n OrderTemplateActions,\n orderActions,\n pagination,\n itemAddedToCartDialog,\n bulkOrderLineActions,\n isDetailsDisplayed,\n detailedProductView,\n toggleDetailsDisplayed,\n resources: {\n cancelBtnLabel,\n productNumberText,\n productText,\n productUnitPriceText,\n productUOMText,\n productQuantityText\n }\n } = props;\n\n const toggleDetails = React.useCallback(() => {\n toggleDetailsDisplayed && toggleDetailsDisplayed(undefined);\n }, [toggleDetailsDisplayed]);\n\n return (\n \n {heading}\n {OrderTemplateActions && (\n \n {orderActions?.addTemplateToBag}\n {orderActions?.renameTemplate}\n {orderActions?.removeTemplate}\n {!isDetailsDisplayed && productsStatusMessage}\n \n )}\n {bulkOrderLineActions}\n {status !== 'SUCCESS' && statusMessage}\n {ProductsTable && orderLines && orderLines.length > 0 && (\n \n \n {ProductsTableHeading}\n \n {orderLines &&\n orderLines.map(product => {\n return _renderItem(product, productQuantityText, ProductsTableRow);\n })}\n \n \n {pagination}\n \n )}\n {itemAddedToCartDialog}\n \n \n Product Details\n \n \n
    \n
  • \n {detailedProductView?.productImage}\n
  • \n
  • \n \n {productText}\n :\n \n {detailedProductView?.productInfo}\n
  • \n
  • \n \n {productNumberText}\n :\n \n {detailedProductView?.productNumber}\n
  • \n
  • \n \n {productUnitPriceText}\n :\n \n {' '}\n {detailedProductView?.productPrice}\n
  • \n
  • \n \n {productUOMText}\n :\n \n {' '}\n {detailedProductView?.productUnitOfMeasure}\n
  • \n
  • \n \n {productQuantityText}\n :\n \n {detailedProductView?.productQuantityView}\n
  • \n {productsStatusMessage &&
  • \n {productsStatusMessage}\n
  • }\n
\n
\n \n \n \n \n
\n );\n};\n\nconst _renderItem = (\n product: IOrderTemplateLineViewProps,\n quantityLabel: string,\n ProductsTableRow?: INodeProps\n): JSX.Element | null => {\n if (!product) {\n return null;\n }\n\n const {\n key,\n selectLine,\n productImage,\n productPrice,\n productNumber,\n addToBagButton,\n removeButton,\n productInfo,\n productUnitOfMeasure,\n productQuantityView,\n productQuantity,\n popUp,\n isMobile\n } = product;\n\n return (\n \n \n {selectLine}\n \n \n {productImage}\n \n {isMobile ? \n
\n {productNumber}\n
\n
\n {quantityLabel}\n :\n {' '}\n {productQuantity}\n
\n : \n {productNumber}\n }\n {!isMobile && \n {productInfo}\n }\n {!isMobile && \n {productPrice}\n }\n {!isMobile && \n {productUnitOfMeasure}\n }\n {!isMobile && \n {productQuantityView}\n }\n {isMobile && \n {popUp}\n }\n {!isMobile &&\n \n {addToBagButton}\n {removeButton}\n }\n
\n );\n};\n\nexport default OrderTemplateLinesView;\n"],"names":["OrderTemplateActions","props","onRemoveOrderTemplate","handlers","itemKey","removeOrderTemplateActionHandler","input","OrderTemplateRender","Id","orderTemplate","removeFromOrderTemplateListText","orderTemplateState","name","imageSettings","context","telemetryContent","enableImageProductLink","onDismiss","key","orderTemplateImage","_renderOrderTemplateImages","orderTemplateLines","orderTemplateAriaLabel","_renderAriaLabel","orderTemplateName","className","href","url","actionContext","separator","includes","_getOrderTemplatePageUrl","totalLines","color","addToCartButton","AddOrderTemplateToCartComponent","id","typeName","moduleTypeName","data","addToCartText","addToBagText","dialogStrings","resources","removeButton","onClick","orderTemplateStatusMessage","isOpen","userMessage","statusCssString","toggle","onClickHandler","productUrl","window","location","assign","defaultImageSettings","viewports","xs","q","w","h","lg","xl","lazyload","count","length","slice","map","line","fullProduct","getProductUrlSync","ProductDetails","undefined","alt","Name","altText","requestContext","src","PrimaryImageUrl","fallBackSrc","getFallbackImageUrl","ItemId","apiSettings","gridSettings","request","loadFailureBehavior","OrderTemplateListStatusMessage","errorType","text","modalCloseButtonReference","onCancelHandler","isCreateOrderTemplateDialogOpen","setOrderTemplateNameDialogOpen","useState","onCreateButtonClick","ref","createOrderTemplateText","OrderTemplateNameDialog","modalOpen","isUpdateDialog","setModalOpen","createOrderTemplateDialogResources","onCancel","onSuccess","onOrderTemplateCreated","parentElementRef","OrderTemplateList","super","_onDismiss","this","setState","_reloadPage","async","reload","_onRemoveFromOrderTemplateList","productListId","telemetry","orderTemplates","user","isAuthenticated","token","result","find","p","productList","deleteAsync","callerContext","then","catch","error","warning","headerStatusMessage","deleteOrderTemplateFailedText","messageGlyph","state","nextProps","nextState","heading","config","emptyOrderTemplateText","createNewTemplateButtonText","orderTemplatesData","orderTemplateListHeading","orderTemplateListTitle","status","errorProps","moduleProps","statusMessage","tag","renderView","emptyViewProps","viewProps","createOrderTemplateButton","_generateOrderTemplateNameDialogResources","templateHeaderStatusMessage","OrderTemplates","OrderTemplate","_renderOrderTemplateList","orderTemplateHeaderLabel","createOrderTemplateHeader","orderTemplateTitleLabel","orderTemplateTitle","orderTemplateNameAriaLabel","orderTemplateDescription","createOrderTemplateDescription","defaultOrderTemplateName","orderTemplateButtonLabel","createOrderTemplateButtonText","orderTemplateCancelButtonLabel","cancelNewOrderTemplateCreationButtonText","index","currentTemplateProps","addToBagButtonText","moduleId","closeWindowButtonText","addToCartFailureMessage","addToCartSuccessMessage","addToCartProcessMessage","linesAddedToCartDialogResources","viewCartButtonText","orderTemplateCloseButtonText","linesAddedToCartHeaderItemsOneText","linesAddedToCartHeaderLinesOneText","linesAddedToCartHeaderLinesFormatText","linesAddedToCartHeaderMessageText","OrderTemplateListView","Module","Node","_renderOrderTemplate","ActiveOrderTemplateLinesInput","getCacheKey","buildCacheKeyWithUrlTokens","getCacheObjectType","dataCacheType","shouldCacheOutput","query","Error","orderTemplateId","queryResultSettings","QueryResultSettings","getActiveOrderTemplateLines","getActiveOrderTemplateLinesDataAction","action","msg","CONTENT","AddLineToTemplate","products","content","Search","selectedProduct","searchTextInput","addLineButtonRef","_renderSearchForm","searchButtonAriaLabel","searchModalPlaceholderText","role","autoComplete","onSubmit","_onSearchSubmit","type","autoFocus","placeholder","value","onChange","_onInputChange","maxLength","event","preventDefault","Loading","_getSearchResults","NotFound","ProductList","_onQuantityChangeHandler","selectedQuantity","target","_onSelectItem","channelId","varianteInput","product","RecordId","productVariant","Promise","resolve","dimensions","_getProductDimensions","selectedProductDimensions","ProductConfiguration","_onBackButtonClickHandler","_highlightSearchTerm","parsedName","unescape","replace","RegExp","dangerouslySetInnerHTML","__html","_resultCountText","searchResultsCountVerbage","toString","searchResultsCountSubject","_addItemToTemplateHandler","quantity","DefaultUnitOfMeasure","reloadPage","_toggleModalHandler","current","focus","addLineModalLinkText","backToResultsText","modalProps","ariaLabel","showBackArrow","_renderContent","addToTemplateHandler","onQuantityChangeHandler","highlightSearchTerm","searchForm","productProps","clickHandler","renderResultCountText","progressNotificationText","notFoundSearchErrorNotice","notFoundSearchErrorRedediation","NotFoundComponent","searchErrorMessage","searchText","catalogId","searchCriteriaInput","Context","ChannelId","CatalogId","IncludeAttributes","SearchCondition","searchByCriteriaAsync","MasterProductId","Dropdown","selectMenu","_onChanged","selectedIndex","dropdownId","selectId","selectedValue","innerText","dropdownList","dropdownName","item","selected","OrderTemplateQuantity","inputRef","_validateMin","minValue","min","isNaN","currentInput","currentCount","_handleChange","bind","glyphMinusClassName","decrementGlyphClass","glyphPlusClassName","incrementGlyphClass","disabled","incDisabled","max","currentValue","extraClass","getChangeHandler","amount","_onIncrementalChange","title","decrementButtonAriaLabel","tabIndex","pattern","onBlur","inputQuantityAriaLabel","incrementButtonAriaLabel","updatedQuantity","e","Number","parseInt","inputElement","HTMLInputElement","setAttribute","defaultProps","selectedDimensions","_getDimensionsError","dimensionName","dimensionMissingError","_addToTemplateHandler","isBusy","showAddConfirmation","errors","add","missingDimensions","dimension","DimensionTypeValue","filter","ProductListId","addToTemplateDuplicateError","addToTemplateGenericError","errorMessage","_onQuantityChange","newValue","totalPrice","Price","_updateDimensionValue","productDimensionFull","newValueId","DimensionValues","_onDimensionChanged","remainingDimensionsErrors","selection","buttonDisabled","mappedDimensions","DimensionValue","ExtensionProperties","variantProduct","dimensionInput","variantDimensions","availabilityInput","newAvailableQuantity","priceInput","productPrice","productAvailableQuantity","unitPrice","BasePrice","sort","a","b","_getDropdownName","dimensionType","productDimensionTypeColor","productDimensionTypeConfiguration","productDimensionTypeSize","productDimensionTypeStyle","addItemToTemplateText","addLineProductUnitPricePrefix","quantitySelectLabel","addLineProductUnitOfMeasurePrefix","totalPriceLabel","_formatPrice","_getDimensionsNodes","_getConfirmationMessage","selectedDimensionNames","variant","Value","addToTemplateConfirmation","Object","values","join","unshift","assertive","price","cultureFormatter","formatCurrency","currencyCode","toFixed","selectProductButtonText","fallBackImg","ProductSelectButton","buttonText","setBusy","getClickHandler","OrderTemplateBulkActions","isAddDisabled","isRemoveDisabled","addHandler","onAddSelectionToBag","removeHandler","onRemoveSelection","selectedLines","searchInputAriaLabel","backButtonText","addSelectedToBagButtonText","removeSelectedToBagButtonText","addLineProps","isMinifiedView","removeOrderActionHandler","_removeOrderTemplate","onRemoveTemplate","_getOrderTemplateAddToCartDialog","addTemplateToBagButtonText","_getOrderTemplateRenameControl","renameOrderTemplateDialogStrings","RenameOrderTemplateComponent","onRenameTemplate","renameOrderTemplateButtonText","renameTemplateButtonText","OrderTemplateLineActions","orderTemplateLine","productListLine","LineId","onAddToBag","onRemoveItem","getAddToBag","getRemoveItem","PopUp","removeFromOrderTemplateLinesText","moreButtonText","viewProductDetailsText","showMobile","setShowMobile","componentClassName","toggleDetailsDisplayed","getActionButton","isMobile","removeButtonClassName","addButtonClassName","onSelectLineHandler","isChecked","onSelect","checked","OrderTemplateMobileLineView","UnitOfMeasure","fallbackImage","productImage","_renderProductImage","productInfo","renderProductInfo","_renderPrice","productNumber","productUnitOfMeasure","productQuantityView","_generateQuantity","onChangeHandler","onChangeQuantity","image","PriceComponent","freePriceText","originalPriceText","currentPriceText","Dimensions","_renderProductDimensions","productName","dimensionsLine","OrderTemplateLinesStatusMessage","OrderTemplateTableHeading","getOnChange","checkedLines","lines","scope","selectAllRowsText","productUnitPrice","productUOM","productQuantity","productActions","OrderTemplateLines","_onRemoveSelection","removeSelectedFailureMessage","removeSelectedSuccessMessage","productSelection","productListLines","removeProductListLinesAsync","substr","indexOf","_onAddSelectionToBag","addedToCartFailureMessage","addedToCartSuccessMessage","cartState","getCartState","cartLines","productLine","ProductId","Quantity","TrackingId","UnitOfMeasureSymbol","addCartLinesAsync","cart","Version","trace","refreshCart","_getCurrentUrl","reqContext","URL","requestUrl","onCloseHandler","isItemAddedToOrderTemplateOpen","_renderItemAddedToCartDialog","itemAddedToCartDialogData","ItemAddedToCartDialog","_generateItemAddedToCartDialogResources","onClose","_renderPagination","fullUrl","itemsPerPage","skipCount","_getCurrentPageNumber","totalItems","previousText","flipperPrevious","nextText","flipperNext","paginationAriaLabel","qsp","items","startingItem","_renderPrev","_renderNext","previousAriaLabel","nextAriaLabel","_toggleDetailsDisplayed","isDetailsDisplayed","detailedProductView","_changeQuantity","orderTemplateLinesData","orderLineIndex","findIndex","newProductListLine","prevQuantity","updateProductListLinesAsync","list","newLine","updatedLines","updatedOrderTemplate","ProductListLines","update","_addItemToBag","maxQuantityLimitText","addProductToCartInput","addProductToCart","priceResult","isMiniCart","app","addToCartBehavior","substatus","maxQuantityForProductListLineItem","debug","message","_removeItemFromOrderTemplateLines","userToken","_renameTemplate","_removeTemplate","newLink","_getViewport","device","Type","innerWidth","sm","md","paginationPreviousText","paginationNextText","_viewport","_updateViewport","isConfirmAddSelectionToBagModalOpen","telemetryPageName","friendlyName","signInUrl","addEventListener","removeEventListener","emptyOrderTemplateLinesText","errorGettingOrderTemplateLines","ObjectExtensions","orderTemplateResult","_isFirstPage","productsStatusMessage","ProductsTable","ProductsTableRow","ProductsTableHeading","_renderProductListHeader","orderLines","_renderProductList","callbacks","updateQuantity","orderActions","_renderOrderTemplateActions","pagination","itemAddedToCartDialog","bulkOrderLineActions","_getOrderTemplateLineActions","updated","productNumberText","productText","productUnitPriceText","productUOMText","productQuantityText","productActionsText","headers","onSelectAll","itemAddedToCartHeaderItemOneText","itemAddedToCartHeaderItemFormatText","itemAddedToCartHeaderMessageText","deleteTemplateButtonText","addTemplateToBag","renameTemplate","removeTemplate","OrderTemplateActionsView","_generateLinesAddedToCartDialogResources","renameOrderTemplateTitleText","cancelBtnLabel","skip","selectOneRowText","priceFree","addOrderTemplateItemToBagButtonText","removeItemFromOrderTemplateButtonText","deleteButtonText","selectLine","addToBagButton","popUp","OrderTemplateLineView","ProductPrice","_renderItem","quantityLabel","toggleDetails","wrapClassName","fade","applicationNode"],"sourceRoot":""}