Compare commits

..

4 Commits

Author SHA1 Message Date
sundasnoreen12
9c3b7a6755 Revert "feat: implemented restricted countires"
This reverts commit ffe306b60f.
2025-02-22 15:52:06 +05:00
sundasnoreen12
ffe306b60f feat: implemented restricted countires 2025-02-22 15:36:07 +05:00
sundasnoreen12
30980242a3 fix: remove check for floating label 2025-02-22 15:35:58 +05:00
sundasnoreen12
83ad419a39 fix: fixed logistration page placeholder issue 2025-02-22 15:35:58 +05:00
8 changed files with 1334 additions and 4482 deletions

View File

@@ -29,13 +29,7 @@ Getting Started
Installation
============
`Tutor`_ is currently recommended as a development environment for your new MFE. Please refer to the `relevant tutor-mfe documentation`_ to get started using it.
.. _Tutor: https://github.com/overhangio/tutor
.. _relevant tutor-mfe documentation: https://github.com/overhangio/tutor-mfe?tab=readme-ov-file#mfe-development
Devstack (Deprecated) instructions
==================================
This MFE is bundled with `Devstack <https://github.com/openedx/devstack>`_, see the `Getting Started <https://github.com/openedx/devstack#getting-started>`_ section for setup instructions.
1. Install Devstack using the `Getting Started <https://github.com/openedx/devstack#getting-started>`_ instructions.
@@ -57,7 +51,7 @@ Devstack (Deprecated) instructions
Environment Variables/Setup Notes
=================================
This MFE is configured via environment variables supplied at build time. All micro-frontends have a shared set of required environment variables, as documented in the Open edX Developer Guide under `Required Environment Variables <https://github.com/overhangio/tutor-mfe?tab=readme-ov-file#mfe-development>`__.
This MFE is configured via environment variables supplied at build time. All micro-frontends have a shared set of required environment variables, as documented in the Open edX Developer Guide under `Required Environment Variables <https://edx.readthedocs.io/projects/edx-developer-docs/en/latest/developers_guide/micro_frontends_in_open_edx.html#required-environment-variables>`__.
The authentication micro-frontend also requires the following additional variable:
@@ -148,13 +142,13 @@ Furthermore, there are several edX-specific environment variables that enable in
- ``true`` | ``''`` (empty strings are falsy)
For more information see the document: `Micro-frontend applications in Open
edX <https://github.com/overhangio/tutor-mfe?tab=readme-ov-file#mfe-development>`__.
edX <https://edx.readthedocs.io/projects/edx-developer-docs/en/latest/developers_guide/micro_frontends_in_open_edx.html#required-environment-variables>`__.
How To Contribute
=================
Contributions are very welcome, and strongly encouraged! We've
put together `some documentation that describes our contribution process <https://docs.openedx.org/en/latest/developers/references/developer_guide/process/index.html>`_.
put together `some documentation that describes our contribution process <https://edx.readthedocs.org/projects/edx-developer-guide/en/latest/process/index.html>`_.
Even though they were written with edx-platform in mind, the guidelines should be followed for Open edX code in general.

View File

@@ -3,7 +3,7 @@ Enable Social Auth Locally
Please follow the steps below to enable social auth (SSO) locally.
1. Follow `Enabling Third Party Authentication <https://docs.openedx.org/en/latest/site_ops/install_configure_run_guide/configuration/tpa/index.html>`_ for backend configuration.
1. Follow `Enabling Third Party Authentication <https://edx.readthedocs.io/projects/edx-installing-configuring-and-running/en/latest/configuration/tpa/index.html>`_ for backend configuration.
2. Authn has a component for rendering Social Auth providers at frontend which goes through each provider.

5702
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -13,12 +13,15 @@
"build": "fedx-scripts webpack",
"i18n_extract": "fedx-scripts formatjs extract",
"lint": "fedx-scripts eslint --ext .js --ext .jsx .",
"lint:fix": "fedx-scripts eslint --fix --ext .js --ext .jsx .",
"snapshot": "fedx-scripts jest --updateSnapshot",
"start": "fedx-scripts webpack-dev-server --progress",
"dev": "PUBLIC_PATH=/authn/ MFE_CONFIG_API_URL='http://localhost:8000/api/mfe_config/v1' fedx-scripts webpack-dev-server --progress --host apps.local.openedx.io",
"test": "fedx-scripts jest --coverage --passWithNoTests"
},
"husky": {
"hooks": {
"pre-commit": "npm run lint"
}
},
"author": "edX",
"license": "AGPL-3.0",
"homepage": "https://github.com/openedx/frontend-app-authn#readme",
@@ -30,32 +33,33 @@
},
"dependencies": {
"@edx/brand": "npm:@openedx/brand-openedx@^1.2.2",
"@edx/frontend-platform": "^8.3.1",
"@edx/frontend-platform": "^8.0.0",
"@edx/openedx-atlas": "^0.6.0",
"@fortawesome/fontawesome-svg-core": "6.7.2",
"@fortawesome/free-brands-svg-icons": "6.7.2",
"@fortawesome/free-solid-svg-icons": "6.7.2",
"@fortawesome/react-fontawesome": "0.2.2",
"@openedx/paragon": "^22.16.0",
"@openedx/paragon": "^22.1.1",
"@optimizely/react-sdk": "^2.9.1",
"@redux-devtools/extension": "3.3.0",
"@testing-library/react": "^16.2.0",
"@testing-library/react": "^12.1.5",
"@testing-library/react-hooks": "^8.0.1",
"algoliasearch": "^4.14.3",
"algoliasearch-helper": "^3.14.0",
"classnames": "2.5.1",
"core-js": "3.41.0",
"core-js": "3.40.0",
"fastest-levenshtein": "1.0.16",
"form-urlencoded": "6.1.5",
"prop-types": "15.8.1",
"query-string": "7.1.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-helmet": "6.1.0",
"react-loading-skeleton": "3.5.0",
"react-redux": "7.2.9",
"react-responsive": "8.2.0",
"react-router": "6.30.0",
"react-router-dom": "6.30.0",
"react-router": "6.29.0",
"react-router-dom": "6.29.0",
"react-zendesk": "^0.1.13",
"redux": "4.2.1",
"redux-logger": "3.0.6",
@@ -69,12 +73,13 @@
"devDependencies": {
"@edx/browserslist-config": "^1.1.1",
"@edx/reactifex": "1.1.0",
"@openedx/frontend-build": "^14.4.2",
"babel-plugin-formatjs": "10.5.37",
"@openedx/frontend-build": "^14.0.3",
"babel-plugin-formatjs": "10.5.35",
"eslint-plugin-import": "2.31.0",
"glob": "7.2.3",
"history": "5.3.0",
"husky": "9.1.7",
"jest": "29.7.0",
"react-test-renderer": "^18.3.1"
"react-test-renderer": "^17.0.2"
}
}

