Merge remote-tracking branch 'upstream/develop' into scratch-desktop

This commit is contained in:
Christopher Willis-Ford committed 2019-03-12 15:55:50 -07:00
commit 39279fa0ef
9 files changed
+29 -15

No files matched your search

+5 -5
View File
@@ -104,13 +104,13 @@
"redux-throttle": "0.1.1",
"rimraf": "^2.6.1",
"scratch-audio": "0.1.0-prerelease.20181023202904",
"scratch-blocks": "0.1.0-prerelease.1545162154",
"scratch-l10n": "3.1.20181213173343",
"scratch-blocks": "0.1.0-prerelease.1545364693",
"scratch-l10n": "3.1.20181220222259",
"scratch-paint": "0.2.0-prerelease.20181220194927",
"scratch-render": "0.1.0-prerelease.20181220195236",
"scratch-storage": "1.2.1",
"scratch-render": "0.1.0-prerelease.20181226153401",
"scratch-storage": "1.2.2",
"scratch-svg-renderer": "0.2.0-prerelease.20181220183040",
"scratch-vm": "0.2.0-prerelease.20181220195716",
"scratch-vm": "0.2.0-prerelease.20181226213940",
"selenium-webdriver": "3.6.0",
"startaudiocontext": "1.2.1",
"style-loader": "^0.23.0",
+1
View File
@@ -141,6 +141,7 @@ const GUIComponent = props => {
<StageWrapper
isRendererSupported={isRendererSupported}
isRtl={isRtl}
loading={loading}
stageSize={STAGE_SIZE_MODES.large}
vm={vm}
>
+1 -1
View File
@@ -2,7 +2,7 @@
@import "../../css/z-index.css";
.background {
position: fixed;
position: absolute;
top: 0;
left: 0;
width: 100%;
@@ -35,6 +35,11 @@ const LoginDropdownMessages = defineMessages({ // eslint-disable-line no-unused-
defaultMessage: 'Need Help?',
description: 'Button text for user to indicate that they need help',
id: 'login.needHelp'
},
validationRequired: {
defaultMessage: 'This field is required',
description: 'Message to tell user they must enter text in a form field',
id: 'form.validationRequired'
}
});
@@ -6,6 +6,7 @@ import Box from '../box/box.jsx';
import {STAGE_DISPLAY_SIZES} from '../../lib/layout-constants.js';
import StageHeader from '../../containers/stage-header.jsx';
import Stage from '../../containers/stage.jsx';
import Loader from '../loader/loader.jsx';
import styles from './stage-wrapper.css';
@@ -13,6 +14,7 @@ const StageWrapperComponent = function (props) {
const {
isRtl,
isRendererSupported,
loading,
stageSize,
vm
} = props;
@@ -38,6 +40,9 @@ const StageWrapperComponent = function (props) {
null
}
</Box>
{loading ? (
<Loader />
) : null}
</Box>
);
};
@@ -45,6 +50,7 @@ const StageWrapperComponent = function (props) {
StageWrapperComponent.propTypes = {
isRendererSupported: PropTypes.bool.isRequired,
isRtl: PropTypes.bool,
loading: PropTypes.bool,
stageSize: PropTypes.oneOf(Object.keys(STAGE_DISPLAY_SIZES)).isRequired,
vm: PropTypes.instanceOf(VM).isRequired
};
+3 -2
View File
@@ -80,8 +80,9 @@ class SBFileUploader extends React.Component {
}
getProjectTitleFromFilename (fileInputFilename) {
if (!fileInputFilename) return '';
// only parse title from files like "filename.sb2" or "filename.sb3"
const matches = fileInputFilename.match(/^(.*)\.sb[23]$/);
// only parse title with valid scratch project extensions
// (.sb, .sb2, and .sb3)
const matches = fileInputFilename.match(/^(.*)\.sb[23]?$/);
if (!matches) return '';
return matches[1].substring(0, 100); // truncate project title to max 100 chars
}
+6 -2
View File
@@ -260,8 +260,12 @@ export default function (vm) {
return stageOptions.concat(stageVariableMenuItems);
}
// Get all the local variables (no lists) and add them to the menu.
const spriteVariableOptions =
vm.runtime.getSpriteTargetByName(selectedItem).getAllVariableNamesInScopeByType('', true);
const target = vm.runtime.getSpriteTargetByName(selectedItem);
let spriteVariableOptions = [];
// The target should exist, but there are ways for it not to (e.g. #4203).
if (target) {
spriteVariableOptions = target.getAllVariableNamesInScopeByType('', true);
}
const spriteVariableMenuItems = spriteVariableOptions.map(variable => [variable, variable]);
return spriteOptions.concat(spriteVariableMenuItems);
}
-3
View File
@@ -53,9 +53,6 @@ const vmManagerHOC = function (WrappedComponent) {
loadProject () {
return this.props.vm.loadProject(this.props.projectData)
.then(() => {
// Mark all the assets as clean since they just got loaded
this.props.vm.assets.forEach(asset => (asset.clean = true));
this.props.onLoadedProject(this.props.loadingState, this.props.canSave);
// Wrap in a setTimeout because skin loading in
// the renderer can be async.
@@ -65,14 +65,14 @@ describe('SBFileUploader Container', () => {
expect(projectName).toBe('my project is great');
});
test('sets blank title with .sb filename', () => {
test('correctly sets title with .sb filename', () => {
const wrapper = shallowWithIntl(getContainer(), {context: {store}});
const instance = wrapper
.dive() // unwrap redux Connect(InjectIntl(SBFileUploader))
.dive() // unwrap InjectIntl(SBFileUploader)
.instance(); // SBFileUploader
const projectName = instance.getProjectTitleFromFilename('my project is great.sb');
expect(projectName).toBe('');
expect(projectName).toBe('my project is great');
});
test('sets blank title with filename with no extension', () => {