mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-02-27 02:03:44 -05:00
refactor: move client-only utils inside client (#51120)
This commit is contained in:
committed by
GitHub
parent
4e1e339b04
commit
dc8dd9c1f7
@@ -9,7 +9,7 @@ import { connect } from 'react-redux';
|
||||
|
||||
import envData from '../../../../../config/env.json';
|
||||
import { getLangCode } from '../../../../../config/i18n';
|
||||
import { getCertIds, getPathFromID } from '../../../../../utils';
|
||||
import { getCertIds, getPathFromID } from '../../../../utils';
|
||||
import { regeneratePathAndHistory } from '../../../../../utils/polyvinyl';
|
||||
import CertificationIcon from '../../../assets/icons/certification';
|
||||
import { CompletedChallenge } from '../../../redux/prop-types';
|
||||
|
||||
@@ -3,7 +3,7 @@ import React, { useState, useEffect, ReactElement } from 'react';
|
||||
import { ReflexContainer, ReflexSplitter, ReflexElement } from 'react-reflex';
|
||||
import { createSelector } from 'reselect';
|
||||
import { connect } from 'react-redux';
|
||||
import { sortChallengeFiles } from '../../../../../utils/sort-challengefiles';
|
||||
import { sortChallengeFiles } from '../../../../utils/sort-challengefiles';
|
||||
import { challengeTypes } from '../../../../../config/challenge-types';
|
||||
import {
|
||||
ChallengeFile,
|
||||
|
||||
@@ -3,7 +3,7 @@ import { connect } from 'react-redux';
|
||||
import { createSelector } from 'reselect';
|
||||
|
||||
import i18next from 'i18next';
|
||||
import { sortChallengeFiles } from '../../../../../utils/sort-challengefiles';
|
||||
import { sortChallengeFiles } from '../../../../utils/sort-challengefiles';
|
||||
import { ChallengeFile, ChallengeFiles } from '../../../redux/prop-types';
|
||||
import { toggleVisibleEditor } from '../redux/actions';
|
||||
import {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { isEmpty } from 'lodash-es';
|
||||
import { sortChallengeFiles } from '../../../../../utils/sort-challengefiles';
|
||||
import { sortChallengeFiles } from '../../../../utils/sort-challengefiles';
|
||||
import { ChallengeFiles, FileKey } from '../../../redux/prop-types';
|
||||
|
||||
export function getTargetEditor(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {challengeFiles} from '../../../../utils/__fixtures__/challenges';
|
||||
import { challengeFiles } from '../../../utils/__fixtures__/challenges';
|
||||
|
||||
const baseChallenge = {
|
||||
id: '1',
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
onlyGithubLink,
|
||||
onlySolution,
|
||||
withChallenges
|
||||
} from './__fixtures/completed-challenges';
|
||||
} from './__fixtures__/completed-challenges';
|
||||
import { getSolutionDisplayType } from './solution-display-type';
|
||||
|
||||
describe('getSolutionDisplayType', () => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ChallengeFile } from "../../client/src/redux/prop-types";
|
||||
import { ChallengeFile } from "../../src/redux/prop-types";
|
||||
|
||||
export const challengeFiles: ChallengeFile[] = [
|
||||
{
|
||||
@@ -1,5 +1,5 @@
|
||||
const path = require('path');
|
||||
const { sortChallengeFiles } = require('../../../utils/sort-challengefiles');
|
||||
const { sortChallengeFiles } = require('../sort-challengefiles');
|
||||
const {
|
||||
challengeTypes,
|
||||
viewTypes
|
||||
|
||||
@@ -1,3 +1,27 @@
|
||||
const idToPath = new Map(
|
||||
Object.entries({
|
||||
'561add10cb82ac38a17523bc': 'back-end-development-and-apis',
|
||||
'5a553ca864b52e1d8bceea14': 'data-visualization',
|
||||
'561acd10cb82ac38a17513bc': 'front-end-development-libraries',
|
||||
'5e611829481575a52dc59c0e': 'quality-assurance-v7',
|
||||
'5e6021435ac9d0ecd8b94b00': 'information-security-v7',
|
||||
'561abd10cb81ac38a17513bc': 'javascript-algorithms-and-data-structures',
|
||||
'561add10cb82ac38a17513bc': 'responsive-web-design',
|
||||
'660add10cb82ac38a17513be': 'legacy-back-end',
|
||||
'561add10cb82ac39a17513bc': 'legacy-data-visualization',
|
||||
'561add10cb82ac38a17513be': 'legacy-front-end',
|
||||
'561add10cb82ac38a17213bc': 'information-security-and-quality-assurance',
|
||||
'561add10cb82ac38a17213bd': 'full-stack',
|
||||
'5e44431b903586ffb414c951': 'scientific-computing-with-python-v7',
|
||||
'5e46fc95ac417301a38fb934': 'data-analysis-with-python-v7',
|
||||
'5e46fc95ac417301a38fb935': 'machine-learning-with-python-v7'
|
||||
})
|
||||
);
|
||||
|
||||
export const getCertIds = (): IterableIterator<string> => idToPath.keys();
|
||||
export const getPathFromID = (id: string): string | undefined =>
|
||||
idToPath.get(id);
|
||||
|
||||
export function isBrowser(): boolean {
|
||||
return typeof window !== 'undefined';
|
||||
}
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
const idToPath = new Map(
|
||||
Object.entries({
|
||||
'561add10cb82ac38a17523bc': 'back-end-development-and-apis',
|
||||
'5a553ca864b52e1d8bceea14': 'data-visualization',
|
||||
'561acd10cb82ac38a17513bc': 'front-end-development-libraries',
|
||||
'5e611829481575a52dc59c0e': 'quality-assurance-v7',
|
||||
'5e6021435ac9d0ecd8b94b00': 'information-security-v7',
|
||||
'561abd10cb81ac38a17513bc': 'javascript-algorithms-and-data-structures',
|
||||
'561add10cb82ac38a17513bc': 'responsive-web-design',
|
||||
'660add10cb82ac38a17513be': 'legacy-back-end',
|
||||
'561add10cb82ac39a17513bc': 'legacy-data-visualization',
|
||||
'561add10cb82ac38a17513be': 'legacy-front-end',
|
||||
'561add10cb82ac38a17213bc': 'information-security-and-quality-assurance',
|
||||
'561add10cb82ac38a17213bd': 'full-stack',
|
||||
'5e44431b903586ffb414c951': 'scientific-computing-with-python-v7',
|
||||
'5e46fc95ac417301a38fb934': 'data-analysis-with-python-v7',
|
||||
'5e46fc95ac417301a38fb935': 'machine-learning-with-python-v7'
|
||||
})
|
||||
);
|
||||
|
||||
export const getCertIds = (): IterableIterator<string> => idToPath.keys();
|
||||
export const getPathFromID = (id: string): string | undefined =>
|
||||
idToPath.get(id);
|
||||
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"fcc": "fCC",
|
||||
"freecodecamp": "freeCodeCamp",
|
||||
"html": "HTML",
|
||||
"css": "CSS",
|
||||
"javascript": "JavaScript"
|
||||
}
|
||||
Reference in New Issue
Block a user