Skip to content

Commit 9b3b34e

Browse files
committed
merge staging
2 parents 5a0c360 + 7ab48e9 commit 9b3b34e

File tree

31 files changed

+275
-169
lines changed

31 files changed

+275
-169
lines changed

apps/i18n/bounce/th_th.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"dirN": "N",
1919
"dirS": "S",
2020
"dirW": "W",
21-
"doCode": "ทำ",
21+
"doCode": "ทำ (do)",
2222
"elseCode": "ไม่เช่นนั้น",
2323
"finalLevel": "ขอแสดงความยินดีคุณสามารถแก้ปัญหาสุดท้ายได้แล้ว.",
2424
"heightParameter": "ความสูง",

apps/i18n/craft/th_th.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"blockActionDestroyEntity": "หายไป",
1414
"blockActionDetect": "ตรวจหา",
1515
"blockActionDetectRedstone": "ตรวจหาหินแดง",
16-
"blockActionDrop": "หล่น",
16+
"blockActionDrop": "ทำหล่น",
1717
"blockActionDropAll": "ปล่อยทั้งหมด",
1818
"blockActionExecute": "",
1919
"blockActionExplodeEntity": "ระเบิด",
@@ -84,12 +84,15 @@
8484
"blockTypeGlowstone": "หินเรืองแสง",
8585
"blockTypeGrass": "หญ้า",
8686
"blockTypeGravel": "ก้อนกรวด",
87+
"blockTypeIce": "น้ำแข็ง",
8788
"blockTypeLava": "ลาวา",
8889
"blockTypeLogAcacia": "ซุงต้นอะเคเชีย",
8990
"blockTypeLogBirch": "ซุงต้นเบิช",
9091
"blockTypeLogJungle": "ซุงต้นไม้ป่า",
9192
"blockTypeLogOak": "ซุงต้นโอ๊ค",
9293
"blockTypeLogSpruce": "ซุงต้นสน",
94+
"blockTypeNetherBrick": "อิฐเนเธอร์",
95+
"blockTypeNetherrack": "หินเชื้อไฟเนเธอร์",
9396
"blockTypeOreCoal": "แร่ถ่านหิน",
9497
"blockTypeOreDiamond": "แร่เพชร",
9598
"blockTypeOreEmerald": "แร่มรกต",
@@ -108,6 +111,7 @@
108111
"blockTypeRedstoneWire": "ลวดหินแดง",
109112
"blockTypeSand": "ทราย",
110113
"blockTypeSandstone": "หินทราย",
114+
"blockTypeSnow": "หิมะ",
111115
"blockTypeStone": "หิน",
112116
"blockTypeTnt": "ระเบิดทีเอ็นที",
113117
"blockTypeTree": "ต้นไม้",

apps/i18n/studio/th_th.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,7 @@
805805
"whenSpriteCollidedWithPumpkin": "สัมผัสกับฟักทอง",
806806
"whenSpriteCollidedWithStar": "สัมผัสกับดาว",
807807
"whenSpriteCollidedWithSandwich": "สัมผัสกับแซนด์วิช",
808-
"whenSpriteCollidedWithSnowball": "สัมผัสกับบอลหิมะ",
808+
"whenSpriteCollidedWithSnowball": "สัมผัสกับก้อนหิมะ",
809809
"whenSpriteCollidedWithBlueFireball": "สัมผัสลูกไฟสีน้ำเงิน",
810810
"whenSpriteCollidedWithPurpleFireball": "สัมผัสลูกไฟสีม่วง",
811811
"whenSpriteCollidedWithRedFireball": "สัมผัสลูกไฟสีแดง",

apps/i18n/turtle/th_th.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
"createSnowflakeSquare": "สร้างเกล็ดหิมะจากรูปทรงสี่เหลี่ยม",
1414
"createSnowflakeParallelogram": "สร้างรูปเกล็ดหิมะ ในประเภทของรูปสี่เหลี่ยมด้านขนาน",
1515
"createSnowflakeLine": "สร้างเกล็ดหิมะจากเส้นตรง",
16-
"createSnowflakeSpiral": "สร้างรูปเกล็ดหิมะ ในประเภทของรูปเกลียว",
17-
"createSnowflakeFlower": "สร้างเกล็ดหิมะรูปทรงดอกไม้",
16+
"createSnowflakeSpiral": "สร้างเกล็ดหิมะแบบเกลียว",
17+
"createSnowflakeFlower": "สร้างเกล็ดหิมะรูปดอกไม้",
1818
"createSnowflakeFractal": "สร้างรูปเกล็ดหิมะ ในประเภทของแฟร็กทัล",
1919
"createSnowflakeRandom": "สร้างเกล็ดหิมะรูปทรงสุ่ม",
2020
"createASnowflakeBranch": "สร้างสาขาของเกล็ดหิมะ",

