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://Citta2.0/./src/modules/citta-b2b-account-profile/components/citta-b2b-account-profile-text.tsx?445a","webpack://Citta2.0/./src/modules/citta-b2b-account-profile/components/citta-b2b-account-profile-attributes.tsx?d627","webpack://Citta2.0/./src/modules/citta-b2b-account-profile/components/citta-b2b-account-profile-description.tsx?5b8b","webpack://Citta2.0/./src/modules/citta-b2b-account-profile/components/citta-b2b-account-profile-links.tsx?5c14","webpack://Citta2.0/./src/modules/citta-b2b-account-profile/citta-b2b-account-profile.tsx?55f6","webpack://Citta2.0/./src/modules/citta-b2b-account-profile/citta-b2b-account-profile.view.tsx?6a23"],"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 * as React from 'react';\r\n\r\ninterface IAccountProfileText {\r\n className: string;\r\n text: string;\r\n}\r\n\r\n// eslint-disable-next-line no-redeclare\r\nconst IAccountProfileText: React.FC = ({ className, text }) => {text};\r\n\r\nexport default IAccountProfileText;\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, { IDictionary, Text } from '@msdyn365-commerce/core';\r\nimport { AttributeDefinition, Customer, CustomerAttribute } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport { StringExtensions, updateCustomerAttributes, updateCustomerAttributesInput } from '@msdyn365-commerce-modules/retail-actions';\r\nimport {\r\n Button,\r\n format,\r\n getPayloadObject,\r\n getTelemetryAttributes,\r\n getTelemetryObject,\r\n IPayLoad,\r\n ITelemetryContent\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport { observable, reaction } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\n\r\nimport { ICittaB2bAccountProfileData } from '../citta-b2b-account-profile.data';\r\nimport { ICittaB2bAccountProfileProps } from '../citta-b2b-account-profile.props.autogenerated';\r\nimport TextComponent from './citta-b2b-account-profile-text';\r\n\r\ninterface IAttributePropertiesType {\r\n Name?: string;\r\n IsMandatory?: boolean;\r\n}\r\n\r\nexport interface IAccountProfileAttributesProps {\r\n accountProfileProps: ICittaB2bAccountProfileProps;\r\n}\r\n\r\nexport enum AccountAttributeDataTypeValue {\r\n Decimal = 3,\r\n Integer = 4,\r\n Text = 5,\r\n TrueFalse = 6\r\n}\r\n\r\nexport interface IAttributePayloadData {\r\n recordId?: number;\r\n name?: string;\r\n dataTypeValue?: number;\r\n isEnumeration?: boolean;\r\n lowerBoundValue?: number;\r\n upperBoundValue?: number;\r\n decimalValue?: number;\r\n integerValue?: number;\r\n textValue?: string;\r\n booleanValue?: boolean;\r\n isMandatory?: boolean;\r\n defaultValue?: string;\r\n}\r\n\r\nexport interface IAccountProfileAttributesState extends React.ComponentState {\r\n editAttributes: boolean;\r\n phone: string;\r\n vatNumber: string;\r\n attributes: IDictionary;\r\n attributeError: IDictionary;\r\n}\r\n\r\n/**\r\n *\r\n * AccountProfileAttributes class.\r\n * @extends {React.PureComponentIAccountProfileAttributesProps, IAccountProfileAttributesState>}\r\n */\r\n@observer\r\nclass AccountProfileAttributes extends React.Component {\r\n private readonly attributePayloadData: IAttributePayloadData[];\r\n\r\n @observable private isUpdatingAttributes: boolean = false;\r\n\r\n @observable private gotException: boolean = false;\r\n\r\n private hasError: boolean = false;\r\n\r\n private readonly telemetryContent?: ITelemetryContent;\r\n\r\n private initialAttributes: IDictionary;\r\n\r\n private initialCustomerAttributes?: CustomerAttribute[];\r\n\r\n private initialPhone: string;\r\n\r\n private initialVatNumber: string;\r\n\r\n private readonly payLoad: IPayLoad;\r\n\r\n private readonly editRef: React.RefObject;\r\n\r\n private readonly attributesContainerRef: React.RefObject;\r\n\r\n private readonly attributeClassName: string = 'ms-account-profile__attributes-element';\r\n\r\n private readonly maxIntegerLimit: number = 2_100_000_000;\r\n\r\n private readonly minIntegerLimit: number = -2_100_000_000;\r\n\r\n private readonly maxDecimalLimit: number = 7_900_000_000_000;\r\n\r\n private readonly minDecimalLimit: number = -7_900_000_000_000;\r\n\r\n private readonly maxStringLength: number = 1000;\r\n\r\n private readonly maxVATNumberLength: number = 20;\r\n\r\n private readonly maxPhoneLength: number = 25;\r\n\r\n private readonly editAsyncCustomerFeatureName: string = 'Dynamics.AX.Application.RetailEnableAsyncCustomerEditFeature';\r\n\r\n private isEditAsyncCustomerFeatureEnabled: boolean = false;\r\n\r\n constructor(props: IAccountProfileAttributesProps) {\r\n super(props);\r\n this.state = {\r\n editAttributes: false,\r\n phone: '',\r\n vatNumber: '',\r\n attributes: {},\r\n attributeError: {}\r\n };\r\n this.initialAttributes = {};\r\n this.initialCustomerAttributes = [];\r\n this.initialPhone = '';\r\n this.initialVatNumber = '';\r\n this.attributePayloadData = [];\r\n const telemetryPageName =\r\n (this.props.accountProfileProps &&\r\n this.props.accountProfileProps.context &&\r\n this.props.accountProfileProps.context.request &&\r\n this.props.accountProfileProps.context.request.telemetryPageName) ||\r\n '';\r\n const friendlyName = (this.props.accountProfileProps && this.props.accountProfileProps.friendlyName) || '';\r\n const telemetry = (this.props.accountProfileProps && this.props.accountProfileProps.telemetry) || {};\r\n this.telemetryContent = getTelemetryObject(telemetryPageName, friendlyName, telemetry);\r\n this.payLoad = getPayloadObject('click', this.telemetryContent, '');\r\n this.editRef = React.createRef();\r\n this.attributesContainerRef = React.createRef();\r\n }\r\n\r\n public componentDidMount(): void {\r\n this._buildPayloadData();\r\n this._getAttributes();\r\n this._getCustomerPhoneAndVatNumber();\r\n reaction(\r\n () => this.props.accountProfileProps.data.customerInformation.result,\r\n () => {\r\n const customerInformation = this.props.accountProfileProps.data.customerInformation.result;\r\n this.initialCustomerAttributes = customerInformation && customerInformation.Attributes;\r\n this._getAttributes();\r\n this._getCustomerPhoneAndVatNumber();\r\n }\r\n );\r\n reaction(\r\n () => this.props.accountProfileProps.data.attributeDefinitions.result,\r\n () => {\r\n this._buildPayloadData();\r\n }\r\n );\r\n }\r\n\r\n public shouldComponentUpdate(nextProps: IAccountProfileAttributesProps, nextState: IAccountProfileAttributesState): boolean {\r\n if (this.state === nextState && this.props.accountProfileProps.data === nextProps.accountProfileProps.data) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n return this._renderAttributes();\r\n }\r\n\r\n private readonly _renderAttributes = (): JSX.Element | null => {\r\n const { config, data, resources } = this.props.accountProfileProps;\r\n const attributeDefinitions: AttributeDefinition[] = data.attributeDefinitions.result || [];\r\n const additionalInformationSectionHeading =\r\n (config.additionalInformationSectionHeading && config.additionalInformationSectionHeading.text) || '';\r\n const showAttributes = config.showAttributes || '';\r\n const attributes = showAttributes.split(',');\r\n const elements = attributes.map(att => {\r\n const attributeDefinition: AttributeDefinition = attributeDefinitions.find(\r\n attribute => attribute.IsHidden === false && attribute.Name!.toLocaleLowerCase() === att.toLocaleLowerCase()\r\n ) || { RecordId: 0 };\r\n return this._renderAttribute(attributeDefinition);\r\n });\r\n const edit = (this.state && this.state.editAttributes) || false;\r\n this.payLoad.contentAction.etext = `${resources.attributesEditButtonText} ${additionalInformationSectionHeading}`;\r\n const editAttributes = getTelemetryAttributes(this.telemetryContent!, this.payLoad);\r\n this.payLoad.contentAction.etext = `${resources.attributesSaveButtonText} ${additionalInformationSectionHeading}`;\r\n const saveAttributes = getTelemetryAttributes(this.telemetryContent!, this.payLoad);\r\n this.payLoad.contentAction.etext = `${resources.attributesCancelButtonText} ${additionalInformationSectionHeading}`;\r\n const cancelAttributes = getTelemetryAttributes(this.telemetryContent!, this.payLoad);\r\n const customerInformation = data.customerInformation.result;\r\n\r\n this.isEditAsyncCustomerFeatureEnabled =\r\n data.featureState?.result?.find(feature => feature.Name === this.editAsyncCustomerFeatureName)?.IsEnabled || false;\r\n\r\n // Disable the 'Edit' button if the switch is enabled and the customer is async.\r\n const disableBtn: boolean =\r\n (this.props.accountProfileProps.context.app?.config?.canRenderAsyncCustomerDataAsUnmodifiable || false) &&\r\n (customerInformation?.IsAsyncCustomer || false) &&\r\n !this.isEditAsyncCustomerFeatureEnabled;\r\n return (\r\n \r\n {config.additionalInformationSectionHeading && (\r\n \r\n )}\r\n {config.showPhone && this._renderPhone()}\r\n {config.showVatNumber && this._renderVatNumber()}\r\n {elements}\r\n {this.gotException && (\r\n
\r\n \r\n
\r\n )}\r\n {!edit && (\r\n \r\n {resources.attributesEditButtonText}\r\n \r\n )}\r\n {edit && (\r\n \r\n {resources.attributesSaveButtonText}\r\n \r\n )}\r\n {edit && (\r\n \r\n {resources.attributesCancelButtonText}\r\n \r\n )}\r\n \r\n );\r\n };\r\n\r\n private readonly _renderPhone = (): JSX.Element | null => {\r\n const { phoneSectionHeading } = this.props.accountProfileProps.config;\r\n const heading = (phoneSectionHeading && phoneSectionHeading.text) || '';\r\n const className = (heading && heading.replace(/ /g, '_')) || '';\r\n const editAttributes = (this.state && this.state.editAttributes) || false;\r\n return (\r\n
\r\n {phoneSectionHeading && }\r\n \r\n {this._renderError('Phone')}\r\n
\r\n );\r\n };\r\n\r\n private readonly _renderVatNumber = (): JSX.Element | null => {\r\n const { vatNumberSectionHeading } = this.props.accountProfileProps.config;\r\n const heading = (vatNumberSectionHeading && vatNumberSectionHeading.text) || '';\r\n const className = (heading && heading.replace(/ /g, '_')) || '';\r\n const editAttributes = (this.state && this.state.editAttributes) || false;\r\n return (\r\n
\r\n {vatNumberSectionHeading && }\r\n \r\n {this._renderError('VATNumber')}\r\n
\r\n );\r\n };\r\n\r\n private readonly _renderAttribute = (customAttribute: AttributeDefinition): JSX.Element | null => {\r\n const editAttributes = (this.state && this.state.editAttributes) || false;\r\n const className = (customAttribute.Name && customAttribute.Name.replace(/ /g, '_')) || '';\r\n switch (customAttribute.ExtDataType && customAttribute.ExtDataType.Value) {\r\n case AccountAttributeDataTypeValue.Integer:\r\n case AccountAttributeDataTypeValue.Decimal:\r\n return this._renderIntegerDecimalInput(customAttribute, className, editAttributes);\r\n case AccountAttributeDataTypeValue.Text:\r\n return this._renderTextInputOrSelect(customAttribute, className, editAttributes);\r\n case AccountAttributeDataTypeValue.TrueFalse:\r\n return this._renderBoolean(customAttribute, className, editAttributes);\r\n default:\r\n return null;\r\n }\r\n };\r\n\r\n private readonly _renderIntegerDecimalInput = (\r\n customAttribute: AttributeDefinition,\r\n className: string,\r\n editAttributes: boolean\r\n ): JSX.Element | null => {\r\n const edit = (this.state && this.state.editAttributes) || false;\r\n const attributeProps = this._getAttributeProps(customAttribute.Name || '');\r\n const displayName: string = attributeProps.Name || '';\r\n return (\r\n
\r\n \r\n \r\n {this._renderError(customAttribute.Name || '')}\r\n
\r\n );\r\n };\r\n\r\n private readonly _renderTextInputOrSelect = (\r\n customAttribute: AttributeDefinition,\r\n className: string,\r\n editAttributes: boolean\r\n ): JSX.Element | null => {\r\n const isEnumeration: boolean = customAttribute.IsEnumeration || false;\r\n const edit = (this.state && this.state.editAttributes) || false;\r\n const attributeProps = this._getAttributeProps(customAttribute.Name || '');\r\n const displayName: string = attributeProps.Name || '';\r\n if (isEnumeration && customAttribute.EnumerationDetails) {\r\n const value = this.state.attributes[customAttribute.Name || ''] || '';\r\n const hasNoValue = value === '';\r\n return (\r\n
\r\n \r\n \r\n {hasNoValue && (\r\n \r\n )}\r\n {customAttribute.EnumerationDetails.map(option => {\r\n const selected = option.EnumerationValue === this.state.attributes[customAttribute.Name || ''];\r\n return (\r\n \r\n {option.EnumerationValue}\r\n \r\n );\r\n })}\r\n \r\n
\r\n );\r\n }\r\n return (\r\n
\r\n \r\n \r\n {this._renderError(customAttribute.Name || '')}\r\n
\r\n );\r\n };\r\n\r\n private readonly _renderBoolean = (\r\n customAttribute: AttributeDefinition,\r\n className: string,\r\n editAttributes: boolean\r\n ): JSX.Element | null => {\r\n let value = this.state.attributes[customAttribute.Name || ''] || '';\r\n const hasNoValue = value === '';\r\n const render = !(hasNoValue && !editAttributes);\r\n value = value || 'false';\r\n const toggleState = (value === 'true' && 'enable') || 'disable';\r\n const arialabel = format(this.props.accountProfileProps.resources.attributeToggleButtonAriaLabel, customAttribute.Name);\r\n const ariaPressed = (value === 'true' && true) || false;\r\n const attributeProps = this._getAttributeProps(customAttribute.Name || '');\r\n const displayName: string = attributeProps.Name || '';\r\n let toggleValue = 'false';\r\n if (value === 'true') {\r\n toggleValue = 'false';\r\n } else {\r\n toggleValue = 'true';\r\n }\r\n\r\n return (\r\n \r\n \r\n {render && (\r\n \r\n \r\n \r\n \r\n \r\n )}\r\n \r\n );\r\n };\r\n\r\n private readonly _renderError = (attributeName: string): JSX.Element | null => {\r\n const error: string = (this.state && this.state.attributeError && this.state.attributeError[attributeName]) || '';\r\n const hasError = !StringExtensions.isNullOrWhitespace(error);\r\n if (hasError) {\r\n return (\r\n
\r\n \r\n
\r\n );\r\n }\r\n return null;\r\n };\r\n\r\n private readonly _getAttributeProps = (attributeName: string): IAttributePropertiesType => {\r\n const attributePayloadData = this.attributePayloadData.find(att => att.name === attributeName);\r\n const isMandatory: boolean = (attributePayloadData && attributePayloadData.isMandatory) || false;\r\n return {\r\n Name: isMandatory ? `${attributeName || ''} *` : attributeName || '',\r\n IsMandatory: isMandatory\r\n };\r\n };\r\n\r\n private readonly _onPhoneChange = (event: React.ChangeEvent): void => {\r\n const value = event.target.value;\r\n this.setState({ phone: value });\r\n };\r\n\r\n private readonly _onVatNumberChange = (event: React.ChangeEvent): void => {\r\n const value = event.target.value;\r\n this.setState({ vatNumber: value });\r\n };\r\n\r\n private readonly _enableAttributes = () => {\r\n this.hasError = false;\r\n\r\n // To clear exception messages\r\n this.gotException = false;\r\n this.setState({ editAttributes: true, attributeError: {} });\r\n if (MsDyn365.isBrowser) {\r\n setTimeout(() => {\r\n if (this.attributesContainerRef.current) {\r\n const attributes: HTMLCollectionOf = this.attributesContainerRef.current.getElementsByClassName(\r\n this.attributeClassName\r\n );\r\n if (attributes && attributes.length > 0) {\r\n this._setFocus(attributes[0] as HTMLElement);\r\n }\r\n }\r\n }, 0);\r\n }\r\n };\r\n\r\n private readonly _disableAttributes = () => {\r\n this.setState({\r\n editAttributes: false,\r\n attributeError: {},\r\n attributes: this.initialAttributes,\r\n phone: this.initialPhone,\r\n vatNumber: this.initialVatNumber\r\n });\r\n if (MsDyn365.isBrowser) {\r\n setTimeout(() => {\r\n this._setFocus(this.editRef.current);\r\n }, 0);\r\n }\r\n };\r\n\r\n private readonly _onAttributeChange = (attributeDefinition: AttributeDefinition) => (event: React.ChangeEvent) => {\r\n const value = event.target.value;\r\n const name = attributeDefinition.Name || '';\r\n this.setState({\r\n attributes: {\r\n ...this.state.attributes,\r\n [name]: value\r\n }\r\n });\r\n };\r\n\r\n private readonly _onAttributeCheck = (attributeDefinition: AttributeDefinition, value: string) => (\r\n event: React.MouseEvent\r\n ) => {\r\n const name = attributeDefinition.Name || '';\r\n this.setState({\r\n attributes: {\r\n ...this.state.attributes,\r\n [name]: value\r\n }\r\n });\r\n };\r\n\r\n private readonly _onAttributeSelect = (attributeDefinition: AttributeDefinition) => (event: React.ChangeEvent) => {\r\n const value = event.currentTarget.selectedOptions[0].value;\r\n const index = event.currentTarget.selectedOptions[0].index;\r\n const name = attributeDefinition.Name || '';\r\n this.setState({\r\n attributes: {\r\n ...this.state.attributes,\r\n [name]: value\r\n },\r\n selectedIndex: {\r\n ...this.state.selectedIndex,\r\n [name]: index\r\n }\r\n });\r\n };\r\n\r\n private readonly _getAttributes = () => {\r\n const { config, data } = this.props.accountProfileProps;\r\n const showAttributes = config.showAttributes || '';\r\n const showAttributesArray = showAttributes.split(',');\r\n const customer = data.customerInformation.result;\r\n const custmerAttributes: CustomerAttribute[] = (customer && customer.Attributes) || [];\r\n const attributes: IDictionary = {};\r\n\r\n showAttributesArray.forEach(showAttribute => {\r\n const attributePayloadData = this.attributePayloadData.find(att => att.name === showAttribute);\r\n const isMandatory: boolean = (attributePayloadData && attributePayloadData.isMandatory) || false;\r\n const defaultValue = attributePayloadData && attributePayloadData.defaultValue;\r\n const attribute = custmerAttributes.find(att => att.Name === showAttribute);\r\n let value: string = '';\r\n if (attribute && attribute.AttributeValue) {\r\n const name = (attribute && attribute.Name) || '';\r\n switch (attribute.DataTypeValue) {\r\n case AccountAttributeDataTypeValue.Integer:\r\n if (attribute.AttributeValue.IntegerValue) {\r\n value = String(attribute.AttributeValue.IntegerValue);\r\n attributes[name] = value;\r\n }\r\n break;\r\n case AccountAttributeDataTypeValue.Decimal:\r\n if (attribute.AttributeValue.DecimalValue) {\r\n value = String(attribute.AttributeValue.DecimalValue);\r\n attributes[name] = value;\r\n }\r\n break;\r\n case AccountAttributeDataTypeValue.Text:\r\n if (attribute.AttributeValue.StringValue) {\r\n value = attribute.AttributeValue.StringValue;\r\n attributes[name] = value;\r\n }\r\n break;\r\n case AccountAttributeDataTypeValue.TrueFalse:\r\n if (attribute.AttributeValue.BooleanValue !== null) {\r\n value = String(attribute.AttributeValue.BooleanValue);\r\n attributes[name] = value;\r\n }\r\n break;\r\n default:\r\n\r\n // Do nothing\r\n }\r\n }\r\n if (StringExtensions.isNullOrWhitespace(value) && isMandatory) {\r\n attributes[showAttribute] = '';\r\n }\r\n if (value.length === 0 && defaultValue) {\r\n attributes[showAttribute] = String(defaultValue);\r\n }\r\n });\r\n if (Object.keys(this.initialAttributes).length === 0) {\r\n this.initialAttributes = attributes;\r\n }\r\n this.setState({ attributes });\r\n };\r\n\r\n // eslint-disable-next-line\r\n private readonly _addOrUpdateAttribute = (customer: Customer) => {\r\n const { resources } = this.props.accountProfileProps;\r\n const { phone, vatNumber } = this.state;\r\n const attributeError: IDictionary = {};\r\n let hasError: boolean = false;\r\n let hasValue: boolean = true;\r\n for (const [key, value] of Object.entries(this.state.attributes)) {\r\n const payloadData: IAttributePayloadData = this.attributePayloadData.find(data => data.name === key) || {};\r\n if (payloadData) {\r\n switch (payloadData.dataTypeValue) {\r\n case AccountAttributeDataTypeValue.Decimal:\r\n const decimalValue = Number(value);\r\n if (isNaN(decimalValue)) {\r\n const typeError = format(resources.attributeInputTypeErrorText, payloadData.name, 'Decimal');\r\n attributeError[payloadData.name || ''] = typeError;\r\n hasError = true;\r\n } else if (payloadData.lowerBoundValue !== undefined && payloadData.upperBoundValue !== undefined) {\r\n if (decimalValue < payloadData.lowerBoundValue || decimalValue > payloadData.upperBoundValue) {\r\n const rangeError = format(\r\n resources.attributeInputRangeErrorText,\r\n payloadData.name,\r\n payloadData.lowerBoundValue,\r\n payloadData.upperBoundValue\r\n );\r\n attributeError[payloadData.name || ''] = rangeError;\r\n hasError = true;\r\n }\r\n } else {\r\n if (decimalValue > this.maxDecimalLimit) {\r\n attributeError[payloadData.name || ''] = format(\r\n resources.attributeInputValueExceedsMaximumErrorText,\r\n payloadData.name,\r\n this.maxDecimalLimit\r\n );\r\n hasError = true;\r\n }\r\n\r\n if (decimalValue < this.minDecimalLimit) {\r\n attributeError[payloadData.name || ''] = format(\r\n resources.attributeInputValueExceedsMinimumErrorText,\r\n payloadData.name,\r\n this.minDecimalLimit\r\n );\r\n hasError = true;\r\n }\r\n }\r\n\r\n if (!hasError) {\r\n if (StringExtensions.isNullOrWhitespace(value)) {\r\n hasValue = false;\r\n } else {\r\n payloadData.decimalValue = decimalValue;\r\n hasValue = true;\r\n }\r\n }\r\n break;\r\n case AccountAttributeDataTypeValue.Integer:\r\n const integerValue = Number(value);\r\n if (isNaN(integerValue) || value.includes('.')) {\r\n const typeError = format(resources.attributeInputTypeErrorText, payloadData.name, 'Integer');\r\n attributeError[payloadData.name || ''] = typeError;\r\n hasError = true;\r\n } else if (payloadData.lowerBoundValue !== undefined && payloadData.upperBoundValue !== undefined) {\r\n if (integerValue < payloadData.lowerBoundValue || integerValue > payloadData.upperBoundValue) {\r\n const rangeError = format(\r\n resources.attributeInputRangeErrorText,\r\n payloadData.name,\r\n payloadData.lowerBoundValue,\r\n payloadData.upperBoundValue\r\n );\r\n attributeError[payloadData.name || ''] = rangeError;\r\n hasError = true;\r\n }\r\n } else {\r\n if (integerValue > this.maxIntegerLimit) {\r\n attributeError[payloadData.name || ''] = format(\r\n resources.attributeInputValueExceedsMaximumErrorText,\r\n payloadData.name,\r\n this.maxIntegerLimit\r\n );\r\n hasError = true;\r\n }\r\n\r\n if (integerValue < this.minIntegerLimit) {\r\n attributeError[payloadData.name || ''] = format(\r\n resources.attributeInputValueExceedsMinimumErrorText,\r\n payloadData.name,\r\n this.minIntegerLimit\r\n );\r\n hasError = true;\r\n }\r\n }\r\n\r\n if (!hasError) {\r\n if (StringExtensions.isNullOrWhitespace(value)) {\r\n hasValue = false;\r\n } else {\r\n payloadData.integerValue = integerValue;\r\n hasValue = true;\r\n }\r\n }\r\n break;\r\n case AccountAttributeDataTypeValue.Text:\r\n let trimValue = '';\r\n if (!StringExtensions.isNullOrWhitespace(value)) {\r\n trimValue = value.trim();\r\n }\r\n if (trimValue.length > this.maxStringLength) {\r\n attributeError[payloadData.name || ''] = format(\r\n resources.attributeInputStringMaxLengthErrorText,\r\n payloadData.name,\r\n this.maxStringLength\r\n );\r\n hasError = true;\r\n }\r\n if (!hasError) {\r\n payloadData.textValue = trimValue;\r\n }\r\n break;\r\n case AccountAttributeDataTypeValue.TrueFalse:\r\n payloadData.booleanValue = value === 'true';\r\n break;\r\n default:\r\n\r\n // Do nothing\r\n }\r\n\r\n if (payloadData.isMandatory && StringExtensions.isNullOrWhitespace(value)) {\r\n attributeError[payloadData.name || ''] = format(resources.attributeInputMandatoryErrorText, payloadData.name);\r\n hasError = true;\r\n }\r\n\r\n const custmerAttributes: CustomerAttribute[] = (customer && customer.Attributes) || [];\r\n const attribute = custmerAttributes.find(att => att.Name === key);\r\n const index = custmerAttributes.findIndex(att => att.Name === key);\r\n\r\n if (index !== -1 && !hasValue) {\r\n custmerAttributes.splice(index, 1);\r\n }\r\n\r\n if (!hasError && hasValue) {\r\n if (attribute) {\r\n attribute.Attribute = undefined;\r\n attribute.DataTypeValue = payloadData.dataTypeValue;\r\n attribute.Name = payloadData.name;\r\n attribute.RecordId = payloadData.recordId;\r\n attribute.Units = undefined;\r\n attribute.AttributeValue = {\r\n IntegerValue: payloadData.integerValue,\r\n BooleanValue: payloadData.booleanValue,\r\n StringValue: payloadData.textValue,\r\n DecimalValue: payloadData.decimalValue\r\n };\r\n attribute.ExtensionProperties = [];\r\n attribute.NameTranslations = [];\r\n } else {\r\n custmerAttributes.push({\r\n '@odata.type': '#Microsoft.Dynamics.Commerce.Runtime.DataModel.CustomerAttribute',\r\n Attribute: undefined,\r\n DataTypeValue: payloadData.dataTypeValue,\r\n KeyName: payloadData.name,\r\n Name: payloadData.name,\r\n RecordId: payloadData.recordId,\r\n Units: undefined,\r\n AttributeValue: {\r\n // @ts-expect-error\r\n '@odata.type': '#Microsoft.Dynamics.Commerce.Runtime.DataModel.CommercePropertyValue',\r\n IntegerValue: payloadData.integerValue,\r\n BooleanValue: payloadData.booleanValue,\r\n StringValue: payloadData.textValue,\r\n DecimalValue: payloadData.decimalValue\r\n },\r\n 'ExtensionProperties@odata.type': '#Collection(Microsoft.Dynamics.Commerce.Runtime.DataModel.CommerceProperty)',\r\n ExtensionProperties: [],\r\n 'NameTranslations@odata.type':\r\n '#Collection(Microsoft.Dynamics.Commerce.Runtime.DataModel.TextValueTranslation)',\r\n NameTranslations: []\r\n });\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (phone.trim().length > this.maxPhoneLength) {\r\n attributeError.Phone = format(resources.attributeInputStringMaxLengthErrorText, 'Phone', this.maxPhoneLength);\r\n hasError = true;\r\n } else {\r\n customer.Phone = phone.trim();\r\n }\r\n\r\n if (vatNumber.trim().length > this.maxVATNumberLength) {\r\n attributeError.VATNumber = format(resources.attributeInputStringMaxLengthErrorText, 'VAT Number', this.maxVATNumberLength);\r\n hasError = true;\r\n } else {\r\n customer.VatNumber = vatNumber.trim();\r\n }\r\n\r\n this.hasError = hasError;\r\n this.setState({ attributeError });\r\n };\r\n\r\n private readonly _saveAttributes = async () => {\r\n const { context, data } = this.props.accountProfileProps;\r\n const customer = data.customerInformation.result;\r\n\r\n if (customer && context) {\r\n this._addOrUpdateAttribute(customer);\r\n const input = new updateCustomerAttributesInput(\r\n customer.AccountNumber,\r\n customer.Attributes || [],\r\n context.request.apiSettings,\r\n customer.Phone,\r\n customer.VatNumber\r\n );\r\n\r\n this.isUpdatingAttributes = true;\r\n this.gotException = false;\r\n\r\n if (!this.hasError) {\r\n this.setState({ editAttributes: false });\r\n try {\r\n await updateCustomerAttributes(input, context.actionContext);\r\n } catch (error) {\r\n this.gotException = true;\r\n customer.Attributes = this.initialCustomerAttributes;\r\n if (context.telemetry) {\r\n context.telemetry.exception(error);\r\n context.telemetry.debug('Unable to update customer attributes');\r\n }\r\n this.setState({\r\n attributeError: {},\r\n attributes: this.initialAttributes,\r\n phone: this.initialPhone,\r\n vatNumber: this.initialVatNumber\r\n });\r\n }\r\n this.setState({ editAttributes: false });\r\n if (!this.gotException) {\r\n this.initialAttributes = this.state.attributes;\r\n this.initialCustomerAttributes = customer.Attributes;\r\n this.initialPhone = this.state.phone;\r\n this.initialVatNumber = this.state.vatNumber;\r\n }\r\n }\r\n\r\n this.isUpdatingAttributes = false;\r\n\r\n if (MsDyn365.isBrowser) {\r\n setTimeout(() => {\r\n this._setFocus(this.editRef.current);\r\n }, 0);\r\n }\r\n }\r\n };\r\n\r\n private readonly _setFocus = (element: HTMLElement | null) => {\r\n element?.focus();\r\n };\r\n\r\n private readonly _buildPayloadData = () => {\r\n const { data } = this.props.accountProfileProps;\r\n const attributeDefinitions = data.attributeDefinitions.result || [];\r\n const attributes: IDictionary = {};\r\n\r\n attributeDefinitions.forEach(attributeDefinition => {\r\n const attributePayloadData: IAttributePayloadData = {};\r\n attributePayloadData.recordId = attributeDefinition.RecordId;\r\n attributePayloadData.name = attributeDefinition.Name;\r\n attributePayloadData.dataTypeValue = attributeDefinition.DataTypeValue;\r\n attributePayloadData.isEnumeration = attributeDefinition.IsEnumeration;\r\n attributePayloadData.isMandatory = attributeDefinition.IsMandatory;\r\n switch (attributeDefinition.DataTypeValue) {\r\n case AccountAttributeDataTypeValue.Integer:\r\n const defaultIntegerValue = attributeDefinition.DefaultValue && attributeDefinition.DefaultValue.IntegerValue;\r\n attributePayloadData.lowerBoundValue = attributeDefinition.LowerBound && attributeDefinition.LowerBound.IntegerValue;\r\n attributePayloadData.upperBoundValue = attributeDefinition.UpperBound && attributeDefinition.UpperBound.IntegerValue;\r\n if (attributePayloadData.name && defaultIntegerValue) {\r\n attributePayloadData.defaultValue = String(defaultIntegerValue);\r\n attributes[attributePayloadData.name] = String(defaultIntegerValue);\r\n }\r\n break;\r\n case AccountAttributeDataTypeValue.Decimal:\r\n const defaultDecimalValue = attributeDefinition.DefaultValue && attributeDefinition.DefaultValue.DecimalValue;\r\n attributePayloadData.lowerBoundValue = attributeDefinition.LowerBound && attributeDefinition.LowerBound.DecimalValue;\r\n attributePayloadData.upperBoundValue = attributeDefinition.UpperBound && attributeDefinition.UpperBound.DecimalValue;\r\n if (attributePayloadData.name && defaultDecimalValue) {\r\n attributePayloadData.defaultValue = String(defaultDecimalValue);\r\n attributes[attributePayloadData.name] = String(defaultDecimalValue);\r\n }\r\n break;\r\n case AccountAttributeDataTypeValue.Text:\r\n const defaultStringValue = attributeDefinition.DefaultValue && attributeDefinition.DefaultValue.StringValue;\r\n if (attributePayloadData.name && defaultStringValue) {\r\n attributePayloadData.defaultValue = defaultStringValue;\r\n attributes[attributePayloadData.name] = defaultStringValue;\r\n }\r\n break;\r\n case AccountAttributeDataTypeValue.TrueFalse:\r\n const defaultBooleanValue =\r\n (attributeDefinition.DefaultValue && attributeDefinition.DefaultValue.BooleanValue) || false;\r\n if (attributePayloadData.name) {\r\n attributePayloadData.defaultValue = String(defaultBooleanValue);\r\n attributes[attributePayloadData.name] = String(defaultBooleanValue);\r\n }\r\n break;\r\n default:\r\n\r\n // Do nothing\r\n }\r\n this.attributePayloadData.push(attributePayloadData);\r\n });\r\n Object.keys(attributes).length > 0 && this.setState({ attributes });\r\n };\r\n\r\n private readonly _getCustomerPhoneAndVatNumber = () => {\r\n const customer = this.props.accountProfileProps.data.customerInformation.result;\r\n const phone = (customer && customer.Phone) || '';\r\n const vatNumber = (customer && customer.VatNumber) || '';\r\n this.setState({ phone, vatNumber });\r\n if (this.initialPhone.length === 0) {\r\n this.initialPhone = phone;\r\n }\r\n if (this.initialVatNumber.length === 0) {\r\n this.initialVatNumber = vatNumber;\r\n }\r\n };\r\n}\r\n\r\nexport default AccountProfileAttributes;\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 React from 'react';\r\n\r\ninterface IAccountProfileDescription {\r\n className: string;\r\n description: string;\r\n}\r\n\r\n// eslint-disable-next-line no-redeclare\r\nconst IAccountProfileDescription: React.FC = ({ className, description }) => (\r\n

{description}

\r\n);\r\n\r\nexport default IAccountProfileDescription;\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 { ILinkData } from '@msdyn365-commerce/core';\r\nimport { getPayloadObject, getTelemetryAttributes, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nexport interface ILinksData {\r\n linkText?: string;\r\n linkUrl: ILinkData;\r\n ariaLabel?: string;\r\n openInNewTab?: boolean;\r\n isDisabled?: boolean;\r\n}\r\n\r\nexport interface IAccountProfileLinks {\r\n links: ILinksData[];\r\n requestContext: Msdyn365.IRequestContext;\r\n\r\n /**\r\n * The telemetry content\r\n */\r\n telemetryContent?: ITelemetryContent;\r\n onTextChange?(index: number): (event: Msdyn365.ContentEditableEvent) => void;\r\n}\r\n\r\nconst AccountProfileLinks: React.FC = ({ links, telemetryContent, requestContext, onTextChange }) => {\r\n if (links.length === 0) {\r\n return null;\r\n }\r\n const editableLinks = _mapEditableLinks(links, telemetryContent);\r\n return (\r\n
\r\n {editableLinks && editableLinks.length > 0 ? (\r\n \r\n ) : null}\r\n
\r\n );\r\n};\r\n\r\nconst _mapEditableLinks = (linkdata: ILinksData[], telemetryContent?: ITelemetryContent): Msdyn365.ILinksData[] | null => {\r\n if (!linkdata || linkdata.length === 0) {\r\n return null;\r\n }\r\n const editableLinks: Msdyn365.ILinksData[] = [];\r\n const payLoad = getPayloadObject('click', telemetryContent!, '');\r\n linkdata.forEach((link, index) => {\r\n payLoad.contentAction.etext = link.linkText;\r\n const attributes = getTelemetryAttributes(telemetryContent!, payLoad);\r\n const editableLink: Msdyn365.ILinksData = {\r\n ariaLabel: link.ariaLabel,\r\n className: link.isDisabled ? 'ms-account-profile__section-link-disable' : 'ms-account-profile__section-link',\r\n linkText: link.linkText,\r\n linkUrl: link.linkUrl.destinationUrl,\r\n openInNewTab: link.openInNewTab,\r\n role: 'link',\r\n additionalProperties: attributes\r\n };\r\n editableLinks.push(editableLink);\r\n });\r\n\r\n return editableLinks;\r\n};\r\n\r\nexport default AccountProfileLinks;\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 { Customer } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport {\r\n ArrayExtensions,\r\n updateCustomerPersonalization,\r\n updateCustomerPersonalizationInput\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport {\r\n Button,\r\n getPayloadObject,\r\n getTelemetryAttributes,\r\n getTelemetryObject,\r\n IModuleProps,\r\n INodeProps,\r\n IPayLoad,\r\n ITelemetryContent\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport get from 'lodash/get';\r\nimport { computed, observable } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\n\r\nimport { ICittaB2bAccountProfileData } from './citta-b2b-account-profile.data';\r\nimport {\r\n ICittaB2bAccountProfileProps,\r\n IEmailAddressSectionHeadingData,\r\n IHeadingData,\r\n INameSectionHeadingData\r\n} from './citta-b2b-account-profile.props.autogenerated';\r\nimport AccountProfileAttributes from './components/citta-b2b-account-profile-attributes';\r\nimport DescriptionComponent from './components/citta-b2b-account-profile-description';\r\nimport LinksComponent, { ILinksData } from './components/citta-b2b-account-profile-links';\r\nimport TextComponent from './components/citta-b2b-account-profile-text';\r\n\r\nexport interface IAccountPreference {\r\n accountPreference: INodeProps;\r\n heading: React.ReactNode;\r\n buttonWrapper: INodeProps;\r\n buttonYesText: React.ReactNode;\r\n buttonNoText: React.ReactNode;\r\n button: React.ReactNode;\r\n description: React.ReactNode;\r\n onUpdateAccountPreference(preferenceType?: string): void;\r\n}\r\n\r\nexport interface IAccountPreferences {\r\n accountPreferences: INodeProps;\r\n heading?: React.ReactNode;\r\n personalization: IAccountPreference;\r\n extraPreferences?: IAccountPreference[];\r\n}\r\n\r\nexport interface IAccountProfileItem {\r\n AccountProfileItem: INodeProps;\r\n heading?: React.ReactNode;\r\n links?: React.ReactNode;\r\n description?: React.ReactNode;\r\n}\r\n\r\nexport interface IAccountCustomerAttributes {\r\n customerAttributes?: React.ReactNode;\r\n}\r\n\r\nexport interface IAccountProfileViewProps extends ICittaB2bAccountProfileProps {\r\n AccountProfile: IModuleProps;\r\n accountProfileWrapper?: INodeProps;\r\n className: string;\r\n heading?: React.ReactNode;\r\n emailSection: IAccountProfileItem;\r\n nameSection: IAccountProfileItem;\r\n preferenceSection: IAccountPreferences;\r\n customerAttributesWrapper?: INodeProps;\r\n customerAttributesSection?: IAccountCustomerAttributes;\r\n infoMessageBar?: React.ReactNode;\r\n}\r\n\r\n/**\r\n *\r\n * AccountProfile component.\r\n * @extends {React.Component>}\r\n */\r\n@observer\r\nclass AccountProfile extends React.Component> {\r\n @observable private isUpdatingPreference: boolean = false;\r\n\r\n private readonly telemetryContent?: ITelemetryContent;\r\n private readonly payLoad: IPayLoad;\r\n private readonly editAsyncCustomerFeatureName: string = 'Dynamics.AX.Application.RetailEnableAsyncCustomerEditFeature';\r\n\r\n private isEditAsyncCustomerFeatureEnabled: boolean = false;\r\n\r\n constructor(props: ICittaB2bAccountProfileProps) {\r\n super(props);\r\n this.telemetryContent = getTelemetryObject(\r\n this.props.context.request.telemetryPageName!,\r\n this.props.friendlyName,\r\n this.props.telemetry\r\n );\r\n this.payLoad = getPayloadObject('click', this.telemetryContent, '');\r\n }\r\n\r\n public shouldComponentUpdate(nextProps: ICittaB2bAccountProfileProps): boolean {\r\n if (this.props.data === nextProps.data) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n public render(): JSX.Element {\r\n const { config, resources, data } = this.props;\r\n const { className, heading, emailAddressSectionHeading, nameSectionHeading, showAttributes, showPhone, showVatNumber } = config;\r\n\r\n const { editButtonText, editButtonAriaLabel } = resources;\r\n const customerInformation = data.customerInformation.result;\r\n\r\n this.isEditAsyncCustomerFeatureEnabled =\r\n data.featureState?.result?.find(feature => feature.Name === this.editAsyncCustomerFeatureName)?.IsEnabled || false;\r\n\r\n const invalidAsyncCustomerState: boolean =\r\n (this.props.context.app?.config?.canRenderAsyncCustomerDataAsUnmodifiable || false) &&\r\n (customerInformation?.IsAsyncCustomer || false) &&\r\n !this.isEditAsyncCustomerFeatureEnabled;\r\n\r\n // As per the design, phone and vat numbers are part of the profile attributes section\r\n const shouldRenderAttributes = (showAttributes && showAttributes.length > 0) || showPhone || showVatNumber || false;\r\n const editLink: ILinksData = {\r\n linkUrl: {\r\n destinationUrl: get(this.props, 'context.request.user.editProfileUrl', '')\r\n },\r\n linkText: editButtonText,\r\n ariaLabel: editButtonAriaLabel,\r\n isDisabled: invalidAsyncCustomerState\r\n };\r\n\r\n const viewProps = {\r\n ...this.props,\r\n className,\r\n AccountProfile: {\r\n moduleProps: this.props,\r\n className: classnames('ms-account-profile', config.className)\r\n },\r\n infoMessageBar: invalidAsyncCustomerState && (\r\n \r\n ),\r\n accountProfileWrapper: {\r\n className: classnames('ms-account-profile-wrapper')\r\n },\r\n heading: heading && (\r\n \r\n ),\r\n emailSection: this._renderEmailSection(\r\n classnames('ms-account-profile__section', 'ms-account-profile__section-email'),\r\n emailAddressSectionHeading as IEmailAddressSectionHeadingData,\r\n customerInformation && customerInformation.Email\r\n ),\r\n nameSection: this._renderNameSection(\r\n classnames('ms-account-profile__section', 'ms-account-profile__section-name'),\r\n nameSectionHeading as INameSectionHeadingData,\r\n this.getDescription(customerInformation),\r\n Msdyn365.isOboRequest(this.props.context.request) ? undefined : [editLink]\r\n ),\r\n preferenceSection: this._renderPreferenceSection(\r\n classnames('ms-account-profile__section', 'ms-account-profile__section-preferences'),\r\n invalidAsyncCustomerState,\r\n customerInformation\r\n ),\r\n customerAttributesWrapper: {\r\n className: classnames('ms-account-profile__attributes-wrapper')\r\n },\r\n customerAttributesSection: shouldRenderAttributes && this._renderCustomerAttributes()\r\n };\r\n return this.props.renderView(viewProps) as React.ReactElement;\r\n }\r\n\r\n public handleHeadingChange = (event: Msdyn365.ContentEditableEvent) => (this.props.config.heading.text = event.target.value);\r\n\r\n public handleEmailHeadingChange = (event: Msdyn365.ContentEditableEvent) =>\r\n (this.props.config.emailAddressSectionHeading!.text = event.target.value);\r\n\r\n public handleNameHeadingChange = (event: Msdyn365.ContentEditableEvent) =>\r\n (this.props.config.nameSectionHeading!.text = event.target.value);\r\n\r\n public handleLinkTextChange = (linkIndex: number) => (event: Msdyn365.ContentEditableEvent) => {\r\n if (this.props.resources.editButtonText) {\r\n this.props.resources.editButtonText = event.target.value;\r\n }\r\n };\r\n\r\n @computed get editProfileUrl(): string {\r\n return get(this.props, 'context.request.user.editProfileUrl', '');\r\n }\r\n\r\n private getDescription(customerInformation: Customer | undefined): string {\r\n let description = '';\r\n if (customerInformation !== undefined) {\r\n description += customerInformation.Name;\r\n // if (customerInformation.FirstName) {\r\n // description += customerInformation.FirstName;\r\n // }\r\n // if (customerInformation.LastName) {\r\n // description += customerInformation.FirstName ? ` ${customerInformation.LastName}` : customerInformation.LastName;\r\n // }\r\n }\r\n return description;\r\n }\r\n\r\n private _renderEmailSection(\r\n className: string,\r\n heading?: IEmailAddressSectionHeadingData,\r\n description?: string,\r\n links?: ILinksData[]\r\n ): IAccountProfileItem {\r\n return {\r\n AccountProfileItem: {\r\n className\r\n },\r\n heading: heading && heading.text && (\r\n \r\n ),\r\n links: links && links.length > 0 && (\r\n \r\n ),\r\n description: description && (\r\n \r\n )\r\n };\r\n }\r\n\r\n private _renderNameSection(\r\n className: string,\r\n heading?: INameSectionHeadingData,\r\n description?: string,\r\n links?: ILinksData[]\r\n ): IAccountProfileItem {\r\n if (!ArrayExtensions.hasElements(links)) {\r\n return {\r\n AccountProfileItem: {\r\n className\r\n },\r\n heading: heading && (\r\n \r\n ),\r\n description: description && (\r\n \r\n )\r\n };\r\n }\r\n return {\r\n AccountProfileItem: {\r\n className\r\n },\r\n heading: heading && (\r\n \r\n ),\r\n links: (\r\n \r\n ),\r\n description: description && (\r\n \r\n )\r\n };\r\n }\r\n\r\n private readonly onClickEventHandler = (className: string) => async () => {\r\n return this._updateAccountPersonalization(className);\r\n };\r\n\r\n private _renderPreferenceSection(\r\n className: string,\r\n invalidAsyncCustomerState: boolean,\r\n customerInformation?: Customer\r\n ): IAccountPreferences | null {\r\n const {\r\n personalizationDescription,\r\n personalizationEnableButtonAriaLabel,\r\n webTrackingDescription,\r\n webTrackingEnableButtonAriaLabel\r\n } = this.props.resources;\r\n const { preferencesSectionHeading, personalizationSectionHeading, webTrackingSectionHeading } = this.props.config;\r\n const { enableDataAnalytics } = this.props.context.request.features;\r\n const extraPreferences: IAccountPreference[] = [];\r\n\r\n if (!customerInformation) {\r\n this.props.context.telemetry.error('Account profile data is empty, module wont render');\r\n return null;\r\n }\r\n\r\n // Show browser activity login preference if switch is enabled AND a heading is provided\r\n enableDataAnalytics &&\r\n webTrackingSectionHeading &&\r\n extraPreferences.push(\r\n this._renderPreference(\r\n 'web-tracking',\r\n webTrackingSectionHeading as IHeadingData,\r\n webTrackingEnableButtonAriaLabel,\r\n webTrackingDescription,\r\n customerInformation.OptOutWebActivityTracking || false,\r\n invalidAsyncCustomerState\r\n )\r\n );\r\n\r\n return {\r\n accountPreferences: {\r\n className\r\n },\r\n heading: preferencesSectionHeading && (\r\n \r\n ),\r\n personalization: this._renderPreference(\r\n 'personalization',\r\n personalizationSectionHeading as IHeadingData,\r\n personalizationEnableButtonAriaLabel,\r\n personalizationDescription,\r\n customerInformation.OptOutPersonalization || false,\r\n invalidAsyncCustomerState\r\n ),\r\n extraPreferences: extraPreferences || undefined\r\n };\r\n }\r\n\r\n private readonly _renderPreference = (\r\n className: string,\r\n sectionHeading: IHeadingData,\r\n enableAriaLabel: string,\r\n description: string,\r\n isOptOut: boolean,\r\n disableBtn: boolean\r\n ) => {\r\n const { toggleDisableText, toggleEnableText } = this.props.resources;\r\n const toggleState = isOptOut ? 'disable' : 'enable';\r\n const onClickHandler = this.onClickEventHandler(className);\r\n this.payLoad.contentAction.etext = sectionHeading.text;\r\n const attributes = getTelemetryAttributes(this.telemetryContent!, this.payLoad);\r\n\r\n return {\r\n accountPreference: {\r\n className: classnames('ms-account-profile__preference', `ms-account-profile__preference-${className}`, {\r\n 'ms-account-profile__personalization-updating': this.isUpdatingPreference\r\n })\r\n },\r\n heading: sectionHeading && (\r\n \r\n ),\r\n buttonWrapper: {\r\n className: classnames('ms-account-profile__toggle-wrapper', `ms-account-profile__toggle-${toggleState}`, {\r\n // Disable the toggle completely if customer is async.\r\n 'ms-account-profile__toggle-disabled': disableBtn\r\n })\r\n },\r\n buttonYesText: ,\r\n buttonNoText: ,\r\n button: (\r\n \r\n ),\r\n description: ,\r\n onUpdateAccountPreference: async () => this._updateAccountPersonalization(className)\r\n };\r\n };\r\n\r\n private readonly _updateAccountPersonalization = async (preferenceType?: string) => {\r\n const customerInformation = this.props.data.customerInformation.result;\r\n\r\n if (customerInformation) {\r\n const {\r\n telemetry,\r\n context: { request, actionContext }\r\n } = this.props;\r\n\r\n let isOptOutPersonalization = false;\r\n let input;\r\n\r\n switch (preferenceType) {\r\n case 'web-tracking':\r\n isOptOutPersonalization = customerInformation.OptOutWebActivityTracking || false;\r\n input = new updateCustomerPersonalizationInput(\r\n customerInformation.AccountNumber,\r\n !isOptOutPersonalization,\r\n request.apiSettings,\r\n preferenceType\r\n );\r\n break;\r\n case undefined:\r\n case 'personalization':\r\n default:\r\n isOptOutPersonalization = customerInformation.OptOutPersonalization || false;\r\n input = new updateCustomerPersonalizationInput(\r\n customerInformation.AccountNumber,\r\n !isOptOutPersonalization,\r\n request.apiSettings,\r\n preferenceType\r\n );\r\n }\r\n\r\n this.isUpdatingPreference = true;\r\n\r\n try {\r\n await updateCustomerPersonalization(input, actionContext);\r\n } catch (error) {\r\n if (telemetry) {\r\n telemetry.exception(error);\r\n telemetry.debug('Unable to update customer personalization');\r\n }\r\n }\r\n\r\n this.isUpdatingPreference = false;\r\n }\r\n };\r\n\r\n private readonly _renderCustomerAttributes = (): React.ReactNode => {\r\n return ;\r\n };\r\n}\r\n\r\nexport default AccountProfile;\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 { Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { IAccountPreference, IAccountPreferences, IAccountProfileItem, IAccountProfileViewProps } from './citta-b2b-account-profile';\r\n\r\nconst AccountPreferencesSection: React.FC = ({ accountPreferences, heading, personalization, extraPreferences }) => {\r\n return (\r\n \r\n {heading}\r\n \r\n {extraPreferences &&\r\n extraPreferences.map((preferenceSecton, index) => {\r\n return ;\r\n })}\r\n \r\n );\r\n};\r\n\r\nconst AccountPreferenceSection: React.FC = ({\r\n accountPreference,\r\n heading,\r\n description,\r\n buttonWrapper,\r\n buttonYesText,\r\n button,\r\n buttonNoText\r\n}) => {\r\n return (\r\n \r\n {heading}\r\n {description}\r\n \r\n {buttonNoText}\r\n {button}\r\n {buttonYesText}\r\n \r\n \r\n );\r\n};\r\n\r\nconst AccountProfileSection: React.FC = ({ AccountProfileItem, heading, links, description }) => {\r\n return (\r\n \r\n {heading}\r\n {description}\r\n {links}\r\n \r\n );\r\n};\r\n\r\nconst AccountProfileView: React.FC = props => {\r\n const {\r\n AccountProfile,\r\n infoMessageBar,\r\n accountProfileWrapper,\r\n heading,\r\n emailSection,\r\n nameSection,\r\n preferenceSection,\r\n customerAttributesWrapper,\r\n customerAttributesSection\r\n } = props;\r\n\r\n return (\r\n \r\n {infoMessageBar}\r\n {accountProfileWrapper && (\r\n \r\n {heading}\r\n \r\n \r\n \r\n \r\n )}\r\n {customerAttributesWrapper && {customerAttributesSection}}\r\n \r\n );\r\n};\r\n\r\nexport default AccountProfileView;\r\n"],"names":["_ref","className","text","React","AccountAttributeDataTypeValue","AccountProfileAttributes","constructor","props","super","isUpdatingAttributes","gotException","hasError","attributeClassName","maxIntegerLimit","minIntegerLimit","maxDecimalLimit","minDecimalLimit","maxStringLength","maxVATNumberLength","maxPhoneLength","editAsyncCustomerFeatureName","isEditAsyncCustomerFeatureEnabled","_renderAttributes","_data$featureState","_this$props$accountPr","config","data","resources","this","accountProfileProps","attributeDefinitions","result","additionalInformationSectionHeading","elements","showAttributes","split","map","att","attributeDefinition","find","attribute","IsHidden","Name","toLocaleLowerCase","RecordId","_renderAttribute","edit","state","editAttributes","payLoad","contentAction","etext","attributesEditButtonText","getTelemetryAttributes","telemetryContent","attributesSaveButtonText","saveAttributes","attributesCancelButtonText","cancelAttributes","customerInformation","featureState","feature","IsEnabled","disableBtn","context","app","canRenderAsyncCustomerDataAsUnmodifiable","IsAsyncCustomer","ref","attributesContainerRef","classnames","Text","tag","showPhone","_renderPhone","showVatNumber","_renderVatNumber","attributesSaveExceptionMessage","Button","Object","assign","onClick","_enableAttributes","innerRef","editRef","title","disabled","_saveAttributes","_disableAttributes","phoneSectionHeading","heading","replace","type","onChange","_onPhoneChange","value","phone","_renderError","vatNumberSectionHeading","_onVatNumberChange","vatNumber","customAttribute","ExtDataType","Value","Integer","Decimal","_renderIntegerDecimalInput","_renderTextInputOrSelect","TrueFalse","_renderBoolean","attributeProps","_getAttributeProps","displayName","_onAttributeChange","attributes","IsMandatory","isEnumeration","IsEnumeration","EnumerationDetails","hasNoValue","id","_onAttributeSelect","key","selected","option","EnumerationValue","render","toggleState","arialabel","format","attributeToggleButtonAriaLabel","ariaPressed","toggleValue","TextComponent","toggleDisableText","_onAttributeCheck","toggleEnableText","attributeName","error","attributeError","StringExtensions","isNullOrWhitespace","role","attributePayloadData","name","isMandatory","event","target","setState","MsDyn365","isBrowser","setTimeout","current","getElementsByClassName","length","_setFocus","initialAttributes","initialPhone","initialVatNumber","_objectSpread","currentTarget","selectedOptions","index","selectedIndex","_getAttributes","showAttributesArray","customer","custmerAttributes","Attributes","forEach","showAttribute","defaultValue","AttributeValue","DataTypeValue","IntegerValue","String","DecimalValue","StringValue","BooleanValue","keys","_addOrUpdateAttribute","hasValue","entries","payloadData","dataTypeValue","decimalValue","Number","isNaN","typeError","attributeInputTypeErrorText","undefined","lowerBoundValue","upperBoundValue","rangeError","attributeInputRangeErrorText","attributeInputValueExceedsMaximumErrorText","attributeInputValueExceedsMinimumErrorText","integerValue","includes","trimValue","trim","attributeInputStringMaxLengthErrorText","textValue","booleanValue","attributeInputMandatoryErrorText","findIndex","splice","Attribute","recordId","Units","ExtensionProperties","NameTranslations","push","KeyName","Phone","VATNumber","VatNumber","async","input","updateCustomerAttributesInput","AccountNumber","request","apiSettings","updateCustomerAttributes","actionContext","initialCustomerAttributes","telemetry","exception","debug","element","focus","_buildPayloadData","defaultIntegerValue","DefaultValue","LowerBound","UpperBound","defaultDecimalValue","defaultStringValue","defaultBooleanValue","_getCustomerPhoneAndVatNumber","telemetryPageName","friendlyName","getTelemetryObject","getPayloadObject","componentDidMount","reaction","shouldComponentUpdate","nextProps","nextState","__decorate","observable","observer","description","_mapEditableLinks","linkdata","editableLinks","link","linkText","editableLink","ariaLabel","isDisabled","linkUrl","destinationUrl","openInNewTab","additionalProperties","links","requestContext","onTextChange","Msdyn365","editProps","AccountProfile","isUpdatingPreference","handleHeadingChange","handleEmailHeadingChange","emailAddressSectionHeading","handleNameHeadingChange","nameSectionHeading","handleLinkTextChange","linkIndex","editButtonText","onClickEventHandler","_updateAccountPersonalization","_renderPreference","sectionHeading","enableAriaLabel","isOptOut","onClickHandler","accountPreference","onEdit","buttonWrapper","buttonYesText","buttonNoText","button","toString","DescriptionComponent","onUpdateAccountPreference","isOptOutPersonalization","preferenceType","OptOutWebActivityTracking","updateCustomerPersonalizationInput","OptOutPersonalization","updateCustomerPersonalization","_renderCustomerAttributes","_this$props$context$a","editButtonAriaLabel","invalidAsyncCustomerState","shouldRenderAttributes","editLink","get","viewProps","moduleProps","infoMessageBar","accountProcessingPendingInfoMessage","accountProfileWrapper","emailSection","_renderEmailSection","Email","nameSection","_renderNameSection","getDescription","preferenceSection","_renderPreferenceSection","customerAttributesWrapper","customerAttributesSection","renderView","editProfileUrl","AccountProfileItem","LinksComponent","ArrayExtensions","hasElements","personalizationDescription","personalizationEnableButtonAriaLabel","webTrackingDescription","webTrackingEnableButtonAriaLabel","preferencesSectionHeading","personalizationSectionHeading","webTrackingSectionHeading","enableDataAnalytics","features","extraPreferences","accountPreferences","personalization","computed","AccountPreferencesSection","Node","AccountPreferenceSection","preferenceSecton","_ref2","AccountProfileSection","_ref3","Module"],"sourceRoot":""}