Skip to content

Commit 901729d

Browse files
authored
Merge pull request #605 from topcoder-platform/rc-3.1
v3.1 TCA April release
2 parents 24036ec + da415d5 commit 901729d

File tree

241 files changed

+4548
-2186
lines changed

Some content is hidden

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

241 files changed

+4548
-2186
lines changed

.circleci/config.yml

+16-16
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,13 @@ deploy_steps: &deploy_steps
129129
./master_deploy.sh -d CFRONT -e $DEPLOY_ENV -c $ENABLE_CACHE
130130
131131
jobs:
132-
# lint-dev:
133-
# <<: *defaults
134-
# environment:
135-
# DEPLOY_ENV: "DEV"
136-
# LOGICAL_ENV: "dev"
137-
# APPNAME: "platform-ui-mvp"
138-
# steps: *lint_steps
132+
lint-dev:
133+
<<: *defaults
134+
environment:
135+
DEPLOY_ENV: "DEV"
136+
LOGICAL_ENV: "dev"
137+
APPNAME: "platform-ui-mvp"
138+
steps: *lint_steps
139139

140140
# lint-prod:
141141
# <<: *defaults
@@ -144,7 +144,7 @@ jobs:
144144
# LOGICAL_ENV: "prod"
145145
# APPNAME: "platform-ui-mvp"
146146
# steps: *lint_steps
147-
147+
148148
build-dev:
149149
<<: *defaults
150150
environment:
@@ -160,7 +160,7 @@ jobs:
160160
LOGICAL_ENV: "prod"
161161
APPNAME: "platform-ui-mvp"
162162
steps: *build_steps
163-
163+
164164
test-dev:
165165
<<: *test_defaults
166166
environment:
@@ -192,12 +192,12 @@ workflows:
192192
version: 2
193193
build:
194194
jobs:
195-
# - lint-dev:
196-
# context : org-global
197-
# filters:
198-
# branches:
199-
# ignore:
200-
# - master
195+
- lint-dev:
196+
context : org-global
197+
filters:
198+
branches:
199+
ignore:
200+
- master
201201

202202
# - lint-prod:
203203
# context : org-global
@@ -224,7 +224,7 @@ workflows:
224224
context : org-global
225225
requires:
226226
- build-dev
227-
filters:
227+
filters:
228228
branches:
229229
only:
230230
- dev

.editorconfig

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
[*]
7+
indent_style = space
8+
indent_size = 4
9+
end_of_line = lf
10+
charset = utf-8
11+
trim_trailing_whitespace = true
12+
insert_final_newline = true

.gitignore

-3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,3 @@
2626
npm-debug.log*
2727
yarn-debug.log*
2828
yarn-error.log*
29-
30-
# Editors
31-
.editorconfig

package.json

