Skip to content

Commit

Permalink
Merge pull request #26756 from code-dot-org/dtl_candidate_d5e1431f
Browse files Browse the repository at this point in the history
DTL (Test > Levelbuilder): d5e1431
  • Loading branch information
Hamms committed Jan 25, 2019
2 parents 7909184 + 982a4c2 commit 68c3e43
Show file tree
Hide file tree
Showing 8,033 changed files with 12,903 additions and 12,314 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion apps/src/applab/Exporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ export default {
sessionId: `${getEnvironmentPrefix()}-${project.getCurrentId()}`,
files,
name: project.getCurrentName(),
sdkVersion: '32.0.0',
sdkVersion: '31.0.0',
});

// Important that index.html comes first:
Expand Down
5 changes: 5 additions & 0 deletions apps/src/applab/designElements/CopyElementToScreenButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ const styles = {
},
screen: {
},
menu: {
maxHeight: '200px',
overflowY: 'auto',
},
};

/**
Expand Down Expand Up @@ -104,6 +108,7 @@ class CopyElementToScreenButton extends React.Component {
targetPoint={targetPoint}
offset={{x: 0, y: 0}}
beforeClose={this.beforeClose}
style={styles.menu}
>
{otherScreens}
</PopUpMenu>
Expand Down
4 changes: 3 additions & 1 deletion apps/src/applab/designElements/ImagePickerPropertyRow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export default class ImagePickerPropertyRow extends React.Component {
initialValue: PropTypes.string.isRequired,
handleChange: PropTypes.func,
desc: PropTypes.node,
elementId: PropTypes.string
};

componentDidMount() {
Expand Down Expand Up @@ -61,7 +62,8 @@ export default class ImagePickerPropertyRow extends React.Component {
// However today the `createModalDialog` function and `Dialog` component
// are intertwined with `StudioApp` which is why we have this direct call.
dashboard.assets.showAssetManager(this.changeImage, 'image', null, {
showUnderageWarning: !getStore().getState().pageConstants.is13Plus
showUnderageWarning: !getStore().getState().pageConstants.is13Plus,
elementId: this.props.elementId
});
};

Expand Down
1 change: 1 addition & 0 deletions apps/src/applab/designElements/button.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ class ButtonProperties extends React.Component {
desc={'image'}
initialValue={element.getAttribute('data-canonical-image-url') || ''}
handleChange={this.props.handleChange.bind(this, 'image')}
elementId={elementUtils.getId(element)}
/>
{iconColorPicker}
<BooleanPropertyRow
Expand Down
1 change: 1 addition & 0 deletions apps/src/applab/designElements/image.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class ImageProperties extends React.Component {
desc={'image'}
initialValue={element.getAttribute('data-canonical-image-url') || ''}
handleChange={this.props.handleChange.bind(this, 'picture')}
elementId={elementUtils.getId(element)}
/>
{iconColorPicker}
<EnumPropertyRow
Expand Down
1 change: 1 addition & 0 deletions apps/src/applab/designElements/screen.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class ScreenProperties extends React.Component {
desc={'image'}
initialValue={element.getAttribute('data-canonical-image-url') || ''}
handleChange={this.props.handleChange.bind(this, 'screen-image')}
elementId={elementUtils.getId(element)}
/>
{iconColorPicker}
<DefaultScreenButtonPropertyRow
Expand Down
4 changes: 3 additions & 1 deletion apps/src/code-studio/assets/show.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ var Dialog = require('../LegacyDialog');
* @param [options.showUnderageWarning] {boolean} Warn if underage.
* @param [options.useFilesApi] {boolean} Use files API instead of assets API.
* @param [options.disableAudioRecording] {boolean} Do not display option to record and upload audio files
* @param [options.elementId] {string} Logging Purposes: which element is the image chosen for
*/
module.exports = function showAssetManager(assetChosen, typeFilter, onClose, options) {
options = options || {};
Expand Down Expand Up @@ -48,7 +49,8 @@ module.exports = function showAssetManager(assetChosen, typeFilter, onClose, opt
showUnderageWarning: !!options.showUnderageWarning,
projectId: dashboard.project.getCurrentId(),
soundPlayer: sounds,
disableAudioRecording: options.disableAudioRecording
disableAudioRecording: options.disableAudioRecording,
elementId: options.elementId
}), codeDiv);

