Skip to content

feat: made profile editable #1212

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: 2u-main
Choose a base branch
from
Open

feat: made profile editable #1212

wants to merge 3 commits into from

Conversation

eemaanamir
Copy link

@eemaanamir eemaanamir commented May 21, 2025

Ticket: INF-1890

Summary:

Restored and enhanced the profile editing functionality in the Profile MFE, making it accessible to all users and aligned with the new Figma design.

Key Changes:

Editing Enabled for All Users

Removed the date of birth restriction on profile editing.

UI Updates

Implemented design changes based on the latest Figma specs.

Editable Fields Now Include:

  • Avatar
  • Full Name
  • Country
  • Language
  • Education
  • Bio
  • Social Links (Facebook, LinkedIn, X)

New Feature Toggle:

  • Introduced DISABLE_VISIBILITY_EDITING environment variable.
  • When set to true, the visibility toggle in the UI is hidden.

@eemaanamir eemaanamir requested a review from a team as a code owner May 21, 2025 13:21
@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label May 21, 2025
@openedx-webhooks
Copy link

Thanks for the pull request, @eemaanamir!

This repository is currently maintained by @openedx/2u-infinity.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.


Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

Copy link

codecov bot commented May 22, 2025

Codecov Report

Attention: Patch coverage is 71.16564% with 141 lines in your changes missing coverage. Please review.

Project coverage is 68.23%. Comparing base (896f2ce) to head (449718b).
Report is 1 commits behind head on 2u-main.

Files with missing lines Patch % Lines
src/profile-v2/forms/SocialLinks.jsx 47.05% 27 Missing ⚠️
src/profile-v2/forms/PreferredLanguage.jsx 53.57% 13 Missing ⚠️
src/profile-v2/forms/elements/SwitchContent.jsx 40.90% 13 Missing ⚠️
src/profile-v2/data/selectors.js 88.17% 11 Missing ⚠️
src/profile-v2/data/services.js 47.61% 10 Missing and 1 partial ⚠️
src/profile-v2/forms/elements/FormControls.jsx 25.00% 9 Missing ⚠️
src/profile-v2/forms/elements/Visibility.jsx 50.00% 8 Missing ⚠️
src/profile-v2/ProfilePage.jsx 84.44% 6 Missing and 1 partial ⚠️
src/profile-v2/forms/Bio.jsx 68.18% 7 Missing ⚠️
src/profile-v2/forms/Country.jsx 69.56% 7 Missing ⚠️
... and 8 more
Additional details and impacted files
@@             Coverage Diff             @@
##           2u-main    #1212      +/-   ##
===========================================
- Coverage    68.73%   68.23%   -0.51%     
===========================================
  Files           72       92      +20     
  Lines         1222     1678     +456     
  Branches       273      412     +139     
===========================================
+ Hits           840     1145     +305     
- Misses         365      511     +146     
- Partials        17       22       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

<FormattedMessage
id="profile.certificates.description"
defaultMessage="Your learner records information is only visible to you. Only your username is visible to others on {siteName}."
defaultMessage="Your learner records information is only visible to you. Only your username and profile image is visible to others on {siteName}."
Copy link
Contributor

Choose a reason for hiding this comment

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

correct statement.
Your learner records information is only visible to you. Only your username and profile image are visible to others on {siteName}

import classNames from 'classnames';

// Actions
Copy link
Contributor

Choose a reason for hiding this comment

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

remove all these comments

Comment on lines +114 to +116
const handleSubmit = useCallback((formId) => {
dispatch(saveProfile(formId, context.authenticatedUser.username));
}, [dispatch, context.authenticatedUser.username]);
Copy link
Contributor

Choose a reason for hiding this comment

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

const { username } = context.authenticatedUser;

const handleSubmit = useCallback((formId) => {
dispatch(saveProfile(formId, username));
}, [dispatch, username]);

>
<div
className={classNames([
'col h-100 w-100 px-0 justify-content-start g-15re',
Copy link
Contributor

Choose a reason for hiding this comment

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

i thinks spelling mistake it should be g-15rem

Comment on lines +179 to +184
<div
className={classNames([
'col container-fluid w-100 h-100 bg-white py-0 rounded-75',
isMobileView ? 'px-3' : 'px-25rem',
])}
>
Copy link
Contributor

Choose a reason for hiding this comment

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

comparison should be like
className={classNames(
'col container-fluid w-100 h-100 bg-white py-0 rounded-75',
{
'px-3': isMobileView,
'px-25rem': !isMobileView,
}
)}

@@ -1,13 +1,16 @@
import { history } from '@edx/frontend-platform';
import { getAuthenticatedUser } from '@edx/frontend-platform/auth';
import pick from 'lodash.pick';
Copy link
Contributor

Choose a reason for hiding this comment

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

import { pick } from 'lodash';

import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { FormattedMessage, useIntl } from '@edx/frontend-platform/i18n';
import get from 'lodash.get';
Copy link
Contributor

Choose a reason for hiding this comment

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

import { get } from 'lodash';

background-color: #FBFAF9;
}


Copy link
Contributor

Choose a reason for hiding this comment

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

remove this empty line

}

.color-brand-500{
background-color: #D74000FF;
Copy link
Contributor

Choose a reason for hiding this comment

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

recheck the color code

call(ProfileApiService.getPreferences, 'gonzo'),

Copy link
Contributor

Choose a reason for hiding this comment

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

remove this empty line

import classNames from 'classnames';

// Actions
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove this type of comment

</span>
);
const UserCertificateSummary = ({ count = 0 }) => {
if (count !== 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

if (count) will also work

},
action: 'POP'
}
};
Copy link
Contributor

Choose a reason for hiding this comment

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

add one extra empty line

@@ -38,4 +39,4 @@ module.exports = {
},
action: 'POP'
}
};
};
Copy link
Contributor

Choose a reason for hiding this comment

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

add one extra empty line

@@ -95,4 +102,4 @@ module.exports = {
},
action: 'POP'
}
};
};
Copy link
Contributor

Choose a reason for hiding this comment

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

add one extra empty line

}

.pb-075rem{
padding-bottom: 0.75rem;
Copy link
Contributor

Choose a reason for hiding this comment

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

convert REM into PX and change color code with paragon color variables


return (
<span className={className}>
<span className="d-inline-block ml-1 mr-2" style={{ width: '1.5rem' }}>
Copy link
Contributor

Choose a reason for hiding this comment

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

remove hard style

closeHandler,
openHandler,
}) => {
const isVisibilityEnabled = getConfig().DISABLE_VISIBILITY_EDITING === 'true';
Copy link
Contributor

Choose a reason for hiding this comment

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

isVisibilityEnabled()

Comment on lines +38 to +47
if (name === formId) {
if (value !== '') {
changeHandler(name, [{ code: value }]);
} else {
changeHandler(name, []);
}
} else {
changeHandler(name, value);
}
};
Copy link
Contributor

Choose a reason for hiding this comment

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

reafactor

import { profilePageSelector } from './data/selectors';
import messages from './ProfilePage.messages';
import withParams from '../utils/hoc';
import { useIsOnMobileScreen, useIsOnTabletScreen } from './data/hooks';

ensureConfig(['CREDENTIALS_BASE_URL', 'LMS_BASE_URL'], 'ProfilePage');

const ProfilePage = ({ params }) => {
const ProfilePage = ({ params, navigate }) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

direct import navigate

@mphilbrick211 mphilbrick211 moved this from Needs Triage to In Eng Review in Contributions May 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-source-contribution PR author is not from Axim or 2U
Projects
Status: No status
Status: In Eng Review
Development

Successfully merging this pull request may close these issues.

4 participants