Skip to content

Commit

Permalink
Merge pull request #17674 from code-dot-org/fix-csf-remix
Browse files Browse the repository at this point in the history
re-enable Remix, Make your own, and Make your own app buttons
  • Loading branch information
davidsbailey committed Sep 12, 2017
2 parents b1efe31 + 088c967 commit 316eaeb
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 20 deletions.
5 changes: 0 additions & 5 deletions apps/src/StudioApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,6 @@ StudioApp.prototype.init = function (config) {
noHowItWorks: config.noHowItWorks,
isLegacyShare: config.isLegacyShare,
isResponsive: getStore().getState().pageConstants.isResponsive,
isTooYoung: config.isTooYoung,
wireframeShare: config.wireframeShare,
});
}
Expand Down Expand Up @@ -1892,7 +1891,6 @@ StudioApp.prototype.handleHideSource_ = function (options) {
channelId: project.getCurrentId(),
appType: project.getStandaloneApp(),
isLegacyShare: options.isLegacyShare,
isTooYoung: !!options.isTooYoung,
}), div);
}
}
Expand Down Expand Up @@ -2823,9 +2821,6 @@ StudioApp.prototype.setPageConstants = function (config, appSpecificConstants) {
inputOutputTable: config.level.inputOutputTable,
is13Plus: config.is13Plus,
isSignedIn: config.isSignedIn,
// The user is signed in, under 13, and does not have a teacher that has
// accepted the terms of service.
isTooYoung: !!config.isTooYoung,
textToSpeechEnabled: config.textToSpeechEnabled,
isK1: config.level.isK1,
appType: config.app,
Expand Down
7 changes: 3 additions & 4 deletions apps/src/applab/applab.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,14 @@ function shouldRenderFooter() {
return studioApp().share;
}

Applab.makeFooterMenuItems = function (isIframeEmbed, isTooYoung) {
Applab.makeFooterMenuItems = function (isIframeEmbed) {
const footerMenuItems = [
window.location.search.indexOf('nosource') < 0 && {
text: i18n.t('footer.how_it_works'),
link: project.getProjectUrl('/view'),
newWindow: true,
},
isIframeEmbed && !dom.isMobile() && !isTooYoung && {
isIframeEmbed && !dom.isMobile() && {
text: applabMsg.makeMyOwnApp(),
link: '/projects/applab/new',
},
Expand Down Expand Up @@ -199,9 +199,8 @@ function renderFooterInSharedGame() {
divApplab.parentNode.insertBefore(footerDiv, divApplab.nextSibling);

const isIframeEmbed = getStore().getState().pageConstants.isIframeEmbed;
const isTooYoung = getStore().getState().pageConstants.isTooYoung;

const menuItems = Applab.makeFooterMenuItems(isIframeEmbed, isTooYoung);
const menuItems = Applab.makeFooterMenuItems(isIframeEmbed);

ReactDOM.render(
<SmallFooter
Expand Down
14 changes: 6 additions & 8 deletions apps/src/code-studio/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,15 +250,13 @@ function remixProject() {
// Minimal project header for viewing channel shares and legacy /c/ share pages.
header.showMinimalProjectHeader = function () {
var projectName = $('<div class="project_name_wrapper header_text">')
.append($('<div class="project_name header_text">').text(dashboard.project.getCurrentName()));
.append($('<div class="project_name header_text">').text(dashboard.project.getCurrentName()))
.append($('<div class="project_updated_at header_text">').text(dashboard.i18n.t('project.click_to_remix')));

$('.project_info').append(projectName);

if (!appOptions.isTooYoung) {
projectName.append($('<div class="project_updated_at header_text">').text(dashboard.i18n.t('project.click_to_remix')));
$('.project_info').append($('<div class="project_remix header_button">').text(dashboard.i18n.t('project.remix')));
$('.project_remix').click(remixProject);
}
$('.project_info')
.append(projectName)
.append($('<div class="project_remix header_button">').text(dashboard.i18n.t('project.remix')));
$('.project_remix').click(remixProject);
};

// Project header for script levels that are backed by a project. Shows a
Expand Down
1 change: 0 additions & 1 deletion apps/src/redux/pageConstants.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ var ALLOWED_KEYS = new Set([
'nonResponsiveVisualizationColumnWidth',
'is13Plus',
'isSignedIn',
'isTooYoung',
'isK1',
'textToSpeechEnabled',
'documentationUrl',
Expand Down
3 changes: 1 addition & 2 deletions apps/src/templates/WireframeButtons.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ let WireframeButtons = React.createClass({
channelId: PropTypes.string,
appType: PropTypes.string.isRequired,
isLegacyShare: PropTypes.bool.isRequired,
isTooYoung: PropTypes.bool.isRequired,
},

getInitialState: function () {
Expand Down Expand Up @@ -114,7 +113,7 @@ let WireframeButtons = React.createClass({
var isLegacyShare = window.location.pathname[1] === 'c';
var appTypeAndLegacy = this.props.appType + (isLegacyShare ? '_legacy' : '');
var url = APP_TYPE_TO_NEW_PROJECT_URL[appTypeAndLegacy];
if (url && !this.props.isTooYoung) {
if (url) {
return (
<span style={{display: 'inline-block'}}>
<a className="WireframeButtons_button" href={url}>
Expand Down
1 change: 1 addition & 0 deletions dashboard/config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,7 @@ en:
secure: 'Secure Version'
report_abuse: 'Report Abuse'
built_on_code_studio: 'Built on Code Studio'
make_my_own_app: 'Make my own app'
how_it_works: 'How it Works (View Code)'
try_hour_of_code: 'Try an Hour of Code!'
reference_area:
Expand Down

0 comments on commit 316eaeb

Please sign in to comment.