View File

@@ -1,4 +1,4 @@
import React, { useState } from 'react';
import React, { useEffect, useRef, useState } from 'react';
import {
Form, TransitionReplace,
@@ -7,9 +7,34 @@ import PropTypes from 'prop-types';
const FormGroup = (props) => {
const [hasFocus, setHasFocus] = useState(false);
const [inputValue, setInputValue] = useState(props.value || '');
const valueRef = useRef('');
useEffect(() => {
const input = document.getElementsByName(props.name)[0];
if (!input) { return undefined; }
const updateValue = () => {
if (input.value && input.value !== valueRef.current) {
valueRef.current = input.value;
setInputValue(input.value);
}
};
requestAnimationFrame(updateValue); // Detect autofill on page load
input.addEventListener('input', updateValue);
input.addEventListener('focus', updateValue);
return () => {
input.removeEventListener('input', updateValue);
input.removeEventListener('focus', updateValue);
};
}, [props.name]);
const handleFocus = (e) => {
setHasFocus(true);
setInputValue(inputValue || '');
if (props.handleFocus) { props.handleFocus(e); }
};
const handleClick = (e) => {
@@ -19,6 +44,10 @@ const FormGroup = (props) => {
setHasFocus(false);
if (props.handleBlur) { props.handleBlur(e); }
};
const handleChange = (e) => {
setInputValue(e.target.value);
if (props.handleChange) { props.handleChange(e); }
};
return (
<Form.Group controlId={props.name} className={props.className} isInvalid={props.errorMessage !== ''}>
@@ -31,11 +60,11 @@ const FormGroup = (props) => {
autoComplete={props.autoComplete}
spellCheck={props.spellCheck}
name={props.name}
value={props.value}
value={inputValue}
onFocus={handleFocus}
onBlur={handleOnBlur}
onClick={handleClick}
onChange={props.handleChange}
onChange={handleChange}
controlClassName={props.borderClass}
trailingElement={props.trailingElement}
floatingLabel={props.floatingLabel}

View File

@@ -1,36 +1,27 @@
import 'core-js/stable';
import 'regenerator-runtime/runtime';
import React, { StrictMode } from 'react';
import React from 'react';
import ReactDOM from 'react-dom';
import {
APP_INIT_ERROR, APP_READY, initialize, mergeConfig, subscribe,
} from '@edx/frontend-platform';
import { ErrorPage } from '@edx/frontend-platform/react';
import { createRoot } from 'react-dom/client';
import configuration from './config';
import messages from './i18n';
import MainApp from './MainApp';
subscribe(APP_READY, () => {
const root = createRoot(document.getElementById('root'));
root.render(
<StrictMode>
<MainApp />
</StrictMode>,
ReactDOM.render(
<MainApp />,
document.getElementById('root'),
);
});
subscribe(APP_INIT_ERROR, (error) => {
const root = createRoot(document.getElementById('root'));
root.render(
<StrictMode>
<ErrorPage message={error.message} />
</StrictMode>,
);
ReactDOM.render(<ErrorPage message={error.message} />, document.getElementById('root'));
});
initialize({

View File

@@ -1,4 +1,4 @@
import { renderHook } from '@testing-library/react';
import { renderHook } from '@testing-library/react-hooks';
import algoliasearchHelper from 'algoliasearch-helper';
import mockedRecommendedProducts from './mockedData';

View File

@@ -618,6 +618,15 @@ describe('RegistrationPage', () => {
...initialState,
register: {
...initialState.register,
registrationFormData: {
...registrationFormData,
formFields: {
name: 'test',
username: 'test',
email: 'test@example.com',
password: 'test',
},
},
backedUpFormData: { ...registrationFormData },
},
commonComponents: {