From 067761f2f653a2ff3d222fbf29fae22c2bad114f Mon Sep 17 00:00:00 2001 From: Tom <20648924+moT01@users.noreply.github.com> Date: Tue, 15 Jun 2021 10:37:13 -0500 Subject: [PATCH] feat(curriculum): add relational databases cert as upcoming change (#41658) --- client/gatsby-node.js | 1 + client/i18n/locales/english/intro.json | 10 ++ .../create-challenge-nodes.js | 4 +- .../pages/learn/relational-databases/index.md | 10 ++ .../learn-relational-databases/index.md | 9 ++ client/src/redux/index.js | 11 ++- client/src/resources/certAndProjectMap.js | 44 ++++++++- .../src/templates/Challenges/codeally/show.js | 99 +++++++++++++++++++ client/utils/challengeTypes.js | 7 +- client/utils/gatsby/challengePageCreator.js | 7 +- client/utils/help-category-map.json | 18 +++- config/certification-settings.js | 21 ++-- .../learn-relational-databases/meta.json | 71 +++++++++++++ .../meta.json | 20 ++++ .../relational-databases-certificate.yml | 15 +++ .../celestial-bodies-database.md | 19 ++++ .../learn-relational-databases/final-boss.md | 18 ++++ .../learn-advanced-bash-by-building.md | 18 ++++ ...-and-sql-by-building-a-bike-rental-shop.md | 17 ++++ .../learn-bash-by-building-a-boilerplate.md | 18 ++++ ...ash-scripting-by-building-five-programs.md | 18 ++++ ...git-by-building-an-sql-reference-object.md | 18 ++++ ...building-a-list-of-inspirational-quotes.md | 18 ++++ .../learn-nano-by-building-a-castle.md | 18 ++++ ...-databases-by-building-a-mario-database.md | 18 ++++ ...earn-sql-by-building-a-student-database.md | 18 ++++ .../periodic-table-database.md | 18 ++++ .../salon-appointment-scheduler.md | 18 ++++ .../world-cup-database.md | 18 ++++ curriculum/schema/challengeSchema.js | 17 +++- 30 files changed, 597 insertions(+), 19 deletions(-) create mode 100644 client/src/pages/learn/relational-databases/index.md create mode 100644 client/src/pages/learn/relational-databases/learn-relational-databases/index.md create mode 100644 client/src/templates/Challenges/codeally/show.js create mode 100644 curriculum/challenges/_meta/learn-relational-databases/meta.json create mode 100644 curriculum/challenges/_meta/relational-databases-certificate/meta.json create mode 100644 curriculum/challenges/english/12-certificates/relational-databases-certificate/relational-databases-certificate.yml create mode 100644 curriculum/challenges/english/13-relational-databases/learn-relational-databases/celestial-bodies-database.md create mode 100644 curriculum/challenges/english/13-relational-databases/learn-relational-databases/final-boss.md create mode 100644 curriculum/challenges/english/13-relational-databases/learn-relational-databases/learn-advanced-bash-by-building.md create mode 100644 curriculum/challenges/english/13-relational-databases/learn-relational-databases/learn-bash-and-sql-by-building-a-bike-rental-shop.md create mode 100644 curriculum/challenges/english/13-relational-databases/learn-relational-databases/learn-bash-by-building-a-boilerplate.md create mode 100644 curriculum/challenges/english/13-relational-databases/learn-relational-databases/learn-bash-scripting-by-building-five-programs.md create mode 100644 curriculum/challenges/english/13-relational-databases/learn-relational-databases/learn-git-by-building-an-sql-reference-object.md create mode 100644 curriculum/challenges/english/13-relational-databases/learn-relational-databases/learn-github-by-building-a-list-of-inspirational-quotes.md create mode 100644 curriculum/challenges/english/13-relational-databases/learn-relational-databases/learn-nano-by-building-a-castle.md create mode 100644 curriculum/challenges/english/13-relational-databases/learn-relational-databases/learn-relational-databases-by-building-a-mario-database.md create mode 100644 curriculum/challenges/english/13-relational-databases/learn-relational-databases/learn-sql-by-building-a-student-database.md create mode 100644 curriculum/challenges/english/13-relational-databases/learn-relational-databases/periodic-table-database.md create mode 100644 curriculum/challenges/english/13-relational-databases/learn-relational-databases/salon-appointment-scheduler.md create mode 100644 curriculum/challenges/english/13-relational-databases/learn-relational-databases/world-cup-database.md diff --git a/client/gatsby-node.js b/client/gatsby-node.js index 8e5d05ed70..c5e986d56d 100644 --- a/client/gatsby-node.js +++ b/client/gatsby-node.js @@ -247,6 +247,7 @@ exports.createSchemaCustomization = ({ actions }) => { const typeDefs = ` type ChallengeNode implements Node { files: ChallengeFile + url: String } type ChallengeFile { indexcss: FileContents diff --git a/client/i18n/locales/english/intro.json b/client/i18n/locales/english/intro.json index a6e57958a8..f217a751a3 100644 --- a/client/i18n/locales/english/intro.json +++ b/client/i18n/locales/english/intro.json @@ -275,6 +275,16 @@ } } }, + "relational-databases": { + "title": "Relational Databases", + "intro": ["placeholder"], + "blocks": { + "learn-relational-databases": { + "title": "Learn Relational Databases", + "intro": ["placeholder"] + } + } + }, "apis-and-microservices": { "title": "APIs and Microservices", "intro": [ diff --git a/client/plugins/fcc-source-challenges/create-challenge-nodes.js b/client/plugins/fcc-source-challenges/create-challenge-nodes.js index e3d6f9c353..984dc3bed6 100644 --- a/client/plugins/fcc-source-challenges/create-challenge-nodes.js +++ b/client/plugins/fcc-source-challenges/create-challenge-nodes.js @@ -3,6 +3,7 @@ const crypto = require('crypto'); function createChallengeNode(challenge, reporter) { // challengeType 11 is for video challenges (they only have instructions) // challengeType 7 is for certificates (they only have tests) + // challengeType 12 is for CodeAlly/CodeRoad challenge // TODO: either handle empty descriptions inside Gatsby OR ensure that // description defaults to '' when creating challenges. @@ -12,7 +13,8 @@ function createChallengeNode(challenge, reporter) { if ( typeof challenge.description !== 'string' && challenge.challengeType !== 11 && - challenge.challengeType !== 7 + challenge.challengeType !== 7 && + challenge.challengeType !== 12 ) { reporter.warn(` diff --git a/client/src/pages/learn/relational-databases/index.md b/client/src/pages/learn/relational-databases/index.md new file mode 100644 index 0000000000..630d7ee662 --- /dev/null +++ b/client/src/pages/learn/relational-databases/index.md @@ -0,0 +1,10 @@ +--- +title: Relational Databases +superBlock: relational-databases +--- + +## Introduction to Relational Databases + +This introduction is a stub + +Help us make it real on [GitHub](https://github.com/freeCodeCamp/learn/tree/master/src/introductions). diff --git a/client/src/pages/learn/relational-databases/learn-relational-databases/index.md b/client/src/pages/learn/relational-databases/learn-relational-databases/index.md new file mode 100644 index 0000000000..1ca88646e8 --- /dev/null +++ b/client/src/pages/learn/relational-databases/learn-relational-databases/index.md @@ -0,0 +1,9 @@ +--- +title: Introduction to Relational Databases +block: Learn Relational Databases +superBlock: Relational Databases +--- + +## Placeholder + +Placeholder diff --git a/client/src/redux/index.js b/client/src/redux/index.js index 27dc841277..305dfcc9dc 100644 --- a/client/src/redux/index.js +++ b/client/src/redux/index.js @@ -234,7 +234,8 @@ export const certificatesByNameSelector = username => state => { isFullStackCert, isSciCompPyCertV7, isDataAnalysisPyCertV7, - isMachineLearningPyCertV7 + isMachineLearningPyCertV7, + isRelationalDatabasesCertV8 } = userByNameSelector(username)(state); return { hasModernCert: @@ -248,7 +249,8 @@ export const certificatesByNameSelector = username => state => { isFullStackCert || isSciCompPyCertV7 || isDataAnalysisPyCertV7 || - isMachineLearningPyCertV7, + isMachineLearningPyCertV7 || + isRelationalDatabasesCertV8, hasLegacyCert: isFrontEndCert || isBackEndCert || isDataVisCert || isInfosecQaCert, isFullStackCert, @@ -302,6 +304,11 @@ export const certificatesByNameSelector = username => state => { show: isMachineLearningPyCertV7, title: 'Machine Learning with Python Certification', certSlug: 'machine-learning-with-python-v7' + }, + { + show: isRelationalDatabasesCertV8, + title: 'Relational Databases Certification', + certSlug: 'relational-databases-v8' } ], legacyCerts: [ diff --git a/client/src/resources/certAndProjectMap.js b/client/src/resources/certAndProjectMap.js index ebc7f6ae0a..882a810c97 100644 --- a/client/src/resources/certAndProjectMap.js +++ b/client/src/resources/certAndProjectMap.js @@ -5,6 +5,8 @@ const jsAlgoBase = 'javascript-algorithms-and-data-structures-projects'; const feLibsBase = '/learn/front-end-libraries/front-end-libraries-projects'; const dataVisBase = '/learn/data-visualization/data-visualization-projects'; +const relationalDatabasesBase = + '/learn/relational-databases/learn-relational-databases'; const apiMicroBase = '/learn/apis-and-microservices/apis-and-microservices-projects'; const qaBase = '/learn/quality-assurance/quality-assurance-projects'; @@ -435,6 +437,44 @@ const certMap = [ } ] }, + { + id: '606243f50267e718b1e755f4', + title: 'Relational Databases', + slug: 'relational-databases', + flag: 'isRelationalDatabasesCert', + projects: [ + { + id: '5f1a4ef5d5d6b5ab580fc6ae', + title: 'Celestial Bodies Database', + link: `${relationalDatabasesBase}/celestial-bodies-database`, + superBlock: 'relational-databases' + }, + { + id: '5f87ac112ae598023a42df1a', + title: 'Salon Appointment Scheduler', + link: `${relationalDatabasesBase}/salon-appointment-scheduler`, + superBlock: 'relational-databases' + }, + { + id: '5f9771307d4d22b9d2b75a94', + title: 'World Cup Database', + link: `${relationalDatabasesBase}/world-cup-database`, + superBlock: 'relational-databases' + }, + { + id: '602d9ff222201c65d2a019f2', + title: 'Periodic Table Database', + link: `${relationalDatabasesBase}/periodic-table-database`, + superBlock: 'relational-databases' + }, + { + id: '602da04c22201c65d2a019f4', + title: 'Final Boss', + link: `${relationalDatabasesBase}/final-boss`, + superBlock: 'relational-databases' + } + ] + }, { id: '561add10cb82ac38a17523bc', title: 'APIs and Microservices', @@ -675,7 +715,9 @@ certMap.forEach(cert => { if (cert.title !== 'Legacy Full Stack') { if (cert.title.startsWith('Legacy')) { legacyProjectMap[cert.title] = cert.projects; - } else { + // temporary hiding of RDBMS cert + // should do suggestion on line 33 and use front matter to hide it + } else if (!cert.title.startsWith('Relational')) { projectMap[cert.title] = cert.projects; } } diff --git a/client/src/templates/Challenges/codeally/show.js b/client/src/templates/Challenges/codeally/show.js new file mode 100644 index 0000000000..47b685c504 --- /dev/null +++ b/client/src/templates/Challenges/codeally/show.js @@ -0,0 +1,99 @@ +/* eslint-disable max-len */ + +// Package Utilities +import React, { Component } from 'react'; +import PropTypes from 'prop-types'; +import { bindActionCreators } from 'redux'; +import { connect } from 'react-redux'; +import Helmet from 'react-helmet'; +import { graphql } from 'gatsby'; + +// Local Utilities +import LearnLayout from '../../../components/layouts/Learn'; +import { ChallengeNode } from '../../../redux/prop-types'; +import { updateChallengeMeta, challengeMounted } from '../redux'; + +// Redux +const mapStateToProps = () => ({}); +const mapDispatchToProps = dispatch => + bindActionCreators( + { + updateChallengeMeta, + challengeMounted + }, + dispatch + ); + +// Proptypes +const propTypes = { + data: PropTypes.shape({ + challengeNode: ChallengeNode + }), + pageContext: PropTypes.shape({ + challengeMeta: PropTypes.shape({ + id: PropTypes.string, + introPath: PropTypes.string, + nextChallengePath: PropTypes.string, + prevChallengePath: PropTypes.string + }) + }), + updateChallengeMeta: PropTypes.func.isRequired +}; + +// Component +class ShowCodeAlly extends Component { + componentDidMount() { + const { + updateChallengeMeta, + data: { + challengeNode: { challengeType, title } + }, + pageContext: { challengeMeta } + } = this.props; + updateChallengeMeta({ ...challengeMeta, title, challengeType }); + } + + render() { + const { + title, + fields: { blockName }, + url + } = this.props.data.challengeNode; + + return ( + + +