diff --git a/README.rst b/README.rst index 2540cd2..33e7ccf 100644 --- a/README.rst +++ b/README.rst @@ -19,7 +19,6 @@ community: Plugin Status (*Experimental*, *Production*, or *Deprecated*) =================================== ====================================================== tutor-contrib-learner-dashboard-mfe Deprecated -tutor-contrib-library-authoring-mfe Experimental =================================== ====================================================== Getting Started diff --git a/plugins/tutor-contrib-library-authoring-mfe/.gitignore b/plugins/tutor-contrib-library-authoring-mfe/.gitignore deleted file mode 100644 index f6a874f..0000000 --- a/plugins/tutor-contrib-library-authoring-mfe/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -.*.swp -!.gitignore -TODO -__pycache__ -*.egg-info/ -/build/ -/dist/ diff --git a/plugins/tutor-contrib-library-authoring-mfe/MANIFEST.in b/plugins/tutor-contrib-library-authoring-mfe/MANIFEST.in deleted file mode 100644 index 280b3f7..0000000 --- a/plugins/tutor-contrib-library-authoring-mfe/MANIFEST.in +++ /dev/null @@ -1,2 +0,0 @@ -recursive-include tutor_library_authoring_mfe/patches * -recursive-include tutor_library_authoring_mfe/templates * diff --git a/plugins/tutor-contrib-library-authoring-mfe/README.rst b/plugins/tutor-contrib-library-authoring-mfe/README.rst deleted file mode 100644 index bcc4244..0000000 --- a/plugins/tutor-contrib-library-authoring-mfe/README.rst +++ /dev/null @@ -1,32 +0,0 @@ -library_authoring_mfe plugin for `Tutor `_ -=================================================================================== - -Installation ------------- - -Follow these instructions to enable this microfrontend: - -* Install `tutor `_ and `tutor-mfe `_: ``pip install tutor tutor-mfe`` -* Enable this plugin: ``tutor plugins enable library-authoring-mfe`` -* Save the tutor config: ``tutor config save`` -* Build mfe image: ``tutor images build mfe`` (if you have trouble here you may need to run it with ``--no-cache``) -* Launch tutor: ``tutor local launch`` - -If you want to run this MFE in -`development mode `_ -(to make changes to the code), instead of step 9 above, do this:: - - tutor config save --append MOUNTS=./frontend-app-library-authoring - cd frontend-app-library-authoring - nvm use && npm install - tutor dev launch - -Setup ------ -* Ensure you have created a user: https://docs.tutor.overhang.io/local.html#creating-a-new-user-with-staff-and-admin-rights -* Ensure you have created an organization: http://studio.local.overhang.io/admin/organizations/organization/ - -Usage ------ -* Log in to studio: http://studio.local.overhang.io/home/ -* Click on the libraries tab diff --git a/plugins/tutor-contrib-library-authoring-mfe/setup.py b/plugins/tutor-contrib-library-authoring-mfe/setup.py deleted file mode 100644 index 5c7496f..0000000 --- a/plugins/tutor-contrib-library-authoring-mfe/setup.py +++ /dev/null @@ -1,60 +0,0 @@ -import io -import os -from setuptools import setup, find_packages - -HERE = os.path.abspath(os.path.dirname(__file__)) - - -def load_readme(): - with io.open(os.path.join(HERE, "README.rst"), "rt", encoding="utf8") as f: - return f.read() - - -def load_about(): - about = {} - with io.open( - os.path.join(HERE, "tutor_library_authoring_mfe", "__about__.py"), - "rt", - encoding="utf-8", - ) as f: - exec(f.read(), about) # pylint: disable=exec-used - return about - - -ABOUT = load_about() - - -setup( - name="tutor-contrib-library-authoring-mfe", - version=ABOUT["__version__"], - url="https://github.com/openedx/openedx-tutor-plugins", - project_urls={ - "Code": "https://github.com/openedx/openedx-tutor-plugins", - "Issue tracker": "https://github.com/openedx/openedx-tutor-plugins/issues", - }, - license="AGPLv3", - author="Braden MacDonald", - description="Library Authoring MFE plugin for Tutor", - long_description=load_readme(), - packages=find_packages(exclude=["tests*"]), - include_package_data=True, - python_requires=">=3.8", - install_requires=["tutor>=17.0.0,<18.0.0", "tutor-mfe>=17.0.0,<18.0.0"], - extras_require={"dev": ["tutor[dev]>=17.0.0,<18.0.0"]}, - entry_points={ - "tutor.plugin.v1": [ - "library-authoring-mfe = tutor_library_authoring_mfe.plugin" - ] - }, - classifiers=[ - "Development Status :: 3 - Alpha", - "Intended Audience :: Developers", - "License :: OSI Approved :: GNU Affero General Public License v3", - "Operating System :: OS Independent", - "Programming Language :: Python", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - ], -) diff --git a/plugins/tutor-contrib-library-authoring-mfe/tutor_library_authoring_mfe/__about__.py b/plugins/tutor-contrib-library-authoring-mfe/tutor_library_authoring_mfe/__about__.py deleted file mode 100644 index 493f741..0000000 --- a/plugins/tutor-contrib-library-authoring-mfe/tutor_library_authoring_mfe/__about__.py +++ /dev/null @@ -1 +0,0 @@ -__version__ = "0.3.0" diff --git a/plugins/tutor-contrib-library-authoring-mfe/tutor_library_authoring_mfe/__init__.py b/plugins/tutor-contrib-library-authoring-mfe/tutor_library_authoring_mfe/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/plugins/tutor-contrib-library-authoring-mfe/tutor_library_authoring_mfe/patches/mfe-webpack-dev-config b/plugins/tutor-contrib-library-authoring-mfe/tutor_library_authoring_mfe/patches/mfe-webpack-dev-config deleted file mode 100644 index f2ea2bf..0000000 --- a/plugins/tutor-contrib-library-authoring-mfe/tutor_library_authoring_mfe/patches/mfe-webpack-dev-config +++ /dev/null @@ -1,14 +0,0 @@ -// If this is the Library Authoring MFE, serve xblock-bootstrap.html statically. -if (fs.existsSync("src/library-authoring/edit-block/LibraryBlock/xblock-bootstrap.html")) { - const path = require('path'); - const CopyPlugin = require('copy-webpack-plugin'); - - module.exports.plugins.push( - new CopyPlugin({ - patterns: [{ - context: path.resolve(__dirname, 'src/library-authoring/edit-block/LibraryBlock'), - from: 'xblock-bootstrap.html', - }], - }), - ); -} diff --git a/plugins/tutor-contrib-library-authoring-mfe/tutor_library_authoring_mfe/patches/openedx-cms-development-settings b/plugins/tutor-contrib-library-authoring-mfe/tutor_library_authoring_mfe/patches/openedx-cms-development-settings deleted file mode 100644 index 81e7ade..0000000 --- a/plugins/tutor-contrib-library-authoring-mfe/tutor_library_authoring_mfe/patches/openedx-cms-development-settings +++ /dev/null @@ -1,4 +0,0 @@ -LIBRARY_AUTHORING_MICROFRONTEND_URL = "http://{{ MFE_HOST }}:{{ get_mfe('library-authoring')['port'] }}/library-authoring/" -CORS_ORIGIN_WHITELIST.append("http://{{ MFE_HOST }}:{{ get_mfe('library-authoring')['port'] }}") -LOGIN_REDIRECT_WHITELIST.append("{{ MFE_HOST }}:{{ get_mfe('library-authoring')['port'] }}") -CSRF_TRUSTED_ORIGINS.append("http://{{ MFE_HOST }}:{{ get_mfe('library-authoring')['port'] }}") diff --git a/plugins/tutor-contrib-library-authoring-mfe/tutor_library_authoring_mfe/patches/openedx-cms-production-settings b/plugins/tutor-contrib-library-authoring-mfe/tutor_library_authoring_mfe/patches/openedx-cms-production-settings deleted file mode 100644 index 5d0bc14..0000000 --- a/plugins/tutor-contrib-library-authoring-mfe/tutor_library_authoring_mfe/patches/openedx-cms-production-settings +++ /dev/null @@ -1,4 +0,0 @@ -LIBRARY_AUTHORING_MICROFRONTEND_URL = "{% if ENABLE_HTTPS %}https://{% else %}http://{% endif %}{{ MFE_HOST }}/library-authoring/" -CORS_ORIGIN_WHITELIST.append("{% if ENABLE_HTTPS %}https://{% else %}http://{% endif %}{{ MFE_HOST }}") -LOGIN_REDIRECT_WHITELIST.append("{{ MFE_HOST }}") -CSRF_TRUSTED_ORIGINS.append("{% if ENABLE_HTTPS %}https://{% else %}http://{% endif %}{{ MFE_HOST }}") diff --git a/plugins/tutor-contrib-library-authoring-mfe/tutor_library_authoring_mfe/patches/openedx-common-settings b/plugins/tutor-contrib-library-authoring-mfe/tutor_library_authoring_mfe/patches/openedx-common-settings deleted file mode 100644 index cdfdda6..0000000 --- a/plugins/tutor-contrib-library-authoring-mfe/tutor_library_authoring_mfe/patches/openedx-common-settings +++ /dev/null @@ -1 +0,0 @@ -FEATURES["ENABLE_LIBRARY_AUTHORING_MICROFRONTEND"] = True diff --git a/plugins/tutor-contrib-library-authoring-mfe/tutor_library_authoring_mfe/patches/openedx-lms-common-settings b/plugins/tutor-contrib-library-authoring-mfe/tutor_library_authoring_mfe/patches/openedx-lms-common-settings deleted file mode 100644 index 5d092f7..0000000 --- a/plugins/tutor-contrib-library-authoring-mfe/tutor_library_authoring_mfe/patches/openedx-lms-common-settings +++ /dev/null @@ -1,2 +0,0 @@ -MFE_CONFIG_OVERRIDES.setdefault("library-authoring", {}) -MFE_CONFIG_OVERRIDES["library-authoring"]["SECURE_ORIGIN_XBLOCK_BOOTSTRAP_HTML_URL"] = "/library-authoring/xblock-bootstrap.html" diff --git a/plugins/tutor-contrib-library-authoring-mfe/tutor_library_authoring_mfe/plugin.py b/plugins/tutor-contrib-library-authoring-mfe/tutor_library_authoring_mfe/plugin.py deleted file mode 100644 index 4bfec83..0000000 --- a/plugins/tutor-contrib-library-authoring-mfe/tutor_library_authoring_mfe/plugin.py +++ /dev/null @@ -1,85 +0,0 @@ -from __future__ import annotations -from glob import glob -import os -import pkg_resources -import uuid - -from tutor import hooks as tutor_hooks -from tutormfe.hooks import MFE_APPS, MFE_ATTRS_TYPE - -from .__about__ import __version__ - -######################################## -# CONFIGURATION -######################################## - -@MFE_APPS.add() -def _add_library_authoring_mfe(apps: dict[str, MFE_ATTRS_TYPE]) -> dict[str, MFE_ATTRS_TYPE]: - apps.update( - { - "library-authoring": { - "repository": "https://github.com/openedx/frontend-app-library-authoring.git", - "port": 3001, - }, - } - ) - return apps - -# This serves no backend purpose at the moment, and should be removed. But it's -# currently echoed through to the backend and the v2 library creation endpoint -# expects to receive some UUID, even if it doesn't do anything with it any -# longer. We should delete this after modifying the view and MFE code to stop -# using it. -tutor_hooks.Filters.CONFIG_UNIQUE.add_items( - [ - ("BLOCKSTORE_COLLECTION_UUID", str(uuid.uuid4())) - ] -) - - -######################################## -# INITIALIZATION TASKS -######################################## - -MY_INIT_TASKS: list[tuple[str, tuple[str, ...]]] = [ - ("cms", ("library_authoring_mfe", "jobs", "init", "cms.sh")), -] - -# For each task added to MY_INIT_TASKS, we load the task template -# and add it to the CLI_DO_INIT_TASKS filter, which tells Tutor to -# run it as part of the `init` job. -for service, template_path in MY_INIT_TASKS: - full_path: str = pkg_resources.resource_filename( - "tutor_library_authoring_mfe", os.path.join("templates", *template_path) - ) - with open(full_path, encoding="utf-8") as init_task_file: - init_task: str = init_task_file.read() - tutor_hooks.Filters.CLI_DO_INIT_TASKS.add_item((service, init_task)) - - -######################################## -# TEMPLATE RENDERING -######################################## - -tutor_hooks.Filters.ENV_TEMPLATE_ROOTS.add_items( - # Root paths for template files, relative to the project root. - [ - pkg_resources.resource_filename("tutor_library_authoring_mfe", "templates"), - ] -) - - -######################################## -# PATCH LOADING -######################################## - -# For each file in tutor_library_authoring_mfe/patches, -# apply a patch based on the file's name and contents. -for path in glob( - os.path.join( - pkg_resources.resource_filename("tutor_library_authoring_mfe", "patches"), - "*", - ) -): - with open(path, encoding="utf-8") as patch_file: - tutor_hooks.Filters.ENV_PATCHES.add_item((os.path.basename(path), patch_file.read())) diff --git a/plugins/tutor-contrib-library-authoring-mfe/tutor_library_authoring_mfe/templates/library_authoring_mfe/jobs/init/cms.sh b/plugins/tutor-contrib-library-authoring-mfe/tutor_library_authoring_mfe/templates/library_authoring_mfe/jobs/init/cms.sh deleted file mode 100644 index 730ad48..0000000 --- a/plugins/tutor-contrib-library-authoring-mfe/tutor_library_authoring_mfe/templates/library_authoring_mfe/jobs/init/cms.sh +++ /dev/null @@ -1,2 +0,0 @@ -# Enable the waffle flag to use this MFE -(./manage.py cms waffle_flag --list | grep studio.library_authoring_mfe) || ./manage.py lms waffle_flag studio.library_authoring_mfe --create --everyone