Skip to content

Commit

Permalink
Merge branch 'develop' into issue-#10630-topbar-btn-not-visible
Browse files Browse the repository at this point in the history
  • Loading branch information
hrshkshri committed Jan 7, 2024
2 parents 9a47832 + 6171792 commit ecf2361
Show file tree
Hide file tree
Showing 77 changed files with 1,112 additions and 353 deletions.
6 changes: 6 additions & 0 deletions assets/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,12 @@ export default {
// The supported tags for the mailing list subscriptions.
"MAILING_LIST_ANDROID_TAG": "Android",
"MAILING_LIST_WEB_TAG": "Web",

// The error message to be displayed when the user tries to subscribe to the
// mailing list but fails.
// eslint-disable-next-line max-len
"MAILING_LIST_UNEXPECTED_ERROR_MESSAGE": "Sorry, an unexpected error occurred. Please email admin@oppia.org to be added to the mailing list.",

// Regex to validate the format of Math rich-text component SVGs. If this is
// changed in the future, the existing filenames on the server should be
// handled as well.
Expand Down
8 changes: 7 additions & 1 deletion assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -595,13 +595,19 @@
"I18N_FOOTER_BROWSE_LIBRARY": "Browse the Library",
"I18N_FOOTER_CONTACT_US": "Contact Us",
"I18N_FOOTER_CONTRIBUTE_ALL_CAPS": "CONTRIBUTE",
"I18N_FOOTER_COPYRIGHT": "© <[currentYear]> The Oppia Foundation",
"I18N_FOOTER_CREDITS": "Credits",
"I18N_FOOTER_DONATE": "Donate",
"I18N_FOOTER_FOLLOW_US": "Follow Us",
"I18N_FOOTER_FORUM": "Forum",
"I18N_FOOTER_GET_INVOLVED": "Get Involved",
"I18N_FOOTER_GET_STARTED": "Get Started",
"I18N_FOOTER_NEWSLETTER_EMAIL": "Email Address",
"I18N_FOOTER_NEWSLETTER_HEADING": "Subscribe To Our Newsletter",
"I18N_FOOTER_NEWSLETTER_TEXT": "Be a part of the Oppia community! Our bi-weekly newsletter keeps you informed on new features, lessons and how Oppia is making a worldwide impact.",
"I18N_FOOTER_OPPIA_FOUNDATION": "The Oppia Foundation",
"I18N_FOOTER_OPPIA_MISSION": "Oppia’s mission is to provide a learning platform that meets the unique needs for under resourced communities.",
"I18N_FOOTER_OPPIA_MISSION_DONATE_VOLUNTEER": "<a href=\"/donate\">Donate</a> or <a href=\"/volunteer\">volunteer</a> today!",
"I18N_FOOTER_PRIVACY_POLICY": "Privacy Policy",
"I18N_FOOTER_TEACH": "Teach with Oppia",
"I18N_FOOTER_TEACH_LEARN_ALL_CAPS": "TEACH/LEARN",
Expand Down Expand Up @@ -1503,7 +1509,7 @@
"I18N_TOPNAV_DONATE": "Donate",
"I18N_TOPNAV_DONATE_DESCRIPTION": "Your contributions help provide quality education to all.",
"I18N_TOPNAV_FACILITATOR_DASHBOARD": "Facilitator Dashboard",
"I18N_TOPNAV_FEEDBACK_UPDATES":"Feedback updates",
"I18N_TOPNAV_FEEDBACK_UPDATES": "Feedback updates",
"I18N_TOPNAV_FORUM": "Forum",
"I18N_TOPNAV_GET_INVOLVED": "Get Involved",
"I18N_TOPNAV_GET_STARTED": "Get Started",
Expand Down
6 changes: 6 additions & 0 deletions assets/i18n/qqq.json
Original file line number Diff line number Diff line change
Expand Up @@ -595,13 +595,19 @@
"I18N_FOOTER_BROWSE_LIBRARY": "Text shown in the footer. - Link to the library page.",
"I18N_FOOTER_CONTACT_US": "Text shown in the footer. - Link to the contact page.\n{{Identical|Contact us}}",
"I18N_FOOTER_CONTRIBUTE_ALL_CAPS": "Text shown in the footer. - Title of the contribute section. Must be in all capital letters for languages that use Latin, Cyrillic, and/or Greek scripts. This section has links to pages where people can contribute to Oppia.\n{{Identical|Contribute}}",
"I18N_FOOTER_COPYRIGHT": "Text that appears at the bottom of the page. It is the copyright.",
"I18N_FOOTER_CREDITS": "Text shown in the footer. - Link to the credits tab in the about page. See I18N_ABOUT_PAGE_TITLE\n{{Identical|Credit}}",
"I18N_FOOTER_DONATE": "Text shown in the footer. - Link to the donation page.\n{{Identical|Donate}}",
"I18N_FOOTER_FOLLOW_US": "Text displayed in the footer. It's shown above the social media icons like Facebook and YouTube.",
"I18N_FOOTER_FORUM": "Text shown in the footer. - Link to the forum page.\n{{Identical|Forum}}",
"I18N_FOOTER_GET_INVOLVED": "Text shown in the footer. - Link to the contact page that explains how to contribute to the Oppia foundation.\n{{Identical|Get involved}}",
"I18N_FOOTER_GET_STARTED": "Text shown in the footer. - Link to the get started page. See I18N_GET_STARTED_PAGE_TITLE\n{{Identical|Get started}}",
"I18N_FOOTER_NEWSLETTER_EMAIL": "Text label that appears on the email input field in the newsletter subscription form.",
"I18N_FOOTER_NEWSLETTER_HEADING": "Text that appears on the heading of the newsletter subscription form.",
"I18N_FOOTER_NEWSLETTER_TEXT": "Be a part of the Oppia community! Our bi-weekly newsletter keeps you informed on new features, lessons and how Oppia is making a worldwide impact.",
"I18N_FOOTER_OPPIA_FOUNDATION": "Text shown in the footer. - Link to the Oppia Foundation website. See I18N_ABOUT_PAGE_TITLE.",
"I18N_FOOTER_OPPIA_MISSION": "Text that appears on the footer of the page that describes the mission of Oppia.",
"I18N_FOOTER_OPPIA_MISSION_DONATE_VOLUNTEER": "Text that appears below the oppia mission in the footer that links to donate and volunteer.",
"I18N_FOOTER_PRIVACY_POLICY": "Text shown in the footer. - Link to a page that contains Oppia's privacy policy.\n{{Identical|Privacy policy}}",
"I18N_FOOTER_TEACH": "Text shown in the footer. - Link to the Teach with Oppia page that contains more information for teachers that want to use Oppia.",
"I18N_FOOTER_TEACH_LEARN_ALL_CAPS": "Text shown in the footer. - Title of the teach/learn section. Must be in all capital letters for languages that use Latin, Cyrillic, and/or Greek scripts. This section has links to pages with content for teachers and students.",
Expand Down
6 changes: 0 additions & 6 deletions assets/scripts/oppia-player-0.0.0.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,6 @@

switch(data.title) {
case 'heightChange':
// TODO(sll): Validate that data.payload is a dict with one field
// whose key is 'height' and whose value is a positive integer.
// TODO(sll): These should pass the iframe source, too (in case there
// are multiple oppia iframes on a page).
window.OPPIA_PLAYER.onHeightChange(
iframeNode, data.payload.height, data.payload.scroll);
break;
Expand Down Expand Up @@ -238,8 +234,6 @@
var VERSION_KEY = 'version=';
var SECRET_KEY = 'secret=';

// TODO(sll): Properly handle the case where ids are manually set, but are
// not unique.
iframe.setAttribute('id', tagId);
var versionString = explorationVersion ? '&v=' + explorationVersion : '';
iframe.setAttribute('src', encodeURI(
Expand Down
50 changes: 28 additions & 22 deletions core/controllers/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@
from core.domain import stats_services
from core.domain import story_domain
from core.domain import story_services
from core.domain import subtopic_page_domain
from core.domain import subtopic_page_services
from core.domain import topic_domain
from core.domain import topic_fetchers
from core.domain import topic_services
Expand Down Expand Up @@ -622,13 +620,18 @@ def _load_dummy_new_structures_data(self) -> None:
'User does not have enough rights to generate data.')
topic_id_1 = topic_fetchers.get_new_topic_id()
topic_id_2 = topic_fetchers.get_new_topic_id()

story_id = story_services.get_new_story_id()

skill_id_1 = skill_services.get_new_skill_id()
skill_id_2 = skill_services.get_new_skill_id()
skill_id_3 = skill_services.get_new_skill_id()

question_id_1 = question_services.get_new_question_id()
question_id_2 = question_services.get_new_question_id()
question_id_3 = question_services.get_new_question_id()
question_id_4 = question_services.get_new_question_id()
question_id_5 = question_services.get_new_question_id()

skill_1 = self._create_dummy_skill(
skill_id_1, 'Dummy Skill 1', '<p>Dummy Explanation 1</p>')
Expand All @@ -643,12 +646,23 @@ def _load_dummy_new_structures_data(self) -> None:
question_id_2, 'Question 2', [skill_id_2])
question_3 = self._create_dummy_question(
question_id_3, 'Question 3', [skill_id_3])
question_4 = self._create_dummy_question(
question_id_4, 'Question 4', [skill_id_1])
question_5 = self._create_dummy_question(
question_id_5, 'Question 5', [skill_id_1])

question_services.add_question(self.user_id, question_1)
question_services.add_question(self.user_id, question_4)
question_services.add_question(self.user_id, question_5)
question_services.add_question(self.user_id, question_2)
question_services.add_question(self.user_id, question_3)

question_services.create_new_question_skill_link(
self.user_id, question_id_1, skill_id_1, 0.3)
question_services.create_new_question_skill_link(
self.user_id, question_id_4, skill_id_1, 0.3)
question_services.create_new_question_skill_link(
self.user_id, question_id_5, skill_id_1, 0.3)
question_services.create_new_question_skill_link(
self.user_id, question_id_2, skill_id_2, 0.5)
question_services.create_new_question_skill_link(
Expand All @@ -657,21 +671,21 @@ def _load_dummy_new_structures_data(self) -> None:
topic_1 = topic_domain.Topic.create_default_topic(
topic_id_1, 'Dummy Topic 1', 'dummy-topic-one', 'description',
'fragm')
topic_1.skill_ids_for_diagnostic_test = [skill_id_1]
topic_1.thumbnail_filename = 'thumbnail.svg'
topic_1.thumbnail_bg_color = '#C6DCDA'
topic_1.subtopics = [
topic_domain.Subtopic(
1, 'Title', [skill_id_1], 'image.svg',
constants.ALLOWED_THUMBNAIL_BG_COLORS['subtopic'][0], 21131,
'dummy-subtopic-three')]
topic_1.next_subtopic_id = 2
topic_1.add_canonical_story(story_id)

topic_2 = topic_domain.Topic.create_default_topic(
topic_id_2, 'Empty Topic', 'empty-topic', 'description',
'fragm')

topic_1.add_canonical_story(story_id)
topic_1.add_uncategorized_skill_id(skill_id_1)
topic_1.add_uncategorized_skill_id(skill_id_2)
topic_1.add_uncategorized_skill_id(skill_id_3)
topic_1.add_subtopic(1, 'Dummy Subtopic Title', 'dummysubtopic')
topic_1.move_skill_id_to_subtopic(None, 1, skill_id_2)
topic_1.move_skill_id_to_subtopic(None, 1, skill_id_3)

subtopic_page = (
subtopic_page_domain.SubtopicPage.create_default_subtopic_page(
1, topic_id_1))
# These explorations were chosen since they pass the validations
# for published stories.
self._reload_exploration('6')
Expand Down Expand Up @@ -758,16 +772,8 @@ def generate_dummy_story_nodes(
skill_services.save_new_skill(self.user_id, skill_3)
story_services.save_new_story(self.user_id, story)
topic_services.save_new_topic(self.user_id, topic_1)
topic_services.publish_topic(topic_id_1, self.user_id)
topic_services.save_new_topic(self.user_id, topic_2)
subtopic_page_services.save_subtopic_page(
self.user_id, subtopic_page, 'Added subtopic',
[topic_domain.TopicChange({
'cmd': topic_domain.CMD_ADD_SUBTOPIC,
'subtopic_id': 1,
'title': 'Dummy Subtopic Title',
'url_fragment': 'dummy-fragment'
})]
)

# Generates translation opportunities for the Contributor Dashboard.
exp_ids_in_story = story.story_contents.get_all_linked_exp_ids()
Expand Down
2 changes: 1 addition & 1 deletion core/controllers/admin_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ def test_load_new_structures_data(self) -> None:
skill_summaries[0].id, skill_summaries[1].id,
skill_summaries[2].id], 0)
)
self.assertEqual(len(questions), 3)
self.assertEqual(len(questions), 5)
# Testing that there are 3 hindi translation opportunities
# available on the Contributor Dashboard. Hindi was picked arbitrarily,
# any language code other than english (what the dummy explorations
Expand Down
3 changes: 0 additions & 3 deletions core/controllers/base_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,6 @@ def test_that_no_get_results_in_500_error(self) -> None:
url, [200, 301, 302, 400, 401, 404])

