Skip to content

Commit 166bda3

Browse files
authored
Merge pull request #846 from topcoder-platform/dev
Member Profiles
2 parents d93c629 + b60e4db commit 166bda3

File tree

390 files changed

+14661
-2145
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

390 files changed

+14661
-2145
lines changed

.circleci/config.yml

+193-197
Large diffs are not rendered by default.

.environments/.env.dev

-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ REACT_APP_ENABLE_TCA_CERT_MONETIZATION=false
55
# Stripe configs
66
REACT_APP_STRIPE_API_KEY=pk_test_rfcS49MHRVUKomQ9JgSH7Xqz
77
REACT_APP_STRIPE_API_VERSION=2020-08-27
8-
# not really used anywhere
9-
REACT_APP_STRIPE_ADMIN_TOKEN=
10-
REACT_APP_STRIPE_CUSTOMER_TOKEN=
118

129
# Vanilla Forums
1310
REACT_APP_VANILLA_ACCESS_TOKEN=va.JApNvUOx3549h20I6tnl1kOQDc75NDIp.0jG3dA.EE3gZgV

.environments/.env.prod

-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ REACT_APP_ENABLE_TCA_CERT_MONETIZATION=false
55
# Stripe configs
66
REACT_APP_STRIPE_API_KEY=pk_live_m3bCBVSfkfMOEp3unZFRsHXi
77
REACT_APP_STRIPE_API_VERSION=2020-08-27
8-
# not really used anywhere
9-
REACT_APP_STRIPE_ADMIN_TOKEN=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiYWRtaW5pc3RyYXRvciJdLCJpc3MiOiJodHRwczovL2FwaS50b3Bjb2Rlci1kZXYuY29tIiwiaGFuZGxlIjoidGVzdDEiLCJleHAiOjI1NjMwNzY2ODksInVzZXJJZCI6IjQwMDUxMzMzIiwiaWF0IjoxNDYzMDc2MDg5LCJlbWFpbCI6InRlc3RAdG9wY29kZXIuY29tIiwianRpIjoiYjMzYjc3Y2QtYjUyZS00MGZlLTgzN2UtYmViOGUwYWU2YTRhIn0.wKWUe0-SaiFVN-VR_-GwgFlvWaDkSbc8H55ktb9LAVw
10-
REACT_APP_STRIPE_CUSTOMER_TOKEN=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJ0ZXN0MSIsImV4cCI6MjU2MzA3NjY4OSwidXNlcklkIjoiNDAwNTEzMzMiLCJpYXQiOjE0NjMwNzYwODksImVtYWlsIjoidGVzdEB0b3Bjb2Rlci5jb20iLCJqdGkiOiJiMzNiNzdjZC1iNTJlLTQwZmUtODM3ZS1iZWI4ZTBhZTZhNGEifQ.jl6Lp_friVNwEP8nfsfmL-vrQFzOFp2IfM_HC7AwGcg
118

129
# Vanilla Forums
1310
REACT_APP_VANILLA_ACCESS_TOKEN=va.JApNvUOx3549h20I6tnl1kOQDc75NDIp.0jG3dA.EE3gZgV

.environments/.env.qa

-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ REACT_APP_ENABLE_TCA_CERT_MONETIZATION=false
55
# Stripe configs
66
REACT_APP_STRIPE_API_KEY=pk_test_rfcS49MHRVUKomQ9JgSH7Xqz
77
REACT_APP_STRIPE_API_VERSION=2020-08-27
8-
# not really used anywhere
9-
REACT_APP_STRIPE_ADMIN_TOKEN=
10-
REACT_APP_STRIPE_CUSTOMER_TOKEN=
118

129
# Vanilla Forums
1310
REACT_APP_VANILLA_ACCESS_TOKEN=va.JApNvUOx3549h20I6tnl1kOQDc75NDIp.0jG3dA.EE3gZgV

