Skip to content

Commit

Permalink
Merge pull request #28997 from code-dot-org/staging
Browse files Browse the repository at this point in the history
DTT (Staging > Test) [robo-dtt]
  • Loading branch information
deploy-code-org committed Jun 7, 2019
2 parents 02293d2 + e3b162c commit bd5c405
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 33 deletions.
5 changes: 5 additions & 0 deletions apps/src/code-studio/showProjectAdmin.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ export default project => {
}
}

if ($('.admin-sharing').length) {
var sharingDisabled = project.getSharingDisabled();
$('.admin-sharing-disabled').text(sharingDisabled);
}

$('#disable-auto-moderation').click(async function() {
await project.disableAutoContentModeration();
$('#disable-auto-moderation').hide();
Expand Down
15 changes: 13 additions & 2 deletions apps/src/gamelab/GameLab.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,20 @@ module.exports = GameLab;
* @param {string} logLevel
*/
GameLab.prototype.log = function(object, logLevel) {
this.consoleLogger_.log(object);
this.consoleLogger_.log(
experiments.isEnabled('react-inspector')
? {output: object, fromConsoleLog: true}
: object
);
if (this.debuggerEnabled) {
getStore().dispatch(jsDebugger.appendLog(object, logLevel));
getStore().dispatch(
jsDebugger.appendLog(
experiments.isEnabled('react-inspector')
? {output: object, fromConsoleLog: true}
: object,
logLevel
)
);
}
};

Expand Down
9 changes: 7 additions & 2 deletions bin/i18n/sync-codeorg-out.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,13 @@ def distribute_course_content(locale)
translated_data.each do |type, type_data|
next if type_data.blank?
type_data.each do |level_url, level_data|
level = get_level_from_url(level_url)
translated_strings[type][level.name] = level_data
# We want function_names and block_categories to be flat (not keyed by level)
if ["function_names", "block_categories"].include? type
translated_strings[type] = translated_strings[type].merge(level_data)
else
level = get_level_from_url(level_url)
translated_strings[type][level.name] = level_data
end
end
end
end
Expand Down
5 changes: 5 additions & 0 deletions dashboard/app/views/levels/_admin.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@
.admin-report-abuse{ style: 'display: none;' }
= link_to 'Report Abuse', '/report_abuse'
%br
.admin-sharing
Sharing disabled?
%span.admin-sharing-disabled
#disable-auto-moderation{'style' => ('display: none;' if content_moderation_disabled)}
%br
%button{id: "disable-auto-moderation", class: "btn btn-default btn-sm"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Scenario: Can Toggle to the Public Project Gallery
Then I navigate to the public gallery via the gallery switcher

Scenario: Can Publish and Unpublish a Project (Button Version)
Given I make a playlab project named "Publishable Project"
Given I make a "playlab" project named "Publishable Project"
Given I am on "http://studio.code.org/projects"
And I wait until element "#react-personal-projects" is visible
And I wait until element ".ui-personal-projects-table" is visible
Expand All @@ -25,7 +25,7 @@ Scenario: Can Publish and Unpublish a Project (Button Version)
@no_ie
# Disabling IE due to bug where key changes are not registered,
Scenario: Can Rename a Project
Given I make a playlab project named "Old Name"
Given I make a "playlab" project named "Old Name"
Given I am on "http://studio.code.org/projects"
And I wait until element "#react-personal-projects" is visible
And I wait until element ".ui-personal-projects-table" is visible
Expand All @@ -40,7 +40,7 @@ Scenario: Can Rename a Project
And the first project in the table is named "New Name"

Scenario: Can Remix a Project
Given I make a playlab project named "Remix Template"
Given I make a "playlab" project named "Remix Template"
Given I am on "http://studio.code.org/projects"
And I wait until element "#react-personal-projects" is visible
And I wait until element ".ui-personal-projects-table" is visible
Expand All @@ -51,7 +51,7 @@ Scenario: Can Remix a Project
And I wait until current URL contains "/edit"

Scenario: Can Delete a Project
Given I make a playlab project named "To Be Deleted"
Given I make a "playlab" project named "To Be Deleted"
Given I am on "http://studio.code.org/projects"
And I wait until element "#react-personal-projects" is visible
And I wait until element ".ui-personal-projects-table" is visible
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@no_mobile
Feature: Prevent Report Abuse Spam

# If someone has already reported abuse on a specific project, we hide the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Feature: Project Sharing - Young Students

Scenario: Young Students Can Always Share Play Lab Projects
Then I make a playlab project named "Playlab Project!"
Then I make a "playlab" project named "Playlab Project!"
And I open the project share dialog
Then the project can be published
Then I publish the project from the share dialog
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ Background:
And I remove featured projects from the gallery

Scenario: Published Projects Show In Recency Order
Then I make a playlab project named "Older Published"
Then I make a "playlab" project named "Older Published"
Then I publish the project
Given I am on "http://studio.code.org/projects/public"
Then I wait until element ".project_card" is in the DOM
Then I scroll the Play Lab gallery section into view
And element ".ui-project-name-playlab:contains('Published'):eq(0)" contains text "Older Published"
Then I make a playlab project named "Newer Published"
Then I make a "playlab" project named "Newer Published"
Then I publish the project
Given I am on "http://studio.code.org/projects/public"
Then I wait until element ".project_card" is in the DOM
Expand All @@ -30,15 +30,15 @@ Scenario: Published Projects Show In Recency Order
Then element ".ui-project-name-playlab:contains('Published'):eq(0)" contains text "Newer Published"

Scenario: Featured Projects Show Before Published Projects
Then I make a playlab project named "First Featured"
Then I make a "playlab" project named "First Featured"
Then I publish the project
Then I press "#feature_project" using jQuery
Given I am on "http://studio.code.org/projects/public"
Then I wait until element ".project_card" is in the DOM
Then I wait until element ".ui-project-name-playlab" is in the DOM
Then I scroll the Play Lab gallery section into view
Then element ".ui-project-name-playlab:contains('Featured'):eq(0)" contains text "First Featured"
Then I make a playlab project named "Published, NOT Featured"
Then I make a "playlab" project named "Published, NOT Featured"
Then I publish the project
Given I am on "http://studio.code.org/projects/public"
Then I wait until element ".project_card" is in the DOM
Expand All @@ -49,10 +49,10 @@ Scenario: Featured Projects Show Before Published Projects
And element ".ui-project-name-playlab:contains('Featured'):eq(0)" contains text "First Featured"

Scenario: UnPublished, Featured Projects Do Not Show
Then I make a playlab project named "Published, Featured"
Then I make a "playlab" project named "Published, Featured"
Then I publish the project
Then I press "#feature_project" using jQuery
Then I make a playlab project named "Unpublished, Featured"
Then I make a "playlab" project named "Unpublished, Featured"
Then I press "#feature_project" using jQuery
Given I am on "http://studio.code.org/projects/public"
Then I wait until element ".project_card" is in the DOM
Expand Down
18 changes: 0 additions & 18 deletions dashboard/test/ui/features/step_definitions/projects.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,24 +71,6 @@
}
end

Then(/^I make a playlab project named "([^"]*)"$/) do |name|
steps %Q{
Then I am on "http://studio.code.org/projects/playlab/new"
And I get redirected to "/projects/playlab/([^\/]*?)/edit" via "dashboard"
And I wait for the page to fully load
And element "#runButton" is visible
And element ".project_updated_at" eventually contains text "Saved"
And I click selector ".project_edit"
And I type "#{name}" into "input.project_name"
And I click selector ".project_save"
And I wait until element ".project_edit" is visible
Then I should see title "#{name} - Play Lab"
And I press "#runButton" using jQuery
And I wait until element ".project_updated_at" contains text "Saved"
And I wait until initial thumbnail capture is complete
}
end

Then(/^I publish the project$/) do
steps %Q{
Given I open the project share dialog
Expand Down

0 comments on commit bd5c405

Please sign in to comment.