# TODO(sll): Add similar tests for POST, PUT, DELETE.
# TODO(sll): Set a self.payload attr in the BaseHandler for
# POST, PUT and DELETE. Something needs to regulate what
# the fields in the payload should be.

def test_requests_for_missing_csrf_token(self) -> None:
"""Tests request without csrf_token results in 401 error."""
Expand Down
3 changes: 0 additions & 3 deletions core/controllers/creator_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,6 @@ def _round_average_ratings(rating: float) -> float:
feedback_services.get_thread_analytics_multi(
exploration_ids_subscribed_to))

# TODO(bhenning): Update this to use unresolved answers from
# stats_services once the training interface is enabled and it's cheaper
# to retrieve top answers from stats_services.
displayable_exploration_summary_dicts: List[
DisplayableExplorationSummaryDict
] = []
Expand Down
4 changes: 2 additions & 2 deletions core/controllers/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,9 @@ def put(self) -> None:
"""Handles PUT request."""
assert self.normalized_payload is not None
email = self.normalized_payload['email']
name = self.normalized_payload['name']
name = self.normalized_payload.get('name')
tag = self.normalized_payload['tag']
status = user_services.add_user_to_mailing_list(email, name, tag)
status = user_services.add_user_to_mailing_list(email, tag, name=name)
self.render_json({'status': status})


