Skip to content

Commit f68c31a

Browse files
committed
TCA-299 - handle lint fixes
1 parent ab3b7d0 commit f68c31a

File tree

12 files changed

+41
-40
lines changed

12 files changed

+41
-40
lines changed

client/src/components/formHelpers/form-fields.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ function FormFields(props: FormFieldsProps): JSX.Element {
8484
name in placeholders ? placeholders[name] : '';
8585
const isURL = types[name] === 'url';
8686
return (
87-
<FormGroup key={key} className="embedded">
87+
<FormGroup key={key} className='embedded'>
8888
{type === 'hidden' ? null : (
8989
<ControlLabel htmlFor={key}>{label}</ControlLabel>
9090
)}

client/src/components/layouts/prism.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pre[class*="language-"].line-numbers.line-numbers {
1+
pre[class*='language-'].line-numbers.line-numbers {
22
border-radius: 8px;
33
font-size: 14px;
44
line-height: 22px;

client/src/components/layouts/variables.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
--tc-link-blue-light: #5fb7ee;
3838
--tc-black: #000;
3939
--tc-black-100: #2a2a2a;
40-
--tc-black-60: #7F7F7F;
40+
--tc-black-60: #7f7f7f;
4141
--tc-black-40: #aaaaaa;
4242
--tc-black-20: #d4d4d4;
4343
--tc-black-10: #e9e9e9;

client/src/templates/Challenges/classic/action-row.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ const ActionRow = ({
3030
togglePane,
3131
showNotes,
3232
showPreview,
33-
isMultifileCertProject,
3433
showInstructions,
3534
showConsole,
3635
superBlock,

client/src/templates/Challenges/classic/editor.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,9 @@ const Editor = (props: EditorProps): JSX.Element => {
573573
attemptRef.current.attempts++;
574574
}
575575

576-
const tryToSubmitChallenge = debounce(props.submitChallenge, 2000, {leading: true});
576+
const tryToSubmitChallenge = debounce(props.submitChallenge, 2000, {
577+
leading: true
578+
});
577579

578580
function createLowerJaw(outputNode: HTMLElement, callback?: () => void) {
579581
const { output } = props;

client/src/templates/Challenges/classic/simple-editor.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,9 @@ const SimpleEditor = (props: EditorProps): JSX.Element => {
513513
attemptRef.current.attempts++;
514514
}
515515

516-
const tryToSubmitChallenge = debounce(props.submitChallenge, 2000, {leading: true});
516+
const tryToSubmitChallenge = debounce(props.submitChallenge, 2000, {
517+
leading: true
518+
});
517519

518520
function resetMarginDecorations() {
519521
const { model, insideEditDecId } = dataRef.current;

client/src/templates/Challenges/codeally/show.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import {
3333
isChallengeCompletedSelector,
3434
updateChallengeMeta,
3535
openModal,
36+
submitChallenge,
3637
updateSolutionFormValues
3738
} from '../redux';
3839
import { createFlashMessage } from '../../../components/Flash/redux';
@@ -76,6 +77,7 @@ const mapDispatchToProps = (dispatch: Dispatch) =>
7677
bindActionCreators(
7778
{
7879
challengeMounted,
80+
submitChallenge,
7981
createFlashMessage,
8082
hideCodeAlly,
8183
openCompletionModal: () => openModal('completion'),
@@ -93,6 +95,7 @@ interface ShowCodeAllyProps {
9395
createFlashMessage: typeof createFlashMessage;
9496
data: { challengeNode: ChallengeNode };
9597
hideCodeAlly: () => void;
98+
submitChallenge: () => void;
9699
isChallengeCompleted: boolean;
97100
isSignedIn: boolean;
98101
openCompletionModal: () => void;
@@ -138,11 +141,7 @@ class ShowCodeAlly extends Component<ShowCodeAllyProps> {
138141
this.props.hideCodeAlly();
139142
}
140143

141-
handleSubmit = ({
142-
showCompletionModal
143-
}: {
144-
showCompletionModal: boolean;
145-
}) => {
144+
handleSubmit = ({ completed }: { completed: boolean }) => {
146145
const {
147146
completedChallenges,
148147
createFlashMessage,
@@ -151,7 +150,7 @@ class ShowCodeAlly extends Component<ShowCodeAllyProps> {
151150
challenge: { id: challengeId }
152151
}
153152
},
154-
openCompletionModal,
153+
submitChallenge,
155154
partiallyCompletedChallenges
156155
} = this.props;
157156

@@ -168,8 +167,8 @@ class ShowCodeAlly extends Component<ShowCodeAllyProps> {
168167
type: 'danger',
169168
message: FlashMessages.CompleteProjectFirst
170169
});
171-
} else if (showCompletionModal) {
172-
openCompletionModal();
170+
} else if (completed) {
171+
submitChallenge();
173172
}
174173
};
175174

client/src/templates/Challenges/components/tool-panel.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ function ToolPanel({
7474

7575
const { t } = useTranslation();
7676

77-
const tryToSubmitChallenge = debounce(submitChallenge, 2000, {leading: true});
77+
const tryToSubmitChallenge = debounce(submitChallenge, 2000, {
78+
leading: true
79+
});
7880

7981
return (
8082
<div

client/src/templates/Challenges/projects/backend/Show.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -174,13 +174,9 @@ class BackEnd extends Component<BackEndProps> {
174174
challengeMounted(challengeMeta.id);
175175
}
176176

177-
handleSubmit({
178-
showCompletionModal
179-
}: {
180-
showCompletionModal: boolean;
181-
}): void {
177+
handleSubmit(): void {
182178
this.props.executeChallenge({
183-
showCompletionModal
179+
showCompletionModal: false
184180
});
185181
}
186182

client/src/templates/Challenges/projects/frontend/Show.tsx

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Button, Grid, Col, Row } from '@freecodecamp/react-bootstrap';
1+
import { Grid, Col, Row } from '@freecodecamp/react-bootstrap';
22
import { graphql } from 'gatsby';
33
import React, { Component } from 'react';
44
import Helmet from 'react-helmet';
@@ -37,7 +37,7 @@ const mapDispatchToProps = (dispatch: Dispatch) =>
3737
submitChallenge,
3838
updateChallengeMeta,
3939
challengeMounted,
40-
updateSolutionFormValues,
40+
updateSolutionFormValues
4141
},
4242
dispatch
4343
);
@@ -71,7 +71,7 @@ class Project extends Component<ProjectProps, ProjectState> {
7171

7272
this.state = {
7373
completed: false,
74-
hasErrors: false,
74+
hasErrors: false
7575
};
7676

7777
this.handleSubmit = this.handleSubmit.bind(this);
@@ -126,12 +126,8 @@ class Project extends Component<ProjectProps, ProjectState> {
126126
}
127127
}
128128

129-
handleSubmit({
130-
completed
131-
}: {
132-
completed: boolean;
133-
}): void {
134-
this.setState({completed, hasErrors: !completed});
129+
handleSubmit({ completed }: { completed: boolean }): void {
130+
this.setState({ completed, hasErrors: !completed });
135131

136132
const { submitChallenge } = this.props;
137133
if (completed) {

client/src/templates/Challenges/video/Show.tsx

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const mapDispatchToProps = (dispatch: Dispatch) =>
4646
submitChallenge,
4747
updateChallengeMeta,
4848
challengeMounted,
49-
updateSolutionFormValues,
49+
updateSolutionFormValues
5050
},
5151
dispatch
5252
);
@@ -185,7 +185,6 @@ class ShowVideo extends Component<ShowVideoProps, ShowVideoState> {
185185
superBlock,
186186
certification,
187187
block,
188-
translationPending,
189188
videoId,
190189
videoLocaleIds,
191190
bilibiliIds,
@@ -197,8 +196,7 @@ class ShowVideo extends Component<ShowVideoProps, ShowVideoState> {
197196
challengeMeta: { nextChallengePath, prevChallengePath }
198197
},
199198
t,
200-
submitChallenge,
201-
isChallengeCompleted
199+
submitChallenge
202200
} = this.props;
203201

204202
const blockNameTitle = `${t(
@@ -236,13 +234,21 @@ class ShowVideo extends Component<ShowVideoProps, ShowVideoState> {
236234
</Col>
237235

238236
<Col md={8} mdOffset={2} sm={10} smOffset={1} xs={12}>
239-
<h3 className="video-section-label">
240-
Question
241-
</h3>
237+
<h3 className='video-section-label'>Question</h3>
242238
</Col>
243-
<Col md={8} mdOffset={2} sm={10} smOffset={1} xs={12} className="video-description">
239+
<Col
240+
md={8}
241+
mdOffset={2}
242+
sm={10}
243+
smOffset={1}
244+
xs={12}
245+
className='video-description'
246+
>
244247
<ChallengeDescription description={description} />
245-
<PrismFormatted className={'dark-palette line-numbers'} text={text} />
248+
<PrismFormatted
249+
className={'dark-palette line-numbers'}
250+
text={text}
251+
/>
246252
<Spacer />
247253
<ObserveKeys>
248254
<div className='video-quiz-options'>

client/src/templates/Challenges/video/show.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@
6868
padding-bottom: 0;
6969
}
7070

71-
7271
.video-quiz-input-hidden {
7372
position: absolute;
7473
left: -9999px;

0 commit comments

Comments
 (0)