-
Notifications
You must be signed in to change notification settings - Fork 51
Feat/challenge reviewer v6 #1673
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
abdc179
114986d
5f37507
d56a1ce
866d9c8
ca279a8
5fe8b9f
445377b
2cf363f
e05594d
9b17d61
82aac16
c0799c2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,9 @@ import { | |
createChallenge as createChallengeAPI, | ||
createResource as createResourceAPI, | ||
deleteResource as deleteResourceAPI, | ||
updateChallengeSkillsApi | ||
updateChallengeSkillsApi, | ||
fetchDefaultReviewers, | ||
fetchScorecards | ||
} from '../services/challenges' | ||
import { searchProfilesByUserIds } from '../services/user' | ||
import { | ||
|
@@ -765,3 +767,53 @@ export function updateChallengeSkills (challengeId, skills) { | |
} | ||
} | ||
} | ||
|
||
/** | ||
* Load scorecards | ||
* @param {Object} filters filters for scorecards | ||
*/ | ||
export function loadScorecards (filters = {}) { | ||
return async (dispatch) => { | ||
try { | ||
const scorecards = await fetchScorecards(filters) | ||
dispatch({ | ||
type: LOAD_CHALLENGE_METADATA_SUCCESS, | ||
metadataKey: 'scorecards', | ||
metadataValue: scorecards.scoreCards || [] | ||
}) | ||
} catch (error) { | ||
console.error('Error loading scorecards:', error) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @vas3a Do I need to remove console.error ? |
||
// Return empty array on error to maintain consistency | ||
dispatch({ | ||
type: LOAD_CHALLENGE_METADATA_SUCCESS, | ||
metadataKey: 'scorecards', | ||
metadataValue: [] | ||
}) | ||
} | ||
} | ||
} | ||
|
||
/** | ||
* Load default reviewers | ||
* @param {Object} filters filters for default reviewers | ||
*/ | ||
export function loadDefaultReviewers (filters = {}) { | ||
return async (dispatch) => { | ||
try { | ||
const defaultReviewers = await fetchDefaultReviewers(filters) | ||
dispatch({ | ||
type: LOAD_CHALLENGE_METADATA_SUCCESS, | ||
metadataKey: 'defaultReviewers', | ||
metadataValue: defaultReviewers | ||
}) | ||
} catch (error) { | ||
console.error('Error loading default reviewers:', error) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using |
||
// Return empty array on error to maintain consistency | ||
dispatch({ | ||
type: LOAD_CHALLENGE_METADATA_SUCCESS, | ||
metadataKey: 'defaultReviewers', | ||
metadataValue: [] | ||
}) | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,230 @@ | ||
@import '../../../styles/includes'; | ||
|
||
.row { | ||
box-sizing: border-box; | ||
display: flex; | ||
flex-direction: row; | ||
margin: 30px 30px 0 30px; | ||
align-content: space-between; | ||
justify-content: flex-start; | ||
|
||
.field { | ||
@include upto-sm { | ||
display: block; | ||
padding-bottom: 10px; | ||
} | ||
|
||
label { | ||
@include roboto-bold(); | ||
font-size: 16px; | ||
line-height: 19px; | ||
font-weight: 500; | ||
color: $tc-gray-80; | ||
} | ||
|
||
&.col1 { | ||
max-width: 185px; | ||
min-width: 185px; | ||
margin-right: 14px; | ||
white-space: nowrap; | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
&.col2 { | ||
align-self: flex-end; | ||
margin-bottom: auto; | ||
margin-top: auto; | ||
display: flex; | ||
flex-direction: column; | ||
width: 600px; | ||
} | ||
} | ||
} | ||
|
||
.description { | ||
color: #666; | ||
margin-bottom: 20px; | ||
font-size: 14px; | ||
line-height: 1.4; | ||
} | ||
|
||
.noReviewers { | ||
text-align: center; | ||
padding: 30px; | ||
color: #999; | ||
font-style: italic; | ||
background-color: #f5f5f5; | ||
border-radius: 4px; | ||
margin-bottom: 20px; | ||
} | ||
|
||
.defaultReviewerNote { | ||
margin-top: 20px; | ||
padding: 15px; | ||
background-color: #e3f2fd; | ||
border: 1px solid #bbdefb; | ||
border-radius: 4px; | ||
} | ||
|
||
.defaultReviewerNote p { | ||
margin: 0 0 15px 0; | ||
color: #1976d2; | ||
font-style: normal; | ||
} | ||
|
||
.reviewerForm { | ||
background-color: white; | ||
border: 1px solid #ddd; | ||
border-radius: 4px; | ||
padding: 20px; | ||
margin-bottom: 20px; | ||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); | ||
} | ||
|
||
.reviewerHeader { | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
margin-bottom: 20px; | ||
padding-bottom: 10px; | ||
border-bottom: 1px solid #eee; | ||
} | ||
|
||
.reviewerHeader h4 { | ||
margin: 0; | ||
color: #333; | ||
font-size: 16px; | ||
font-weight: 600; | ||
} | ||
|
||
.formRow { | ||
display: flex; | ||
flex-wrap: wrap; | ||
gap: 20px; | ||
margin-bottom: 15px; | ||
} | ||
|
||
.formGroup { | ||
flex: 1; | ||
min-width: 200px; | ||
} | ||
|
||
.formGroup label { | ||
display: block; | ||
margin-bottom: 5px; | ||
font-weight: 500; | ||
color: #555; | ||
font-size: 14px; | ||
} | ||
|
||
.formGroup input, | ||
.formGroup select { | ||
width: 100%; | ||
padding: 8px 12px; | ||
border: 1px solid #ccc; | ||
border-radius: 4px; | ||
font-size: 14px; | ||
background-color: white; | ||
} | ||
|
||
.formGroup input:focus, | ||
.formGroup select:focus { | ||
outline: none; | ||
border-color: #0066cc; | ||
box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.2); | ||
} | ||
|
||
.addButton { | ||
text-align: center; | ||
margin-top: 20px; | ||
} | ||
|
||
.summary { | ||
background-color: #f8f9fa; | ||
border: 1px solid #dee2e6; | ||
border-radius: 4px; | ||
padding: 20px; | ||
margin: 20px 0; | ||
} | ||
|
||
.summary h4 { | ||
margin: 0 0 15px 0; | ||
color: #333; | ||
font-size: 16px; | ||
font-weight: 600; | ||
} | ||
|
||
.summaryRow { | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
padding: 8px 0; | ||
border-bottom: 1px solid #eee; | ||
} | ||
|
||
.summaryRow:last-child { | ||
border-bottom: none; | ||
font-weight: 600; | ||
color: #0066cc; | ||
} | ||
|
||
.summaryRow span:first-child { | ||
color: #666; | ||
} | ||
|
||
.summaryRow span:last-child { | ||
font-weight: 500; | ||
} | ||
|
||
.loading { | ||
text-align: center; | ||
padding: 40px; | ||
color: #666; | ||
font-style: italic; | ||
} | ||
|
||
.error { | ||
color: $tc-red; | ||
rishabhtc marked this conversation as resolved.
Show resolved
Hide resolved
|
||
background-color: #ffebee; | ||
padding: 15px; | ||
border-radius: 4px; | ||
border: 1px solid #ffcdd2; | ||
margin-bottom: 20px; | ||
} | ||
|
||
.validationErrors { | ||
background-color: #fff3cd; | ||
border: 1px solid #ffeaa7; | ||
border-radius: 4px; | ||
padding: 10px; | ||
margin-bottom: 15px; | ||
} | ||
|
||
.validationError { | ||
color: #856404; | ||
font-size: 13px; | ||
margin-bottom: 5px; | ||
} | ||
|
||
.validationError:last-child { | ||
margin-bottom: 0; | ||
} | ||
|
||
// Responsive adjustments | ||
@media (max-width: 768px) { | ||
.formRow { | ||
flex-direction: column; | ||
gap: 15px; | ||
} | ||
|
||
.formGroup { | ||
min-width: 100%; | ||
} | ||
|
||
.reviewerHeader { | ||
flex-direction: column; | ||
align-items: flex-start; | ||
gap: 10px; | ||
} | ||
} |
Uh oh!
There was an error while loading. Please reload this page.