Skip to content

Commit 7b5886f

Browse files
authored
Merge pull request #1201 from topcoder-platform/pm-1503_2
fix(PM-1503): QA feedbacks in view scorecard page
2 parents 7bef943 + e960d77 commit 7b5886f

File tree

7 files changed

+31
-16
lines changed

7 files changed

+31
-16
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ workflows:
223223
- CORE-635
224224
- feat/review
225225
- feat/system-admin
226-
- pm-1365_1
226+
- pm-1503_2
227227

228228
- deployQa:
229229
context: org-global

src/apps/review/src/lib/hooks/useFetchScorecard.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { toast } from 'react-toastify'
12
import useSWR, { SWRResponse } from 'swr'
23

34
import { EnvironmentConfig } from '~/config'
@@ -21,6 +22,11 @@ export function useFetchScorecard(id: string | undefined): ScorecardResponse {
2122
// eslint-disable-next-line unicorn/no-null
2223
id ? `${baseUrl}/scorecards/${id}` : null,
2324
fetcher,
25+
{
26+
onError: err => {
27+
toast.error(err.message)
28+
},
29+
},
2430
)
2531

2632
return {

src/apps/review/src/pages/scorecards/ViewScorecardPage/ScorecardDetails/ScorecardDetails.module.scss

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@import '@libs/ui/styles/includes';
2+
13
.container {
24
display: flex;
35
flex-direction: row;
@@ -50,4 +52,10 @@
5052
flex-direction: column;
5153
}
5254
}
53-
}
55+
}
56+
57+
@media (max-width: #{$lg-max}) {
58+
.container {
59+
flex-direction: column;
60+
}
61+
}

src/apps/review/src/pages/scorecards/ViewScorecardPage/ScorecardGroups/ScorecardGroups.module.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737
.group {
3838
.heading {
3939
.groupInfo {
40-
flex-direction: column;
40+
flex-direction: row;
4141
.name {
42-
margin-bottom: 8px;
42+
margin-bottom: 0px;
4343
}
4444
}
4545
}

src/apps/review/src/pages/scorecards/ViewScorecardPage/ScorecardSections/ScorecardSections.module.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,15 @@
8080
.section {
8181
.heading {
8282
.sectionInfo {
83-
flex-direction: column;
83+
flex-direction: row;
8484
.name {
85-
margin-bottom: 4px;
85+
margin-bottom: 0px;
8686
}
8787
}
8888
}
8989
.questions {
9090
.question {
91-
flex-direction: column;
91+
flex-direction: row;
9292
.left {
9393
.detailItemsWrapper {
9494
.detailItem {

src/apps/review/src/pages/scorecards/ViewScorecardPage/ViewScorecardPage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ const ViewScorecardPage: FC = () => {
2020
const { profile }: ProfileContextData = useContext(profileContext)
2121
const isAdmin = profile?.roles.includes(UserRole.administrator)
2222
const breadCrumb = useMemo(
23-
() => [{ index: 1, label: 'Scorecards', path: '/review/scorecard' }, { index: 2, label: 'Scorecards Details' }],
23+
() => [{ index: 1, label: 'Scorecards', path: '/scorecard' }, { index: 2, label: 'Scorecards Details' }],
2424
[],
2525
)
2626

2727
const scorecardQuery = useFetchScorecard(scorecardId)
2828

2929
return (
3030
<PageWrapper
31-
pageTitle='Software General Review Scorecard'
31+
pageTitle={(scorecardQuery.scorecard && scorecardQuery.scorecard.name) || ''}
3232
breadCrumb={breadCrumb}
3333
rightHeader={isAdmin && (
3434
<LinkButton

src/apps/review/src/review-app.routes.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ export const reviewRoutes: ReadonlyArray<PlatformRoute> = [
101101
route: activeReviewAssigmentsRouteId,
102102
},
103103
{
104-
authRequired: true,
105104
children: [
106105
{
107106
authRequired: true,
@@ -110,21 +109,23 @@ export const reviewRoutes: ReadonlyArray<PlatformRoute> = [
110109
route: '',
111110
},
112111
{
113-
authRequired: false,
114-
element: <ViewScorecardPage />,
115-
id: 'view-scorecard-page',
116-
route: ':scorecardId',
117-
},
118-
{
112+
authRequired: true,
119113
element: <EditScorecardPage />,
120114
id: 'edit-scorecard-page',
121115
route: ':scorecardId/edit',
122116
},
123117
{
118+
authRequired: true,
124119
element: <EditScorecardPage />,
125120
id: 'new-scorecard-page',
126121
route: 'new',
127122
},
123+
{
124+
authRequired: false,
125+
element: <ViewScorecardPage />,
126+
id: 'view-scorecard-page',
127+
route: ':scorecardId',
128+
},
128129

129130
],
130131
element: <ScorecardsContainer />,

0 commit comments

Comments
 (0)