Skip to content

Commit

Permalink
Remove gadgets functionality and update the exploration schema versio…
Browse files Browse the repository at this point in the history
…n accordingly. (oppia#3801)

* Remove gadgets functionality.

* Remove unnecessary regex.
  • Loading branch information
seanlip authored and tjiang11 committed Aug 26, 2017
1 parent 7ec1402 commit 7d3d505
Show file tree
Hide file tree
Showing 97 changed files with 2,225 additions and 6,825 deletions.
18 changes: 6 additions & 12 deletions app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,6 @@ handlers:
# TODO(Sean Lip): Add cache when system to break cache during
# new release is figured out.
Cache-Control: 'no-cache'
- url: /extensions/gadgets/(.*)/static/(.*)
static_files: extensions/gadgets/\1/static/\2
upload: extensions/gadgets/(.*)/static/(.*)
secure: always
http_headers:
Cache-Control: 'no-cache'
- url: /extensions/interactions/(.*)/static/(.*)
static_files: extensions/interactions/\1/static/\2
upload: extensions/interactions/(.*)/static/(.*)
Expand All @@ -93,13 +87,13 @@ handlers:
secure: always
http_headers:
Cache-Control: 'no-cache'
# Serve js scripts for gadgets, interactions, rich_text_components and objects
# under extensions in dev mode. This regex allows us to recursively serve js
# scripts under the three specified directories. "\1" and "\2" insert capture
# groups from the url pattern.
- url: /extensions/(gadgets|interactions|rich_text_components|objects)/(.*\.(js))$
# Serve js scripts for interactions, rich_text_components and objects under
# extensions in dev mode. This regex allows us to recursively serve js scripts
# under the three specified directories. "\1" and "\2" insert capture groups
# from the url pattern.
- url: /extensions/(interactions|rich_text_components|objects)/(.*\.(js))$
static_files: extensions/\1/\2
upload: extensions/(gadgets|interactions|rich_text_components|objects)/(.*\.(js))$
upload: extensions/(interactions|rich_text_components|objects)/(.*\.(js))$
secure: always
- url: /mapreduce/pipeline/images
static_dir: third_party/gae-mapreduce-1.9.17.0/mapreduce/lib/pipeline/ui/images
Expand Down
11 changes: 0 additions & 11 deletions core/controllers/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
from core.domain import exp_domain
from core.domain import exp_services
from core.domain import fs_domain
from core.domain import gadget_registry
from core.domain import interaction_registry
from core.domain import obj_services
from core.domain import rights_manager
Expand Down Expand Up @@ -143,14 +142,8 @@ def get(self, exploration_id):
interaction_registry.Registry.get_interaction_html(
interaction_ids))

gadget_types = gadget_registry.Registry.get_all_gadget_types()
gadget_templates = (
gadget_registry.Registry.get_gadget_html(gadget_types))

