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

Teacher homepage: optional override of teacher announcement #17585

Merged
merged 1 commit into from
Sep 7, 2017

Conversation

breville
Copy link
Member

@breville breville commented Sep 7, 2017

The "census_announcement" DCDO hash can now contain values specifying the heading, description, analytic ID and URL of the the teacher announcement that shows at https://studio.code.org for teachers. If the "census_announcement" DCDO key is set, then all four of these values will be expected. If the DCDO key is not set, then we fall back to the default announcement.

The full DCDO hash for this special announcement now looks something like this:

DCDO.set('census_announcement', {'homepage_text'=> 'This is a special announcement.', 'homepage_subtext' => 'Announcement subtext', 'alert_heading' => 'Announcement heading', 'alert_text'=> "This is the announcement text.", 'alert_url'=> "https://blog.code.org/12345", 'teacher_announce_heading'=> 'Teacher announcement heading', 'teacher_announce_description'=> 'Teacher announcement description.', 'teacher_announce_url' => 'https://blog.code.org/123456', 'teacher_announce_id' => 'census_announcement'})

The "census_announcement" DCDO hash can now contain values specifying the heading, description, analytic ID and URL of the the teacher announcement that shows at https://studio.code.org for teachers.  If the "census_announcement" DCDO key is set, then all four of these values will be expected.  If the DCDO key is not set, then we fall back to the default announcement.

The full DCDO hash for this special announcement now looks something like this:

DCDO.set('census_announcement', {'homepage_text'=> 'This is a special announcement.', 'homepage_subtext' => 'Announcement subtext', 'alert_heading' => 'Announcement heading', 'alert_text'=> "This is the announcement text.", 'alert_url'=> "https://blog.code.org/12345", 'teacher_announce_heading'=> 'Teacher announcement heading', 'teacher_announce_description'=> 'Teacher announcement description.', 'teacher_announce_url' => 'https://blog.code.org/123456', 'teacher_announce_id' => 'census_announcement'})
@Bjvanminnen
Copy link
Contributor

I wonder if we're better off having a JSON string here than a ruby hash?

@breville
Copy link
Member Author

breville commented Sep 7, 2017

We use these DCDO flags in a mix of Ruby & JS code. JSON could be handy but I think the native hash is handy too. As it is, this code should only live for about a week.

@breville breville merged commit e05ac04 into staging Sep 7, 2017
@breville breville deleted the teacher-home-dcdo-announcement branch September 7, 2017 21:18
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

3 participants