Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update bramble, light-theme, files API feedback #15388

Merged
merged 1 commit into from May 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/package.json
Expand Up @@ -42,7 +42,7 @@
"devDependencies": {
"@cdo/apps": "file:src",
"@code-dot-org/blockly": "1.6.19",
"@code-dot-org/bramble": "0.1.15",
"@code-dot-org/bramble": "0.1.16",
"@code-dot-org/johnny-five": "0.10.10-cdo.0",
"@code-dot-org/js-interpreter-tyrant": "0.2.2",
"@code-dot-org/js-numbers": "0.1.0-cdo.0",
Expand Down
3 changes: 2 additions & 1 deletion apps/src/weblab/brambleHost.js
Expand Up @@ -496,12 +496,13 @@ function load(Bramble) {
bramble_ = Bramble;

Bramble.load("#bramble", {
url: "//downloads.computinginthecore.org/bramble_0.1.15/index.html?disableExtensions=bramble-move-file",
url: "//downloads.computinginthecore.org/bramble_0.1.16/index.html?disableExtensions=bramble-move-file",
// DEVMODE: INSECURE (local) url: "../blockly/js/bramble/index.html?disableExtensions=bramble-move-file",
// DEVMODE: INSECURE url: "http://127.0.0.1:8000/src/index.html?disableExtensions=bramble-move-file",
useLocationSearch: true,
disableUIState: true,
initialUIState: {
theme: 'light-theme',
readOnly: webLab_.getPageConstants().isReadOnlyWorkspace
}
});
Expand Down
6 changes: 3 additions & 3 deletions apps/yarn.lock
Expand Up @@ -9,9 +9,9 @@
version "1.6.19"
resolved "https://registry.yarnpkg.com/@code-dot-org/blockly/-/blockly-1.6.19.tgz#5b1e6eacf5ff3b6b41ae81772f2ce8145740ded4"

"@code-dot-org/bramble@0.1.15":
version "0.1.15"
resolved "https://registry.yarnpkg.com/@code-dot-org/bramble/-/bramble-0.1.15.tgz#4c550a49665df8f03b952fe432d4ef010631397d"
"@code-dot-org/bramble@0.1.16":
version "0.1.16"
resolved "https://registry.yarnpkg.com/@code-dot-org/bramble/-/bramble-0.1.16.tgz#9f0b904a15397750f88ce75d1036b86725ce115e"
dependencies:
autoprefixer-core "5.1.8"
aws-sdk "^2.2.9"
Expand Down
14 changes: 11 additions & 3 deletions shared/middleware/files_api.rb
Expand Up @@ -505,7 +505,12 @@ def files_put_file(encrypted_channel_id, filename, body)
not_found if src_entry.nil?
new_entry_json = src_entry.to_json
else
new_entry_json = copy_file('files', encrypted_channel_id, URI.encode(unescaped_filename_downcased), URI.encode(unescaped_src_filename_downcased))
new_entry_json = copy_file(
'files',
encrypted_channel_id,
URI.encode(unescaped_filename_downcased),
URI.encode(unescaped_src_filename_downcased)
)
end
else
new_entry_json = put_file('files', encrypted_channel_id, URI.encode(unescaped_filename_downcased), body)
Expand All @@ -523,7 +528,8 @@ def files_put_file(encrypted_channel_id, filename, body)
manifest_is_unchanged = false
end

deleting_separate_file = unescaped_delete_filename_downcased && unescaped_delete_filename_downcased != unescaped_filename_downcased
deleting_separate_file = unescaped_delete_filename_downcased &&
unescaped_delete_filename_downcased != unescaped_filename_downcased
# if we're also deleting a file (on rename), remove it from the manifest (don't remove from manifest)
if deleting_separate_file
reject_result = manifest.reject! {|e| e['filename'].downcase == unescaped_delete_filename_downcased}
Expand All @@ -541,7 +547,9 @@ def files_put_file(encrypted_channel_id, filename, body)
end

# delete a file if requested (same as src file in a rename operation)
bucket.delete(encrypted_channel_id, URI.encode(unescaped_delete_filename_downcased)) if deleting_separate_file
if deleting_separate_file
bucket.delete(encrypted_channel_id, URI.encode(unescaped_delete_filename_downcased))
end

# return the new entry info
new_entry_hash['filesVersionId'] = response.version_id
Expand Down
2 changes: 1 addition & 1 deletion shared/test/test_files.rb
Expand Up @@ -474,7 +474,7 @@ def test_rename_case_only
assert_fileinfo_equal(expected_image_info_after_rename, file_infos_after_rename[0])

# The manifest version (filesVersionId) should be different, but the file version should be the same
assert response_before_rename['filesVersionId'] != response_after_rename['filesVersionId']
refute_equal response_before_rename['filesVersionId'], response_after_rename['filesVersionId']
assert_equal file_infos[0]['versionId'], file_infos_after_rename[0]['versionId']

@api.delete_object(escaped_filename2)
Expand Down