self.values.update({
'GADGET_SPECS': gadget_registry.Registry.get_all_specs(),
'INTERACTION_SPECS': interaction_registry.Registry.get_all_specs(),
'PANEL_SPECS': feconf.PANELS_PROPERTIES,
'DEFAULT_OBJECT_VALUES': obj_services.get_default_object_values(),
'DEFAULT_TWITTER_SHARE_MESSAGE_EDITOR': (
DEFAULT_TWITTER_SHARE_MESSAGE_EDITOR.value),
Expand All @@ -170,7 +163,6 @@ def get(self, exploration_id):
'can_unpublish': rights_manager.check_can_unpublish_activity(
self.user, exploration_rights),
'dependencies_html': jinja2.utils.Markup(dependencies_html),
'gadget_templates': jinja2.utils.Markup(gadget_templates),
'interaction_templates': jinja2.utils.Markup(
interaction_templates),
'meta_description': feconf.CREATE_PAGE_DESCRIPTION,
Expand All @@ -179,7 +171,6 @@ def get(self, exploration_id):
get_value_generators_js()),
'title': exploration.title,
'visualizations_html': jinja2.utils.Markup(visualizations_html),
'ALLOWED_GADGETS': feconf.ALLOWED_GADGETS,
'ALLOWED_INTERACTION_CATEGORIES': (
feconf.ALLOWED_INTERACTION_CATEGORIES),
'INVALID_PARAMETER_NAMES': feconf.INVALID_PARAMETER_NAMES,
Expand Down Expand Up @@ -242,8 +233,6 @@ def _get_exploration_data(
exploration_id).to_dict(),
'show_state_editor_tutorial_on_load': (
self.user_id and not self.has_seen_editor_tutorial),
'skin_customizations': exploration.skin_instance.to_dict()[
'skin_customizations'],
'states': states,
'tags': exploration.tags,
'title': exploration.title,
Expand Down
6 changes: 0 additions & 6 deletions core/controllers/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
from core.domain import exp_domain
from core.domain import exp_services
from core.domain import feedback_services
from core.domain import gadget_registry
from core.domain import interaction_registry
from core.domain import learner_progress_services
from core.domain import moderator_services
Expand Down Expand Up @@ -76,7 +75,6 @@ def _get_exploration_player_data(
version = exploration.version

# TODO(sll): Cache these computations.
gadget_types = exploration.get_gadget_types()
interaction_ids = exploration.get_interaction_ids()
dependency_ids = (
interaction_registry.Registry.get_deduplicated_dependency_ids(
Expand All @@ -85,15 +83,12 @@ def _get_exploration_player_data(
dependency_registry.Registry.get_deps_html_and_angular_modules(
dependency_ids))

gadget_templates = (
gadget_registry.Registry.get_gadget_html(gadget_types))
interaction_templates = (
rte_component_registry.Registry.get_html_for_all_components() +
interaction_registry.Registry.get_interaction_html(
interaction_ids))

return {
'GADGET_SPECS': gadget_registry.Registry.get_all_specs(),
'INTERACTION_SPECS': interaction_registry.Registry.get_all_specs(),
'DEFAULT_TWITTER_SHARE_MESSAGE_PLAYER': (
DEFAULT_TWITTER_SHARE_MESSAGE_PLAYER.value),
Expand All @@ -105,7 +100,6 @@ def _get_exploration_player_data(
'exploration_version': version,
'collection_id': collection_id,
'collection_title': collection_title,
'gadget_templates': jinja2.utils.Markup(gadget_templates),
'interaction_templates': jinja2.utils.Markup(
interaction_templates),
'is_private': rights_manager.is_exploration_private(
Expand Down
2 changes: 1 addition & 1 deletion core/controllers/reader_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ def setUp(self):
category='Architecture', language_code='en')

self.save_new_valid_exploration(
self.EXP_ID_1, self.owner_id, title='Welcome to Gadgets',
self.EXP_ID_1, self.owner_id, title='Welcome',
category='Architecture', language_code='fi')

self.save_new_valid_exploration(
Expand Down
5 changes: 2 additions & 3 deletions core/domain/collection_services_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ class CollectionSummaryQueriesUnitTests(CollectionServicesUnitTests):
COL_ID_0 = '0_arch_bridges_in_england'
COL_ID_1 = '1_welcome_introduce_oppia'
COL_ID_2 = '2_welcome_introduce_oppia_interactions'
COL_ID_3 = '3_welcome_gadgets'
COL_ID_3 = '3_welcome'
COL_ID_4 = '4_languages_learning_basic_verbs_in_spanish'
COL_ID_5 = '5_languages_private_collection_in_spanish'

Expand All @@ -325,8 +325,7 @@ def setUp(self):
self.COL_ID_2, self.owner_id,
title='Introduce Interactions in Oppia', category='Welcome')
self.save_new_default_collection(
self.COL_ID_3, self.owner_id, title='Welcome to Gadgets',
category='Welcome')
self.COL_ID_3, self.owner_id, title='Welcome', category='Welcome')
self.save_new_default_collection(
self.COL_ID_4, self.owner_id,
title='Learning basic verbs in Spanish', category='Languages')
Expand Down
Loading

0 comments on commit 7d3d505

Please sign in to comment.