Expand Down
23 changes: 12 additions & 11 deletions core/controllers/profile_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -986,7 +986,8 @@ class MailingListSubscriptionHandlerTests(test_utils.GenericTestBase):

def test_put_function(self) -> None:
swap_add_fn = self.swap(
user_services, 'add_user_to_mailing_list', lambda *args: True)
user_services, 'add_user_to_mailing_list', lambda *args,
**kwargs: True)

self.signup(self.VIEWER_EMAIL, self.VIEWER_USERNAME)
self.login(self.VIEWER_EMAIL)
Expand All @@ -996,8 +997,8 @@ def test_put_function(self) -> None:
json_response = self.put_json(
'/mailinglistsubscriptionhandler', {
'email': 'email@example.com',
'name': 'Name',
'tag': 'Web'
'tag': 'Web',
'name': 'Name'
}, csrf_token=csrf_token)
self.assertEqual(json_response, {'status': True})

Expand All @@ -1017,8 +1018,8 @@ def raise_exception() -> None:
self.put_json(
'/mailinglistsubscriptionhandler', {
'email': 'email@example.com',
'name': 'Name',
'tag': 'Web'
'tag': 'Web',
'name': 'Name'
}, csrf_token=csrf_token, expected_status_int=500)

self.logout()
Expand All @@ -1035,22 +1036,22 @@ def test_invalid_inputs(self) -> None:
self.put_json(
'/mailinglistsubscriptionhandler', {
'email': 'invalidemail.com',
'name': 'Name',
'tag': 'Web'
'tag': 'Web',
'name': 'Name'
}, csrf_token=csrf_token, expected_status_int=400)