.storybook/main.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,15 @@ const config: StorybookConfig = {
3232
};
3333
}
3434

35-
return config;
35+
return {
36+
...config,
37+
plugins: config.plugins?.filter(plugin => {
38+
if (plugin.constructor.name === 'ESLintWebpackPlugin') {
39+
return false
40+
}
41+
return true
42+
}),
43+
};
3644
}
3745
};
3846
export default config;

.vscode/components.code-snippets

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
"interface ${1:ComponentName}Props {",
2727
"}",
2828
"",
29-
"const ${1:ComponentName}: FC<${1:ComponentName}Props> = (props: ${1:ComponentName}Props) => {",
29+
"const ${1:ComponentName}: FC<${1:ComponentName}Props> = props => {",
3030
"",
3131
" return (",
32-
" <div className={styles['wrap']}>",
32+
" <div className={styles.wrap}>",
3333
" </div>",
3434
" )",
3535
"}",

craco.config.js

+8
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ const BabelRcPlugin = require('@jackwilsdon/craco-use-babelrc');
55

66
const isProd = process.env.APPMODE === "production";
77

8+
function getModeName() {
9+
const index = process.argv.indexOf('--mode');
10+
return index === -1 ? '' : process.argv[index + 1] || ''
11+
}
12+
13+
console.log({buildMode: getModeName()});
14+
815
const localIdentName = isProd
916
? "[hash:base64:6]"
1017
: "[name]_[local]__[hash:base64:6]";
@@ -35,6 +42,7 @@ module.exports = {
3542
'@devCenter': resolve('src/apps/dev-center/src'),
3643
'@gamificationAdmin': resolve('src/apps/gamification-admin/src'),
3744
'@talentSearch': resolve('src/apps/talent-search/src'),
45+
'@profiles': resolve('src/apps/profiles/src'),
3846

3947
'@platform': resolve('src/apps/platform/src'),
4048
// aliases used in SCSS files

package.json

+8-3
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
"private": true,
55
"license": "ISC",
66
"scripts": {
7-
"dev": "craco start --mode ${REACT_APP_HOST_ENV:-dev}",
7+
"dev": "craco start --mode ${LOGICAL_ENV:-dev}",
88
"start": "bash start.sh",
9-
"build": "export CI=false && craco build --mode ${REACT_APP_HOST_ENV:-prod}",
10-
"build:dev": "craco build --mode ${REACT_APP_HOST_ENV:-dev}",
9+
"build": "export CI=false && craco build --mode ${LOGICAL_ENV:-prod}",
10+
"build:dev": "craco build --mode ${LOGICAL_ENV:-dev}",
1111
"demo": "npx http-server --port 443 -a 0.0.0.0 -S -C ./ssl/rootCA.crt -K ./ssl/rootCA.key -P https://local.topcoder-dev.com? --proxy-options.secure false ./build",
1212
"lint": "eslint -c ./src/.eslintrc.js 'src/**/*.{ts,tsx,js,jsx}'",
1313
"lint:fix": "yarn lint --fix",
@@ -23,6 +23,7 @@
2323
"dependencies": {
2424
"@datadog/browser-logs": "^4.21.2",
2525
"@heroicons/react": "^1.0.6",
26+
"@popperjs/core": "^2.11.8",
2627
"@sprig-technologies/sprig-browser": "^2.20.1",
2728
"@storybook/addon-actions": "^7.0.5",
2829
"@storybook/react": "^7.0.5",
@@ -32,6 +33,7 @@
3233
"apexcharts": "^3.36.0",
3334
"axios": "^1.1.2",
3435
"browser-cookies": "^1.2.0",
36+
"city-timezones": "^1.2.1",
3537
"classnames": "^2.3.2",
3638
"contentful": "^9.2.5",
3739
"country-calling-code": "0.0.3",
@@ -74,13 +76,15 @@
7476
"react-contenteditable": "^3.3.6",
7577
"react-css-super-themr": "^2.2.0",
7678
"react-date-range": "^1.1.3",
79+
"react-datepicker": "^4.14.1",
7780
"react-dom": "^18.2.0",
7881
"react-dropzone": "^11.3.2",
7982
"react-elastic-carousel": "^0.11.5",
8083
"react-gtm-module": "^2.0.11",
8184
"react-helmet": "^6.1.0",
8285
"react-html-parser": "^2.0.2",
8386
"react-markdown": "8.0.6",
87+
"react-popper": "^2.3.0",
8488
"react-redux": "^8.0.4",
8589
"react-redux-toastr": "^7.6.10",
8690
"react-responsive": "^9.0.0-beta.5",
@@ -149,6 +153,7 @@
149153
"@types/node": "^18.8.5",
150154
"@types/reach__router": "^1.3.11",
151155
"@types/react": "^18.0.21",
156+
"@types/react-datepicker": "^4.11.2",
152157
"@types/react-dom": "^18.0.6",
153158
"@types/react-gtm-module": "^2.0.1",
154159
"@types/react-helmet": "^6.1.6",

src/.eslintrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ module.exports = {
7171
parameter: true,
7272
memberVariableDeclaration: true,
7373
callSignature: true,
74-
variableDeclaration: true,
74+
variableDeclaration: false,
7575
arrayDestructuring: false,
7676
objectDestructuring: true,
7777
},
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const SPRIG_CES_SURVEY_ID = 'onAccountSettingsUpdate'

src/apps/accounts/src/config/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './constants'

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

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export * from './accounts-swr'
22
export * from './components'
33
export * from './assets'
4+
export * from './sprig-survey'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { sprigTriggerForUser } from '~/libs/shared'
2+
import { UserProfile } from '~/libs/core'
3+
4+
import { SPRIG_CES_SURVEY_ID } from '../config'
5+
6+
export function triggerSprigSurvey({ userId }: UserProfile): void {
7+
sprigTriggerForUser(SPRIG_CES_SURVEY_ID, userId)
8+
}

src/apps/accounts/src/settings/tabs/account/AccountTab.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { UserProfile, UserTraits } from '~/libs/core'
55
import { AccountRole } from './account-role'
66
import { SecuritySection } from './security'
77
import { UserAndPassword } from './user-and-pass'
8+
import { MemberAddress } from './address'
89
import styles from './AccountTab.module.scss'
910

1011
interface AccountTabProps {
@@ -20,6 +21,8 @@ const AccountTab: FC<AccountTabProps> = (props: AccountTabProps) => (
2021

2122
<UserAndPassword profile={props.profile} memberTraits={props.memberTraits} />
2223

24+
<MemberAddress profile={props.profile} />
25+
2326
<SecuritySection profile={props.profile} />
2427
</div>
2528
)

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

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +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'
56

67
import styles from './AccountRole.module.scss'
78

@@ -35,6 +36,7 @@ const AccountRole: FC<AccountRoleProps> = (props: AccountRoleProps) => {
3536
.then(() => {
3637
setMemberRole(newRole)
3738
setIsRoleChangeConfirmed(true)
39+
triggerSprigSurvey(props.profile)
3840
})
3941
.finally(() => {
4042
setIsUpdating(false)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
@import '@libs/ui/styles/includes';
2+
3+
.container {
4+
margin: $sp-8 0;
5+
6+
.content {
7+
display: grid;
8+
grid-template-columns: repeat(2, 1fr);
9+
margin-bottom: 0;
10+
11+
@include ltelg {
12+
grid-template-columns: 1fr;
13+
}
14+
15+
>p {
16+
max-width: 380px;
17+
}
18+
19+
.form {
20+
.formCTAs {
21+
margin-top: $sp-4;
22+
padding-top: $sp-4;
23+
border-top: 2px solid $black-10;
24+
}
25+
}
26+
}
27+
}

0 commit comments

Comments
 (0)