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,iBAAS,IAAAmB,OAAA,EAAfA,EAAiBqb,+BAAuB,IAAAZ,EAAAA,EAAI,GACxDtY,MAA+C,QAA1CuY,EAAiB,QAAjBza,EAAEL,EAAMf,iBAAS,IAAAoB,OAAA,EAAfA,EAAiBob,+BAAuB,IAAAX,EAAAA,EAAI,GACnD9I,KAAK,SACL/M,QAASA,IAAMS,EAAe+U,EAA8Ce,WACxEH","sources":["webpack://nss-commerce/./src/modules/nss-c-order-history-with-search-and-filters/common/get-sales-order.ts?98cd","webpack://nss-commerce/./src/modules/nss-c-order-history-with-search-and-filters/components/nss-c-order-history-search-bar.component.tsx?c1de","webpack://nss-commerce/./src/modules/nss-c-order-history-with-search-and-filters/components/nss-c-order-history-with-search-and-filters-header.component.tsx?e8ea","webpack://nss-commerce/./src/modules/nss-c-order-history-with-search-and-filters/components/nss-c-order-history-with-search-and-filters-order-list.component.tsx?2378","webpack://nss-commerce/./src/modules/nss-c-order-history-with-search-and-filters/components/nss-c-order-history-with-search-and-filters-order-table.component.tsx?60cc","webpack://nss-commerce/./src/modules/nss-c-order-history-with-search-and-filters/components/nss-c-order-history-with-search-and-filters-organization-wide-selector.component.tsx?524d","webpack://nss-commerce/./src/modules/nss-c-order-history-with-search-and-filters/components/nss-c-order-history-with-search-and-filters-view-mode-selector.component.tsx?32b7"],"sourcesContent":["/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { IActionContext, getUrlSync } from '@msdyn365-commerce/core-internal';\r\nimport { SalesOrder, SalesStatus } from '@msdyn365-commerce/retail-proxy';\r\nimport { StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\n\r\n/**\r\n * Resources for order status.\r\n */\r\nexport interface IOrderHistoryWithSearchAndFiltersOrderStatusResources {\r\n orderStatusCreated: string;\r\n orderStatusDelivered: string;\r\n orderStatusInvoiced: string;\r\n orderStatusCanceled: string;\r\n}\r\n\r\n/**\r\n * Retrieves the url for order details page.\r\n * @param actionContext - Core action context.\r\n * @param salesOrder - Order information.\r\n * @returns Url to order details.\r\n */\r\nexport const getOrderDetailsPageUrl = (actionContext: IActionContext, salesOrder: SalesOrder): string => {\r\n const orderDetailsUrl = getUrlSync('orderDetails', actionContext) || '';\r\n const separator = orderDetailsUrl.includes('?') ? '&' : '?';\r\n if (!StringExtensions.isNullOrWhitespace(salesOrder.SalesId)) {\r\n // Redirect with sales order sales id\r\n return `${orderDetailsUrl}${separator}salesId=${salesOrder.SalesId}`;\r\n }\r\n\r\n // Redirect with sales order transaction id\r\n return `${orderDetailsUrl}${separator}transactionId=${salesOrder.Id}`;\r\n};\r\n\r\n/**\r\n * Retrieves the text for order status.\r\n * @param status - The sales order.\r\n * @param resources - Resources where we can find the text.\r\n * @returns The text for the order status.\r\n */\r\nexport const getOrderStatusLabel = (\r\n status: SalesStatus | undefined,\r\n resources: IOrderHistoryWithSearchAndFiltersOrderStatusResources\r\n): string => {\r\n switch (status) {\r\n case SalesStatus.Created:\r\n return resources.orderStatusCreated;\r\n case SalesStatus.Delivered:\r\n return resources.orderStatusDelivered;\r\n case SalesStatus.Invoiced:\r\n return resources.orderStatusInvoiced;\r\n case SalesStatus.Canceled:\r\n return resources.orderStatusCanceled;\r\n default:\r\n return '';\r\n }\r\n};\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport { IComponent, IComponentProps, msdyn365Commerce } from '@msdyn365-commerce/core';\r\nimport {\r\n Button,\r\n ITelemetryContent,\r\n TelemetryConstant,\r\n getPayloadObject,\r\n getTelemetryAttributes\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport React from 'react';\r\n\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Class names used in component.\r\n */\r\nconst componentClassName = 'msc-search-bar';\r\nconst filterOptionsClassName = `${componentClassName}__search-options`;\r\nconst filterOptionClassName = `${componentClassName}__search-option`;\r\nconst filterOptionSelectedClassName = `${componentClassName}__search-option-selected`;\r\nconst searchBarClassName = `${componentClassName}__search-text`;\r\nconst buttonClassName = `${componentClassName}__search-button`;\r\n\r\n/**\r\n * ISearchBarComponent interface.\r\n */\r\ninterface ISearchBarComponent extends IComponent {}\r\n\r\n/**\r\n * ISearchBarResources interface.\r\n */\r\nexport interface ISearchBarResources {\r\n searchOptionsAriaLabel?: string;\r\n searchBarPlaceholder?: string;\r\n searchBarAriaLabel?: string;\r\n searchButtonLabel?: string;\r\n searchButtonAriaLabel?: string;\r\n}\r\n\r\n/**\r\n * ISearchBarData interface.\r\n */\r\nexport interface ISearchBarData {\r\n options: ISearchBarOption[];\r\n}\r\n\r\n/**\r\n * ISearchBarOption interface.\r\n */\r\nexport interface ISearchBarOption {\r\n label: string;\r\n value: string;\r\n}\r\n\r\n/**\r\n * ISearchBarProps interface.\r\n */\r\nexport interface ISearchBarProps extends IComponentProps {\r\n className?: string;\r\n resources?: ISearchBarResources;\r\n currentSearchOption?: ISearchBarOption;\r\n currentSearchText?: string;\r\n telemetryContent?: ITelemetryContent;\r\n clearSearchTextOnOptionChange?: boolean;\r\n orgUsers?: string[];\r\n onSelectOption?(newSearchOption?: ISearchBarOption): void;\r\n onChange?(searchOption?: ISearchBarOption, searchText?: string): void;\r\n onBlur?(searchOption?: ISearchBarOption, searchText?: string): void;\r\n onClick?(searchOption?: ISearchBarOption, searchText?: string): void;\r\n}\r\n\r\n/**\r\n * SearchBar component.\r\n * @param props - Configuration of the component.\r\n * @returns React node.\r\n */\r\nconst SearchBarFunctionalComponent: React.FC = (props: ISearchBarProps) => {\r\n const [searchOptionState, setSearchOptionState] = React.useState(props.currentSearchOption);\r\n const [searchTextState, setSearchTextState] = React.useState(props.currentSearchText);\r\n const [showSuggestions, setShowSuggestions] = React.useState(false);\r\n const [activeSuggestionIndex, setActiveSuggestionIndex] = React.useState(0);\r\n const [filteredSuggestions, setFilteredSuggestions] = React.useState([]);\r\n\r\n const onSelectOptionHandler = (event: React.ChangeEvent) => {\r\n const value = event.currentTarget.value;\r\n const searchOption = props.data.options?.find((option: ISearchBarOption) => option.value === value);\r\n setSearchOptionState(searchOption);\r\n if (props.clearSearchTextOnOptionChange) {\r\n setSearchTextState('');\r\n }\r\n props.onSelectOption?.(searchOption);\r\n };\r\n\r\n const onChangeHandler = (event: React.FocusEvent): void => {\r\n const value = event.currentTarget.value;\r\n setSearchTextState(value);\r\n if (searchOptionState?.value === '0') {\r\n const suggestions: string[] = props.orgUsers ?? [];\r\n const filtered = suggestions.filter(suggestion => suggestion.toLowerCase().includes(value.toLowerCase()));\r\n\r\n setFilteredSuggestions(filtered);\r\n setShowSuggestions(true);\r\n setActiveSuggestionIndex(0);\r\n } else {\r\n setFilteredSuggestions([]);\r\n setShowSuggestions(false);\r\n }\r\n props.onChange?.(searchOptionState, value);\r\n };\r\n\r\n const handleFocus = () => {\r\n const suggestions: string[] = props.orgUsers ?? [];\r\n setFilteredSuggestions(suggestions);\r\n setShowSuggestions(true);\r\n };\r\n\r\n const handleSuggestionClick = (suggestion: string) => {\r\n console.log('vivz handleClick', suggestion);\r\n if (suggestion !== '') {\r\n const customer = suggestion.split(' ');\r\n setSearchTextState(customer && customer.length && customer.length > 0 ? customer[0] : '');\r\n setFilteredSuggestions([]);\r\n setShowSuggestions(false);\r\n }\r\n };\r\n\r\n const handleKeyDown = (e: React.KeyboardEvent) => {\r\n if (e.key === 'ArrowDown') {\r\n if (activeSuggestionIndex < filteredSuggestions.length - 1) {\r\n setActiveSuggestionIndex(activeSuggestionIndex + 1);\r\n }\r\n } else if (e.key === 'ArrowUp') {\r\n if (activeSuggestionIndex > 0) {\r\n setActiveSuggestionIndex(activeSuggestionIndex - 1);\r\n }\r\n } else if (e.key === 'Enter') {\r\n if (filteredSuggestions[activeSuggestionIndex] !== '') {\r\n const customer = filteredSuggestions[activeSuggestionIndex].split(' ');\r\n setSearchTextState(customer && customer.length && customer.length > 0 ? customer[0] : '');\r\n setShowSuggestions(false);\r\n }\r\n }\r\n };\r\n\r\n const onBlurHandler = (event: React.FocusEvent) => {\r\n event.preventDefault();\r\n const value = event.currentTarget.value;\r\n setSearchTextState(value);\r\n setTimeout(() => {\r\n setShowSuggestions(false);\r\n\r\n setFilteredSuggestions([]);\r\n props.onBlur?.(searchOptionState, value);\r\n }, 200);\r\n };\r\n\r\n const onClickHandler = () => {\r\n props.onClick?.(searchOptionState, searchTextState);\r\n };\r\n\r\n // define telemetry attributes\r\n const searchButtonAttributes = getTelemetryAttributes(\r\n props.telemetryContent!,\r\n getPayloadObject('click', props.telemetryContent!, TelemetryConstant.Search)\r\n );\r\n\r\n return (\r\n
\r\n {ArrayExtensions.hasElements(props.data.options) && (\r\n \r\n {props.data.options?.map((option: ISearchBarOption) => {\r\n return (\r\n \r\n {option.label}\r\n \r\n );\r\n })}\r\n \r\n )}\r\n
\r\n \r\n {showSuggestions && searchOptionState?.value === '0' && (\r\n
    \r\n {filteredSuggestions.length ? (\r\n filteredSuggestions.map((suggestion, index) => (\r\n handleSuggestionClick(suggestion)}\r\n className={index === activeSuggestionIndex ? 'active' : ''}\r\n >\r\n {suggestion}\r\n \r\n ))\r\n ) : (\r\n
  • No Customers Found
  • \r\n )}\r\n
\r\n )}\r\n
\r\n \r\n {props.resources?.searchButtonLabel}\r\n \r\n
\r\n );\r\n};\r\n\r\n/**\r\n * SearchBar component.\r\n */\r\nexport const SearchBarComponent: React.FunctionComponent = msdyn365Commerce.createComponent(\r\n 'SearchBarComponent',\r\n { component: SearchBarFunctionalComponent }\r\n);\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { Node } from '@msdyn365-commerce-modules/utilities';\r\nimport React from 'react';\r\n\r\nimport classnames from 'classnames';\r\n\r\nimport { SalesOrder } from '@msdyn365-commerce/retail-proxy';\r\n\r\n/**\r\n * Class names used in component.\r\n */\r\nconst componentClassName = 'ms-order-history-with-search-and-filters-header';\r\nconst headingClassName = `${componentClassName}__heading`;\r\nconst orderCountClassName = `${componentClassName}__order-count`;\r\n\r\n/**\r\n * IOrderHistoryWithSearchAndFiltersHeaderResources interface.\r\n */\r\nexport interface IOrderHistoryWithSearchAndFiltersHeaderResources {\r\n orderCountLabel: string;\r\n ordersCountLabel: string;\r\n}\r\n\r\n/**\r\n * IOrderHistoryWithSearchAndFiltersHeaderData interface.\r\n */\r\nexport interface IOrderHistoryWithSearchAndFiltersHeaderData {\r\n salesOrders: SalesOrder[];\r\n}\r\n\r\n/**\r\n * IOrderHistoryWithSearchAndFiltersHeaderProps interface.\r\n */\r\nexport interface IOrderHistoryWithSearchAndFiltersHeaderProps\r\n extends Msdyn365.IComponentProps {\r\n className?: string;\r\n resources: IOrderHistoryWithSearchAndFiltersHeaderResources;\r\n textProps: Msdyn365.ITextProps;\r\n showOrderCount: boolean;\r\n extraActions?: React.ReactNode;\r\n onChange(event: Msdyn365.ContentEditableEvent): void;\r\n}\r\n\r\n/**\r\n * OrderHistoryWithSearchAndFiltersHeader component.\r\n * @param props - Configuration of the component.\r\n * @returns React node.\r\n */\r\nconst OrderHistoryWithSearchAndFiltersHeaderFunctionalComponent: React.FC = (\r\n props: IOrderHistoryWithSearchAndFiltersHeaderProps\r\n) => {\r\n const {\r\n resources,\r\n data: { salesOrders },\r\n textProps,\r\n showOrderCount,\r\n extraActions\r\n } = props;\r\n\r\n const orderCount = salesOrders?.length;\r\n const orderCountText = `(${orderCount} ${orderCount === 1 ? resources?.orderCountLabel : resources?.ordersCountLabel})`;\r\n\r\n return (\r\n \r\n {textProps?.text && (\r\n \r\n )}\r\n {showOrderCount && {orderCountText}}\r\n {extraActions}\r\n \r\n );\r\n};\r\n\r\n/**\r\n * OrderHistoryWithSearchAndFiltersHeader component.\r\n */\r\nexport const OrderHistoryWithSearchAndFiltersHeaderComponent: React.FunctionComponent = Msdyn365.msdyn365Commerce.createComponent<\r\n // @ts-expect-error\r\n IOrderHistoryWithSearchAndFiltersHeaderProps\r\n>('OrderHistoryWithSearchAndFiltersHeaderComponent', { component: OrderHistoryWithSearchAndFiltersHeaderFunctionalComponent });\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport MsDyn365, { IComponentProps, msdyn365Commerce } from '@msdyn365-commerce/core';\r\nimport {\r\n Button,\r\n format,\r\n getPayloadObject,\r\n getTelemetryAttributes,\r\n ITelemetryContent,\r\n Node,\r\n TelemetryConstant,\r\n Modal,\r\n IModalProps,\r\n ModalHeader,\r\n ModalBody,\r\n ModalFooter\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport {\r\n ChannelDeliveryOptionConfiguration,\r\n ChannelIdentity,\r\n Customer,\r\n OrderOriginator,\r\n OrgUnitLocation,\r\n SalesOrder,\r\n SimpleProduct\r\n} from '@msdyn365-commerce/retail-proxy';\r\nimport { ArrayExtensions, ObjectExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { Observer } from 'mobx-react';\r\nimport React from 'react';\r\n\r\nimport classnames from 'classnames';\r\n\r\nimport { getGroups, IGroup, IGroupDelivery, IGroups } from '@msdyn365-commerce-modules/order-management';\r\nimport { getOrderInformation, getOrderInformationInput, IOrderInformation } from '@msdyn365-commerce-modules/order-management';\r\nimport { ISalesLine } from '@msdyn365-commerce-modules/order-management';\r\nimport { getSalesLines, getSalesLinesInput, IGetSalesLinesInput } from '@msdyn365-commerce-modules/order-management';\r\nimport { ExpandButtonState, IPriceContext, SalesLineState } from '@msdyn365-commerce-modules/order-management';\r\nimport {\r\n INssCOrderHistoryWithSearchAndFiltersProps,\r\n INssCOrderHistoryWithSearchAndFiltersResources\r\n} from '../nss-c-order-history-with-search-and-filters.props.autogenerated';\r\nimport { INssCOrderHistoryWithSearchAndFiltersData } from '../nss-c-order-history-with-search-and-filters.data';\r\nimport { getOrderDetailsPageUrl } from '../common/get-sales-order';\r\nimport { SalesOrderExtended } from '../actions/get-nss-c-order-history-with-search-and-filters';\r\nimport { nSS_UpdateSalesOrderApprovalStatusAsync } from '../../../proxy/DataActionExtension.g';\r\nimport { OrderStatusStateShareInput, IOrderStatus } from '../../../actions/order-status-state-share.action';\r\n\r\n/**\r\n * Class names used in component.\r\n */\r\nconst componentClassName = 'ms-order-history-with-search-and-filters-order-list';\r\nconst orderListItemClassName = `${componentClassName}__sales-order`;\r\nconst orderInformationHeaderClassName = `${componentClassName}__sales-order__header`;\r\nconst orderInformationCountClassName = `${componentClassName}__sales-order__order-number-count`;\r\nconst expandProductsButtonClassName = `${componentClassName}__sales-order__expand-products-button`;\r\nconst expandProductsButtonWrapperClassName = `${componentClassName}__sales-order__expand-products-button-wrapper`;\r\nconst orderDetailButtonClassName = `${componentClassName}__btn-order-details`;\r\nconst moduleName = componentClassName;\r\n\r\n/**\r\n * IOrderHistoryWithSearchAndFiltersOrderListData interface.\r\n */\r\nexport interface IOrderHistoryWithSearchAndFiltersOrderListData {\r\n salesOrders: SalesOrderExtended[];\r\n products: SimpleProduct[];\r\n channelIdentities?: ChannelIdentity[];\r\n orgUnitLocations?: OrgUnitLocation[];\r\n customer?: Customer;\r\n originators?: OrderOriginator[];\r\n}\r\n\r\nexport interface IExtendedOrderInformation extends IOrderInformation {\r\n orderStatus?: React.ReactNode;\r\n}\r\n\r\n/**\r\n * IOrderHistoryWithSearchAndFiltersOrderListProps interface.\r\n */\r\nexport interface IOrderHistoryWithSearchAndFiltersOrderListProps extends IComponentProps {\r\n moduleProps: INssCOrderHistoryWithSearchAndFiltersProps;\r\n className?: string;\r\n resources: INssCOrderHistoryWithSearchAndFiltersResources;\r\n isMobileView?: boolean;\r\n showChannelInfo: boolean;\r\n showOrderPlacedBy?: boolean;\r\n salesLinesLimit?: number;\r\n telemetryContent?: ITelemetryContent;\r\n retailMultiplePickUpOptionEnabled?: boolean;\r\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\r\n}\r\n\r\n/**\r\n * IOrderHistoryWithSearchAndFiltersOrderItemProps interface.\r\n */\r\ninterface IOrderHistoryWithSearchAndFiltersOrderItemProps {\r\n orderInfomation: IExtendedOrderInformation;\r\n groups?: IGroups;\r\n orderDetailsLink: React.ReactNode;\r\n expandProductsButton?: React.ReactNode;\r\n}\r\n\r\nexport const getOrderApprovalStatus = (props: ISalesOrderApproval): React.ReactNode => {\r\n const {\r\n salesOrder,\r\n context,\r\n data: { customer },\r\n moduleProps: {\r\n data: { orderStatus }\r\n }\r\n } = props;\r\n const { saleOrderApprovalStatusAttributeName, customerSaleOrderApprovalRequiredAttributeName } = context.app.config;\r\n let approvalStatus: string | undefined = '';\r\n let showApprovalStatus: boolean = false;\r\n const updatedApprovalStatus = orderStatus.result?.orderStatus.find(orderId => orderId.saleOrderId === salesOrder.SalesId)?.orderStatus;\r\n if (customer && salesOrder) {\r\n const customerApproval = customer.Attributes?.find(attr => attr.Name === customerSaleOrderApprovalRequiredAttributeName);\r\n const orderStatusAttribute = salesOrder.Attributes?.find(attr => attr.Name === saleOrderApprovalStatusAttributeName);\r\n if (salesOrder.SalesId && orderStatusAttribute && customerApproval?.AttributeValue?.StringValue === 'Yes') {\r\n showApprovalStatus = true;\r\n approvalStatus = orderStatusAttribute.TextValue?.replace('-', ' ');\r\n }\r\n }\r\n if (showApprovalStatus) {\r\n return (\r\n \r\n Approval Status: {updatedApprovalStatus ? updatedApprovalStatus : approvalStatus}\r\n \r\n );\r\n }\r\n return null;\r\n};\r\n\r\n/**\r\n * OrderInfomation component.\r\n * @param props - Configuration of the component.\r\n * @returns React node.\r\n */\r\nconst OrderInfomationComponent: React.FC = ({\r\n orderInformationProps,\r\n salesId,\r\n receiptId,\r\n channelName,\r\n createdDate,\r\n count,\r\n amount,\r\n channelReferenceId,\r\n orderStatus\r\n}) => (\r\n \r\n
{channelName}
\r\n
\r\n {salesId}\r\n {count}\r\n
\r\n {receiptId}\r\n {createdDate}\r\n {amount}\r\n {channelReferenceId}\r\n {orderStatus}\r\n
\r\n);\r\n\r\n/**\r\n * GroupDelivery component.\r\n * @param props - Configuration of the component.\r\n * @returns React node.\r\n */\r\nconst GroupDeliveryComponent: React.FC = ({ deliveryProps, heading, count, processing, address, trackingInfo }) => (\r\n \r\n {heading}\r\n {count}\r\n {processing}\r\n {address}\r\n {trackingInfo}\r\n \r\n);\r\n\r\n/**\r\n * Group component.\r\n * @param props - Configuration of the component.\r\n * @returns React node.\r\n */\r\nconst GroupComponent: React.FC = ({ groupProps, delivery, salesLinesProps, salesLines }) => (\r\n \r\n {delivery && }\r\n {salesLines && (\r\n \r\n {salesLines.map((salesLine: ISalesLine) => (\r\n {salesLine.salesLine}\r\n ))}\r\n \r\n )}\r\n \r\n);\r\n\r\n/**\r\n * Groups component.\r\n * @param props - Configuration of the component.\r\n * @returns React node.\r\n */\r\nconst GroupsComponent: React.FC = ({ groupsProps, groups }) => (\r\n \r\n {groups.map((group: IGroup, index: number) => (\r\n \r\n ))}\r\n \r\n);\r\n\r\n/**\r\n * Updates product states to show all products.\r\n * @param expandButtonState - Expand button state.\r\n * @param productStates - Product states.\r\n * @returns Callback method.\r\n */\r\nconst onExpandProductsCallback = (expandButtonState: ExpandButtonState, productStates: SalesLineState[]) => () => {\r\n for (const productState of productStates) {\r\n productState.isHidden = false;\r\n }\r\n expandButtonState.extraProductsCount = 0;\r\n};\r\n\r\n/**\r\n * Gets the IOrderHistoryWithSearchAndFiltersOrderItem configuration.\r\n * @param salesOrder The sales order\r\n * @param index The sales order index\r\n * @param props The component props\r\n * @returns The IOrderHistoryWithSearchAndFiltersOrderItem configuration.\r\n */\r\nconst createOrderHistoryWithSearchAndFiltersOrderItemProps = (\r\n salesOrder: SalesOrderExtended,\r\n index: number,\r\n props: IOrderHistoryWithSearchAndFiltersOrderListProps\r\n): IOrderHistoryWithSearchAndFiltersOrderItemProps => {\r\n const {\r\n id,\r\n typeName,\r\n context,\r\n moduleProps: { telemetry },\r\n data: { products, channelIdentities, orgUnitLocations, customer, originators },\r\n showChannelInfo,\r\n telemetryContent,\r\n resources: { freePriceText, detailsAriaLabel, detailsLabel, orderItemLabel, orderItemsLabel },\r\n context: { actionContext },\r\n retailMultiplePickUpOptionEnabled,\r\n channelDeliveryOptionConfig\r\n } = props;\r\n\r\n const priceContext = {\r\n id,\r\n typeName,\r\n context,\r\n telemetry,\r\n freePriceText\r\n } as IPriceContext;\r\n\r\n const originator: OrderOriginator | undefined = originators?.find(\r\n originator =>\r\n (salesOrder.SalesId && originator.SalesId === salesOrder.SalesId) ||\r\n (salesOrder.Id && originator.TransactionId === salesOrder.Id)\r\n );\r\n\r\n const salesLinesInput =\r\n products &&\r\n getSalesLinesInput(\r\n props.moduleProps,\r\n moduleName,\r\n salesOrder,\r\n products,\r\n priceContext,\r\n undefined,\r\n undefined,\r\n undefined,\r\n retailMultiplePickUpOptionEnabled,\r\n channelDeliveryOptionConfig\r\n );\r\n\r\n let salesLines: ISalesLine[] | undefined;\r\n let expandProductsButton: React.ReactNode;\r\n if (salesLinesInput) {\r\n const getSalesLinesInputProps: IGetSalesLinesInput = { ...salesLinesInput, imageOnly: true };\r\n if (!ObjectExtensions.isNullOrUndefined(props.salesLinesLimit)) {\r\n const extraProductsCount = getSalesLinesInputProps.salesLines.length - props.salesLinesLimit;\r\n getSalesLinesInputProps.salesLineStates = getSalesLinesInputProps.salesLines.map(\r\n (salesLine, index) => new SalesLineState(`${salesLine.LineId ?? ''}-${index}`, index >= props.salesLinesLimit!)\r\n );\r\n if (extraProductsCount > 0) {\r\n const expandButtonState = new ExpandButtonState(extraProductsCount);\r\n expandProductsButton = (\r\n <>\r\n \r\n {() => {\r\n const text = format(\r\n props.resources.orderHistoryExpandProductsButtonText,\r\n expandButtonState.extraProductsCount\r\n );\r\n return (\r\n expandButtonState.extraProductsCount > 0 && (\r\n \r\n {text}\r\n \r\n )\r\n );\r\n }}\r\n \r\n \r\n );\r\n }\r\n }\r\n salesLines = getSalesLines(getSalesLinesInputProps);\r\n }\r\n\r\n expandProductsButton = (\r\n <>\r\n {expandProductsButton}\r\n
\r\n \r\n );\r\n\r\n const groups =\r\n salesLines &&\r\n getGroups({\r\n moduleName,\r\n salesLines,\r\n resources: { orderItemLabel, orderItemsLabel },\r\n retailMultiplePickUpOptionEnabled\r\n });\r\n\r\n const orderInfomationInput = getOrderInformationInput(\r\n props.moduleProps,\r\n moduleName,\r\n salesOrder,\r\n priceContext,\r\n channelIdentities,\r\n orgUnitLocations,\r\n customer,\r\n originator,\r\n showChannelInfo\r\n );\r\n\r\n const payLoad = getPayloadObject('click', telemetryContent!, TelemetryConstant.OrderDetails);\r\n const orderDetailsAttributes = getTelemetryAttributes(telemetryContent!, payLoad);\r\n\r\n const orderDetailsLink = (\r\n
\r\n \r\n \r\n {detailsLabel}\r\n \r\n
\r\n );\r\n const orderInformation = getOrderInformation(orderInfomationInput);\r\n const newOrderInformation: IExtendedOrderInformation = {\r\n ...orderInformation,\r\n orderStatus: getOrderApprovalStatus({ ...props, salesOrder }) // Adding a new property 'orderStatus' with the new React Element\r\n };\r\n return {\r\n orderInfomation: newOrderInformation,\r\n groups: groups,\r\n orderDetailsLink: orderDetailsLink,\r\n expandProductsButton: expandProductsButton\r\n };\r\n};\r\n\r\ninterface ISalesOrderApproval extends IOrderHistoryWithSearchAndFiltersOrderListProps {\r\n salesOrder: SalesOrderExtended;\r\n}\r\n\r\nconst SalesOrderApproval = (props: ISalesOrderApproval) => {\r\n const {\r\n salesOrder,\r\n context: { actionContext, app },\r\n data: { customer },\r\n moduleProps: {\r\n data: { orderStatus }\r\n }\r\n } = props;\r\n\r\n const [showApprovalStatus, setShowApprovalStatus] = React.useState(false);\r\n const [updateApprovalStatusAllowed, setUpdateApprovalStatusAllowed] = React.useState(true);\r\n const [approvalStatus, setApprovalStatus] = React.useState('Not Approved');\r\n const [isApproved, setIsApproved] = React.useState(false);\r\n const [rejectionComments, setRejectionComments] = React.useState('');\r\n const [isModalOpen, setIsModalOpen] = React.useState(false);\r\n const [modalHasError, setModalHasError] = React.useState(false);\r\n const { reasonForRejection, errorForRejectionReason, btnSubmitLabel, approveLabel, rejectLabel } = props.resources;\r\n\r\n React.useEffect(() => {\r\n const { saleOrderApprovalStatusAttributeName, customerSaleOrderApprovalRequiredAttributeName } = app.config;\r\n\r\n if (customer && salesOrder) {\r\n const customerApproval = customer.Attributes?.find(attr => attr.Name === customerSaleOrderApprovalRequiredAttributeName);\r\n const orderStatusAttribute = salesOrder.Attributes?.find(attr => attr.Name === saleOrderApprovalStatusAttributeName);\r\n if (\r\n salesOrder.SalesId &&\r\n orderStatusAttribute &&\r\n customer.IsB2bAdmin &&\r\n customerApproval?.AttributeValue?.StringValue === 'Yes'\r\n ) {\r\n setShowApprovalStatus(true);\r\n if (orderStatusAttribute.TextValue === 'Approved') {\r\n setApprovalStatus(orderStatusAttribute.TextValue);\r\n setIsApproved(true);\r\n setUpdateApprovalStatusAllowed(false);\r\n } else if (orderStatusAttribute.TextValue === 'Pending') {\r\n setUpdateApprovalStatusAllowed(true);\r\n } else {\r\n setApprovalStatus(orderStatusAttribute.TextValue?.replace('-', ' '));\r\n setUpdateApprovalStatusAllowed(false);\r\n }\r\n }\r\n }\r\n }, []);\r\n\r\n const updateApprovalStatus = async () => {\r\n setIsApproved(true);\r\n setApprovalStatus('Approved');\r\n setUpdateApprovalStatusAllowed(false);\r\n void nSS_UpdateSalesOrderApprovalStatusAsync({ callerContext: actionContext }, salesOrder?.SalesId || '', 'Approved', '');\r\n const orderStatuses: IOrderStatus[] = orderStatus.result?.orderStatus ?? [];\r\n const orderStatusData: IOrderStatus = {\r\n orderStatus: 'Approved',\r\n saleOrderId: salesOrder.SalesId ? salesOrder.SalesId : ''\r\n };\r\n const replacedIndex = orderStatuses.findIndex(orderStatus => orderStatus.saleOrderId === salesOrder.SalesId);\r\n if (replacedIndex >= 0) {\r\n orderStatuses[replacedIndex] = orderStatusData;\r\n } else {\r\n orderStatuses.push(orderStatusData);\r\n }\r\n\r\n actionContext.update(new OrderStatusStateShareInput(), { orderStatus: orderStatuses });\r\n };\r\n\r\n const toggleModal = () => {\r\n setIsModalOpen(!isModalOpen);\r\n setModalHasError(false);\r\n const comments = MsDyn365.isBrowser && (document.getElementById('rejectionReason') as HTMLInputElement);\r\n if (comments) {\r\n comments.value = '';\r\n }\r\n };\r\n const modalPropsTerms: IModalProps = {\r\n applicationNode: MsDyn365.isBrowser ? document.body : '',\r\n isOpen: isModalOpen,\r\n autoFocus: true,\r\n size: 'sm',\r\n keyboard: true,\r\n backdrop: true,\r\n zIndex: 1000,\r\n fade: true,\r\n className: 'msc-modal__order-status',\r\n toggle: toggleModal\r\n };\r\n const addRejectionComments = () => {\r\n if (rejectionComments) {\r\n setIsApproved(false);\r\n setApprovalStatus('Not Approved');\r\n setUpdateApprovalStatusAllowed(false);\r\n void nSS_UpdateSalesOrderApprovalStatusAsync(\r\n { callerContext: actionContext },\r\n salesOrder?.SalesId || '',\r\n 'Not-Approved',\r\n rejectionComments\r\n );\r\n const orderStatuses: IOrderStatus[] = orderStatus.result?.orderStatus ?? [];\r\n const orderStatusData: IOrderStatus = {\r\n orderStatus: 'Not Approved',\r\n saleOrderId: salesOrder.SalesId ? salesOrder.SalesId : ''\r\n };\r\n orderStatuses.push(orderStatusData);\r\n actionContext.update(new OrderStatusStateShareInput(), { orderStatus: orderStatuses });\r\n setIsModalOpen(false);\r\n setModalHasError(false);\r\n } else {\r\n setModalHasError(true);\r\n }\r\n };\r\n\r\n const handleChange = (event: React.ChangeEvent) => {\r\n setRejectionComments(event.target.value);\r\n if (event.target.value === '') {\r\n setModalHasError(true);\r\n } else {\r\n setModalHasError(false);\r\n }\r\n };\r\n\r\n const statusClass = classnames('approval-status', { approved: isApproved, 'not-approved': !isApproved });\r\n return showApprovalStatus ? (\r\n
\r\n \r\n
\r\n \r\n \r\n
\r\n \r\n \r\n {reasonForRejection}\r\n \r\n \r\n
\r\n \r\n
\r\n {modalHasError && (\r\n
\r\n {errorForRejectionReason}\r\n
\r\n )}\r\n
\r\n \r\n \r\n {btnSubmitLabel}\r\n \r\n \r\n
\r\n
\r\n ) : null;\r\n};\r\n\r\n/**\r\n * OrderHistoryWithSearchAndFiltersOrderList component.\r\n * @param props - Configuration of the component.\r\n * @returns React node.\r\n */\r\nconst OrderHistoryWithSearchAndFiltersOrderListFunctionalComponent: React.FC = (\r\n props: IOrderHistoryWithSearchAndFiltersOrderListProps\r\n) => {\r\n return (\r\n \r\n {ArrayExtensions.hasElements(props.data.salesOrders) &&\r\n props.data.salesOrders.map((salesOrder: SalesOrder, index: number) => {\r\n const itemProps: IOrderHistoryWithSearchAndFiltersOrderItemProps = createOrderHistoryWithSearchAndFiltersOrderItemProps(\r\n salesOrder,\r\n index,\r\n props\r\n );\r\n return (\r\n \r\n {itemProps.orderInfomation && }\r\n {itemProps.groups && }\r\n {itemProps.expandProductsButton}\r\n {itemProps.orderDetailsLink}\r\n \r\n );\r\n })}\r\n \r\n );\r\n};\r\n\r\n/**\r\n * OrderHistoryWithSearchAndFiltersOrderList component.\r\n */\r\nexport const OrderHistoryWithSearchAndFiltersOrderListComponent: React.FunctionComponent = msdyn365Commerce.createComponent<\r\n // @ts-expect-error\r\n IOrderHistoryWithSearchAndFiltersOrderListProps\r\n>('OrderHistoryWithSearchAndFiltersOrderListComponent', { component: OrderHistoryWithSearchAndFiltersOrderListFunctionalComponent });\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { IComponentProps, ICoreContext, IDateFormatOptions, msdyn365Commerce, isOboRequest } from '@msdyn365-commerce/core';\r\nimport { ArrayExtensions, StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { ChannelIdentity, Customer, OrderOriginator, OrgUnitLocation, SalesOrder } from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n ActionMenuComponent,\r\n TableCellComponent,\r\n TableComponent,\r\n TableCellContentType,\r\n TableHeaderComponent,\r\n TableRowComponent\r\n} from '@msdyn365-commerce/components';\r\nimport React from 'react';\r\n\r\nimport classnames from 'classnames';\r\n\r\nimport {\r\n Button,\r\n ITelemetryContent,\r\n TelemetryConstant,\r\n getPayloadObject,\r\n getTelemetryAttributes\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport {\r\n countItems,\r\n getOrderChannelAddress,\r\n getOrderChannelName,\r\n getOrderChannelTypeValue,\r\n isOnlineStoreChannel\r\n} from '@msdyn365-commerce-modules/order-management';\r\nimport {\r\n IOrderHistoryWithSearchAndFiltersOrderStatusResources,\r\n getOrderDetailsPageUrl,\r\n getOrderStatusLabel\r\n} from '../common/get-sales-order';\r\n\r\n/**\r\n * Class names used in component.\r\n */\r\nconst componentClassName = 'ms-order-history-with-search-and-filters-order-table';\r\nconst placedByClassName = `${componentClassName}__row__placed-by`;\r\nconst orderNumberClassName = `${componentClassName}__row__order-number`;\r\nconst columnMobileClassName = `${componentClassName}__row__mobile-cell`;\r\nconst actionsClassName = `${componentClassName}__row__actions`;\r\nconst viewDetailsMenuItemClassName = `${componentClassName}__row__view-details-action`;\r\n\r\n/**\r\n * IOrderHistoryWithSearchAndFiltersOrderTableResources interface.\r\n */\r\nexport interface IOrderHistoryWithSearchAndFiltersOrderTableResources extends IOrderHistoryWithSearchAndFiltersOrderStatusResources {\r\n orderHistoryOrderNumberText: string;\r\n orderHistoryCreatedDateText: string;\r\n orderHistoryItemsText: string;\r\n orderHistoryTotalText: string;\r\n orderHistoryOriginText: string;\r\n orderHistoryOrderStatusText: string;\r\n orderHistoryActionMenuButtonAriaLabel: string;\r\n orderHistoryViewDetailsButtonText: string;\r\n orderHistoryViewDetailsButtonAriaLabel: string;\r\n orderHistoryCreatedDateMobileDescriptionText: string;\r\n orderHistoryOrderNumberIsNotAvailable: string;\r\n onlineStoreChannelNameText: string;\r\n posChannelNameText: string;\r\n orderPlacedByFullText?: string;\r\n orderPlacedByYouText?: string;\r\n orderOnBehalfOfText?: string;\r\n}\r\n\r\n/**\r\n * IOrderHistoryWithSearchAndFiltersOrderTableData interface.\r\n */\r\nexport interface IOrderHistoryWithSearchAndFiltersOrderTableData {\r\n salesOrders: SalesOrder[];\r\n channelIdentities?: ChannelIdentity[];\r\n orgUnitLocations?: OrgUnitLocation[];\r\n customer?: Customer;\r\n originators?: OrderOriginator[];\r\n}\r\n\r\n/**\r\n * IOrderHistoryWithSearchAndFiltersOrderTableProps interface.\r\n */\r\nexport interface IOrderHistoryWithSearchAndFiltersOrderTableProps extends IComponentProps {\r\n className?: string;\r\n resources: IOrderHistoryWithSearchAndFiltersOrderTableResources;\r\n isMobileView?: boolean;\r\n showChannelInfo: boolean;\r\n showOrderPlacedBy?: boolean;\r\n telemetryContent?: ITelemetryContent;\r\n}\r\n\r\ninterface IOnBehalfOfOrderResources {\r\n orderHistoryOrderNumberIsNotAvailable?: string;\r\n}\r\n\r\ninterface IOnBehalfOfOrderProps {\r\n salesOrder: SalesOrder;\r\n isOnBehalfOfOrder: boolean;\r\n originator?: OrderOriginator;\r\n placedByName: string;\r\n placedByText: string;\r\n onBehalfOfText: string;\r\n showOrderPlacedBy?: boolean;\r\n resources: IOnBehalfOfOrderResources;\r\n}\r\n\r\n/**\r\n * Formats amount.\r\n * @param context - Core context.\r\n * @param amount - Amount to display.\r\n * @param currencyCode - Currency for the amount.\r\n * @returns String value.\r\n */\r\nconst formatAmount = (context: ICoreContext, amount: number | undefined, currencyCode: string | undefined) => {\r\n if (amount === undefined) {\r\n return '';\r\n }\r\n return context.cultureFormatter.formatCurrency(amount, currencyCode);\r\n};\r\n\r\n/**\r\n * Formats date.\r\n * @param context - Core context.\r\n * @param date - Date to display.\r\n * @returns String value.\r\n */\r\nconst formatDate = (context: ICoreContext, date: Date | undefined) => {\r\n if (date === undefined) {\r\n return '';\r\n }\r\n\r\n const dateOptions: IDateFormatOptions = { year: 'numeric', month: 'short', day: 'numeric' };\r\n return context.cultureFormatter.formatDate(date, dateOptions);\r\n};\r\n\r\nconst getShortEllipsisText = (originalText: string, maxTextLength: number) => {\r\n const isRtl = document.body.parentElement?.getAttribute('dir') === 'rtl';\r\n return originalText.length > maxTextLength\r\n ? isRtl\r\n ? `…${originalText.substring(0, maxTextLength - 1)}`\r\n : `${originalText.substring(0, maxTextLength - 1)}…`\r\n : originalText;\r\n};\r\n\r\nconst getOnBehalfOfOrderProps = (\r\n props: IOrderHistoryWithSearchAndFiltersOrderTableProps,\r\n salesOrder: SalesOrder\r\n): IOnBehalfOfOrderProps => {\r\n const {\r\n data: { channelIdentities, orgUnitLocations, customer, originators },\r\n resources: { orderPlacedByFullText, orderPlacedByYouText, orderOnBehalfOfText, orderHistoryOrderNumberIsNotAvailable }\r\n } = props;\r\n\r\n const channelAddress = getOrderChannelAddress(salesOrder, orgUnitLocations);\r\n const channelTypeValue = getOrderChannelTypeValue(salesOrder, channelIdentities);\r\n const isOnlineStore = isOnlineStoreChannel(channelTypeValue, channelAddress);\r\n\r\n const originator: OrderOriginator | undefined = originators?.find(\r\n originator =>\r\n (salesOrder.SalesId && originator.SalesId === salesOrder.SalesId) ||\r\n (salesOrder.Id && originator.TransactionId === salesOrder.Id)\r\n );\r\n\r\n const isYou =\r\n !isOboRequest(props.context.request) &&\r\n originator?.CustomerId &&\r\n originator?.CustomerName &&\r\n !originator?.StaffId &&\r\n !originator?.StaffName &&\r\n customer?.AccountNumber === originator?.CustomerId\r\n ? true\r\n : false;\r\n const isYouObo = !isYou && !isOboRequest(props.context.request);\r\n let placedByName =\r\n originator?.StaffId && originator.StaffName\r\n ? originator.StaffName\r\n : originator?.CustomerId && originator.CustomerName\r\n ? originator.CustomerName\r\n : '-';\r\n placedByName = `${placedByName} ${isYou ? orderPlacedByYouText : ''}`;\r\n const isOnBehalfOfOrder = isOnlineStore && originator?.StaffName && customer?.Name;\r\n const placedByText = `${orderPlacedByFullText} ${placedByName}`;\r\n const onBehalfOfText = `${orderOnBehalfOfText} ${customer?.Name} ${isYouObo ? orderPlacedByYouText : ''}`;\r\n\r\n return {\r\n resources: { orderHistoryOrderNumberIsNotAvailable: orderHistoryOrderNumberIsNotAvailable },\r\n salesOrder: salesOrder,\r\n isOnBehalfOfOrder: !!isOnBehalfOfOrder,\r\n originator: originator,\r\n placedByName: placedByName,\r\n placedByText: placedByText,\r\n onBehalfOfText: onBehalfOfText,\r\n showOrderPlacedBy: props.showOrderPlacedBy\r\n };\r\n};\r\n\r\nconst getOrderPlacedByCellContent = (props: IOnBehalfOfOrderProps): JSX.Element | null => {\r\n const maxOrderTextLength = window.innerWidth > 700 ? 20 : 12;\r\n return (\r\n \r\n {props.placedByName}\r\n {props.isOnBehalfOfOrder && (\r\n <>\r\n
{getShortEllipsisText(props.onBehalfOfText, maxOrderTextLength)}\r\n \r\n )}\r\n
\r\n );\r\n};\r\n\r\nconst getOrderNumberCellContent = (onBehalfOfOrderProps: IOnBehalfOfOrderProps, linkToOrderDetails: string): JSX.Element | null => {\r\n const maxOrderTextLength = window.innerWidth > 700 ? 20 : 12;\r\n const {\r\n salesOrder,\r\n isOnBehalfOfOrder,\r\n placedByText,\r\n showOrderPlacedBy,\r\n resources: { orderHistoryOrderNumberIsNotAvailable }\r\n } = onBehalfOfOrderProps;\r\n\r\n let orderNumberCellText = salesOrder.SalesId;\r\n if (StringExtensions.isNullOrWhitespace(orderNumberCellText)) {\r\n orderNumberCellText = orderHistoryOrderNumberIsNotAvailable;\r\n }\r\n\r\n return (\r\n <>\r\n \r\n {isOnBehalfOfOrder && !showOrderPlacedBy && (\r\n \r\n {getShortEllipsisText(placedByText, maxOrderTextLength)}\r\n \r\n )}\r\n \r\n );\r\n};\r\n\r\nconst getTableRowComponentChildren = (\r\n props: IOrderHistoryWithSearchAndFiltersOrderTableProps,\r\n index: number,\r\n salesOrder: SalesOrder\r\n): React.ReactElement[] => {\r\n const numItemsCellText: number = ArrayExtensions.hasElements(salesOrder.SalesLines) ? countItems(salesOrder.SalesLines) : 0;\r\n const totalAmountCellText: string = formatAmount(props.context, salesOrder.TotalAmount, salesOrder.CurrencyCode);\r\n\r\n const orderStatusCellText: string = getOrderStatusLabel(salesOrder.StatusValue, props.resources);\r\n\r\n const channelName: string = getOrderChannelName(salesOrder, props.data.channelIdentities);\r\n const channelAddress: string = getOrderChannelAddress(salesOrder, props.data.orgUnitLocations);\r\n const channelNameCellText: string =\r\n channelName &&\r\n (channelAddress ? `${props.resources.posChannelNameText} ${channelName}` : props.resources.onlineStoreChannelNameText);\r\n\r\n const onBehalfOfOrderProps: IOnBehalfOfOrderProps = getOnBehalfOfOrderProps(props, salesOrder);\r\n\r\n const linkToOrderDetails = getOrderDetailsPageUrl(props.context.actionContext, salesOrder);\r\n\r\n const payLoad = getPayloadObject('click', props.telemetryContent!, TelemetryConstant.OrderDetails);\r\n const orderDetailsAttributes = getTelemetryAttributes(props.telemetryContent!, payLoad);\r\n\r\n return [\r\n \r\n {getOrderPlacedByCellContent(onBehalfOfOrderProps)}\r\n ,\r\n \r\n {getOrderNumberCellContent(onBehalfOfOrderProps, linkToOrderDetails)}\r\n ,\r\n \r\n {channelNameCellText}\r\n ,\r\n \r\n {numItemsCellText}\r\n ,\r\n \r\n {totalAmountCellText}\r\n ,\r\n \r\n {formatDate(props.context, salesOrder.CreatedDateTime)}\r\n ,\r\n \r\n {orderStatusCellText}\r\n ,\r\n \r\n \r\n \r\n {props.resources.orderHistoryViewDetailsButtonText}\r\n \r\n \r\n \r\n ];\r\n};\r\n\r\n/**\r\n * OrderHistoryWithSearchAndFiltersOrderTable component.\r\n * @param props - Configuration of the component.\r\n * @returns React node.\r\n */\r\nconst OrderHistoryWithSearchAndFiltersOrderTableFunctionalComponent: React.FC = (\r\n props: IOrderHistoryWithSearchAndFiltersOrderTableProps\r\n) => {\r\n return (\r\n \r\n \r\n \r\n {props.resources.orderPlacedByFullText ?? ''}\r\n \r\n \r\n {props.resources.orderHistoryOrderNumberText}\r\n \r\n \r\n {props.resources.orderHistoryOriginText}\r\n \r\n \r\n {props.resources.orderHistoryItemsText}\r\n \r\n \r\n {props.resources.orderHistoryTotalText}\r\n \r\n \r\n {props.resources.orderHistoryCreatedDateText}\r\n \r\n \r\n {props.resources.orderHistoryOrderStatusText}\r\n \r\n \r\n \r\n {props.data.salesOrders?.map((salesOrder: SalesOrder, index: number) => {\r\n return (\r\n \r\n {getTableRowComponentChildren(props, index, salesOrder)}\r\n \r\n );\r\n })}\r\n \r\n );\r\n};\r\n\r\n/**\r\n * OrderHistoryWithSearchAndFiltersOrderTable component.\r\n */\r\nexport const OrderHistoryWithSearchAndFiltersOrderTableComponent: React.FunctionComponent = msdyn365Commerce.createComponent<\r\n // @ts-expect-error\r\n IOrderHistoryWithSearchAndFiltersOrderTableProps\r\n>('OrderHistoryWithSearchAndFiltersOrderTableComponent', { component: OrderHistoryWithSearchAndFiltersOrderTableFunctionalComponent });\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { IComponentProps, msdyn365Commerce } from '@msdyn365-commerce/core';\r\nimport { Customer } from '@msdyn365-commerce/retail-proxy';\r\nimport { Button, ITelemetryContent, getPayloadObject, getTelemetryAttributes } from '@msdyn365-commerce-modules/utilities';\r\nimport React from 'react';\r\n\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Class names used in component.\r\n */\r\nconst componentClassName = 'ms-order-history-with-search-and-filters-organization-wide-selector';\r\nconst buttonClassName = `${componentClassName}__button`;\r\nconst buttonActiveClassName = `${componentClassName}__active-button`;\r\nconst buttonInactiveClassName = `${componentClassName}__inactive-button`;\r\n\r\n/**\r\n * IOrderHistoryWithSearchAndFiltersOrganizationWideSelectorResources interface.\r\n */\r\nexport interface IOrderHistoryWithSearchAndFiltersOrganizationWideSelectorResources {\r\n currentUserOptionLabel: string;\r\n currentUserOptionAriaLabel?: string;\r\n organizationWideOptionLabel: string;\r\n organizationWideOptionAriaLabel?: string;\r\n}\r\n\r\n/**\r\n * OrderHistoryWithSearchAndFiltersOrganizationWideSelectorState interface.\r\n */\r\nexport enum OrderHistoryWithSearchAndFiltersOrganizationWideSelectorState {\r\n CurrentUser,\r\n OrganizationWide\r\n}\r\n\r\n/**\r\n * IOrderHistoryWithSearchAndFiltersOrganizationWideSelectorData interface.\r\n */\r\nexport interface IOrderHistoryWithSearchAndFiltersOrganizationWideSelectorData {\r\n customer: Customer;\r\n}\r\n\r\n/**\r\n * IOrderHistoryWithSearchAndFiltersOrganizationWideSelectorProps interface.\r\n */\r\nexport interface IOrderHistoryWithSearchAndFiltersOrganizationWideSelectorProps\r\n extends IComponentProps {\r\n className?: string;\r\n resources: IOrderHistoryWithSearchAndFiltersOrganizationWideSelectorResources;\r\n currentSelectorState: OrderHistoryWithSearchAndFiltersOrganizationWideSelectorState;\r\n telemetryContent?: ITelemetryContent;\r\n onChange(state: OrderHistoryWithSearchAndFiltersOrganizationWideSelectorState): void;\r\n}\r\n\r\n/**\r\n * OrderHistoryWithSearchAndFiltersOrganizationWideSelector component.\r\n * @param props - Configuration of the component.\r\n * @returns React node.\r\n */\r\nconst OrderHistoryWithSearchAndFiltersOrganizationWideSelectorFunctionalComponent: React.FC = (\r\n props: IOrderHistoryWithSearchAndFiltersOrganizationWideSelectorProps\r\n) => {\r\n // Current version doesn't include functionality for non b2b users or non-admin b2b users.\r\n if (!props.data.customer.IsB2bAdmin) {\r\n return
;\r\n }\r\n\r\n const [selectorState, setSelectorState] = React.useState(props.currentSelectorState);\r\n\r\n const onClickHandler = (newSelectorState: OrderHistoryWithSearchAndFiltersOrganizationWideSelectorState) => {\r\n setSelectorState(newSelectorState);\r\n props.onChange(newSelectorState);\r\n };\r\n\r\n // define telemetry attributes\r\n const currentUserOrderHistoryAttributes = getTelemetryAttributes(\r\n props.telemetryContent!,\r\n getPayloadObject('click', props.telemetryContent!, props.resources?.currentUserOptionLabel ?? 'Current user order history')\r\n );\r\n const orgWideOrderHistoryAttributes = getTelemetryAttributes(\r\n props.telemetryContent!,\r\n getPayloadObject('click', props.telemetryContent!, props.resources?.currentUserOptionLabel ?? 'Org wide order history')\r\n );\r\n\r\n return (\r\n
\r\n onClickHandler(OrderHistoryWithSearchAndFiltersOrganizationWideSelectorState.CurrentUser)}\r\n {...currentUserOrderHistoryAttributes}\r\n >\r\n {props.resources?.currentUserOptionLabel}\r\n \r\n onClickHandler(OrderHistoryWithSearchAndFiltersOrganizationWideSelectorState.OrganizationWide)}\r\n {...orgWideOrderHistoryAttributes}\r\n >\r\n {props.resources?.organizationWideOptionLabel}\r\n \r\n
\r\n );\r\n};\r\n\r\n/**\r\n * OrderHistoryWithSearchAndFiltersOrganizationWideSelector component.\r\n */\r\nexport const OrderHistoryWithSearchAndFiltersOrganizationWideSelectorComponent: React.FunctionComponent = msdyn365Commerce.createComponent<\r\n // @ts-expect-error\r\n IOrderHistoryWithSearchAndFiltersOrganizationWideSelectorProps\r\n>('OrderHistoryWithSearchAndFiltersOrganizationWideSelectorComponent', {\r\n component: OrderHistoryWithSearchAndFiltersOrganizationWideSelectorFunctionalComponent\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { IComponentProps, msdyn365Commerce } from '@msdyn365-commerce/core';\r\nimport {\r\n Button,\r\n ITelemetryContent,\r\n TelemetryConstant,\r\n getPayloadObject,\r\n getTelemetryAttributes\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport React from 'react';\r\n\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Class names used in component.\r\n */\r\nconst componentClassName = 'ms-order-history-with-search-and-filters-view-mode-selector';\r\nconst detailsViewClassName = `${componentClassName}__detailed-view`;\r\nconst listViewClassName = `${componentClassName}__list-view`;\r\nconst viewSelectedClassName = `${componentClassName}__selected`;\r\n\r\n/**\r\n * IOrderHistoryWithSearchAndFiltersViewModeResources interface.\r\n */\r\nexport interface IOrderHistoryWithSearchAndFiltersViewModeResources {\r\n listViewOptionAriaLabel?: string;\r\n detailedViewOptionAriaLabel?: string;\r\n}\r\n\r\n/**\r\n * OrderHistoryWithSearchAndFiltersViewModeState interface.\r\n */\r\nexport enum OrderHistoryWithSearchAndFiltersViewModeState {\r\n DetailedView,\r\n ListView\r\n}\r\n\r\n/**\r\n * IOrderHistoryWithSearchAndFiltersViewModeProps interface.\r\n */\r\nexport interface IOrderHistoryWithSearchAndFiltersViewModeProps extends IComponentProps<{}> {\r\n className?: string;\r\n resources?: IOrderHistoryWithSearchAndFiltersViewModeResources;\r\n currentViewModeState: OrderHistoryWithSearchAndFiltersViewModeState;\r\n telemetryContent?: ITelemetryContent;\r\n onClick(state: OrderHistoryWithSearchAndFiltersViewModeState): void;\r\n}\r\n\r\n/**\r\n * OrderHistoryWithSearchAndFiltersViewMode component.\r\n * @param props - Configuration of the component.\r\n * @returns React node.\r\n */\r\nconst OrderHistoryWithSearchAndFiltersViewModeFunctionalComponent: React.FC = (\r\n props: IOrderHistoryWithSearchAndFiltersViewModeProps\r\n) => {\r\n const [viewModeState, setViewModeState] = React.useState(props.currentViewModeState);\r\n\r\n const onClickHandler = (newViewModeState: OrderHistoryWithSearchAndFiltersViewModeState) => {\r\n setViewModeState(newViewModeState);\r\n props.onClick(newViewModeState);\r\n };\r\n\r\n // define telemetry attributes\r\n const viewModeDetailedViewAttributes = getTelemetryAttributes(\r\n props.telemetryContent!,\r\n getPayloadObject('click', props.telemetryContent!, `${TelemetryConstant.ViewMode} - Detailed view`)\r\n );\r\n const viewModeListViewAttributes = getTelemetryAttributes(\r\n props.telemetryContent!,\r\n getPayloadObject('click', props.telemetryContent!, `${TelemetryConstant.ViewMode} - List view`)\r\n );\r\n\r\n return (\r\n
\r\n onClickHandler(OrderHistoryWithSearchAndFiltersViewModeState.DetailedView)}\r\n {...viewModeDetailedViewAttributes}\r\n />\r\n onClickHandler(OrderHistoryWithSearchAndFiltersViewModeState.ListView)}\r\n {...viewModeListViewAttributes}\r\n />\r\n
\r\n );\r\n};\r\n\r\n/**\r\n * OrderHistoryWithSearchAndFiltersViewMode component.\r\n */\r\nexport const OrderHistoryWithSearchAndFiltersViewModeComponent: React.FunctionComponent = msdyn365Commerce.createComponent<\r\n // @ts-expect-error\r\n IOrderHistoryWithSearchAndFiltersViewModeProps\r\n>('OrderHistoryWithSearchAndFiltersViewModeComponent', { component: OrderHistoryWithSearchAndFiltersViewModeFunctionalComponent });\r\n"],"names":["getOrderDetailsPageUrl","actionContext","salesOrder","orderDetailsUrl","getUrlSync","separator","includes","StringExtensions","isNullOrWhitespace","SalesId","Id","getOrderStatusLabel","status","resources","SalesStatus","Created","orderStatusCreated","Delivered","orderStatusDelivered","Invoiced","orderStatusInvoiced","Canceled","orderStatusCanceled","componentClassName","SearchBarComponent","msdyn365Commerce","createComponent","component","props","_props$resources","_props$resources2","_props$data$options2","_props$resources3","_props$resources4","_props$resources5","_props$resources$sear","_props$resources6","_props$resources7","_props$resources$sear2","_props$resources8","_props$resources9","_props$resources10","searchOptionState","setSearchOptionState","React","currentSearchOption","searchTextState","setSearchTextState","currentSearchText","showSuggestions","setShowSuggestions","activeSuggestionIndex","setActiveSuggestionIndex","filteredSuggestions","setFilteredSuggestions","searchButtonAttributes","getTelemetryAttributes","telemetryContent","getPayloadObject","TelemetryConstant","Search","className","classnames","ArrayExtensions","hasElements","data","options","title","searchOptionsAriaLabel","onChange","event","_props$data$options","_props$onSelectOption","value","currentTarget","searchOption","find","option","clearSearchTextOnOptionChange","onSelectOption","call","map","key","label","type","placeholder","searchBarPlaceholder","searchBarAriaLabel","_props$onChange","_props$orgUsers","filtered","orgUsers","filter","suggestion","toLowerCase","onBlur","preventDefault","setTimeout","_props$onBlur","onKeyDown","e","length","customer","split","onFocus","handleFocus","_props$orgUsers2","suggestions","index","onClick","console","log","handleSuggestionClick","Button","Object","assign","searchButtonAriaLabel","searchButtonLabel","onClickHandler","_props$onClick","headingClassName","orderCountClassName","OrderHistoryWithSearchAndFiltersHeaderComponent","Msdyn365","salesOrders","textProps","showOrderCount","extraActions","orderCount","orderCountText","orderCountLabel","ordersCountLabel","Node","text","tag","editProps","onEdit","requestContext","context","request","orderListItemClassName","orderInformationHeaderClassName","orderInformationCountClassName","expandProductsButtonClassName","expandProductsButtonWrapperClassName","orderDetailButtonClassName","moduleName","getOrderApprovalStatus","_orderStatus$result","moduleProps","orderStatus","saleOrderApprovalStatusAttributeName","customerSaleOrderApprovalRequiredAttributeName","app","config","approvalStatus","showApprovalStatus","updatedApprovalStatus","result","orderId","saleOrderId","_customer$Attributes","_salesOrder$Attribute","_customerApproval$Att","customerApproval","Attributes","attr","Name","orderStatusAttribute","_orderStatusAttribute","AttributeValue","StringValue","TextValue","replace","OrderInfomationComponent","_ref","orderInformationProps","salesId","receiptId","channelName","createdDate","count","amount","channelReferenceId","GroupDeliveryComponent","_ref2","deliveryProps","heading","processing","address","trackingInfo","GroupComponent","_ref3","groupProps","delivery","salesLinesProps","salesLines","salesLine","LineId","GroupsComponent","_ref4","groupsProps","groups","group","onExpandProductsCallback","expandButtonState","productStates","productState","isHidden","extraProductsCount","SalesOrderApproval","setShowApprovalStatus","updateApprovalStatusAllowed","setUpdateApprovalStatusAllowed","setApprovalStatus","isApproved","setIsApproved","rejectionComments","setRejectionComments","isModalOpen","setIsModalOpen","modalHasError","setModalHasError","reasonForRejection","errorForRejectionReason","btnSubmitLabel","approveLabel","rejectLabel","_customer$Attributes2","_salesOrder$Attribute2","_customerApproval$Att2","IsB2bAdmin","_orderStatusAttribute2","toggleModal","comments","MsDyn365","isBrowser","document","getElementById","modalPropsTerms","applicationNode","body","isOpen","autoFocus","size","keyboard","backdrop","zIndex","fade","toggle","statusClass","approved","htmlFor","async","_orderStatus$result$o","_orderStatus$result2","nSS_UpdateSalesOrderApprovalStatusAsync","callerContext","orderStatuses","orderStatusData","replacedIndex","findIndex","push","update","OrderStatusStateShareInput","disabled","Modal","ModalHeader","closeAriaLabel","closeButtonLabel","ModalBody","id","rows","cols","target","ModalFooter","addRejectionComments","_orderStatus$result$o2","_orderStatus$result3","OrderHistoryWithSearchAndFiltersOrderListComponent","itemProps","createOrderHistoryWithSearchAndFiltersOrderItemProps","typeName","telemetry","products","channelIdentities","orgUnitLocations","originators","showChannelInfo","freePriceText","detailsAriaLabel","detailsLabel","orderItemLabel","orderItemsLabel","retailMultiplePickUpOptionEnabled","channelDeliveryOptionConfig","priceContext","originator","TransactionId","salesLinesInput","getSalesLinesInput","undefined","expandProductsButton","getSalesLinesInputProps","_objectSpread","imageOnly","ObjectExtensions","isNullOrUndefined","salesLinesLimit","salesLineStates","_salesLine$LineId","SalesLineState","ExpandButtonState","Observer","format","orderHistoryExpandProductsButtonText","role","getSalesLines","getGroups","orderInfomationInput","getOrderInformationInput","payLoad","OrderDetails","orderDetailsAttributes","orderDetailsLink","href","ChannelReferenceId","orderInfomation","getOrderInformation","placedByClassName","orderNumberClassName","columnMobileClassName","actionsClassName","viewDetailsMenuItemClassName","formatDate","date","cultureFormatter","year","month","day","getShortEllipsisText","originalText","maxTextLength","_document$body$parent","isRtl","parentElement","getAttribute","substring","getOrderPlacedByCellContent","maxOrderTextLength","window","innerWidth","placedByName","isOnBehalfOfOrder","onBehalfOfText","getOrderNumberCellContent","onBehalfOfOrderProps","linkToOrderDetails","placedByText","showOrderPlacedBy","orderHistoryOrderNumberIsNotAvailable","orderNumberCellText","getTableRowComponentChildren","_props$resources$orde","_props$resources$orde2","numItemsCellText","SalesLines","countItems","totalAmountCellText","TotalAmount","currencyCode","CurrencyCode","formatCurrency","formatAmount","orderStatusCellText","StatusValue","getOrderChannelName","channelAddress","getOrderChannelAddress","channelNameCellText","posChannelNameText","onlineStoreChannelNameText","getOnBehalfOfOrderProps","orderPlacedByFullText","orderPlacedByYouText","orderOnBehalfOfText","channelTypeValue","getOrderChannelTypeValue","isOnlineStore","isOnlineStoreChannel","isYou","isOboRequest","CustomerId","CustomerName","StaffId","StaffName","AccountNumber","isYouObo","TableCellComponent","contentType","TableCellContentType","Text","isVisible","isMobileView","Number","Amount","Date","CreatedDateTime","ActionMenuComponent","ariaLabel","orderHistoryActionMenuButtonAriaLabel","orderHistoryViewDetailsButtonText","orderHistoryViewDetailsButtonAriaLabel","OrderHistoryWithSearchAndFiltersOrderTableComponent","_props$resources$orde3","_props$data$salesOrde","TableComponent","TableHeaderComponent","orderHistoryOrderNumberText","orderHistoryOriginText","orderHistoryItemsText","orderHistoryTotalText","orderHistoryCreatedDateText","orderHistoryOrderStatusText","TableRowComponent","buttonClassName","buttonActiveClassName","buttonInactiveClassName","OrderHistoryWithSearchAndFiltersOrganizationWideSelectorState","OrderHistoryWithSearchAndFiltersOrganizationWideSelectorComponent","_props$resources$curr","_props$resources$curr2","_props$resources$curr3","_props$resources$curr4","_props$resources$orga","_props$resources$orga2","_props$resources11","_props$resources12","selectorState","setSelectorState","currentSelectorState","newSelectorState","currentUserOrderHistoryAttributes","currentUserOptionLabel","orgWideOrderHistoryAttributes","CurrentUser","currentUserOptionAriaLabel","OrganizationWide","organizationWideOptionAriaLabel","organizationWideOptionLabel","detailsViewClassName","listViewClassName","viewSelectedClassName","OrderHistoryWithSearchAndFiltersViewModeState","OrderHistoryWithSearchAndFiltersViewModeComponent","_props$resources$deta","_props$resources$deta2","_props$resources$list","_props$resources$list2","viewModeState","setViewModeState","currentViewModeState","newViewModeState","viewModeDetailedViewAttributes","ViewMode","viewModeListViewAttributes","DetailedView","detailedViewOptionAriaLabel","ListView","listViewOptionAriaLabel"],"sourceRoot":""}