diff --git a/client/gatsby-node.js b/client/gatsby-node.js
index 4c29498840..c22bd824bc 100644
--- a/client/gatsby-node.js
+++ b/client/gatsby-node.js
@@ -78,6 +78,7 @@ exports.createPages = function createPages({ graphql, actions, reporter }) {
node {
block
challengeType
+ isHidden
fields {
slug
}
diff --git a/client/src/components/Map/components/SuperBlock.js b/client/src/components/Map/components/SuperBlock.js
index 411cd12906..8b2c03eb25 100644
--- a/client/src/components/Map/components/SuperBlock.js
+++ b/client/src/components/Map/components/SuperBlock.js
@@ -60,9 +60,12 @@ export class SuperBlock extends Component {
const blocksForSuperBlock = nodes.filter(
node => node.superBlock === superBlock
);
+ // since the nodes have been filtered based on isHidden, any blocks whose
+ // nodes have been entirely removed will not appear in this array.
const blockDashedNames = uniq(
blocksForSuperBlock.map(({ block }) => block)
);
+ // render all non-empty blocks
return (
{blockDashedNames.map(blockDashedName => (
diff --git a/client/src/components/Map/index.js b/client/src/components/Map/index.js
index 53f1b1495f..9e7fd47de4 100644
--- a/client/src/components/Map/index.js
+++ b/client/src/components/Map/index.js
@@ -111,6 +111,8 @@ export class Map extends Component {
render() {
const { nodes } = this.props;
+ // if a given superBlock's nodes have been filtered (via isHidden, say) that
+ // superBlock will not appear in superBlocks and will not be rendered.
const superBlocks = uniq(nodes.map(({ superBlock }) => superBlock));
return (
diff --git a/client/src/pages/learn.js b/client/src/pages/learn.js
index 2daebc5af8..78a6a0413e 100644
--- a/client/src/pages/learn.js
+++ b/client/src/pages/learn.js
@@ -101,7 +101,7 @@ export const LearnPage = ({
isSignedIn={isSignedIn}
nodes={edges
.map(({ node }) => node)
- .filter(({ isPrivate }) => !isPrivate)}
+ .filter(({ isPrivate, isHidden }) => !isPrivate && !isHidden)}
/>
@@ -136,6 +136,7 @@ export const query = graphql`
isRequired
superBlock
dashedName
+ isHidden
}
}
}
diff --git a/client/src/redux/propTypes.js b/client/src/redux/propTypes.js
index 3d2abd23b4..b8a9f491be 100644
--- a/client/src/redux/propTypes.js
+++ b/client/src/redux/propTypes.js
@@ -36,7 +36,7 @@ export const ChallengeNode = PropTypes.shape({
guideUrl: PropTypes.string,
head: PropTypes.arrayOf(PropTypes.string),
instructions: PropTypes.string,
- isBeta: PropTypes.bool,
+ isHidden: PropTypes.bool,
isComingSoon: PropTypes.bool,
isLocked: PropTypes.bool,
isPrivate: PropTypes.bool,
diff --git a/client/utils/gatsby/challengePageCreator.js b/client/utils/gatsby/challengePageCreator.js
index 9685196bb5..b749f48166 100644
--- a/client/utils/gatsby/challengePageCreator.js
+++ b/client/utils/gatsby/challengePageCreator.js
@@ -67,9 +67,12 @@ exports.createChallengePages = createPage => ({ node }, index, thisArray) => {
required = [],
template,
challengeType,
- id
+ id,
+ isHidden
} = node;
- if (challengeType === 7) {
+ // TODO: challengeType === 7 and isPrivate are the same, right? If so, we
+ // should remove one of them.
+ if (challengeType === 7 || isHidden) {
return null;
}
diff --git a/curriculum/getChallenges.js b/curriculum/getChallenges.js
index 3e906e17c8..07acad80bd 100644
--- a/curriculum/getChallenges.js
+++ b/curriculum/getChallenges.js
@@ -127,9 +127,6 @@ async function createChallenge(fullPath, maybeMeta) {
challenge.required = required.concat(challenge.required || []);
challenge.template = template;
challenge.time = time;
- // isBeta should default to true, so if it is missing, set it to be true
- // eslint-disable-next-line no-undefined
- challenge.isBeta = challenge.isBeta === undefined ? true : challenge.isBeta;
return challenge;
}
diff --git a/curriculum/schema/challengeSchema.js b/curriculum/schema/challengeSchema.js
index 865a5adf12..3ca10005aa 100644
--- a/curriculum/schema/challengeSchema.js
+++ b/curriculum/schema/challengeSchema.js
@@ -45,7 +45,7 @@ function getSchemaForLang(lang) {
helpRoom: Joi.string(),
id: Joi.objectId().required(),
instructions: Joi.string().allow(''),
- isBeta: Joi.bool(),
+ isHidden: Joi.bool().required(),
isComingSoon: Joi.bool(),
isLocked: Joi.bool(),
isPrivate: Joi.bool(),