self.put_json(
'/mailinglistsubscriptionhandler', {
'email': 'email@example.com',
'name': '',
'tag': 'Web'
'tag': 'Web',
'name': ''
}, csrf_token=csrf_token, expected_status_int=400)

self.put_json(
'/mailinglistsubscriptionhandler', {
'email': 'email@example.com',
'name': 'Name',
'tag': ''
'tag': '',
'name': 'Name'
}, csrf_token=csrf_token, expected_status_int=400)

self.logout()
Expand Down
4 changes: 0 additions & 4 deletions core/controllers/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -1911,10 +1911,6 @@ class RecommendationsHandler(
if there are upcoming explorations for the learner to complete.
"""

# TODO(bhenning): Move the recommendation selection logic & related tests
# to the domain layer as service methods or to the frontend to reduce the
# amount of logic needed in this handler.

GET_HANDLER_ERROR_RETURN_TYPE = feconf.HANDLER_TYPE_JSON

URL_PATH_ARGS_SCHEMAS = {
Expand Down
4 changes: 0 additions & 4 deletions core/controllers/reader_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -734,10 +734,6 @@ def _get_recommendation_ids(
# TODO(bhenning): Add tests for ensuring system explorations are properly
# sampled when there are many matched for a given exploration ID.

# TODO(bhenning): Verify whether recommended author-specified explorations
# are also played within the context of collections, and whether that's
# desirable.

def _set_recommendations(
self, exp_id: str, recommended_ids: List[str]
) -> None:
Expand Down
4 changes: 0 additions & 4 deletions core/controllers/recent_commits.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ class RecentCommitsHandler(
):
"""Returns a list of recent commits."""

# TODO(sll): Accept additional URL parameters that filter by user_id and
# exploration_id. For the former, do a check to ensure that the user is
# allowed to see this data (as it may include private explorations).

GET_HANDLER_ERROR_RETURN_TYPE = feconf.HANDLER_TYPE_JSON
URL_PATH_ARGS_SCHEMAS: Dict[str, str] = {}
HANDLER_ARGS_SCHEMAS = {
Expand Down
1 change: 0 additions & 1 deletion core/domain/collection_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,6 @@ def get_collection_summary_by_id(
corresponding to a collection with the given collection_id or
None if no CollectionSummaryModel exists for the given ID.
"""
# TODO(msl): Maybe use memcache similarly to get_collection_by_id.
collection_summary_model = collection_models.CollectionSummaryModel.get(
collection_id, strict=False)
if collection_summary_model is None:
Expand Down
7 changes: 0 additions & 7 deletions core/domain/collection_services_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2078,13 +2078,6 @@ def test_contributor_summary(self) -> None:
self.COLLECTION_0_ID,
{self.albert_id: 2, self.bob_id: 2})

