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

Projects: Minecraft Aquatic in the project widget #25691

Merged
merged 3 commits into from Oct 31, 2018

Conversation

Erin007
Copy link
Contributor

@Erin007 Erin007 commented Oct 30, 2018

Very similar to #25498.

If the DCDO hoc_launch flag is set, a button to make new Minecraft Aquatic projects will show as the first Minecraft option in the expanded project type list of the project widget. This button will show on the public project gallery widget, the signed in projects gallery widget and the projects widget on the signed in homepage.

screen shot 2018-10-30 at 12 01 13 pm

The DCDO check and prop includeMCAquatic will be removed post-launch.

const { showFullList } = this.state;
const GAMES_AND_EVENTS = includeDanceParty ?
['spritelab', 'dance','flappy', 'starwarsblocks', 'starwars', 'bounce', 'sports', 'basketball'] :
['spritelab','flappy', 'starwarsblocks', 'starwars', 'bounce', 'sports', 'basketball'];

const MINECRAFT = includeMCAquatic ?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: you can use the unshift method to prepend to an array and avoid repetition:

let minecraft_buttons = ['minecraft_hero', 'minecraft_designer', 'minecraft_adventurer'];
if (includeMCAquatic) {
  minecraft_buttons.unshift('minecraft_aquatic');
}

@@ -8,6 +8,8 @@
- homepage_data[:topCourse] = @top_course
- homepage_data[:isEnglish] = @is_english
- homepage_data[:includeDanceParty] = DCDO.get("dance_projects", false)
- hoc_launch = DCDO.get("hoc_launch", nil)
- homepage_data[:includeMCAquatic] = !hoc_launch.nil?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just to be safe, i think we should check the the value of hoc_launch matches an acceptable value ('mc' or 'dance':

- homepage_data[:includeMCAquatic] = ['mc', 'dance'].include? hoc_launch

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- homepage_data[:includeMCAquatic] = !hoc_launch.nil?
- homepage_data[:includeMCAquatic] = ['mc', 'dance'].include? hoc_launch

@@ -7,6 +7,8 @@
- projects_data[:canViewAdvancedTools] = !(current_user.under_13? && current_user.terms_version.nil?)
- projects_data[:canShare] = !current_user.sharing_disabled?
- projects_data[:includeDanceParty] = DCDO.get("dance_projects", false)
- hoc_launch = DCDO.get("hoc_launch", nil)
- projects_data[:includeMCAquatic] = !hoc_launch.nil?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- projects_data[:includeMCAquatic] = !hoc_launch.nil?
- projects_data[:includeMCAquatic] = ['mc', 'dance'].include? hoc_launch

@@ -2,6 +2,8 @@
- projects_data = {}
- projects_data[:limitedGallery] = limited_gallery
- projects_data[:includeDanceParty] = DCDO.get("dance_projects", false)
- hoc_launch = DCDO.get("hoc_launch", nil)
- projects_data[:includeMCAquatic] = !hoc_launch.nil?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- projects_data[:includeMCAquatic] = !hoc_launch.nil?
- projects_data[:includeMCAquatic] = ['mc', 'dance'].include? hoc_launch

@Erin007 Erin007 merged commit 224842e into staging Oct 31, 2018
@Erin007 Erin007 deleted the mincraft-project-widget branch November 14, 2018 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants