Skip to content

Commit 9b98cc0

Browse files
authored
Merge pull request #921 from topcoder-platform/PROD-4398_integrate-userflow-remove-sprig
PROD-4398 integrate userflow remove sprig -> dev
2 parents f9f6f14 + e1a0806 commit 9b98cc0

File tree

39 files changed

+104
-167
lines changed

39 files changed

+104
-167
lines changed

.circleci/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ workflows:
261261
- dev
262262
- justin_fixes
263263
- talent_search_fixes
264+
- PROD-4398_integrate-userflow-remove-sprig
264265

265266
- deployQa:
266267
context: org-global

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
"tc-auth-lib": "topcoder-platform/tc-auth-lib#1.0.26",
120120
"turndown": "^4.0.2",
121121
"typescript": "^4.8.4",
122-
"universal-navigation": "https://github.com/topcoder-platform/universal-navigation#9e62ddc61d",
122+
"universal-navigation": "https://github.com/topcoder-platform/universal-navigation#9fc50d938be7182",
123123
"uuid": "^9.0.0"
124124
},
125125
"devDependencies": {
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
export const SPRIG_CES_SURVEY_ID = 'onAccountSettingsUpdate'
1+
import { EnvironmentConfig } from '~/config'
2+
3+
export const CES_SURVEY_ID = EnvironmentConfig.USERFLOW_SURVEYS.ACCOUNT_SETTINGS

src/apps/accounts/src/lib/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
export * from './accounts-swr'
22
export * from './components'
33
export * from './assets'
4-
export * from './sprig-survey'
4+
export * from './userflow-survey'

src/apps/accounts/src/lib/sprig-survey.ts

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { TcUniNavFn } from 'universal-navigation'
2+
3+
import { CES_SURVEY_ID } from '../config'
4+
5+
declare let tcUniNav: TcUniNavFn
6+
7+
export function triggerSurvey(): void {
8+
tcUniNav('triggerFlow', CES_SURVEY_ID, {})
9+
}

src/apps/accounts/src/settings/tabs/account/account-role/AccountRole.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Dispatch, FC, SetStateAction, useState } from 'react'
22

33
import { BaseModal, Button, Collapsible } from '~/libs/ui'
44
import { authUrlLogout, updatePrimaryMemberRoleAsync, UserProfile } from '~/libs/core'
5-
import { triggerSprigSurvey } from '~/apps/accounts/src/lib'
5+
import { triggerSurvey } from '~/apps/accounts/src/lib'
66

77
import styles from './AccountRole.module.scss'
88

@@ -36,7 +36,7 @@ const AccountRole: FC<AccountRoleProps> = (props: AccountRoleProps) => {
3636
.then(() => {
3737
setMemberRole(newRole)
3838
setIsRoleChangeConfirmed(true)
39-
triggerSprigSurvey(props.profile)
39+
triggerSurvey()
4040
})
4141
.finally(() => {
4242
setIsUpdating(false)

src/apps/accounts/src/settings/tabs/account/address/MemberAddress.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
useCountryLookup,
1414
UserProfile,
1515
} from '~/libs/core'
16-
import { triggerSprigSurvey } from '~/apps/accounts/src/lib'
16+
import { triggerSurvey } from '~/apps/accounts/src/lib'
1717

1818
import styles from './MemberAddress.module.scss'
1919

@@ -88,7 +88,7 @@ const MemberAddress: FC<MemberAddressProps> = (props: MemberAddressProps) => {
8888
.then(() => {
8989
toast.success('Your account has been updated.', { position: toast.POSITION.BOTTOM_RIGHT })
9090
setFormErrors({})
91-
triggerSprigSurvey(props.profile)
91+
triggerSurvey()
9292
})
9393
.catch(() => {
9494
toast.error('Something went wrong. Please try again.', { position: toast.POSITION.BOTTOM_RIGHT })

src/apps/accounts/src/settings/tabs/account/security/Security.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { KeyedMutator } from 'swr'
44
import { noop } from 'lodash'
55

66
import { Button, Collapsible, FormToggleSwitch, IconSolid, Tooltip } from '~/libs/ui'
7-
import { diceIdLogo, MFAImage, SettingSection, triggerSprigSurvey } from '~/apps/accounts/src/lib'
7+
import { diceIdLogo, MFAImage, SettingSection, triggerSurvey } from '~/apps/accounts/src/lib'
88
import { MemberMFAStatus, updateMemberMFAStatusAsync, useMemberMFAStatus, UserProfile } from '~/libs/core'
99

1010
import { DiceSetupModal } from './dice-setup-modal'
@@ -39,7 +39,7 @@ const Security: FC<SecurityProps> = (props: SecurityProps) => {
3939
.then(() => {
4040
setMFAEnabled(!mfaEnabled)
4141
toast.success('Your Multi Factor Authentication (MFA) status was updated.')
42-
triggerSprigSurvey(props.profile)
42+
triggerSurvey()
4343
})
4444
.catch(() => {
4545
toast.error('Something went wrong. Please try again later.')

src/apps/accounts/src/settings/tabs/account/user-and-pass/UserAndPassword.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {
1717
UserTrait,
1818
UserTraits,
1919
} from '~/libs/core'
20-
import { SettingSection, triggerSprigSurvey } from '~/apps/accounts/src/lib'
20+
import { SettingSection, triggerSurvey } from '~/apps/accounts/src/lib'
2121

2222
import { UserAndPassFromConfig } from './user-and-pass.form.config'
2323
import styles from './UserAndPassword.module.scss'
@@ -82,7 +82,7 @@ const UserAndPassword: FC<UserAndPasswordProps> = (props: UserAndPasswordProps)
8282
setUserConsent(!userConsent)
8383
mutateTraits()
8484
toast.success('User consent updated successfully.')
85-
triggerSprigSurvey(props.profile)
85+
triggerSurvey()
8686
})
8787
.catch(() => {
8888
toast.error('Failed to update user consent.')

0 commit comments

Comments
 (0)