dialog.show();
Expand Down
26 changes: 22 additions & 4 deletions apps/src/code-studio/components/AssetManager.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,13 @@ export default class AssetManager extends React.Component {
allowedExtensions: PropTypes.string,
uploadsEnabled: PropTypes.bool.isRequired,
useFilesApi: PropTypes.bool,
//For logging upload failures
projectId: PropTypes.string,
soundPlayer: PropTypes.object,
disableAudioRecording: PropTypes.bool,
//Temp prop for logging - identifies if displayed by 'Manage Assets' flow
imagePicker: PropTypes.bool

// For logging purposes
imagePicker: PropTypes.bool, // identifies if displayed by 'Manage Assets' flow
projectId: PropTypes.string,
elementId: PropTypes.string
};

constructor(props) {
Expand Down Expand Up @@ -143,6 +144,21 @@ export default class AssetManager extends React.Component {
if (this.props.assetsChanged) {
this.props.assetsChanged();
}
firehoseClient.putRecord(
{
study: 'delete-asset',
study_group: this.props.assetChosen && typeof this.props.assetChosen === 'function' ? 'choose-assets' : 'manage-assets',
event: 'confirm',
project_id: this.props.projectId,
data_json: JSON.stringify(
{
assetName: name,
elementId: this.props.elementId
}
)
}
);

this.setState({
assets: assetListStore.list(this.props.allowedExtensions),
statusMessage: 'File "' + name + '" successfully deleted!'
Expand Down Expand Up @@ -223,6 +239,8 @@ export default class AssetManager extends React.Component {
onDelete={this.deleteAssetRow.bind(this, asset.filename)}
soundPlayer={this.props.soundPlayer}
imagePicker={this.props.imagePicker}
projectId={this.props.projectId}
elementId={this.props.elementId}
/>
);
}.bind(this));
Expand Down
20 changes: 18 additions & 2 deletions apps/src/code-studio/components/AssetRow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ export default class AssetRow extends React.Component {
onChoose: PropTypes.func,
onDelete: PropTypes.func.isRequired,
soundPlayer: PropTypes.object,
projectId: PropTypes.string,

//temporary prop to differentiate choosing images and sounds
imagePicker: PropTypes.bool
// For logging purposes
imagePicker: PropTypes.bool, // identifies if displayed by 'Manage Assets' flow
elementId: PropTypes.string
};

state = {
Expand All @@ -32,6 +34,20 @@ export default class AssetRow extends React.Component {
*/
confirmDelete = () => {
this.setState({action: 'confirming delete', actionText: ''});
firehoseClient.putRecord(
{
study: 'delete-asset',
study_group: this.props.onChoose && typeof this.props.onChoose === 'function' ? 'choose-assets' : 'manage-assets',
event: 'initiate',
project_id: this.props.projectId,
data_json: JSON.stringify(
{
assetName: this.props.name,
elementId: this.props.elementId
}
)
}
);
};

/**
Expand Down
6 changes: 4 additions & 2 deletions apps/src/code-studio/components/ImagePicker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ export default class ImagePicker extends React.Component {
useFilesApi: PropTypes.bool,
soundPlayer: PropTypes.object,
disableAudioRecording: PropTypes.bool,
//For logging upload failures
projectId: PropTypes.string
//For logging purposes
projectId: PropTypes.string,
elementId: PropTypes.string
};

state = {mode: 'files'};
Expand Down Expand Up @@ -93,6 +94,7 @@ export default class ImagePicker extends React.Component {
soundPlayer={this.props.soundPlayer}
disableAudioRecording={this.props.disableAudioRecording}
imagePicker={true}
elementId={this.props.elementId}
/> :
<IconLibrary assetChosen={this.getAssetNameWithPrefix}/>;

Expand Down
6 changes: 3 additions & 3 deletions apps/src/code-studio/pd/fit_weekend_registration/Joining.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default class Joining extends LabeledFormComponent {
lastName: "Last name",
email: "Email",
phone: "Phone number",
ableToAttend: "Are you able to attend your assigned FiT Weekend?"
ableToAttend: "Are you able to attend your assigned FiT Workshop?"
};

static associatedFields = Object.keys(Joining.labels);
Expand Down Expand Up @@ -52,7 +52,7 @@ export default class Joining extends LabeledFormComponent {

<FormGroup>
<ControlLabel>
Your assigned Facilitator-in-Training (FiT) Weekend is:
Your assigned Facilitator-in-Training (FiT) Workshop is:
<br />
<strong>
FiT {this.props.city}, {this.props.date}
Expand All @@ -61,7 +61,7 @@ export default class Joining extends LabeledFormComponent {
{this.radioButtonsFor("ableToAttend")}
{this.props.data.ableToAttend === "No" &&
<p>
If you're unable to attend your assigned FiT Weekend, please
If you're unable to attend your assigned FiT Workshop, please
contact <a href="mailto:facilitators@code.org">facilitators@code.org</a> as
soon as possible so we can assist you.
</p>
Expand Down
4 changes: 2 additions & 2 deletions apps/src/code-studio/pd/fit_weekend_registration/Releases.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default class Releases extends LabeledFormComponent {
<h4>Section 3: Releases</h4>
<FormGroup>
<ControlLabel>
Please read this <a target="_blank" href="https://docs.google.com/document/d/12NVUcqccNRbVukoGMCserwSpg4vfG0vNlEqTxr6oit0/edit">photo release.</a>
Please read this <a target="_blank" href="https://docs.google.com/document/d/1zke9hlGbI1XbSzwQ1rNZofXuXaOboJuTFPW2Z_XOA1w/edit">photo release.</a>
</ControlLabel>
{this.singleCheckboxFor("photoRelease")}
<ControlLabel>
Expand Down Expand Up @@ -61,7 +61,7 @@ export default class Releases extends LabeledFormComponent {
<p>
We're excited you're planning to join us this summer! You will receive
more information about travel approximately six weeks before the FiT
Weekend. In the meantime, please <strong>do not</strong> book your flight,
Workshop. In the meantime, please <strong>do not</strong> book your flight,
and make sure to contact <a href="mailto:facilitators@code.org">facilitators@code.org</a> with any questions. We look
forward to meeting you this summer!
</p>
Expand Down
29 changes: 9 additions & 20 deletions apps/src/code-studio/pd/fit_weekend_registration/TravelPlans.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ export default class TravelPlans extends LabeledFormComponent {
contactRelationship: "Relationship to you:",
contactPhone: "Phone number:",
dietaryNeeds: "Do you have any dietary needs or food allergies?",
dietaryNeedsDetails: "Please provide details about your food allergy.",
dietaryNeedsDetails: "Please provide details about your dietary needs.",
addressStreet: "Street",
addressCity: "City",
addressState: "State",
addressZip: "Zip",
howTraveling: "Code.org provides a round trip flight for every FiT Weekend attendee. If you choose to fly, we will provide you with detailed flight booking instructions approximately six weeks prior to the event. If you choose not to fly, and live at least 25 miles from the event location, Code.org will provide you with a $150 gift card to help cover the cost of driving, trains, or public transit. Code.org is not able to provide reimbursement for the cost of driving, trains, or public transit if you live less than 25 miles from the event location. How will you travel to the FiT Weekend?",
needHotel: "Code.org provides a hotel room for every FiT Weekend attendee. Attendees will not be required to share a room. Would you like a hotel room at the FiT Weekend?",
howTraveling: "Code.org provides a round trip flight for every FiT Workshop attendee. If you choose to fly, we will provide you with detailed flight booking instructions approximately six weeks prior to the event. If you choose not to fly, and live at least 25 miles from the event location, Code.org will provide you with a $150 gift card to help cover the cost of driving, trains, or public transit. Code.org is not able to provide reimbursement for the cost of driving, trains, or public transit if you live less than 25 miles from the event location. How will you travel to the FiT Workshop?",
needHotel: "Code.org provides a hotel room for every FiT Workshop attendee. Attendees will not be required to share a room. Would you like a hotel room at the FiT Workshop?",
needAda: "Do you require an ADA accessible hotel room?",
explainAda: "Please explain your specific accommodation needs."
needDisabilitySupport: "Do you have a disability and/or require accommodation in order to fully participate in our event? If so, please select yes, and you will be contacted by someone from our staff to discuss your specific needs."
};

static associatedFields = Object.keys(TravelPlans.labels).concat([
Expand Down Expand Up @@ -63,16 +63,12 @@ export default class TravelPlans extends LabeledFormComponent {
);
}

if (data.dietaryNeeds && data.dietaryNeeds.includes('Food Allergy')) {
if (data.dietaryNeeds && (data.dietaryNeeds.includes('Food Allergy') || data.dietaryNeeds.includes('Other'))) {
requiredFields.push('dietaryNeedsDetails');
}

if (data.needHotel === 'Yes') {
requiredFields.push("needAda");

if (data.needAda === 'Yes') {
requiredFields.push("explainAda");
}
}

return requiredFields;
Expand All @@ -98,7 +94,7 @@ export default class TravelPlans extends LabeledFormComponent {
{this.checkBoxesFor("dietaryNeeds")}
{
this.props.data.dietaryNeeds &&
this.props.data.dietaryNeeds.includes('Food Allergy') &&
(this.props.data.dietaryNeeds.includes('Food Allergy') || this.props.data.dietaryNeeds.includes('Other')) &&
this.largeInputFor("dietaryNeedsDetails")
}
</FormGroup>
Expand Down Expand Up @@ -126,18 +122,14 @@ export default class TravelPlans extends LabeledFormComponent {

<FormGroup>
{this.radioButtonsWithAdditionalTextFieldsFor("howTraveling", {
'I will carpool with another FiT Weekend attendee (Please note who)': 'carpooling_with_attendee'
'I will carpool with another FiT Workshop attendee (Please note who)': 'carpooling_with_attendee'
})}
{this.radioButtonsFor("needHotel")}
{
this.props.data.needHotel === 'Yes' &&
this.radioButtonsFor("needAda")
}
{
this.props.data.needHotel === 'Yes' &&
this.props.data.needAda === 'Yes' &&
this.largeInputFor("explainAda")
}
{this.radioButtonsFor("needDisabilitySupport")}
</FormGroup>
</FormGroup>
);
Expand All @@ -154,11 +146,8 @@ export default class TravelPlans extends LabeledFormComponent {
if (data.needHotel !== 'Yes') {
changes.needAda = undefined;
}
if (changes.needAda !== 'Yes') {
changes.explainAda = undefined;
}

if (data.dietaryNeeds && !data.dietaryNeeds.includes('Food Allergy')) {
if (data.dietaryNeeds && !data.dietaryNeeds.includes('Food Allergy') && !data.dietaryNeeds.includes('Other')) {
changes.dietaryNeedsDetails = undefined;
}

Expand Down
2 changes: 1 addition & 1 deletion apps/src/gamelab/Exporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ export default {
sessionId: `${getEnvironmentPrefix()}-${project.getCurrentId()}`,
files,
name: project.getCurrentName(),
sdkVersion: '32.0.0',
sdkVersion: '31.0.0',
});

// Important that index.html comes first:
Expand Down
17 changes: 14 additions & 3 deletions apps/src/templates/export/expo/CustomAsset.exported_js
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,25 @@ export default class CustomAsset {
// Ignore this because it throws if the dir already exists on Android
}
}
({ md5 } = await FileSystem.downloadAsync(this.asset.uri, localUri, {
if (this.asset.localUri) {
await FileSystem.copyAsync({
from: this.asset.localUri,
to: localUri,
});
({ md5 } = await FileSystem.getInfoAsync(localUri, {
cache: true,
md5: true,
}));
}));
} else {
({ md5 } = await FileSystem.downloadAsync(this.asset.uri, localUri, {
cache: true,
md5: true,
}));
}
if (md5 !== this.asset.hash) {
throw new Error(
`Downloaded file for asset '${this.fileName} ` +
`Located at ${this.asset.localUri} ` +
`Located at ${localUri} ` +
`failed MD5 integrity check`
);
}
Expand Down
6 changes: 5 additions & 1 deletion apps/src/templates/export/expo/app.json.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "<%- appName %> from Code.org Code Studio.",
"slug": "<%- appName.replace(/([^a-zA-Z0-9_\-]+)/gi, '-') %>",
"privacy": "public",
"sdkVersion": "32.0.0",
"sdkVersion": "31.0.0",
"platforms": ["ios", "android"],
"version": "1.0.0",
"orientation": "portrait",
Expand All @@ -15,8 +15,12 @@
"backgroundColor": "#ffffff"
},
"updates": {
"enabled": false,
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"**/*"
],
"packagerOpts": {
"assetExts": [
"html",
Expand Down
4 changes: 2 additions & 2 deletions apps/src/templates/export/expo/package.exported_json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
"eject": "expo eject"
},
"dependencies": {
"expo": "^32.0.0",
"expo": "^31.0.4",
"expo-cli": "^2.6.14",
"react": "16.5.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz"
"react-native": "https://github.com/expo/react-native/archive/sdk-31.0.1.tar.gz"
}
}

0 comments on commit 68c3e43

Please sign in to comment.