@alphapoint/apex-web 5.5.6 → 5.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/lib/apex.integration.test.js +435 -0
  2. package/lib/apex.js +37 -1
  3. package/lib/apex.test.js +138 -0
  4. package/lib/components/2FA/PasskeyOption.js +126 -0
  5. package/lib/components/2FA/TwoFactorAuthComponent.js +24 -5
  6. package/lib/components/2FA/TwoFactorAuthComponent.test.js +94 -0
  7. package/lib/components/2FA/TwoFactorAuthContainer.js +139 -27
  8. package/lib/components/2FA/TwoFactorAuthContainer.test.js +627 -0
  9. package/lib/components/AccountsDropdown/AccountsDropdownComponent.css +6 -0
  10. package/lib/components/AccountsDropdown/AccountsDropdownComponent.js +6 -2
  11. package/lib/components/AccountsDropdown/AccountsDropdownComponent.test.js +43 -0
  12. package/lib/components/AccountsDropdown/AccountsDropdownContainer.js +3 -1
  13. package/lib/components/BalancesList/BalancesListContainer.js +4 -1
  14. package/lib/components/ConfirmBlockTradeModal/ConfirmBlockTradeModalContainer.js +34 -6
  15. package/lib/components/ConfirmBlockTradeModal/ConfirmBlockTradeModalContainer.test.js +298 -0
  16. package/lib/components/ConfirmOrderModal/ConfirmOrderModalComponent.js +26 -4
  17. package/lib/components/ConfirmOrderModal/ConfirmOrderModalContainer.js +4 -1
  18. package/lib/components/DigitalAssets/digitalAssetsPriceLabel.test.js +238 -0
  19. package/lib/components/EnableTwoFactorAuth/Disable2FAForm.js +22 -7
  20. package/lib/components/EnableTwoFactorAuth/Disable2FAModal.js +15 -5
  21. package/lib/components/EnableTwoFactorAuth/Disable2FAModal.test.js +460 -0
  22. package/lib/components/EnableTwoFactorAuth/Disable2FAModalContainer.js +108 -16
  23. package/lib/components/EnableTwoFactorAuth/EnableTwoFactorAuthComponent.js +7 -0
  24. package/lib/components/EnableTwoFactorAuth/EnableTwoFactorAuthComponent.test.js +105 -0
  25. package/lib/components/EnableTwoFactorAuth/EnableTwoFactorAuthContainerFactory.js +15 -3
  26. package/lib/components/FusionAuth/UnlinkOAuthIdentityModal.css +13 -0
  27. package/lib/components/FusionAuth/UnlinkOAuthIdentityModal.js +246 -0
  28. package/lib/components/FusionAuth/UnlinkOAuthIdentityModal.test.js +521 -0
  29. package/lib/components/InstrumentPositions/InstrumentPositionsContainer.js +4 -1
  30. package/lib/components/Login/LoginFormComponent.js +1 -1
  31. package/lib/components/MarginBalances/MarginDepositWithdraw/MarginDepositModal/MarginDepositFormContainer.js +2 -1
  32. package/lib/components/NoAccountBanner/NoAccountBanner.css +9 -0
  33. package/lib/components/NoAccountBanner/NoAccountBanner.js +58 -0
  34. package/lib/components/NoAccountBanner/index.js +16 -0
  35. package/lib/components/NoAccountPlaceholder/NoAccountPlaceholder.css +31 -0
  36. package/lib/components/NoAccountPlaceholder/NoAccountPlaceholder.js +33 -0
  37. package/lib/components/NoAccountPlaceholder/index.js +9 -0
  38. package/lib/components/OrderEntryComponents/advancedForm/AdvancedOrderFormContainer.js +2 -0
  39. package/lib/components/OrderEntryComponents/common/FormAmountFields.js +5 -0
  40. package/lib/components/OrderEntryComponents/common/TwapScheduleFields.js +98 -0
  41. package/lib/components/OrderEntryComponents/defaultForm/OrderEntryAnchoring.js +86 -39
  42. package/lib/components/OrderEntryComponents/defaultForm/OrderEntryAnchoring.test.js +326 -0
  43. package/lib/components/OrderEntryComponents/defaultForm/OrderEntryContainer.js +10 -2
  44. package/lib/components/OrderHistoryComponents/DepositsStatus/DepositsStatusComponent.js +1 -1
  45. package/lib/components/OrderHistoryComponents/DepositsStatus/DepositsStatusComponent.test.js +99 -0
  46. package/lib/components/OrderHistoryComponents/InactiveOrders/InactiveOrdersComponent.js +1 -1
  47. package/lib/components/OrderHistoryComponents/OpenOrders/OpenOrdersComponent.js +1 -1
  48. package/lib/components/OrderHistoryComponents/WithdrawStatus/WithdrawStatusComponent.js +1 -1
  49. package/lib/components/OrderHistoryComponents/WithdrawStatus/WithdrawStatusComponent.test.js +113 -0
  50. package/lib/components/Settings/ProfileAndSecurity/PasskeysSettingsCard/PasskeysSettingsCard.css +108 -0
  51. package/lib/components/Settings/ProfileAndSecurity/PasskeysSettingsCard/PasskeysSettingsCard.test.js +983 -0
  52. package/lib/components/Settings/ProfileAndSecurity/PasskeysSettingsCard/PasskeysSettingsCardComponent.js +500 -0
  53. package/lib/components/Settings/ProfileAndSecurity/PasskeysSettingsCard/index.js +9 -0
  54. package/lib/components/Settings/ProfileAndSecurity/ProfileSettingsCard/ProfileForm/SsoLinkRowComponent.css +4 -0
  55. package/lib/components/Settings/ProfileAndSecurity/ProfileSettingsCard/ProfileForm/SsoLinkRowComponent.js +29 -17
  56. package/lib/components/Settings/ProfileAndSecurity/ProfileSettingsCard/ProfileForm/SsoLinkRowComponent.test.js +135 -0
  57. package/lib/components/Settings/ProfileAndSecurity/TwoFactorAuthSettingsCard/EnableTwoFactorAuth/EnableTwoFactorAuthComponent.js +12 -4
  58. package/lib/components/Settings/ProfileAndSecurity/TwoFactorAuthSettingsCard/EnableTwoFactorAuth/EnableTwoFactorAuthComponent.test.js +268 -0
  59. package/lib/components/TwoFactorAuthForm/TwoFactorAuthForm.test.js +475 -0
  60. package/lib/components/TwoFactorAuthForm/TwoFactorAuthFormComponent.js +26 -5
  61. package/lib/components/TwoFactorAuthForm/TwoFactorAuthFormContainer.js +50 -32
  62. package/lib/components/common/APAutoTabInput/APAutoTabInput.js +5 -2
  63. package/lib/components/common/APSelect/APSelect.js +3 -1
  64. package/lib/components/common/ErrorBoundary/ErrorBoundary.css +35 -0
  65. package/lib/components/common/ErrorBoundary/ErrorBoundary.js +87 -0
  66. package/lib/config/CONFIG.md +4 -0
  67. package/lib/config/configDefault.json +2 -1
  68. package/lib/constants/sendOrder/orderEntryFormConstants.js +23 -4
  69. package/lib/constants/sendOrder/timeInForceConstants.js +3 -1
  70. package/lib/constants/sendOrder/twapRejectReasons.js +26 -0
  71. package/lib/helpers/errorTextFormatter.js +13 -4
  72. package/lib/helpers/errorTextFormatter.test.js +26 -0
  73. package/lib/helpers/orderHistoryHelper.js +13 -1
  74. package/lib/helpers/orderHistoryHelper.test.js +58 -13
  75. package/lib/helpers/passkeyApi.js +228 -0
  76. package/lib/helpers/passkeyApi.test.js +171 -0
  77. package/lib/helpers/placeOrderHelper.js +76 -61
  78. package/lib/helpers/placeOrderHelper.test.js +169 -10
  79. package/lib/helpers/recalculateOrderHelper.js +4 -1
  80. package/lib/helpers/recalculateOrderHelper.test.js +88 -2
  81. package/lib/helpers/twapOrderHelper.js +265 -0
  82. package/lib/helpers/twapOrderHelper.test.js +467 -0
  83. package/lib/helpers/twoFactorAuthCancellation.js +38 -0
  84. package/lib/helpers/webauthnHelper.js +300 -0
  85. package/lib/helpers/webauthnHelper.test.js +199 -0
  86. package/lib/hocs/forAccount.js +33 -0
  87. package/lib/hocs/forAccount.test.js +50 -0
  88. package/lib/hocs/forVerified.js +16 -2
  89. package/lib/hocs/withAuthentication.js +3 -1
  90. package/lib/hocs/withOneSubmission.js +168 -0
  91. package/lib/index.js +3 -2
  92. package/lib/layouts/HeaderLayout/HeaderLayout.js +2 -1
  93. package/lib/layouts/WalletsLayout/WalletsLayoutContainer.js +3 -1
  94. package/lib/layouts/WalletsLayout/WalletsLayoutContainer.test.js +84 -0
  95. package/lib/redux/actions/apiActions.js +77 -9
  96. package/lib/redux/actions/apiActions.test.js +233 -0
  97. package/lib/redux/actions/authActions.js +514 -198
  98. package/lib/redux/actions/authActions.test.js +627 -47
  99. package/lib/redux/actions/depositActions.js +1 -1
  100. package/lib/redux/actions/depositActions.test.js +100 -30
  101. package/lib/redux/actions/fusionAuthActions.test.js +265 -84
  102. package/lib/redux/actions/interestAccountActions.js +12 -3
  103. package/lib/redux/actions/interestAccountActions.test.js +73 -0
  104. package/lib/redux/actions/modalActions.js +1 -0
  105. package/lib/redux/actions/orderEntryActions.blockTrade.test.js +306 -0
  106. package/lib/redux/actions/orderEntryActions.js +74 -22
  107. package/lib/redux/actions/orderEntryActions.test.js +63 -11
  108. package/lib/redux/actions/orderHistoryActions.js +20 -8
  109. package/lib/redux/actions/orderHistoryActions.test.js +63 -0
  110. package/lib/redux/actions/userActions.js +379 -179
  111. package/lib/redux/actions/userActions.test.js +925 -234
  112. package/lib/redux/actions/withdrawActions.js +62 -29
  113. package/lib/redux/actions/withdrawActions.test.js +246 -73
  114. package/lib/redux/actions/withdrawActions.travelRule.test.js +17 -3
  115. package/lib/redux/margin/actions/marginActions.js +6 -3
  116. package/lib/redux/margin/actions/marginActions.test.js +166 -0
  117. package/lib/redux/middlewares/authMiddleware.js +5 -0
  118. package/lib/redux/middlewares/authMiddleware.test.js +88 -29
  119. package/lib/redux/reducers/authReducer.js +1 -0
  120. package/lib/redux/reducers/authReducer.test.js +38 -0
  121. package/lib/redux/reducers/userReducer.js +10 -0
  122. package/lib/redux/reducers/userReducer.test.js +29 -0
  123. package/lib/redux/selectors/orderEntrySelector.js +19 -8
  124. package/lib/redux/selectors/orderEntrySelector.test.js +209 -0
  125. package/lib/redux/selectors/orderTotalSelector.test.js +40 -1
  126. package/lib/redux/selectors/recentActivitySelector.js +8 -2
  127. package/lib/redux/selectors/recentActivitySelector.v2.test.js +33 -0
  128. package/lib/redux/selectors/userSelectors.js +6 -1
  129. package/lib/redux/selectors/userSelectors.test.js +28 -0
  130. package/lib/services/fms/fms.js +2 -0
  131. package/lib/services/fms/fms.test.js +35 -0
  132. package/package.json +4 -4