+4-10
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"@sprig-technologies/sprig-browser": "^2.20.1",
2727
"@stripe/react-stripe-js": "1.13.0",
2828
"@stripe/stripe-js": "1.41.0",
29+
"@types/testing-library__jest-dom": "^5.14.5",
2930
"apexcharts": "^3.36.0",
3031
"axios": "^1.1.2",
3132
"browser-cookies": "^1.2.0",
@@ -52,6 +53,7 @@
5253
"react-dom": "^18.2.0",
5354
"react-elastic-carousel": "^0.11.5",
5455
"react-gtm-module": "^2.0.11",
56+
"react-helmet": "^6.1.0",
5557
"react-redux": "^8.0.4",
5658
"react-redux-toastr": "^7.6.10",
5759
"react-responsive-modal": "^6.2.0",
@@ -99,6 +101,7 @@
99101
"@types/react": "^18.0.21",
100102
"@types/react-dom": "^18.0.6",
101103
"@types/react-gtm-module": "^2.0.1",
104+
"@types/react-helmet": "^6.1.6",
102105
"@types/react-redux-toastr": "^7.6.2",
103106
"@types/react-router-dom": "^5.3.3",
104107
"@types/sanitize-html": "^2.6.2",
@@ -126,10 +129,10 @@
126129
"eslint-plugin-cypress": "^2.12.1",
127130
"eslint-plugin-import": "^2.25.3",
128131
"eslint-plugin-jsx-a11y": "^6.5.1",
129-
"eslint-plugin-no-null": "^1.0.2",
130132
"eslint-plugin-ordered-imports": "^0.6.0",
131133
"eslint-plugin-react": "^7.28.0",
132134
"eslint-plugin-react-hooks": "^4.3.0",
135+
"eslint-plugin-unicorn": "^46.0.0",
133136
"file-loader": "^6.2.0",
134137
"husky": "^8.0.1",
135138
"identity-obj-proxy": "^3.0.0",
@@ -154,15 +157,6 @@
154157
"webpack-dev-server": "^4.11.1",
155158
"webpack-merge": "^5.8.0"
156159
},
157-
"eslintConfig": {
158-
"extends": [
159-
"react-app",
160-
"react-app/jest"
161-
],
162-
"rules": {
163-
"no-useless-escape": 0
164-
}
165-
},
166160
"browserslist": {
167161
"production": [
168162
">0.2%",

src-ts/.eslintrc.js

+11-7
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ module.exports = {
2121
},
2222
plugins: [
2323
'@typescript-eslint',
24-
'no-null',
24+
'unicorn',
2525
'ordered-imports',
2626
'react',
2727
'react-hooks'
@@ -35,6 +35,7 @@ module.exports = {
3535
}
3636
},
3737
rules: {
38+
'@typescript-eslint/ban-ts-comment': 'off',
3839
'@typescript-eslint/ban-types': [
3940
'error',
4041
{
@@ -50,7 +51,7 @@ module.exports = {
5051
allowExpressions: true
5152
}
5253
],
53-
'@typescript-eslint/no-explicit-any': 'error',
54+
'@typescript-eslint/no-explicit-any': 'off',
5455
'@typescript-eslint/no-inferrable-types': 'off',
5556
'@typescript-eslint/no-shadow': 'error',
5657
'@typescript-eslint/no-unused-vars': 'error',
@@ -89,9 +90,10 @@ module.exports = {
8990
'error',
9091
'prefer-single'
9192
],
92-
'jsx-a11y/click-events-have-key-events': 'warn',
93-
'jsx-a11y/no-noninteractive-element-interactions': 'warn',
94-
'jsx-a11y/no-static-element-interactions': 'warn',
93+
'jsx-a11y/click-events-have-key-events': 'off',
94+
'jsx-a11y/no-noninteractive-element-interactions': 'off',
95+
'jsx-a11y/no-static-element-interactions': 'off',
96+
'jsx-a11y/label-has-associated-control': 'off',
9597
'jsx-a11y/tabindex-no-positive': [
9698
'warn'
9799
],
@@ -107,7 +109,6 @@ module.exports = {
107109
],
108110
'no-extra-boolean-cast': 'off',
109111
'no-nested-ternary': 'off',
110-
'no-null/no-null': 'error',
111112
'no-param-reassign': [
112113
'error',
113114
{
@@ -181,6 +182,7 @@ module.exports = {
181182
],
182183
},
183184
],
185+
'no-empty': ["error", { "allowEmptyCatch": true }],
184186
'padded-blocks': 'off',
185187
'padding-line-between-statements': [
186188
'error',
@@ -263,12 +265,14 @@ module.exports = {
263265
'react/jsx-props-no-spreading': [
264266
0
265267
],
268+
'react/no-danger': 'off',
266269
'react/react-in-jsx-scope': 'off',
267270
'react/require-default-props': 'off',
268271
'semi': [
269272
'error',
270273
'never',
271274
],
272-
'sort-keys': 'error'
275+
'sort-keys': 'error',
276+
'unicorn/no-null': 'error'
273277
},
274278
};

src-ts/config/environments/environment.default.config.ts

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export const EnvironmentConfigDefault: EnvironmentConfigModel = {
1313
FORUM_ACCESS_TOKEN: 'va.JApNvUOx3549h20I6tnl1kOQDc75NDIp.0jG3dA.EE3gZgV',
1414
FORUM_V2: 'https://vanilla.topcoder-dev.com/api/v2',
1515
V3: 'https://api.topcoder-dev.com/v3',
16+
V4: 'https://api.topcoder-dev.com/v4',
1617
V5: 'https://api.topcoder-dev.com/v5',
1718
},
1819
AUTH: {
@@ -23,6 +24,8 @@ export const EnvironmentConfigDefault: EnvironmentConfigModel = {
2324
PUBLIC_TOKEN: 'puba0825671e469d16f940c5a30dc738f11',
2425
SERVICE: 'platform-ui',
2526
},
27+
MEMBER_VERIFY_LOOKER: 3322,
28+
REACT_APP_ENABLE_TCA_CERT_MONETIZATION: process.env.REACT_APP_ENABLE_TCA_CERT_MONETIZATION as unknown as boolean || false,
2629
REAUTH_OFFSET: 55,
2730
SPRIG: {
2831
ENVIRONMENT_ID: 'bUcousVQ0-yF',

src-ts/config/environments/environment.prod.config.ts

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export const EnvironmentConfigProd: EnvironmentConfigModel = {
1515
FORUM_ACCESS_TOKEN: EnvironmentConfigDefault.API.FORUM_ACCESS_TOKEN,
1616
FORUM_V2: 'https://discussions.topcoder.com/api/v2',
1717
V3: 'https://api.topcoder.com/v3',
18+
V4: 'https://api.topcoder.com/v4',
1819
V5: 'https://api.topcoder.com/v5',
1920
},
2021
AUTH: {

src-ts/header/Header.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ const Header: FC = () => {
9090
navElementId,
9191
{
9292
handleNavigation: navigationHandler,
93+
integrations: {
94+
sprig: 'disable',
95+
},
9396
onReady() { setReady(true) },
9497
signIn() { window.location.href = authUrlLogin() },
9598
signOut() { window.location.href = authUrlLogout },

src-ts/lib/breadcrumb/Breadcrumb.module.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
padding: 0;
4141
@include ltesm {
4242
flex: 0 1 auto;
43-
&:first-child {
44-
flex: 1 0 auto;
43+
&:first-child:not(:global(.elipsis)) {
44+
flex: 1 0 0;
4545
}
4646
}
4747
a {

src-ts/lib/breadcrumb/Breadcrumb.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ const Breadcrumb: FC<BreadcrumbProps> = (props: BreadcrumbProps) => {
2828
<BreadcrumbItem
2929
index={index + 1}
3030
item={item}
31+
// eslint-disable-next-line react/no-array-index-key
3132
key={index}
3233
/>
3334
))
@@ -63,6 +64,7 @@ const Breadcrumb: FC<BreadcrumbProps> = (props: BreadcrumbProps) => {
6364
<BreadcrumbItem
6465
index={index + 1}
6566
item={item}
67+
// eslint-disable-next-line react/no-array-index-key
6668
key={index}
6769
/>
6870
))}

src-ts/lib/breadcrumb/breadcrumb-item/BreadcrumbItem.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { FC } from 'react'
22
import { Link } from 'react-router-dom'
3+
import classNames from 'classnames'
34

45
import styles from '../Breadcrumb.module.scss'
56

@@ -19,10 +20,11 @@ const BreadcrumbItem: FC<BreadcrumbItemProps> = (props: BreadcrumbItemProps) =>
1920
return (
2021
<li
2122
key={props.index}
22-
onClick={() => onClick()}
23+
onClick={onClick}
24+
className={props.item.isElipsis ? 'elipsis' : ''}
2325
>
2426
<Link
25-
className={props.item.isElipsis && styles.elipsis}
27+
className={classNames(props.item.isElipsis && styles.elipsis)}
2628
to={props.item.url}
2729
>
2830
{props.item.name}

src-ts/lib/button/Button.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export interface ButtonProps {
2424
readonly onClick?: (event?: any) => void
2525
readonly rel?: string
2626
readonly route?: string
27+
readonly routeState?: Record<string, any>
2728
readonly size?: ButtonSize
2829
readonly tabIndex?: number
2930
readonly target?: string
@@ -70,6 +71,7 @@ const Button: FC<ButtonProps> = (props: ButtonProps) => {
7071
tabIndex={props.tabIndex}
7172
title={props.title}
7273
to={props.route}
74+
state={props.routeState}
7375
>
7476
{content}
7577
</Link>

src-ts/lib/contact-support-form/ContactSupportForm.tsx

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Dispatch, FC, SetStateAction, useCallback, useContext, useEffect, useState } from 'react'
22

33
import { Form, FormDefinition, formGetInputModel, FormInputModel } from '../form'
4+
import { FormValue } from '../form/form-functions'
45
import { LoadingSpinner } from '../loading-spinner'
56
import { profileContext, ProfileContextData } from '../profile-provider'
67

@@ -27,13 +28,13 @@ const ContactSupportForm: FC<ContactSupportFormProps> = (props: ContactSupportFo
2728

2829
useEffect(() => {
2930
if (!loading && saveOnSuccess) {
30-
props.onSave()
31+
props.onSave.call(undefined)
3132
}
3233
}, [loading, saveOnSuccess, props.onSave])
3334

34-
const generateRequest: (inputs: ReadonlyArray<FormInputModel>) => void = useCallback((
35+
const generateRequest: (inputs: ReadonlyArray<FormInputModel>) => FormValue = useCallback((
3536
inputs: ReadonlyArray<FormInputModel>,
36-
): ContactSupportRequest => {
37+
): FormValue => {
3738
const firstName: string
3839
= formGetInputModel(inputs, ContactSupportFormField.first).value as string
3940
const lastName: string
@@ -50,12 +51,12 @@ const ContactSupportForm: FC<ContactSupportFormProps> = (props: ContactSupportFo
5051
lastName,
5152
question,
5253
}
53-
}, [props.workId])
54+
}, [props.isSelfService, props.workId])
5455

55-
const saveAsync: (request: ContactSupportRequest) => Promise<void>
56-
= useCallback(async (request: ContactSupportRequest): Promise<void> => {
56+
const saveAsync: (request: FormValue) => Promise<void>
57+
= useCallback(async (request: FormValue): Promise<void> => {
5758
setLoading(true)
58-
return contactSupportSubmitRequestAsync(request)
59+
return contactSupportSubmitRequestAsync(request as unknown as ContactSupportRequest)
5960
.then(() => {
6061
setSaveOnSuccess(true)
6162
})
@@ -92,7 +93,7 @@ const ContactSupportForm: FC<ContactSupportFormProps> = (props: ContactSupportFo
9293

9394
<Form
9495
formDef={props.formDef}
95-
formValues={profile}
96+
formValues={profile as unknown as FormValue}
9697
requestGenerator={generateRequest}
9798
save={saveAsync}
9899
/>

0 commit comments

Comments
 (0)