From a1ca4768b330376c742c4d8c3d171442aaadcd8f Mon Sep 17 00:00:00 2001 From: Ray Schamp Date: Fri, 26 Oct 2018 17:13:38 +0100 Subject: [PATCH 1/3] Don't publish playground or test files to npm The package is too large to publish to NPM. These aren't necessary for other packages using scratch-gui as a module. --- .npmignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.npmignore b/.npmignore index 5d6915802..61247064a 100644 --- a/.npmignore +++ b/.npmignore @@ -8,9 +8,11 @@ npm-* # Testing /.nyc_output /coverage +/test # Build /.opt-in +/build # generated translation files /translations From 03415086da92e7ab9c64b825a762314a9b6af816 Mon Sep 17 00:00:00 2001 From: chrisgarrity Date: Fri, 26 Oct 2018 21:06:50 -0400 Subject: [PATCH 2/3] Restore IntlProvider for Internet Explorer GUI includes its own Intl provider (react-intl supports nested intl providers) that works within the www intl provider. Restore the app-state provider intl provider and app-stat-hoc for the stand-alone gui so that IE can function enough to put up the unsupported browser. --- src/lib/app-state-hoc.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 ( - + + + ); } From 319e326e007da47a6a05f4874ad9b70cb1001038 Mon Sep 17 00:00:00 2001 From: Eric Rosenbaum Date: Thu, 25 Oct 2018 16:42:58 -0400 Subject: [PATCH 3/3] Hack to load starter project for CN tutorial --- src/containers/tips-library.jsx | 17 ++++++++++++++++- src/lib/libraries/decks/index.jsx | 1 + 2 files changed, 17 insertions(+), 1 deletion(-) 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/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'