@@ -248,7 +248,7 @@ var getDepositTickets = exports.getDepositTickets = function getDepositTickets()
248
248
  depositTickets = _context4.v;
249
249
  // Temporarily inject AmlTravelRulePendingUserInput status into every other row
250
250
  modifiedTickets = depositTickets.map(function (ticket, index) {
251
- return index % 2 === 0 ? _objectSpread(_objectSpread({}, ticket), {}, {
251
+ return index % 2 === 0 && ticket.Status !== 'AddressBlacklisted' ? _objectSpread(_objectSpread({}, ticket), {}, {
252
252
  Status: 'AmlTravelRulePendingUserInput'
253
253
  }) : ticket;
254
254
  });
@@ -667,6 +667,76 @@ describe('depositActions', function () {
667
667
  }
668
668
  }, _callee22);
669
669
  })));
670
+ it('should not overwrite the Status of AddressBlacklisted tickets', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee23() {
671
+ return _regenerator().w(function (_context23) {
672
+ while (1) switch (_context23.n) {
673
+ case 0:
674
+ apiActions.setReturnValue('GetDepositTickets', [{
675
+ TicketNumber: 1,
676
+ Status: 'AddressBlacklisted'
677
+ }, {
678
+ TicketNumber: 2,
679
+ Status: 'AddressBlacklisted'
680
+ }, {
681
+ TicketNumber: 3,
682
+ Status: 'AddressBlacklisted'
683
+ }]);
684
+ _context23.n = 1;
685
+ return store.dispatch(actions.getDepositTickets());
686
+ case 1:
687
+ expect(store.getActions()).toContainEqual({
688
+ type: actions.RECEIVE_DEPOSIT_TICKETS,
689
+ payload: [{
690
+ TicketNumber: 1,
691
+ Status: 'AddressBlacklisted'
692
+ }, {
693
+ TicketNumber: 2,
694
+ Status: 'AddressBlacklisted'
695
+ }, {
696
+ TicketNumber: 3,
697
+ Status: 'AddressBlacklisted'
698
+ }]
699
+ });
700
+ case 2:
701
+ return _context23.a(2);
702
+ }
703
+ }, _callee23);
704
+ })));
705
+ it('should still inject AmlTravelRulePendingUserInput into even-index tickets that are not AddressBlacklisted', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee24() {
706
+ return _regenerator().w(function (_context24) {
707
+ while (1) switch (_context24.n) {
708
+ case 0:
709
+ apiActions.setReturnValue('GetDepositTickets', [{
710
+ TicketNumber: 1,
711
+ Status: 'Pending'
712
+ }, {
713
+ TicketNumber: 2,
714
+ Status: 'Pending'
715
+ }, {
716
+ TicketNumber: 3,
717
+ Status: 'AddressBlacklisted'
718
+ }]);
719
+ _context24.n = 1;
720
+ return store.dispatch(actions.getDepositTickets());
721
+ case 1:
722
+ expect(store.getActions()).toContainEqual({
723
+ type: actions.RECEIVE_DEPOSIT_TICKETS,
724
+ payload: [{
725
+ TicketNumber: 1,
726
+ Status: 'AmlTravelRulePendingUserInput'
727
+ }, {
728
+ TicketNumber: 2,
729
+ Status: 'Pending'
730
+ }, {
731
+ TicketNumber: 3,
732
+ Status: 'AddressBlacklisted'
733
+ }]
734
+ });
735
+ case 2:
736
+ return _context24.a(2);
737
+ }
738
+ }, _callee24);
739
+ })));
670
740
  });
