Skip to content
Snippets Groups Projects
Commit 319e326e authored by Eric Rosenbaum's avatar Eric Rosenbaum
Browse files

Hack to load starter project for CN tutorial

parent 0a78bebd
No related branches found
No related tags found
No related merge requests found
...@@ -35,6 +35,19 @@ class TipsLibrary extends React.PureComponent { ...@@ -35,6 +35,19 @@ class TipsLibrary extends React.PureComponent {
]); ]);
} }
handleItemSelect (item) { handleItemSelect (item) {
/*
Support tutorials that require specific starter projects.
If a tutorial declares "requiredProjectId", check that the URL contains
it. If it is not, open a new page with this tutorial and project id.
TODO remove this at first opportunity. If this is still here after HOC2018,
blame Eric R. Andrew is also on record saying "this is temporary".
*/
if (item.requiredProjectId && window.location.href.indexOf(item.requiredProjectId) === -1) {
const urlParams = `?tutorial=${item.urlId}#${item.requiredProjectId}`;
return window.open(window.location.pathname + urlParams, '_blank');
}
this.props.onActivateDeck(item.id); this.props.onActivateDeck(item.id);
analytics.event({ analytics.event({
category: 'library', category: 'library',
...@@ -48,7 +61,9 @@ class TipsLibrary extends React.PureComponent { ...@@ -48,7 +61,9 @@ class TipsLibrary extends React.PureComponent {
id: id, id: id,
name: decksLibraryContent[id].name, name: decksLibraryContent[id].name,
featured: true, featured: true,
tags: decksLibraryContent[id].tags tags: decksLibraryContent[id].tags,
urlId: decksLibraryContent[id].urlId,
requiredProjectId: decksLibraryContent[id].requiredProjectId
})); }));
if (!this.props.visible) return null; if (!this.props.visible) return null;
......
...@@ -248,6 +248,7 @@ export default { ...@@ -248,6 +248,7 @@ export default {
id="gui.howtos.cartoon-network" id="gui.howtos.cartoon-network"
/> />
), ),
requiredProjectId: '249143200',
img: libraryCartoonNetwork, img: libraryCartoonNetwork,
steps: [{ steps: [{
video: 'uz5oz5h9yg' video: 'uz5oz5h9yg'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment