Skip to content

Commit 8ac7844

Browse files
committed
Merge branch 'dev' of github.com:topcoder-platform/platform-ui into dev
2 parents 7ff7622 + d3339ae commit 8ac7844

File tree

8 files changed

+26
-23
lines changed

8 files changed

+26
-23
lines changed

.circleci/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ workflows:
258258
only:
259259
- dev
260260
- LVT-256
261+
- CORE-635
261262

262263
- deployQa:
263264
context: org-global

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* *

src/apps/learn/src/course-completed/course-view/CourseView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const CourseView: FC<CourseViewProps> = (props: CourseViewProps) => (
5454
size='md'
5555
primary
5656
label='Start a new course'
57-
to={rootRoute}
57+
to={rootRoute || '/'}
5858
/>
5959
</div>
6060
<p className='body-main'>

src/apps/profiles/src/member-profile/profile-header/ProfileHeader.tsx

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,9 @@ import {
88
UserProfile,
99
} from '~/libs/core'
1010
import { ProfilePicture, useCheckIsMobile } from '~/libs/shared'
11-
import { Button } from '~/libs/ui'
1211

1312
import { AddButton, EditMemberPropertyBtn } from '../../components'
1413
import { EDIT_MODE_QUERY_PARAM, profileEditModes } from '../../config'
15-
import { MemberProfileContextValue, useMemberProfileContext } from '../MemberProfile.context'
1614

1715
import { OpenForGigs } from './OpenForGigs'
1816
import { ModifyMemberNameModal } from './ModifyMemberNameModal'
@@ -45,8 +43,6 @@ const ProfileHeader: FC<ProfileHeaderProps> = (props: ProfileHeaderProps) => {
4543
const [isHiringFormOpen, setIsHiringFormOpen]: [boolean, Dispatch<SetStateAction<boolean>>]
4644
= useState<boolean>(false)
4745

48-
const { isTalentSearch }: MemberProfileContextValue = useMemberProfileContext()
49-
5046
const { state }: Location = useLocation()
5147

5248
const searchedSkills: string[] = useMemo(
@@ -179,18 +175,6 @@ const ProfileHeader: FC<ProfileHeaderProps> = (props: ProfileHeaderProps) => {
179175
.format('MMM YYYY')}
180176
</p>
181177
</div>
182-
{
183-
!canEdit && isTalentSearch ? (
184-
<div className={styles.hiringClickWrap}>
185-
<Button
186-
label='Hire Topcoder Talent'
187-
primary
188-
size='lg'
189-
onClick={handleStartHiringToggle}
190-
/>
191-
</div>
192-
) : undefined
193-
}
194178
</div>
195179

196180
{

src/apps/wallet-admin/src/home/tabs/payments/PaymentsTab.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ const ListView: FC<ListViewProps> = (props: ListViewProps) => {
219219
return confirmFlow?.content
220220
}, [confirmFlow])
221221

222+
// eslint-disable-next-line complexity
222223
const updatePayment = async (paymentId: string): Promise<void> => {
223224
const currentEditState = editStateRef.current
224225
// Send to server only the fields that have changed
@@ -259,10 +260,15 @@ const ListView: FC<ListViewProps> = (props: ListViewProps) => {
259260

260261
toast.success('Updating payment', { position: toast.POSITION.BOTTOM_RIGHT })
261262
try {
262-
const udpateMessage = await editPayment(updates)
263-
toast.success(udpateMessage, { position: toast.POSITION.BOTTOM_RIGHT })
264-
} catch (err) {
265-
toast.error('Failed to update payment', { position: toast.POSITION.BOTTOM_RIGHT })
263+
const updateMessage = await editPayment(updates)
264+
toast.success(updateMessage, { position: toast.POSITION.BOTTOM_RIGHT })
265+
} catch (err:any) {
266+
if (err?.message) {
267+
toast.error(err?.message, { position: toast.POSITION.BOTTOM_RIGHT })
268+
} else {
269+
toast.error('Failed to update payment', { position: toast.POSITION.BOTTOM_RIGHT })
270+
}
271+
266272
return
267273
}
268274

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
import { ApiError } from './ApiError'
2+
13
export default interface ApiResponse<T> {
24
status: 'success' | 'error'
35
data: T
6+
error: ApiError
47
}

src/apps/wallet-admin/src/lib/services/wallet.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ export async function editPayment(updates: {
8383
const response = await xhrPatchAsync<string, ApiResponse<string>>(url, body)
8484

8585
if (response.status === 'error') {
86+
if (response.error && response.error.message) {
87+
throw new Error(response.error.message)
88+
}
89+
8690
throw new Error('Error editing payment')
8791
}
8892

src/libs/core/lib/xhr/xhr-functions/xhr.functions.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,14 @@ function interceptError(instance: AxiosInstance): void {
172172
config => config,
173173
(error: any) => {
174174
// if there is server error message, then return it inside `message` property of error
175-
error.message = error?.response?.data?.message || error.message
175+
if (error?.response?.data?.message) {
176+
error.message = error?.response?.data?.message
177+
} else if (error?.response?.data?.error?.message) {
178+
error.message = error?.response?.data?.error?.message
179+
}
180+
176181
// if there is server errors data, then return it inside `errors` property of error
177182
error.errors = error?.response?.data?.errors
178-
179183
return Promise.reject(error)
180184
},
181185
)

0 commit comments

Comments
 (0)