@flarehr/apollo-super-selection 1.3.40541 → 1.3.40599

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.
@@ -1,4 +1,5 @@
1
1
  import { Component, h, Prop } from '@stencil/core';
2
+ import { isSome } from 'fp-ts/lib/Option';
2
3
  import { Link } from '../funds/promoted-fund/types';
3
4
  import { EventTrackingService } from '../services/event-tracking.service';
4
5
  import navigationService from '../services/navigation.service';
@@ -9,7 +10,15 @@ export class Consent {
9
10
  this.eventTrackingService = EventTrackingService.Instance;
10
11
  }
11
12
  componentDidLoad() {
12
- return this.eventTrackingService.TrackSuperFundDisclaimerViewedAsync({});
13
+ let isDefinedBenefitsEligible = 'Not set';
14
+ if (isSome(superSelectionService.isDefinedBenefitsEligible)) {
15
+ isDefinedBenefitsEligible = superSelectionService.isDefinedBenefitsEligible.value
16
+ ? 'True'
17
+ : 'False';
18
+ }
19
+ return this.eventTrackingService.TrackSuperFundDisclaimerViewedAsync({
20
+ isDefinedBenefitsEligible
21
+ });
13
22
  }
14
23
  render() {
15
24
  return (h("div", null,
@@ -101,8 +101,8 @@ export class SuperSelectionAppService {
101
101
  get campaignConnectEnabled() {
102
102
  return this._state.campaignConnectEnabled;
103
103
  }
104
- get definedBenefitsEligibility() {
105
- return this._state.definedBenefitsEligibility;
104
+ get isDefinedBenefitsEligible() {
105
+ return this._state.isDefinedBenefitsEligible;
106
106
  }
107
107
  async loadAppStateAsync() {
108
108
  const appStateResponse = await superSelectionApi.getAppStateAsync();
@@ -112,7 +112,7 @@ export class SuperSelectionAppService {
112
112
  this._state.promotedFunds = O.fromNullable(appStateResponse.promotedFunds);
113
113
  this._state.campaignConnectEnabled = appStateResponse.campaignConnectEnabled;
114
114
  this._state.superChoicePrefill = O.fromNullable(appStateResponse.prefill);
115
- this._state.definedBenefitsEligibility = appStateResponse.definedBenefitsEligibility;
115
+ this._state.isDefinedBenefitsEligible = O.fromNullable(appStateResponse.isDefinedBenefitsEligible);
116
116
  }
117
117
  async startLoadingCampaignConnectAsync() {
118
118
  if (this._state.campaignConnectEnabled) {
@@ -13,6 +13,6 @@ export const initialState = {
13
13
  hasSuperSelectionBeenSubmitted: false,
14
14
  campaignConnectEnabled: false,
15
15
  campaignConnectPromise: O.none,
16
- definedBenefitsEligibility: false,
16
+ isDefinedBenefitsEligible: O.none,
17
17
  campaignConnect: O.none
18
18
  };
@@ -1,7 +1,7 @@
1
1
  import { Component, Event, getAssetPath, h, Host, Prop, State, Watch } from '@stencil/core';
2
2
  import { injectHistory } from '@stencil/router';
3
3
  import * as O from 'fp-ts/lib/Option';
4
- import { isSome } from 'fp-ts/lib/Option';
4
+ import { isNone, isSome } from 'fp-ts/lib/Option';
5
5
  import iframe from '../../utils/iframe';
6
6
  import * as constants from './funds/constants';
7
7
  import promotedFundState from './funds/promoted-fund/promoted-fund.store';
@@ -54,7 +54,8 @@ export class SuperSelectionApp {
54
54
  const ignoreExistingSelectionOption = O.fromNullable(this.ignoreExistingSelection);
55
55
  const shouldIgnoreExistingDefinedBenefitsChoice = isSome(chosenFundOption) &&
56
56
  chosenFundOption.value.type == 'Defined Benefits Fund' &&
57
- superSelectionAppService.definedBenefitsEligibility == false;
57
+ (isNone(superSelectionAppService.isDefinedBenefitsEligible) ||
58
+ !superSelectionAppService.isDefinedBenefitsEligible.value);
58
59
  const shouldIgnoreExistingChoice = (isSome(ignoreExistingSelectionOption) && ignoreExistingSelectionOption.value) ||
59
60
  shouldIgnoreExistingDefinedBenefitsChoice;
60
61
  if (isSome(superSelectionAppService.state.superChoicePrefill)) {