671
741
  describe('createDepositTicket action', function () {
672
742
  beforeEach(function () {
@@ -675,10 +745,10 @@ describe('depositActions', function () {
675
745
  });
676
746
  apiActions.setReturnValue('GetDepositTickets', []);
677
747
  });
678
- it('should call CreateDepositTicket via callAPI', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee23() {
748
+ it('should call CreateDepositTicket via callAPI', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee25() {
679
749
  var depositInfoPayload;
680
- return _regenerator().w(function (_context23) {
681
- while (1) switch (_context23.n) {
750
+ return _regenerator().w(function (_context25) {
751
+ while (1) switch (_context25.n) {
682
752
  case 0:
683
753
  depositInfoPayload = JSON.stringify({
684
754
  fullname: 'John Doe',
@@ -688,7 +758,7 @@ describe('depositActions', function () {
688
758
  success: true,
689
759
  requestCode: 'abcd-efgh-1234-5678'
690
760
  });
691
- _context23.n = 1;
761
+ _context25.n = 1;
692
762
  return store.dispatch(actions.createDepositTicket({
693
763
  ProductId: 1,
694
764
  amount: 100,
@@ -707,15 +777,15 @@ describe('depositActions', function () {
707
777
  Status: 'New'
708
778
  });
709
779
  case 2:
710
- return _context23.a(2);
780
+ return _context25.a(2);
711
781
  }
712
- }, _callee23);
782
+ }, _callee25);
713
783
  })));
714
784
  });
715
- it("should dispatch ".concat(actions.RECEIVE_DEPOSIT_TICKET, " action"), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee24() {
785
+ it("should dispatch ".concat(actions.RECEIVE_DEPOSIT_TICKET, " action"), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee26() {
716
786
  var createTicketResponse;
717
- return _regenerator().w(function (_context24) {
718
- while (1) switch (_context24.n) {
787
+ return _regenerator().w(function (_context26) {
788
+ while (1) switch (_context26.n) {
719
789
  case 0:
720
790
  store = getStoreMock({
721
791
  UseGetDepositWorkflow: false
@@ -726,7 +796,7 @@ describe('depositActions', function () {
726
796
  requestCode: 'abcd-efgh-1234-5678'
727
797
  };
728
798
  apiActions.setReturnValue('CreateDepositTicket', createTicketResponse);
729
- _context24.n = 1;
799
+ _context26.n = 1;
730
800
  return store.dispatch(actions.createDepositTicket({
731
801
  ProductId: 1,
732
802
  amount: 100,
@@ -739,14 +809,14 @@ describe('depositActions', function () {
739
809
  payload: createTicketResponse
740
810
  });
741
811
  case 2:
742
- return _context24.a(2);
812
+ return _context26.a(2);
743
813
  }
744
- }, _callee24);
814
+ }, _callee26);
745
815
  })));
746
- it("should call showSnack if response result is false", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee25() {
816
+ it("should call showSnack if response result is false", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee27() {
747
817
  var createTicketResponse;
748
- return _regenerator().w(function (_context25) {
749
- while (1) switch (_context25.n) {
818
+ return _regenerator().w(function (_context27) {
819
+ while (1) switch (_context27.n) {
750
820
  case 0:
751
821
  store = getStoreMock({
752
822
  UseGetDepositWorkflow: false
@@ -755,7 +825,7 @@ describe('depositActions', function () {
755
825
  result: false
756
826
  };
757
827
  apiActions.setReturnValue('CreateDepositTicket', createTicketResponse);
758
- _context25.n = 1;
828
+ _context27.n = 1;
759
829
  return store.dispatch(actions.createDepositTicket({
760
830
  ProductId: 1,
761
831
  amount: 100,
@@ -765,28 +835,28 @@ describe('depositActions', function () {
765
835
  case 1:
766
836
  expect(snackbarActions.showSnack).toHaveBeenCalled();
767
837
  case 2:
768
- return _context25.a(2);
838
+ return _context27.a(2);
769
839
  }
770
- }, _callee25);
840
+ }, _callee27);
771
841
  })));
772
842
  describe('subscribeToDeposits', function () {
773
- it('should call subscribeToDeposits', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee26() {
774
- return _regenerator().w(function (_context26) {
775
- while (1) switch (_context26.n) {
843
+ it('should call subscribeToDeposits', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee28() {
844
+ return _regenerator().w(function (_context28) {
845
+ while (1) switch (_context28.n) {
776
846
  case 0:
777
- _context26.n = 1;
847
+ _context28.n = 1;
778
848
  return store.dispatch(actions.subscribeToDeposits());
779
849
  case 1:
780
850
  expect(_depositSubscriptionService["default"].subscribe).toHaveBeenCalled();
781
851
  case 2:
782
- return _context26.a(2);
852
+ return _context28.a(2);
783
853
  }
784
- }, _callee26);
854
+ }, _callee28);
785
855
  })));
786
- it("should dispatch ".concat(actions.ADD_DEPOSIT, " action with update when subscribed"), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee27() {
856
+ it("should dispatch ".concat(actions.ADD_DEPOSIT, " action with update when subscribed"), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee29() {
787
857
  var updates, expectedActions;
788
- return _regenerator().w(function (_context27) {
789
- while (1) switch (_context27.n) {
858
+ return _regenerator().w(function (_context29) {
859
+ while (1) switch (_context29.n) {
790
860
  case 0:
791
861
  updates = [];
792
862
  expectedActions = [{
@@ -794,14 +864,14 @@ describe('depositActions', function () {
794
864
  payload: updates
795
865
  }];
796
866
  _depositSubscriptionService["default"].setUpdateData(updates);
797
- _context27.n = 1;
867
+ _context29.n = 1;
798
868
  return store.dispatch(actions.subscribeToDeposits());
799
869
  case 1:
800
870
  expect(store.getActions()).toEqual(expectedActions);
801
871
  case 2:
802
- return _context27.a(2);
872
+ return _context29.a(2);
803
873
  }
804
- }, _callee27);
874
+ }, _callee29);
805
875
  })));
806
876
  });
807
877
  });