feature/AB#32503 - Add AutoNumeric for currency input masking#2450
Draft
plavoie-BC wants to merge 4 commits into
Draft
feature/AB#32503 - Add AutoNumeric for currency input masking#2450plavoie-BC wants to merge 4 commits into
plavoie-BC wants to merge 4 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR replaces jquery-maskmoney with AutoNumeric to handle currency input masking across the Unity GrantManager portal UI, centralizing initialization via a shared initCurrencyInputs helper and updating bundling/resource mapping to load AutoNumeric globally.
Changes:
- Added
autonumericdependency and removedjquery-maskmoney; updated resource mapping and lockfile accordingly. - Updated multiple components/pages to use
initCurrencyInputs(...)and AutoNumeric APIs instead of.maskMoney(...). - Added AutoNumeric to the UX2 global script bundle and introduced a shared
initCurrencyInputshelper inzone-extensions.js.
Reviewed changes
Copilot reviewed 27 out of 28 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| applications/Unity.GrantManager/src/Unity.GrantManager.Web/yarn.lock | Locks new autonumeric dependency and related resolution changes. |
| applications/Unity.GrantManager/src/Unity.GrantManager.Web/Views/Shared/Components/ProjectInfo/ProjectInfoViewComponent.cs | Removes jquery-maskmoney script from bundle. |
| applications/Unity.GrantManager/src/Unity.GrantManager.Web/Views/Shared/Components/ProjectInfo/Default.js | Switches currency field updates to AutoNumeric instance updates (with fallback). |
| applications/Unity.GrantManager/src/Unity.GrantManager.Web/Views/Shared/Components/PaymentConfiguration/PaymentConfigurationViewComponent.cs | Removes jquery-maskmoney script from bundle. |
| applications/Unity.GrantManager/src/Unity.GrantManager.Web/Views/Shared/Components/PaymentConfiguration/Default.js | Uses AutoNumeric to read unmasked numeric values; initializes currency inputs via helper. |
| applications/Unity.GrantManager/src/Unity.GrantManager.Web/Views/Shared/Components/FundingAgreementInfo/FundingAgreementInfoViewComponent.cs | Removes jquery-maskmoney script from bundle. |
| applications/Unity.GrantManager/src/Unity.GrantManager.Web/Views/Shared/Components/AssessmentResults/Default.js | Replaces .maskMoney(...) usage with initCurrencyInputs(...) and AutoNumeric updates. |
| applications/Unity.GrantManager/src/Unity.GrantManager.Web/Views/Shared/Components/AssessmentResults/Default.cshtml | Updates inline initialization to call initCurrencyInputs(...). |
| applications/Unity.GrantManager/src/Unity.GrantManager.Web/Views/Shared/Components/AssessmentResults/AssessmentResults.cs | Removes jquery-maskmoney script from bundle. |
| applications/Unity.GrantManager/src/Unity.GrantManager.Web/Views/Shared/Components/ApplicantOrganizationInfo/ApplicantOrganizationInfoViewComponent.cs | Removes jquery-maskmoney script from bundle. |
| applications/Unity.GrantManager/src/Unity.GrantManager.Web/Views/Shared/Components/ActionBar/ActionBar.cs | Removes jquery-maskmoney script from bundle. |
| applications/Unity.GrantManager/src/Unity.GrantManager.Web/Pages/GrantApplications/Details.js | Replaces custom currency masking init with shared initCurrencyInputs(...). |
| applications/Unity.GrantManager/src/Unity.GrantManager.Web/Pages/BulkApprovals/ApproveApplicationsModal.cshtml | Replaces inline .maskMoney(...) with initCurrencyInputs(...). |
| applications/Unity.GrantManager/src/Unity.GrantManager.Web/Pages/ApplicantHistory/EditFundingHistoryModal.cshtml | Replaces inline .maskMoney(...) with initCurrencyInputs(...). |
| applications/Unity.GrantManager/src/Unity.GrantManager.Web/Pages/ApplicantHistory/CreateFundingHistoryModal.cshtml | Replaces inline .maskMoney(...) with initCurrencyInputs(...). |
| applications/Unity.GrantManager/src/Unity.GrantManager.Web/package.json | Adds autonumeric and removes jquery-maskmoney. |
| applications/Unity.GrantManager/src/Unity.GrantManager.Web/abp.resourcemapping.js | Removes maskmoney mapping and adds AutoNumeric mapping. |
| applications/Unity.GrantManager/modules/Unity.Theme.UX2/src/Unity.Theme.UX2/wwwroot/themes/ux2/zone-extensions.js | Introduces shared AutoNumeric currency config + initCurrencyInputs; updates reset/init logic. |
| applications/Unity.GrantManager/modules/Unity.Theme.UX2/src/Unity.Theme.UX2/Bundling/UnityThemeUX2GlobalScriptContributor.cs | Adds AutoNumeric to the global UX2 script bundle. |
| applications/Unity.GrantManager/modules/Unity.Payments/src/Unity.Payments.Web/Views/Shared/Components/PaymentInfo/PaymentInfoViewComponent.cs | Removes jquery-maskmoney script from bundle. |
| applications/Unity.GrantManager/modules/Unity.Payments/src/Unity.Payments.Web/Views/Shared/Components/PaymentInfo/Default.js | Initializes currency inputs via shared initCurrencyInputs(...). |
| applications/Unity.GrantManager/modules/Unity.Payments/src/Unity.Payments.Web/Views/Shared/Components/PaymentInfo/Default.cshtml | Updates inline initialization to call initCurrencyInputs(...). |
| applications/Unity.GrantManager/modules/Unity.Payments/src/Unity.Payments.Web/Pages/PaymentRequests/CreatePaymentRequests.cshtml | Replaces inline .maskMoney(...) formatting with initCurrencyInputs(...). |
| applications/Unity.GrantManager/modules/Unity.Payments/src/Unity.Payments.Web/Pages/PaymentApprovals/UpdatePaymentRequestStatus.cshtml | Replaces inline .maskMoney(...) init with initCurrencyInputs(...). |
| applications/Unity.GrantManager/modules/Unity.Flex/src/Unity.Flex.Web/Views/Shared/Components/WorksheetInstanceWidget/WorksheetInstanceWidget.cs | Removes jquery-maskmoney script from bundle. |
| applications/Unity.GrantManager/modules/Unity.Flex/src/Unity.Flex.Web/Views/Shared/Components/WorksheetInstanceWidget/Default.js | Replaces custom currency masking init with initCurrencyInputs(...). |
| applications/Unity.GrantManager/modules/Unity.Flex/src/Unity.Flex.Web/Views/Shared/Components/CurrencyWidget/Default.js | Replaces custom currency masking init with initCurrencyInputs(...). |
| applications/Unity.GrantManager/modules/Unity.Flex/src/Unity.Flex.Web/Pages/Components/DataGrid/EditDataRowModal.cshtml | Replaces inline .maskMoney(...) init with initCurrencyInputs(...). |
Comments suppressed due to low confidence (1)
applications/Unity.GrantManager/modules/Unity.Theme.UX2/src/Unity.Theme.UX2/wwwroot/themes/ux2/zone-extensions.js:404
initializeNumericFields()now only callsinitCurrencyInputs(). However,.numeric-maskand.percentage-maskclasses are still present in the UI (for exampleApplicantInfo/Default.cshtmlusesnumeric-maskandProjectInfo/Default.cshtmlusespercentage-mask), so those inputs will no longer be initialized/masked at all after removingjquery-maskmoney. Consider adding AutoNumeric initialization for these non-currency numeric fields (or a separate initializer) to avoid a regression in formatting/validation behavior.
initializeNumericFields() {
initCurrencyInputs(this.form[0]);
}
| } | ||
|
|
||
| const currencyConfiguration = { | ||
| currencySymbol: AutoNumeric.options.currencySymbol.dollar, |
Comment on lines
311
to
+316
| $el.val(this.originalValues[name]); | ||
|
|
||
| // Re-apply any special formatting (like currency masks) | ||
| if ($el.hasClass('unity-currency-input') || | ||
| $el.hasClass('numeric-mask') || | ||
| $el.hasClass('percentage-mask')) { | ||
| $el.maskMoney('mask', this.originalValues[name]); | ||
| $el.hasClass('custom-currency-input')) { | ||
| const anElement = AutoNumeric.getAutoNumericElement(element); |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Pull request overview
This PR replaces
jquery-maskmoneywith AutoNumeric to handle currency input masking across the Unity GrantManager portal UI, centralizing initialization via a sharedinitCurrencyInputshelper and updating bundling/resource mapping to load AutoNumeric globally.Changes:
autonumericdependency and removedjquery-maskmoney; updated resource mapping and lockfile accordingly.initCurrencyInputs(...)and AutoNumeric APIs instead of.maskMoney(...).initCurrencyInputshelper inzone-extensions.js.