Change the PLATFORM_NAME Prefix and Remove/Disable Register Button from Login Page

I want to customize the text “Start learning with” that comes before the PLATFORM_NAME (DP Learning). I also want to remoe the register button before the sign in button. I used the command tutor config save --set ALLOW_PUBLIC_ACCOUNT_CREATION=false
and
tutor config save --set SHOW_REGISTRATION_LINKS=false
to remove the register button from the other/home page

I have also written a plugin for this.

from tutor import hooks
hooks.Filters.ENV_PATCHES.add_item(
    (
        "openedx-lms-common-settings",
        "FEATURES['ALLOW_PUBLIC_ACCOUNT_CREATION'] = False"
    )
)

How should I update this so the register button can be removed from the sign in page

Refer to the images below


image

Thanks in advance!!

Hello Hamza,
to change the “Start learning with” text,
you must modify the messages.js file
which is found in
Authn’s MFE:

/frontend-app-authn/src/base-container/components/default-layout/messages.js

changing the defaultMessage ​​you get it.

@Juan-Carlos
Thank you for your reply.

Given the changes you mentioned, I believe it will be necessary to run this command tutor images build openedx.

Also, would you be able to provide guidance on how to remove or disable the ‘Register’ button?

If you are mounting it locally you can see the change and you can do:

tutor images build mfe

since it is MFE that changes.

And regarding disabling the registration button, I think you can set a variable, let me find it and let you know.

What you can do is directly hide the Tab from this file:

/frontend-app-authn/src/logistration/Logistration.jsx

how is it on line 121
and remove the conditional from the eventKey on line 116

image

@Juan-Carlos
Thank you for your previous reply. I’m running into some difficulty. As you can see in the image below, I don’t have the ‘mfe’ folders you mentioned in your solution. Did I make a mistake during the installation process? How can I resolve this issue?

I have deployed tutor openedx on a linux VM using docker and docker-compose

Sorry for hiding the username. Don’t know if this is considered as a security issue or not. I am just trying to be safe.

I appreciate your quick responses. Thanks in advance.

image

but you cloned the frontend-app-authn repo?

@Juan-Carlos
This is the list of dockers I have in my VM. Refer to the image bellow:

You will have to create a fork of the frontend-app-authn repository, make changes to that as required and then use that MFE instead of the default.

@zameel7
1- Is this the repo that I have to fork [frontend-app-authn]https://github.com/openedx/frontend-app-authn
2- How can I use MFE instead of the default. At the moment tutor plugins list shows (refer to the image please).


The mfe plugin plugin is enabled.

3- Where will I fork the frontend-app-authn repo? Maybe here /root/.local/share/tutor?

Thanks!

  1. Yes, that is the repo you need to fork. Make sure you fork the right tag that suits your tutor version.
  2. To use custom MFE, the detailed docs are there in the tutor-mfe plugin README
  3. You won’t need to have the forked repo anywhere in the path. You’ll have to include its git URL to use it against the default. You’ll get the details from what I mentioned above in 2nd answer.

@zameel7
Hi,
I have forked the repo here /root/.local/share/tutor/frontend-app-authn.
I customized it and ran command tutor mounts add /root/.local/share/tutor/frontend-app-authn. Now, I have executed the command tutor local restart

The changes did no apply. Is it necessary to do tutor local launch
Do I have to stop tutor before launching it again?

Thanks!

You need to create a tutor plugin that adds some more details about the custom MFE. It is available in the tutor-mfe repo.

@zameel7
I am sorry but I unable to understand the tutor-mfe README

Also, I have not forked the repo but cloned it in the VM. Please guide me more for the solution of this problem.

Wait I think I understand now.
I have to fork the repo, change the code accordingly, push the changes on the repo and then add this

from tutormfe.hooks import MFE_APPS

@MFE_APPS.add()
def _add_my_mfe(mfes):
    mfes["mymfe"] = {
        "repository": "https://github.com/myorg/mymfe.git",
        "port": 2001,
        "version": "me/my-custom-branch-or-tag", # optional, will default to the Open edX current tag.
    }
    return mfes

Please correct me if I am wrong

@zameel7
The plugin name is my_mfe_plugin
the Name in the above code will be

mfes["my_mfe_plugin"]

or

mfes["frontend-app-authn"]
from tutormfe.hooks import MFE_APPS

@MFE_APPS.add()
def _add_my_mfe(mfes):
	mfes["authn"] = {
		"repository": "/path/to/mfe/fork  |  or git repo",
		"port": 1999,
		"version": "me/my-custom-branch-or-tag", # optional, will default to the Open edX current tag.
	}

    return mfes

This would be how you should make the plugin

Hi @zameel7 . I hope you are doing well. I am facing an error when I build the mfe docker. My custom plugin looks like

from tutor import hooks
from tutormfe.hooks import MFE_APPS

