Skip to content

Conversation

@andrey-canon
Copy link
Collaborator

@andrey-canon andrey-canon commented Oct 7, 2025

Description

Adds frontend-essentials package and implements ProfileDataModal into LearningHeader. Migration pr of eduNEXT#1

Issue # 1308

How to test

  1. Set the required settings
VALID_PUBLIC_SECTORS = [
    "saudi_post",
    "communications_and_information_technology_commission",
    "ministry_of_communications_and_information_technology",
    "real_estate_development_fund",
    "general_authority_for_statistics",
    "other"
]
REQUIRED_USER_FIELDS = {
    "account": {
    },
    "profile": {
        "phone_number": {"max_length": 15, "format": "phone"},
    },
    "extra_info": {
        "occupation": {
            "char_type": "latin",
            "max_length": 50,
        },
        "sector": {
            "allow_empty": True,
            "dependent_fields": {
                "extrainfo.occupation": {
                    "employee": [
                        "public",
                        "private",
                        "non_profit"
                    ]
                }
            },
            "max_length": 50
        },
        "specific_sector": {
            "allow_empty": True,
            "dependent_fields": {
                "extrainfo.sector": {
                    "public": VALID_PUBLIC_SECTORS,
                }
            },
            "max_length": 150,
        },
        "national_id": {
            "max_length": 15,
            "format": "numeric",
        },
        "arabic_name": {
            "max_length": 50,
            "char_type": "arabic",
        },
    },
}
ENABLE_OTP_VALIDATION = False
USER_PROFILE_API_EXTRA_INFO_FIELDS = [
    "arabic_name",
    "arabic_first_name",
    "arabic_last_name",
    "occupation",
    "sector",
    "national_id",
    "specific_sector",
]
CONDITIONAL_USER_FIELDS = {
    "occupation": {
        "dependent_fields": {
            "employee": [
                "sector",
            ],
        },
        "key": "occupation",
        "options": [
            "employee",
            "student",
            "unemployed",
        ],
    },
    "public_sector": {
        "key": "specificSector",
        "options": VALID_PUBLIC_SECTORS,
    },
    "sector": {
        "dependent_fields": {
            "non_profit": [
                "specific_sector",
            ],
            "private": [
                "specific_sector",
            ],
            "public": [
                "public_sector",
            ]
        },
        "key": "sector",
        "options": [
            "public",
            "private",
            "non_profit",
        ],
    },
}
MFE_CONFIG["CONDITIONAL_USER_FIELDS"] = CONDITIONAL_USER_FIELDS
MFE_CONFIG["COURSE_EXPERIENCE_API_URL"] = "http://local.openedx.io:8000/eox-nelp/api/experience/v1"
MFE_CONFIG["OTP_API_URL"] = "http://local.openedx.io:8000/eox-nelp/api/one-time-password/v1"
MFE_CONFIG["USER_PROFILE_API_URL"] = "http://local.openedx.io:8000/eox-nelp/api/user-profile/v1"
  1. Set the module.config.js file
module.exports = {
    /*
    Modules you want to use from local source code.  Adding a module here means that when this app
    runs its build, it'll resolve the source from peer directories of this app.
  
    moduleName: the name you use to import code from the module.
    dir: The relative path to the module's source code.
    dist: The sub-directory of the source code where it puts its build artifact.  Often "dist".
    */
    localModules: [
        { moduleName: '@edx/frontend-component-header/dist', dir: '../frontend-component-header', dist: 'src' },
        { moduleName: '@edx/frontend-component-header', dir: '../frontend-component-header', dist: 'src' },
    ],
};
  1. Go to the learning page
  2. Verify the modal behavior, complete all the fields and save the data
2025-10-07.10-33-05.mp4

@andrey-canon andrey-canon requested a review from johanseto October 7, 2025 15:34
@andrey-canon andrey-canon force-pushed the teak-mig/FUTUREX-1439 branch from 04f382f to e0e419c Compare October 7, 2025 17:07
@andrey-canon andrey-canon changed the base branch from teak-mig/FUTUREX-1439 to open-release/teak.nelp October 7, 2025 17:08
@andrey-canon andrey-canon force-pushed the teak-mig/FUTUREX-1308 branch from 0620efe to b42d373 Compare October 7, 2025 17:08
Copy link

@johanseto johanseto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Working in my local env

Screencast.from.08-10-25.09.55.02.webm

@andrey-canon andrey-canon force-pushed the teak-mig/FUTUREX-1308 branch from b42d373 to 4ace17e Compare October 9, 2025 15:59
@andrey-canon andrey-canon merged commit 53419c7 into open-release/teak.nelp Oct 9, 2025
@andrey-canon andrey-canon temporarily deployed to open-release/teak.nelp October 9, 2025 16:01 — with GitHub Actions Inactive
@andrey-canon andrey-canon temporarily deployed to open-release/teak.nelp October 9, 2025 16:01 — with GitHub Actions Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants