feat: mvp features for soft launch (#44539)

* refactor: use enum

* feat: create links between legacy and new

* refactor: pull out legacy-links component

* fix: import order

* fix: provide icon for new superblock

* feat: only show the copy on the new superblock

* fix: use the proper i18n keys correctly

* feat: put the new superblock at the end of the map

* feat: update the new superblock title

* test: update for soft launch order

* fix: show original project links on /settings

Soft launch only.

* test: use SHOW_NEW_CURRICULUM in tests

* fix: rename the remaining rwd-22s

* feat: make the messge prettier

* fix: message copy

* refactor: make comment make sense

Co-authored-by: Ahmad Abdolsaheb <ahmad.abdolsaheb@gmail.com>
Co-authored-by: Nicholas Carrigan (he/him) <nhcarrigan@gmail.com>
This commit is contained in:
Oliver Eyton-Williams
2021-12-22 16:53:40 +00:00
committed by GitHub
parent 10f0d3c07a
commit fd63bb6f85
11 changed files with 62 additions and 12 deletions

View File

@@ -274,10 +274,17 @@ function populateTestsForLang({ lang, challenges, meta }) {
return;
}
it(`${superBlock} should have the same order in every meta`, function () {
const firstOrder = getSuperOrder(filteredMeta[0].superBlock);
const firstOrder = getSuperOrder(filteredMeta[0].superBlock, {
showNewCurriculum: process.env.SHOW_NEW_CURRICULUM
});
assert.isNumber(firstOrder);
assert.isTrue(
filteredMeta.every(el => getSuperOrder(el.superBlock) === firstOrder),
filteredMeta.every(
el =>
getSuperOrder(el.superBlock, {
showNewCurriculum: process.env.SHOW_NEW_CURRICULUM
}) === firstOrder
),
'The superOrder properties are mismatched.'
);
});

View File

@@ -36,7 +36,7 @@ const superBlockToOrder = {
};
const superBlockToNewOrder = {
'2022/responsive-web-design': 0,
'responsive-web-design': 0,
'javascript-algorithms-and-data-structures': 1,
'front-end-development-libraries': 2,
'data-visualization': 3,
@@ -48,7 +48,7 @@ const superBlockToNewOrder = {
'information-security': 9,
'machine-learning-with-python': 10,
'coding-interview-prep': 11,
'responsive-web-design': 12
'2022/responsive-web-design': 12
};
function getSuperOrder(

View File

@@ -38,7 +38,7 @@ describe('getSuperOrder', () => {
it('returns a different order if passed the option showNewCurriculum: true', () => {
expect.assertions(13);
expect(
getSuperOrder('2022/responsive-web-design', { showNewCurriculum: true })
getSuperOrder('responsive-web-design', { showNewCurriculum: true })
).toBe(0);
expect(
getSuperOrder('javascript-algorithms-and-data-structures', {
@@ -82,7 +82,7 @@ describe('getSuperOrder', () => {
getSuperOrder('coding-interview-prep', { showNewCurriculum: true })
).toBe(11);
expect(
getSuperOrder('responsive-web-design', { showNewCurriculum: true })
getSuperOrder('2022/responsive-web-design', { showNewCurriculum: true })
).toBe(12);
});
});