diff --git a/src/containers/tips-library.jsx b/src/containers/tips-library.jsx index 09e34f7fa..7b2771364 100644 --- a/src/containers/tips-library.jsx +++ b/src/containers/tips-library.jsx @@ -35,6 +35,19 @@ class TipsLibrary extends React.PureComponent { ]); } 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); analytics.event({ category: 'library', @@ -48,7 +61,9 @@ class TipsLibrary extends React.PureComponent { id: id, name: decksLibraryContent[id].name, featured: true, - tags: decksLibraryContent[id].tags + tags: decksLibraryContent[id].tags, + urlId: decksLibraryContent[id].urlId, + requiredProjectId: decksLibraryContent[id].requiredProjectId })); if (!this.props.visible) return null; diff --git a/src/lib/app-state-hoc.jsx b/src/lib/app-state-hoc.jsx index 3c9eb9266..93d97180e 100644 --- a/src/lib/app-state-hoc.jsx +++ b/src/lib/app-state-hoc.jsx @@ -2,6 +2,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import {Provider} from 'react-redux'; import {createStore, combineReducers, compose} from 'redux'; +import ConnectedIntlProvider from './connected-intl-provider.jsx'; import localesReducer, {initLocale, localesInitialState} from '../reducers/locales'; @@ -107,7 +108,9 @@ const AppStateHOC = function (WrappedComponent, localesOnly) { } = this.props; return ( - + + + ); } diff --git a/src/lib/libraries/decks/index.jsx b/src/lib/libraries/decks/index.jsx index 65242b170..f44f5fcb2 100644 --- a/src/lib/libraries/decks/index.jsx +++ b/src/lib/libraries/decks/index.jsx @@ -248,6 +248,7 @@ export default { id="gui.howtos.cartoon-network" /> ), + requiredProjectId: '249143200', img: libraryCartoonNetwork, steps: [{ video: 'uz5oz5h9yg'