apps/src/authoredHintUtils.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -107,18 +107,6 @@ authoredHintUtils.getFinishedHints_ = function () {
107107
return authoredHintUtils.getFromLocalStorage_('finished_authored_hint_views', []);
108108
};
109109

110-
/**
111-
* This only retrieves the hints stored in localStorage, which likely won't
112-
* include things from older sessions.
113-
*
114-
* TODO(ram): Grab *all* the old hint requests from the server, preferably on
115-
* level load
116-
* @return {FinishedHint[]}
117-
*/
118-
authoredHintUtils.getOldFinishedHints = function () {
119-
return authoredHintUtils.getFromLocalStorage_('old_finished_authored_hint_views', []);
120-
};
121-
122110
/**
123111
* @return {AttemptRecord}
124112
*/

apps/src/block_utils.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -878,6 +878,9 @@ exports.createJsWrapperBlockCreator = function (
878878
let prefix = '';
879879
const values = args.map(arg => {
880880
const inputConfig = inputConfigs.find(input => input.name === arg.name);
881+
if (!inputConfig) {
882+
return;
883+
}
881884
let inputCode = inputTypes[inputConfig.mode].generateCode(this, inputConfig);
882885
if (inputConfig.assignment) {
883886
prefix += `${inputCode} = `;

apps/src/studio/Sprite.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,9 +439,9 @@ export default class Sprite extends Item {
439439
this.lastDrawPosition = drawPosition;
440440
}
441441

442-
// TODO(ram): make x and y props consistent with Item. In sprites they
443-
// represent the top left corner, in items they're the center.
444442
/**
443+
* x and y props are not consistent with Item. In sprites they represent the
444+
* top left corner, in items they're the center.
445445
* @override
446446
*/
447447
getCenterPos() {

apps/test/unit/blockUtilsTest.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
import { parseElement, serialize } from '@cdo/apps/xml.js';
1212
import { expect } from '../util/configuredChai';
1313
import sinon from 'sinon';
14+
import { allowConsoleWarnings } from '../util/testUtils';
1415

1516
describe('block utils', () => {
1617
describe('cleanBlocks', () => {
@@ -955,6 +956,7 @@ describe('block utils', () => {
955956
});
956957
});
957958
describe('custom inputs', () => {
959+
allowConsoleWarnings();
958960
it('generates code for a statement input', () => {
959961
createBlock({
960962
func: 'runThisCallback',
@@ -1061,6 +1063,17 @@ describe('block utils', () => {
10611063
expect(code.trim()).to.equal(
10621064
'processAnotherStringValue("some input with a \\"quote\\" in it");');
10631065
});
1066+
it('does not throw when there are extra args', () => {
1067+
createBlock({
1068+
name: 'extraArgsTest',
1069+
expression: 'extraArgsTest;',
1070+
blockText: 'run this program in strict mode',
1071+
args: [{name: 'EXTRA'}],
1072+
}, '', 'test');
1073+
const code = generator['test_extraArgsTest']();
1074+
1075+
expect(code.trim()).to.equal('extraArgsTest;');
1076+
});
10641077
});
10651078
});
10661079
});

cookbooks/Berksfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ GRAPH
7373
cdo-analytics (0.0.0)
7474
apt (~> 2.6.0)
7575
ark (>= 0.0.0)
76-
cdo-apps (0.2.316)
76+
cdo-apps (0.2.317)
7777
apt (>= 0.0.0)
7878
build-essential (>= 0.0.0)
7979
cdo-analytics (>= 0.0.0)

cookbooks/cdo-apps/metadata.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
license 'All rights reserved'
55
description 'Installs/Configures cdo-apps'
66
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
7-
version '0.2.316'
7+
version '0.2.317'
88

99
depends 'apt'
1010
depends 'build-essential'

cookbooks/cdo-apps/templates/default/crontab.erb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,6 @@
9999
cronjob at:'0 10 * * *', do:deploy_dir('bin', 'cron', 'redshift_rollups')
100100
cronjob at:'1 7 * * 6', do:deploy_dir('bin', 'cron', 'cleanup_workshop_attendance_codes')
101101

102-
# 4AM UTC is 8 or 9PM PT, a low traffic time when engineers are still awake to monitor any issues that occur
103-
# during the automated restarts.
104-
cronjob at:'00 4 * * *', do:deploy_dir('bin', 'cron', 'restart_high_memory_frontend_services')
105-
106102
# RDS backup window is 08:50-09:20, so by 11:50 backups should definitely be ready
107103
cronjob at:'50 11 * * *', do:deploy_dir('bin', 'cron', 'push_latest_rds_backup_to_secondary_account')
108104
end

dashboard/app/controllers/omniauth_callbacks_controller.rb

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ def silent_takeover(oauth_user, auth_hash)
264264
# This should never happen if other logic is working correctly, so notify
265265
Honeybadger.notify(
266266
error_class: 'Failed to create AuthenticationOption during silent takeover',
267-
error_message: "Could not create AuthenticationOption during silent takeover for user with email #{lookup_email}"
267+
error_message: "Failed for user with id #{@user.id}"
268268
)
269269
return
270270
end
@@ -280,7 +280,7 @@ def silent_takeover(oauth_user, auth_hash)
280280
# This should never happen if other logic is working correctly, so notify
281281
Honeybadger.notify(
282282
error_class: 'Failed to update User during silent takeover',
283-
error_message: "Could not update user during silent takeover for user with email #{lookup_email}"
283+
error_message: "Failed for user with id #{@user.id}"
284284
)
285285
return
286286
end
@@ -316,13 +316,6 @@ def can_connect_provider?
316316

317317
def get_connect_provider_errors(auth_option)
318318
errors = auth_option.errors.full_messages
319-
Honeybadger.notify(
320-
error_message: "Error connecting to provider",
321-
context: {
322-
authentication_option: auth_option,
323-
errors: errors
324-
}
325-
)
326319

327320
return errors.first unless errors.empty?
328321
I18n.t('auth.unable_to_connect_provider', provider: I18n.t("auth.#{auth_option.credential_type}"))

dashboard/app/controllers/projects_controller.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ class ProjectsController < ApplicationController
9191
spritelab: {
9292
name: 'New Sprite Lab Project',
9393
},
94+
dance: {
95+
name: 'New Dance Lab Project',
96+
levelbuilder_required: true,
97+
},
9498
makerlab: {
9599
name: 'New Maker Lab Project',
96100
login_required: true

dashboard/app/controllers/registrations_controller.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ def update
4949
respond_to_account_update(successfully_updated)
5050
end
5151

52+
#
53+
# GET /users/finish_sign_up
54+
#
55+
def finish_sign_up
56+
end
57+
5258
def create
5359
Retryable.retryable on: [Mysql2::Error, ActiveRecord::RecordNotUnique], matching: /Duplicate entry/ do
5460
super

dashboard/app/helpers/users_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def check_and_apply_oauth_takeover(user)
8282
# We want to know when this fails
8383
Honeybadger.notify(
8484
error_class: 'Failed to create AuthenticationOption during signup oauth takeover',
85-
error_message: "Could not create AuthenticationOption during signup oauth takeover for user with email #{user.email}"
85+
error_message: "Failed for user with id #{user.id}"
8686
)
8787
end
8888
else

dashboard/app/views/devise/registrations/finish_sign_up.html.haml

Whitespace-only changes.

dashboard/app/views/levels/editors/_all.html.haml

Lines changed: 1 addition & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -89,86 +89,7 @@
8989
= text_field_tag 'level[reference_links][]', ref_link, placeholder: 'Additional Reference Link'
9090
#plusAnswerReference
9191
%i.fa.fa-plus-circle
92-
93-
#callout_editor.field
94-
.json_editor
95-
.json_template
96-
.callout_space
97-
%label Callout
98-
%table
99-
%tr
100-
%td.required Element ID
101-
%td.required{colspan: 2} Localization Key
102-
%td.required{colspan: 5} Callout text
103-
%tr
104-
%td
105-
%input.element_id{type: 'text', placeholder: '#runButton'}
106-
%td{colspan: 2}
107-
%input.localization_key{type: 'text', placeholder: 'level_name_callout1', style: 'width: 96%'}
108-
%td{colspan: 5}
109-
%input.callout_text{type: 'text', placeholder: 'Text of callout', style: 'width: 97%'}
110-
%tr
111-
%td Qtip on callout
112-
%td Qtip points to
113-
%td Show when
114-
%td X dist
115-
%td Y dist
116-
%td Classes
117-
%td Reappear
118-
%td Palette Category
119-
%tr
120-
%td
121-
%select.my
122-
%option{value: 'top left'} Top left
123-
%option{value: 'top center'} Top center
124-
%option{value: 'top right'} Top right
125-
%option{value: 'right top'} Right top
126-
%option{value: 'right center'} Right center
127-
%option{value: 'right bottom'} Right bottom
128-
%option{value: 'bottom right'} Bottom right
129-
%option{value: 'bottom center'} Bottom center
130-
%option{value: 'bottom left'} Bottom left
131-
%option{value: 'left bottom'} Left bottom
132-
%option{value: 'left center'} Left center
133-
%option{value: 'left top'} Left top
134-
%td
135-
%select.at{style: 'width: 140px;'}
136-
%option{value: 'top left'} Top left
137-
%option{value: 'top center'} Top center
138-
%option{value: 'top right'} Top right
139-
%option{value: 'right top'} Right top
140-
%option{value: 'right center'} Right center
141-
%option{value: 'right bottom'} Right bottom
142-
%option{value: 'bottom right'} Bottom right
143-
%option{value: 'bottom center'} Bottom center
144-
%option{value: 'bottom left'} Bottom left
145-
%option{value: 'left bottom'} Left bottom
146-
%option{value: 'left center'} Left center
147-
%option{value: 'left top'} Left top
148-
%td
149-
%input.on{type: 'text', style: 'width: 160px;', placeholder: 'function_editor_opened'}
150-
%td
151-
%input.x{type: 'number', style: 'width: 40px;'}
152-
%td
153-
%input.y{type: 'number', style: 'width: 40px;'}
154-
%td
155-
%input.classes{type: 'text', placeholder: 'no-tip', style: 'width: 80px;'}
156-
%td
157-
%input.canReappear{type: 'checkbox', placeholder: 'false', style: 'width: 50px;'}
158-
%td
159-
%input.dropletPaletteCategory{type: 'text', placeholder: 'math', style: 'width: 100px;'}
160-
%tr
161-
%button.remove_callout{type: 'button'}
162-
%i.icon-trash
163-
%hr
164-
#all_callouts_editor
165-
%button#add_callout{type: 'button'} Add a callout
166-
167-
.field
168-
= f.label :callout_json
169-
%div{style: '-webkit-user-select: text'}
170-
~ f.text_area :callout_json, rows: 4
171-
92+
=render partial: 'levels/editors/callouts', locals: {f: f}
17293
- if @level.respond_to? :free_play
17394
.field
17495
= render partial: 'levels/editors/checkboxes', locals: {f: f, field_name: :free_play, description: "Free Play"}

dashboard/app/views/levels/editors/_applab.html.haml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@
3333
.field
3434
= f.label :start_html, 'Starting design mode html'
3535
%p
36-
This should be equivalent to the level html created by design mode. The recommended way to generate this
37-
is to add your elements in design mode, hit run, then open up the browser console and type `Applab.levelHtml`.
36+
This should be equivalent to the level html created by design mode. Learn how to how to make them
37+
=link_to 'here', 'https://github.com/code-dot-org/code-dot-org/wiki/%5BLevelbuilder%5D-Adding-Preloaded-Design-Elements-in-App-Lab', target: '_blank'
38+
39+
%p
3840
IMPORTANT WARNING: If you have referenced images in the HTML and/or CODE, then you need to get fully-qualified
3941
code.org https URLS for these assets and update the HTML and the code to reflect these. You can quickly get full
4042
image urls by drag-dropping the image into the markdown section of a dummy level in levelbuilder.

dashboard/app/views/levels/editors/_blockly.html.haml

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -47,30 +47,7 @@
4747
This adds a call block to the end of the toolbox for each function defined
4848
in the workspace (including hidden start blocks).
4949

50-
.field
51-
= link_to 'Edit Toolbox Blocks', level_edit_blocks_path( @level, :toolbox_blocks) unless @level.new_record?
52-
= render partial: 'levels/editors/collapsible_block_editor', locals: {f: f, xml_id: 'toolbox'}
53-
54-
.field
55-
= link_to 'Edit Start Blocks', level_edit_blocks_path(@level, :start_blocks) unless @level.new_record?
56-
= render partial: 'levels/editors/collapsible_block_editor', locals: {f: f, xml_id: 'start'}
57-
58-
.field
59-
= link_to 'Edit Required Blocks', level_edit_blocks_path(@level, :required_blocks) unless @level.new_record?
60-
= render partial: 'levels/editors/collapsible_block_editor', locals: {f: f, xml_id: 'required'}
61-
62-
.field
63-
= link_to 'Edit Recommended Blocks', level_edit_blocks_path(@level, :recommended_blocks) unless @level.new_record?
64-
= render partial: 'levels/editors/collapsible_block_editor', locals: {f: f, xml_id: 'recommended'}
65-
66-
.field
67-
= link_to 'Edit Initialization Blocks', level_edit_blocks_path(@level, :initialization_blocks) unless @level.new_record?
68-
= render partial: 'levels/editors/collapsible_block_editor', locals: {f: f, xml_id: 'initialization'}
69-
70-
-if @level.respond_to? :solution_blocks
71-
.field
72-
= link_to 'Edit Solution Blocks', level_edit_blocks_path(@level, :solution_blocks) unless @level.new_record?
73-
= render partial: 'levels/editors/collapsible_block_editor', locals: {f: f, xml_id: 'solution'}
50+
= render partial: 'levels/editors/blockly_xml_editors', locals:{f: f}
7451

7552
.field
7653
= f.label :ideal, 'Ideal block number'

0 commit comments

Comments
 (0)