# TODO(madiyar): Uncomment after revert_collection implementation
# Have Albert revert to version 3. Version 5
# collection_services.revert_collection(albert_id,
# self.COLLECTION_ID, 4, 3)
# self._check_contributors_summary(self.COLLECTION_ID,
# {albert_id: 1, bob_id: 2})

def test_create_collection_summary_with_contributor_to_remove(self) -> None:
self.save_new_valid_collection(
self.COLLECTION_0_ID, self.albert_id)
Expand Down
4 changes: 2 additions & 2 deletions core/domain/email_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@
'There are suggestions on the <a href="%s%s">Contributor Dashboard</a> '
'that have been waiting for more than %s days for review. Please take '
'a look at the suggestions mentioned below and help them get reviewed '
'by going to the <a href="%s%s#/roles">admin roles page</a> and either:'
'by going to the <a href="%s%s">admin roles page</a> and either:'
'<br><br><ul>'
'<li>Add more reviewers to the suggestion types that have suggestions '
'waiting too long for a review</li><br>'
Expand Down Expand Up @@ -1761,7 +1761,7 @@ def _send_suggestions_waiting_too_long_email(
curriculum_admin_usernames[index], feconf.OPPIA_SITE_URL,
feconf.CONTRIBUTOR_DASHBOARD_URL,
suggestion_models.SUGGESTION_REVIEW_WAIT_TIME_THRESHOLD_IN_DAYS,
feconf.OPPIA_SITE_URL, feconf.ADMIN_URL,
feconf.OPPIA_SITE_URL, feconf.CONTRIBUTOR_DASHBOARD_ADMIN_URL,
list_of_suggestion_descriptions)

_send_email(
Expand Down
Loading

0 comments on commit ecf2361

Please sign in to comment.