)
@@ -26,7 +33,7 @@ const CopilotField = ({ copilots, challenge, onUpdateOthers, readOnly }) => {
<>
-
+
{
@@ -49,7 +56,7 @@ const CopilotField = ({ copilots, challenge, onUpdateOthers, readOnly }) => {
CopilotField.defaultProps = {
copilots: [],
- onUpdateOthers: () => {},
+ onUpdateOthers: () => { },
readOnly: false
}
@@ -57,7 +64,8 @@ CopilotField.propTypes = {
copilots: PropTypes.arrayOf(PropTypes.shape()).isRequired,
challenge: PropTypes.shape().isRequired,
onUpdateOthers: PropTypes.func,
- readOnly: PropTypes.bool
+ readOnly: PropTypes.bool,
+ assignYourselfCopilit: PropTypes.func.isRequired
}
export default CopilotField
diff --git a/src/components/ChallengeEditor/index.js b/src/components/ChallengeEditor/index.js
index ae5d8cbd..5d2958b8 100644
--- a/src/components/ChallengeEditor/index.js
+++ b/src/components/ChallengeEditor/index.js
@@ -181,7 +181,7 @@ class ChallengeEditor extends Component {
}
}
- async resetChallengeData (setState = () => {}) {
+ async resetChallengeData (setState = () => { }) {
const { isNew, challengeDetails, metadata, attachments, challengeId, assignedMemberDetails } = this.props
if (
challengeDetails &&
@@ -214,11 +214,13 @@ class ChallengeEditor extends Component {
setState({
challenge: challengeDetail,
assignedMemberDetails,
- draftChallenge: { data: {
- ..._.cloneDeep(challengeDetails),
- copilot: challengeData.copilot,
- reviewer: challengeData.reviewer
- } },
+ draftChallenge: {
+ data: {
+ ..._.cloneDeep(challengeDetails),
+ copilot: challengeData.copilot,
+ reviewer: challengeData.reviewer
+ }
+ },
isLoading: false,
isOpenAdvanceSettings,
currentTemplate
@@ -506,7 +508,7 @@ class ChallengeEditor extends Component {
if (fileTypesMetadataIndex > -1) {
fileTypesMetadata = { ...newChallenge.metadata[fileTypesMetadataIndex] }
newChallenge.metadata[fileTypesMetadataIndex] = fileTypesMetadata
- // if not yet, create an empty record in metadata
+ // if not yet, create an empty record in metadata
} else {
fileTypesMetadata = { name: 'fileTypes', value: '[]' }
newChallenge.metadata.push(fileTypesMetadata)
@@ -1038,7 +1040,8 @@ class ChallengeEditor extends Component {
newChallenge.phases = _.cloneDeep(draftChallenge.data.phases)
this.setState({
draftChallenge,
- challenge: newChallenge })
+ challenge: newChallenge
+ })
} else {
this.setState({ draftChallenge })
}
@@ -1065,7 +1068,7 @@ class ChallengeEditor extends Component {
return challengeId
}
- async updateAllChallengeInfo (status, cb = () => {}) {
+ async updateAllChallengeInfo (status, cb = () => { }) {
const { updateChallengeDetails, assignedMemberDetails: oldAssignedMember, projectDetail } = this.props
if (this.state.isSaving) return
this.setState({ isSaving: true }, async () => {
@@ -1095,11 +1098,13 @@ class ChallengeEditor extends Component {
const draftChallenge = { data: action.challengeDetails }
draftChallenge.data.copilot = copilot
draftChallenge.data.reviewer = reviewer
- this.setState({ isLaunch: true,
+ this.setState({
+ isLaunch: true,
isConfirm: newChallenge.id,
draftChallenge,
challenge: newChallenge,
- isSaving: false }, cb)
+ isSaving: false
+ }, cb)
} catch (e) {
const error = this.formatResponseError(e) || `Unable to update the challenge to status ${status}`
this.setState({ isSaving: false, error }, cb)
@@ -1353,7 +1358,7 @@ class ChallengeEditor extends Component {
/>
)
- // if some information for closing task is missing, ask to complete it
+ // if some information for closing task is missing, ask to complete it
} else {
const formattedErrors = validationErrors.length === 1 ? validationErrors[0] : (
validationErrors.slice(0, -1).join(', ') + ' and ' + validationErrors[validationErrors.length - 1]
@@ -1410,7 +1415,7 @@ class ChallengeEditor extends Component {
*/}
- { !this.state.hasValidationErrors ? (
+ {!this.state.hasValidationErrors ? (
) : (
@@ -1468,11 +1473,11 @@ class ChallengeEditor extends Component {
{projectDetail.version === 'v4' &&
}
- { useTask && (
) }
+ {useTask && (
)}
{showDesignChallengeWarningModel && designChallengeModal}
- { errorContainer }
- { actionButtons }
+ {errorContainer}
+ {actionButtons}
) : (