Skip to content

Commit

Permalink
Remove LMS import/export feature flag
Browse files Browse the repository at this point in the history
This flag has now been enabled in the client for all users.
  • Loading branch information
robertknight committed Dec 19, 2023
1 parent d997bc2 commit d4e87b1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 33 deletions.
1 change: 0 additions & 1 deletion lms/models/application_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ class ApplicationSettings(JSONSettings):
asbool,
name="Auto Assigned To Organisation",
),
JSONSetting("hypothesis", "import_export_enabled", asbool),
JSONSetting("hypothesis", "instructor_email_digests_enabled", asbool),
)

Expand Down
1 change: 0 additions & 1 deletion lms/templates/admin/application_instance/show.html.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@
<input type="hidden" name="csrf_token" value="{{ get_csrf_token() }}">
<fieldset class="box">
<legend class="label has-text-centered">General settings</legend>
{{ settings_checkbox("Enable import/export in client", "hypothesis", "import_export_enabled", default=False) }}
{{ settings_checkbox('Enable instructor email digests', 'hypothesis', 'instructor_email_digests_enabled') }}
</fieldset>
<fieldset class="box">
Expand Down
13 changes: 5 additions & 8 deletions lms/views/lti/basic_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,11 @@ def _show_document(self, assignment):
self.context.js_config.add_document_url(assignment.document_url)
self.context.js_config.enable_lti_launch_mode(self.course, assignment)

import_export_enabled = self.request.lti_user.application_instance.settings.get(
"hypothesis", "import_export_enabled", False
)

if import_export_enabled:
js_config = self.context.js_config
js_config.enable_client_feature("import_annotations")
js_config.enable_client_feature("export_annotations")
# If there are any Hypothesis client feature flags that need to be
# enabled based on the current application instance settings, those
# should be enabled here via `self.context.js_config.enable_client_feature`.
#
# There are currently no such features.

# Run any non standard code for the current product
self._misc_plugin.post_launch_assignment_hook(
Expand Down
23 changes: 0 additions & 23 deletions tests/unit/lms/views/lti/basic_launch_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,29 +292,6 @@ def test__show_document_configures_toolbar(

assert result == {}

@pytest.mark.parametrize("import_export_feature", [True, False])
def test__show_document_enables_client_features(
self, svc, pyramid_request, context, assignment, import_export_feature
):
pyramid_request.lti_user.application_instance.settings.set(
"hypothesis", "import_export_enabled", import_export_feature
)

# pylint: disable=protected-access
svc._show_document(assignment)

expected_features = set()
if import_export_feature:
expected_features.add("import_annotations")
expected_features.add("export_annotations")

enable_client_feature = context.js_config.enable_client_feature
actual_features = set(
call.args[0] for call in enable_client_feature.call_args_list
)

assert actual_features == expected_features

@pytest.fixture
def assignment(self):
return factories.Assignment(is_gradable=False)
Expand Down

0 comments on commit d4e87b1

Please sign in to comment.