Skip to content

Commit 1ae2533

Browse files
committed
Merge remote-tracking branch 'origin/feat/review' into PM-1504_edit-create-scorecard
2 parents c50842f + 95cf7a2 commit 1ae2533

File tree

15 files changed

+90
-41
lines changed

15 files changed

+90
-41
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/components/ScorecardsFilter/ScorecardsFilter.module.scss

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,19 @@
110110
font-weight: 700;
111111
}
112112

113+
:global(.input-el) {
114+
margin-bottom: 0;
115+
padding: 3px 16px 3px 16px;
116+
}
117+
118+
:global(.input-wrapper) {
119+
height: 38px;
120+
}
121+
122+
:global(.btn-size-lg) {
123+
padding: 6px 24px;
124+
}
125+
113126
}
114127

115128
@media (max-width: 768px) {
@@ -161,16 +174,3 @@
161174
}
162175
}
163176

164-
:global(.input-el) {
165-
margin-bottom: 0;
166-
padding: 3px 16px 3px 16px;
167-
}
168-
169-
:global(.input-wrapper) {
170-
height: 38px;
171-
}
172-
173-
:global(.btn-size-lg) {
174-
padding: 6px 24px;
175-
}
176-

src/apps/review/src/lib/components/TableScorecards/TableScorecards.module.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
display: flex;
1212
gap: 4px;
1313
align-items: center;
14+
cursor: pointer;
15+
16+
&:hover {
17+
text-decoration: underline;
18+
}
1419

1520
svg {
1621
width: 20px;

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { toast } from 'react-toastify'
12
import { sortBy } from 'lodash'
23
import useSWR, { SWRResponse } from 'swr'
34

@@ -14,14 +15,25 @@ interface ScorecardResponse {
1415
isValidating: boolean
1516
}
1617

17-
export function useFetchScorecard(id: string | undefined): ScorecardResponse {
18+
export function useFetchScorecard(id: string | undefined, shouldRetry: boolean): ScorecardResponse {
1819

1920
const fetcher = (url: string): Promise<Scorecard> => xhrGetAsync<Scorecard>(url)
2021

2122
const { data, error, isValidating }: SWRResponse<Scorecard, any> = useSWR<Scorecard>(
2223
// eslint-disable-next-line unicorn/no-null
2324
id ? `${baseUrl}/scorecards/${id}` : null,
2425
fetcher,
26+
{
27+
...(shouldRetry
28+
? {}
29+
: {
30+
errorRetryCount: 0,
31+
shouldRetryOnError: false,
32+
}),
33+
onError: err => {
34+
toast.error(err.message)
35+
},
36+
},
2537
)
2638

2739
return {

src/apps/review/src/lib/models/ScorecardQuestion.model.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ export interface ScorecardQuestion {
99
weight: number
1010
scaleMin: number
1111
scaleMax: number
12+
requiresUpload: boolean
1213
}

src/apps/review/src/mock-datas/MockScorecard.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export const MockScorecard: ScorecardInfo = {
3333
'Was the pricing adequate for the contest?',
3434
guidelines: mockGuidelines,
3535
id: '4',
36+
requiresUpload: true,
3637
scaleMax: 9,
3738
scaleMin: 1,
3839
type: 'YES_NO',
@@ -43,6 +44,7 @@ export const MockScorecard: ScorecardInfo = {
4344
'Was the timeline adequate for the contest?',
4445
guidelines: mockGuidelines,
4546
id: '5',
47+
requiresUpload: true,
4648
scaleMax: 9,
4749
scaleMin: 1,
4850
type: 'YES_NO',
@@ -52,6 +54,7 @@ export const MockScorecard: ScorecardInfo = {
5254
description: 'Were the specifications clear?',
5355
guidelines: mockGuidelines,
5456
id: '6',
57+
requiresUpload: true,
5558
scaleMax: 9,
5659
scaleMin: 1,
5760
type: 'SCALE',
@@ -61,6 +64,7 @@ export const MockScorecard: ScorecardInfo = {
6164
description: 'Here comes another question',
6265
guidelines: mockGuidelines,
6366
id: '7',
67+
requiresUpload: true,
6468
scaleMax: 9,
6569
scaleMin: 1,
6670
type: 'SCALE',
@@ -79,6 +83,7 @@ export const MockScorecard: ScorecardInfo = {
7983
'Have all major specification requirements been met?',
8084
guidelines: mockGuidelines,
8185
id: '9',
86+
requiresUpload: true,
8287
scaleMax: 9,
8388
scaleMin: 1,
8489
type: 'SCALE',
@@ -89,6 +94,7 @@ export const MockScorecard: ScorecardInfo = {
8994
'Have all minor specification requirements been met?',
9095
guidelines: mockGuidelines,
9196
id: '10',
97+
requiresUpload: true,
9298
scaleMax: 9,
9399
scaleMin: 1,
94100
type: 'SCALE',
@@ -115,6 +121,7 @@ export const MockScorecard: ScorecardInfo = {
115121
'This is the first question of this section',
116122
guidelines: mockGuidelines,
117123
id: '13',
124+
requiresUpload: true,
118125
scaleMax: 9,
119126
scaleMin: 1,
120127
type: 'SCALE',
@@ -125,6 +132,7 @@ export const MockScorecard: ScorecardInfo = {
125132
'This is the second question of this section',
126133
guidelines: mockGuidelines,
127134
id: '14',
135+
requiresUpload: true,
128136
scaleMax: 9,
129137
scaleMin: 1,
130138
type: 'SCALE',
@@ -143,6 +151,7 @@ export const MockScorecard: ScorecardInfo = {
143151
'Does the code have proper code coverage?',
144152
guidelines: mockGuidelines,
145153
id: '16',
154+
requiresUpload: true,
146155
scaleMax: 9,
147156
scaleMin: 1,
148157
type: 'SCALE',
@@ -154,6 +163,7 @@ export const MockScorecard: ScorecardInfo = {
154163
'Do all test cases provided, pass, given any test data or setup for the current application?',
155164
guidelines: mockGuidelines,
156165
id: '17',
166+
requiresUpload: true,
157167
scaleMax: 9,
158168
scaleMin: 1,
159169
type: 'SCALE',

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const EditScorecardPage: FC = () => {
2323
const [isSaving, setSaving] = useState(false)
2424
const params = useParams()
2525
const isEditMode = !!params.scorecardId
26-
const scorecardQuery = useFetchScorecard(params.scorecardId)
26+
const scorecardQuery = useFetchScorecard(params.scorecardId, false)
2727
const title = useMemo(() => (
2828
`${isEditMode ? 'Edit' : 'Create'} Scorecard`
2929
), [isEditMode])

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export const ScorecardsListPage: FC<{}> = () => {
6767
}
6868

6969
toast.success('Scorecard cloned successfully!')
70-
navigate(`${cloned.id}/details`)
70+
navigate(`${cloned.id}/edit`)
7171
} catch (error) {
7272
toast.error('Failed to clone scorecard!')
7373
console.error('Failed to clone scorecard:', error)

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: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,12 @@
3737
.group {
3838
.heading {
3939
.groupInfo {
40-
flex-direction: column;
40+
flex-direction: row;
41+
.weight {
42+
text-align: end;
43+
}
4144
.name {
42-
margin-bottom: 8px;
45+
margin-bottom: 0px;
4346
}
4447
}
4548
}

0 commit comments

Comments
 (0)