hooks.Filters.ENV_PATCHES.add_item(
    (
        "openedx-lms-common-settings",
        "FEATURES['ALLOW_PUBLIC_ACCOUNT_CREATION'] = False"
    )
)

hooks.Filters.ENV_PATCHES.add_item(
    (
        "openedx-lms-common-settings",
        "FEATURES['ENABLE_COMBINED_LOGIN_REGISTRATION_FOOTER'] = True"
    )
)

hooks.Filters.ENV_PATCHES.add_item(
    (
        "openedx-lms-common-settings",
        "FEATURES['SHOW_REGISTRATION_LINKS'] = False"
    )
)

@MFE_APPS.add()
def _add_my_mfe(mfes):
        mfes["authn"] = {
                "repository": "/home/azureuser/mfe_codes/frontend-app-authn",
                "port": 1999
        }
        return mfes

After updating the forked code and updating the custom plugin code I run this command tutor images build mfe
The docker build begins and gets stuck and throws this error bellow

=> CANCELED [ora-grading-common 3/5] RUN --mount=type=cache,target=/root/.npm,sharing=shared npm clean-install --no-audit --no-fund --registry=https://registry.npmjs.org/          4834.7s
 
=> CANCELED [discussions-common 3/8] RUN --mount=type=cache,target=/root/.npm,sharing=shared npm clean-install --no-audit --no-fund --registry=https://registry.npmjs.org/          4832.3s

 => CANCELED [communications-common 3/5] RUN --mount=type=cache,target=/root/.npm,sharing=shared npm clean-install --no-audit --no-fund --registry=https://registry.npmjs.org/       4831.1s

 => CANCELED [learner-dashboard-common 3/7] RUN --mount=type=cache,target=/root/.npm,sharing=shared npm clean-install --no-audit --no-fund --registry=https://registry.npmjs.org/    4833.3s

 => CANCELED [learning-common 3/8] RUN --mount=type=cache,target=/root/.npm,sharing=shared npm clean-install --no-audit --no-fund --registry=https://registry.npmjs.org/             4834.0s

 => CANCELED [course-authoring-common 3/5] RUN --mount=type=cache,target=/root/.npm,sharing=shared npm clean-install --no-audit --no-fund --registry=https://registry.npmjs.org/     4831.9s

 => CANCELED [profile-common 3/8] RUN --mount=type=cache,target=/root/.npm,sharing=shared npm clean-install --no-audit --no-fund --registry=https://registry.npmjs.org/              4835.5s

 => ERROR [gradebook-common 3/5] RUN --mount=type=cache,target=/root/.npm,sharing=shared npm clean-install --no-audit --no-fund --registry=https://registry.npmjs.org/               4829.1s

 => CANCELED [account-common 3/8] RUN --mount=type=cache,target=/root/.npm,sharing=shared npm clean-install --no-audit --no-fund --registry=https://registry.npmjs.org/              4831.6s

 => CACHED [authn-common 1/6] COPY --from=authn-src /package.json /openedx/app/package.json                                                                                             0.0s

 => CACHED [authn-common 2/6] COPY --from=authn-src /package-lock.json /openedx/app/package-lock.json                                                                                   0.0s

 => CANCELED [authn-common 3/6] RUN --mount=type=cache,target=/root/.npm,sharing=shared npm clean-install --no-audit --no-fund --registry=https://registry.npmjs.org/                4829.9s
------

 > [gradebook-common 3/5] RUN --mount=type=cache,target=/root/.npm,sharing=shared npm clean-install --no-audit --no-fund --registry=https://registry.npmjs.org/:
4827.9 npm ERR! code EIDLETIMEOUT
4827.9 npm ERR! Idle timeout reached for host registry.npmjs.org:443
4828.3 
4828.3 npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2024-09-29T14_37_20_405Z-debug-0.log
------
Dockerfile:270
--------------------
 268 |     ENV CPPFLAGS=-DPNG_ARM_NEON_OPT=0
 269 |     ENV PACT_SKIP_BINARY_INSTALL=true
 270 | >>> RUN --mount=type=cache,target=/root/.npm,sharing=shared npm clean-install --no-audit --no-fund --registry=$NPM_REGISTRY
 271 |     
 272 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c npm clean-install --no-audit --no-fund --registry=$NPM_REGISTRY" did not complete successfully: exit code: 1

Error: Command failed with status 1: docker buildx build --tag=docker.io/overhangio/openedx-mfe:18.0.0-indigo --output=type=docker --cache-from=type=registry,ref=docker.io/overhangio/openedx-mfe:18.0.0-indigo-cache --build-context=authn-src=/root/.local/share/tutor/frontend-app-authn /root/.local/share/tutor/env/plugins/mfe/build/mfe

Please help me with this.
Thanks in advance

I am using tutor redwood.1