Change login MFE to use image layout

Hello

I want to change the login page to use the image layout. I was able to do this when mounting a custom authn MFE but I saw that you can also change the env variables using a plugin if I am understanding correctly from what I saw in the MFE git repo? I would prefer this to avoid having to add custom MFEs if possible.

It seemed logical to follow this section from the MFE github based on the env variables available in frontend-app-authn github.
GitHub - overhangio/tutor-mfe: This plugin makes it possible to easily add micro frontend (MFE) applications on top of an Open edX platform that runs with Tutor.

Below is my take on the plugin to enable this layout.

from tutor import hooks

hooks.Filters.ENV_PATCHES.add_items(
        [
                (
                        "mfe-lms-common-settings",
                        """
MFE_CONFIG["ENABLE_IMAGE_LAYOUT"] = True
MFE_CONFIG["BANNER_IMAGE_LARGE"]="http://local.edly.io:8000/theming/asset/images/banner.png"
MFE_CONFIG["BANNER_IMAGE_MEDIUM"]="http://local.edly.io:8000/theming/asset/images/banner.png"
MFE_CONFIG["BANNER_IMAGE_SMALL"]="http://local.edly.io:8000/theming/asset/images/banner.png"
MFE_CONFIG["BANNER_IMAGE_EXTRA_SMALL"]="http://local.edly.io:8000/theming/asset/images/banner.png"
"""
                )
        ]
)

Please let me know if theres anything I should change or if I should just go ahead and make a custom authn MFE to do this.

I am also on tutor v17.0.3

Have you enabled this plugin and tried out the platform? You probably will have to rebuild the MFE images after enabling this plugin.

Thanks for your response.

Yes I have, I have enabled and built many times with slightly different configurations each time that I am actually starting to lose track. I have also tried adding those variables to the dockerfile but that did not work either.

I have had this work before on another instance of tutor on a different computer however that one is v18. I might have to upgrade to version 18 or just settle for a custom MFE where I can modify the env variables myself.

I don’t think it’s an issue of the version as the tutor-mfe README in version 17.0.1 too has those options.

So I tried to repeat the steps exactly the same way as I do on the v18 instance where it works.

I mounted the frontend-app-authn MFE, I applied my plugin which applies the arguments in the Dockerfile, built the image with tutor images build authn-dev and ran tutor dev start.

I repeated this on the v17 instance however I did not get the same result.

I copied over the plugin used on the first instance exactly which also did not help.

I installed the tutor version manager plugin on the server where it does not work so I could test out v18 on it to seem if I get the same result. I enabled image layout using the plugin I made and it worked first time so this must be a v17 bug because I also created an extra instance of v17 which also did not work. I guess I have an excuse to update now haha.

1 Like