- Renders correctly in various states successfully redire
fill="currentColor"
/>
-
+
Everyone on localhost
@@ -746,7 +746,7 @@ exports[` Renders correctly in various states test country edit w
- Member since
+ Member since
2017
Renders correctly in various states test country edit w
- Member since
+ Member since
2017
Renders correctly in various states test country edit w
fill="currentColor"
/>
-
+
Just me
@@ -2400,7 +2400,7 @@ exports[` Renders correctly in various states test country edit w
fill="currentColor"
/>
-
+
Everyone on localhost
@@ -2470,7 +2470,7 @@ exports[` Renders correctly in various states test country edit w
fill="currentColor"
/>
-
+
Just me
@@ -2540,7 +2540,7 @@ exports[` Renders correctly in various states test country edit w
fill="currentColor"
/>
-
+
Everyone on localhost
@@ -2622,7 +2622,7 @@ exports[` Renders correctly in various states test country edit w
fill="currentColor"
/>
- Add
+ Add
LinkedIn
@@ -2691,7 +2691,7 @@ exports[` Renders correctly in various states test country edit w
fill="currentColor"
/>
-
+
Everyone on localhost
@@ -2761,7 +2761,7 @@ exports[` Renders correctly in various states test country edit w
fill="currentColor"
/>
-
+
Everyone on localhost
@@ -2812,7 +2812,7 @@ exports[` Renders correctly in various states test country edit w
- Completed on
+ Completed on
3/4/2019
@@ -2951,7 +2951,7 @@ exports[` Renders correctly in various states test education edit
- Member since
+ Member since
2017
Renders correctly in various states test education edit
- Member since
+ Member since
2017
Renders correctly in various states test education edit
fill="currentColor"
/>
-
+
Just me
@@ -3207,7 +3207,7 @@ exports[` Renders correctly in various states test education edit
fill="currentColor"
/>
-
+
Everyone on localhost
@@ -3277,7 +3277,7 @@ exports[` Renders correctly in various states test education edit
fill="currentColor"
/>
-
+
Everyone on localhost
@@ -3539,7 +3539,7 @@ exports[` Renders correctly in various states test education edit
fill="currentColor"
/>
-
+
Everyone on localhost
@@ -3621,7 +3621,7 @@ exports[` Renders correctly in various states test education edit
fill="currentColor"
/>
- Add
+ Add
LinkedIn
@@ -3690,7 +3690,7 @@ exports[` Renders correctly in various states test education edit
fill="currentColor"
/>
-
+
Everyone on localhost
@@ -3760,7 +3760,7 @@ exports[` Renders correctly in various states test education edit
fill="currentColor"
/>
-
+
Everyone on localhost
@@ -3811,7 +3811,7 @@ exports[` Renders correctly in various states test education edit
- Completed on
+ Completed on
3/4/2019
@@ -3950,7 +3950,7 @@ exports[` Renders correctly in various states test preferreded la
- Member since
+ Member since
2017
Renders correctly in various states test preferreded la
- Member since
+ Member since
2017
Renders correctly in various states test preferreded la
fill="currentColor"
/>
-
+
Just me
@@ -4206,7 +4206,7 @@ exports[` Renders correctly in various states test preferreded la
fill="currentColor"
/>
-
+
Everyone on localhost
@@ -5343,7 +5343,7 @@ exports[` Renders correctly in various states test preferreded la
fill="currentColor"
/>
-
+
Just me
@@ -5413,7 +5413,7 @@ exports[` Renders correctly in various states test preferreded la
fill="currentColor"
/>
-
+
Everyone on localhost
@@ -5495,7 +5495,7 @@ exports[` Renders correctly in various states test preferreded la
fill="currentColor"
/>
- Add
+ Add
LinkedIn
@@ -5564,7 +5564,7 @@ exports[` Renders correctly in various states test preferreded la
fill="currentColor"
/>
-
+
Everyone on localhost
@@ -5634,7 +5634,7 @@ exports[` Renders correctly in various states test preferreded la
fill="currentColor"
/>
-
+
Everyone on localhost
@@ -5685,7 +5685,7 @@ exports[` Renders correctly in various states test preferreded la
- Completed on
+ Completed on
3/4/2019
@@ -5824,7 +5824,7 @@ exports[` Renders correctly in various states test user with test
- Member since
+ Member since
2017
Renders correctly in various states test user with test
- Member since
+ Member since
2017
Renders correctly in various states test user with test
fill="currentColor"
/>
-
+
Just me
@@ -7391,7 +7391,7 @@ exports[` Renders correctly in various states test user with test
fill="currentColor"
/>
-
+
Everyone on localhost
@@ -7461,7 +7461,7 @@ exports[` Renders correctly in various states test user with test
fill="currentColor"
/>
-
+
Just me
@@ -7531,7 +7531,7 @@ exports[` Renders correctly in various states test user with test
fill="currentColor"
/>
-
+
Everyone on localhost
@@ -7613,7 +7613,7 @@ exports[` Renders correctly in various states test user with test
fill="currentColor"
/>
- Add
+ Add
LinkedIn
@@ -7682,7 +7682,7 @@ exports[` Renders correctly in various states test user with test
fill="currentColor"
/>
-
+
Everyone on localhost
@@ -7752,7 +7752,7 @@ exports[` Renders correctly in various states test user with test
fill="currentColor"
/>
-
+
Everyone on localhost
@@ -7803,7 +7803,7 @@ exports[` Renders correctly in various states test user with test
- Completed on
+ Completed on
3/4/2019
@@ -7942,7 +7942,7 @@ exports[` Renders correctly in various states test user with test
- Member since
+ Member since
2017
Renders correctly in various states test user with test
- Member since
+ Member since
2017
Renders correctly in various states test user with test
fill="currentColor"
/>
-
+
Just me
@@ -9503,7 +9503,7 @@ exports[` Renders correctly in various states test user with test
fill="currentColor"
/>
-
+
Everyone on localhost
@@ -9573,7 +9573,7 @@ exports[` Renders correctly in various states test user with test
fill="currentColor"
/>
-
+
Just me
@@ -9643,7 +9643,7 @@ exports[` Renders correctly in various states test user with test
fill="currentColor"
/>
-
+
Everyone on localhost
@@ -9725,7 +9725,7 @@ exports[` Renders correctly in various states test user with test
fill="currentColor"
/>
- Add
+ Add
LinkedIn
@@ -9794,7 +9794,7 @@ exports[` Renders correctly in various states test user with test
fill="currentColor"
/>
-
+
Everyone on localhost
@@ -9864,7 +9864,7 @@ exports[` Renders correctly in various states test user with test
fill="currentColor"
/>
-
+
Everyone on localhost
@@ -9915,7 +9915,7 @@ exports[` Renders correctly in various states test user with test
- Completed on
+ Completed on
3/4/2019
@@ -10038,7 +10038,7 @@ exports[` Renders correctly in various states viewing other profi
- Member since
+ Member since
2017
Renders correctly in various states viewing other profi
- Member since
+ Member since
2017
Renders correctly in various states viewing own profile
- Member since
+ Member since
2017
Renders correctly in various states viewing own profile
- Member since
+ Member since
2017
Renders correctly in various states viewing own profile
fill="currentColor"
/>
-
+
Just me
@@ -10716,7 +10716,7 @@ exports[` Renders correctly in various states viewing own profile
fill="currentColor"
/>
-
+
Everyone on localhost
@@ -10786,7 +10786,7 @@ exports[` Renders correctly in various states viewing own profile
fill="currentColor"
/>
-
+
Everyone on localhost
@@ -10856,7 +10856,7 @@ exports[` Renders correctly in various states viewing own profile
fill="currentColor"
/>
-
+
Just me
@@ -10926,7 +10926,7 @@ exports[` Renders correctly in various states viewing own profile
fill="currentColor"
/>
-
+
Everyone on localhost
@@ -11008,7 +11008,7 @@ exports[` Renders correctly in various states viewing own profile
fill="currentColor"
/>
- Add
+ Add
LinkedIn
@@ -11077,7 +11077,7 @@ exports[` Renders correctly in various states viewing own profile
fill="currentColor"
/>
-
+
Everyone on localhost
@@ -11147,7 +11147,7 @@ exports[` Renders correctly in various states viewing own profile
fill="currentColor"
/>
-
+
Everyone on localhost
@@ -11198,7 +11198,7 @@ exports[` Renders correctly in various states viewing own profile
- Completed on
+ Completed on
3/4/2019
@@ -11337,7 +11337,7 @@ exports[` Renders correctly in various states while saving an edi
- Member since
+ Member since
2017
Renders correctly in various states while saving an edi
- Member since
+ Member since
2017
Renders correctly in various states while saving an edi
fill="currentColor"
/>
-
+
Just me
@@ -11593,7 +11593,7 @@ exports[` Renders correctly in various states while saving an edi
fill="currentColor"
/>
-
+
Everyone on localhost
@@ -11663,7 +11663,7 @@ exports[` Renders correctly in various states while saving an edi
fill="currentColor"
/>
-
+
Everyone on localhost
@@ -11733,7 +11733,7 @@ exports[` Renders correctly in various states while saving an edi
fill="currentColor"
/>
-
+
Just me
@@ -11803,7 +11803,7 @@ exports[` Renders correctly in various states while saving an edi
fill="currentColor"
/>
-
+
Everyone on localhost
@@ -11885,7 +11885,7 @@ exports[` Renders correctly in various states while saving an edi
fill="currentColor"
/>
- Add
+ Add
LinkedIn
@@ -12088,7 +12088,7 @@ exports[` Renders correctly in various states while saving an edi
fill="currentColor"
/>
-
+
Everyone on localhost
@@ -12139,7 +12139,7 @@ exports[` Renders correctly in various states while saving an edi
- Completed on
+ Completed on
3/4/2019
@@ -12278,7 +12278,7 @@ exports[` Renders correctly in various states while saving an edi
- Member since
+ Member since
2017
Renders correctly in various states while saving an edi
- Member since
+ Member since
2017
Renders correctly in various states while saving an edi
fill="currentColor"
/>
-
+
Just me
@@ -12534,7 +12534,7 @@ exports[` Renders correctly in various states while saving an edi
fill="currentColor"
/>
-
+
Everyone on localhost
@@ -12604,7 +12604,7 @@ exports[` Renders correctly in various states while saving an edi
fill="currentColor"
/>
-
+
Everyone on localhost
@@ -12674,7 +12674,7 @@ exports[` Renders correctly in various states while saving an edi
fill="currentColor"
/>
-
+
Just me
@@ -12744,7 +12744,7 @@ exports[` Renders correctly in various states while saving an edi
fill="currentColor"
/>
-
+
Everyone on localhost
@@ -12826,7 +12826,7 @@ exports[` Renders correctly in various states while saving an edi
fill="currentColor"
/>
- Add
+ Add
LinkedIn
@@ -13037,7 +13037,7 @@ exports[` Renders correctly in various states while saving an edi
fill="currentColor"
/>
-
+
Everyone on localhost
@@ -13088,7 +13088,7 @@ exports[` Renders correctly in various states while saving an edi
- Completed on
+ Completed on
3/4/2019
@@ -13227,7 +13227,7 @@ exports[` Renders correctly in various states without credentials
- Member since
+ Member since
2017
Renders correctly in various states without credentials
- Member since
+ Member since
2017
Renders correctly in various states without credentials
fill="currentColor"
/>
-
+
Just me
@@ -13403,7 +13403,7 @@ exports[` Renders correctly in various states without credentials
fill="currentColor"
/>
-
+
Everyone on localhost
@@ -13473,7 +13473,7 @@ exports[` Renders correctly in various states without credentials
fill="currentColor"
/>
-
+
Everyone on localhost
@@ -13543,7 +13543,7 @@ exports[` Renders correctly in various states without credentials
fill="currentColor"
/>
-
+
Just me
@@ -13613,7 +13613,7 @@ exports[` Renders correctly in various states without credentials
fill="currentColor"
/>
-
+
Everyone on localhost
@@ -13695,7 +13695,7 @@ exports[` Renders correctly in various states without credentials
fill="currentColor"
/>
- Add
+ Add
LinkedIn
@@ -13764,7 +13764,7 @@ exports[` Renders correctly in various states without credentials
fill="currentColor"
/>
-
+
Everyone on localhost
@@ -13834,7 +13834,7 @@ exports[` Renders correctly in various states without credentials
fill="currentColor"
/>
-
+
Everyone on localhost
@@ -13885,7 +13885,7 @@ exports[` Renders correctly in various states without credentials
+
+ This is the name that appears in your account and on your certificates.
+
+
+
+
+
+
+
+ Location
+
+
+
+
+
+
+ Everyone on localhost
+
+
+
+
+ Montenegro
+
+
+
+
+
+
+
+ Primary Language Spoken
+
+
+
+
+
+
+ Everyone on localhost
+
+
+
+
+ Yoruba
+
+
+
+
+
+
+
-
-
-
-
- Primary Language Spoken
-
-
-
-
-
-
- Everyone on localhost
-
-
-
-
- Yoruba
-
-
-
-
-
-
-
- Education
-
-
-
-
-
-
- Just me
-
-
-
-
- Elementary/primary school
-
-
-
@@ -7860,7 +2622,7 @@ exports[` Renders correctly in various states test user with test
`;
-exports[` Renders correctly in various states test user with test user with non-disabled country 1`] = `
+exports[` Renders correctly in various states test preferreded language edit with error 1`] = `
Renders correctly in various states test user with test
+`;
+
+exports[` Renders correctly in various states test user with test user with non-disabled country 1`] = `
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ staff
+
+
+ Member since
+ 2017
+
+
+
+
+
+
+
+
+
+
+
+
+ staff
+
+
+ Member since
+ 2017
+
+
+
+
+
+
+
+
+
+ Full Name
+
+
+
+
+
+
+ Just me
+
+
+
+
+ Lemon Seltzer
+
+
+ This is the name that appears in your account and on your certificates.
+
+
+
+
+
+
+
-
-
-
-
- Primary Language Spoken
-
+
-
- Edit
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Primary Language Spoken
+
+
+
@@ -2910,77 +3061,7 @@ exports[` Renders correctly in various states test preferreded la
style="padding: .1px 0px;"
>
-
- Location
-
-
-
-
-
-
- Everyone on localhost
-
-
-
-
- Montenegro
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
- Primary Language Spoken
-
-
-
-
-
-
-
-
-
- Education
-
-
-
- Other education
-
-
-
-
-
-
-
- Social Links
-
-
-
-
-
-
-
-
-
-
-
- About Me
-
-
-
- bio
-
-
-
-
+
+
+
+
+
+
+
+
+ Primary Language Spoken
+
+
+
+
+
+
+
+
+
+ Education
+
+
+
+ Other education
+
+
+
+
+
+
+
+ Social Links
+
+
+
+
+
+
+
+
+
+
+
+ About Me
+
+
+
+ bio
+
+
+
+
@@ -6933,67 +7255,120 @@ exports[` Renders correctly in various states viewing own profile
style="padding: .1px 0px;"
>
-
- Location
-
+
-
- Montenegro
-
Renders correctly in various states while saving an edi
d="M19 19H5V5h7V3H3v18h18v-9h-2v7ZM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7Z"
fill="currentColor"
/>
-
-
- in a new tab
-
-
-
-
-
-
-
-
-
- Full Name
-
-
- Edit
-
-
-
-
-
-
- Just me
-
-
-
-
- Lemon Seltzer
-
-
- This is the name that appears in your account and on your certificates.
-
-
+
+
+ in a new tab
+
+
+
+
Renders correctly in various states while saving an edi
- Location
+ Full Name
Renders correctly in various states while saving an edi
>
- Everyone on localhost
+ Just me
@@ -7869,8 +8169,158 @@ exports[` Renders correctly in various states while saving an edi
class="h5"
data-hj-suppress="true"
>
- Montenegro
+ Lemon Seltzer
+
+ This is the name that appears in your account and on your certificates.
+
+
+
+
+
+
+
+
Renders correctly in various states while saving an edi
style="padding: .1px 0px;"
>
- Your learner records information is only visible to you. Only your username is visible to others on localhost.
-
+ />
Renders correctly in various states viewing other profi
-
+
- Your certificates
+ Profile information
+
+
-
- Your learner records information is only visible to you. Only your username is visible to others on localhost.
-
+
+
+ Username
+
+
+
+
+
+
+ verified
+
+
+
+
+
+
+ Full name
+
+
+
+
+
+
+
+
+ Verified User
+
+
+
+
+
+
+
+
+
+
+ Country
+
+
+
+
+ United States of America
+
+
+
+
+
+
+
+
+
+
+ Primary language spoken
+
+
+
+
+ English
+
+
+
+
+
+
+
+
+
+
+ Education
+
+
+
+
+ Other education
+
+
+
+
+
+
+
+
+
+
+
+
+ Bio
+
+
+
+
+ About me
+
+
+
+
+
+
+
+
+
+
+
+
+
+ X
+
+
+
+
+ https://twitter.com/user
+
+
+
+
+
+
+
+
+
+
-
-
- You don't have any certificates yet.
+
`;
@@ -182,13 +547,13 @@ exports[` Renders correctly in various states viewing own profile
class="profile-page"
>
Renders correctly in various states viewing own profile
-
-
-
- Change
-
-
-
Renders correctly in various states viewing own profile
src="http://localhost:18000/media/profile-images/d2a9bdc2ba165dcefc73265c54bf9a20_500.jpg?v=1552495012"
/>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -249,65 +641,555 @@ exports[` Renders correctly in various states viewing own profile
Lemon Seltzer
+
+ Member since
+
+
+ 2017
+
+
+
+
+
+ 1
+
+ certifications
+
+
Renders correctly in various states viewing own profile
- Your learner records information is only visible to you. Only your username is visible to others on localhost.
+ Your learner records information is only visible to you. Only your username and profile image are visible to others on localhost.
@@ -342,7 +1224,7 @@ exports[` Renders correctly in various states viewing own profile
style="background-image: url(icon/mock/path);"
/>
Renders correctly in various states viewing own profile
class="pt-3"
>
Renders correctly in various states without credentials
class="profile-page"
>
Renders correctly in various states without credentials
-
-
-
- Change
-
-
-
Renders correctly in various states without credentials
src="http://localhost:18000/media/profile-images/d2a9bdc2ba165dcefc73265c54bf9a20_500.jpg?v=1552495012"
/>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -495,9 +1404,7 @@ exports[` Renders correctly in various states without credentials
-
1
-
certifications
@@ -507,9 +1414,6 @@ exports[` Renders correctly in various states without credentials
class="p-0 col-auto"
/>
-
Renders correctly in various states without credentials
+
+
+
+
+ Profile information
+
+
+
+
+
+
+
+
+ Username
+
+
+
+
+
+
+ staff
+
+
+
+
+
+
+ Full name
+
+
+
+
+
+
+
+
+ Lemon Seltzer
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Country
+
+
+
+
+ Montenegro
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Primary language spoken
+
+
+
+
+ Yoruba
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Education
+
+
+
+
+ Elementary/primary school
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Bio
+
+
+
+
+ This is my bio
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ X
+
+
+
+
+
+ https://www.twitter.com/ALOHA
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Facebook
+
+
+
+
+
+ https://www.facebook.com/aloha
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ LinkedIn
+
+
+
+
+
+
+ Add
+ LinkedIn
+
+
+
+
+
+
+
+
+
+
+
+
Renders correctly in various states without credentials
- Your learner records information is only visible to you. Only your username is visible to others on localhost.
+ Your learner records information is only visible to you. Only your username and profile image are visible to others on localhost.
@@ -559,7 +1958,7 @@ exports[` Renders correctly in various states without credentials
style="background-image: url(icon/mock/path);"
/>
+
+ >
+ ),
+ }}
+ />
+ );
+};
+
+Education.propTypes = {
+ formId: PropTypes.string.isRequired,
+ levelOfEducation: PropTypes.string,
+ visibilityLevelOfEducation: PropTypes.oneOf(['private', 'all_users']),
+ editMode: PropTypes.oneOf(['editing', 'editable', 'empty', 'static']),
+ saveState: PropTypes.string,
+ error: PropTypes.string,
+ changeHandler: PropTypes.func.isRequired,
+ submitHandler: PropTypes.func.isRequired,
+ closeHandler: PropTypes.func.isRequired,
+ openHandler: PropTypes.func.isRequired,
+};
+
+Education.defaultProps = {
+ editMode: 'static',
+ saveState: null,
+ levelOfEducation: null,
+ visibilityLevelOfEducation: 'private',
+ error: null,
+};
+
+export default connect(
+ editableFormSelector,
+ {},
+)(Education);
diff --git a/src/profile-v2/forms/Education.messages.jsx b/src/profile-v2/forms/Education.messages.jsx
new file mode 100644
index 000000000..dd7f4227d
--- /dev/null
+++ b/src/profile-v2/forms/Education.messages.jsx
@@ -0,0 +1,56 @@
+import { defineMessages } from '@edx/frontend-platform/i18n';
+
+const messages = defineMessages({
+ 'profile.education.education': {
+ id: 'profile.education.education',
+ defaultMessage: 'Education',
+ description: 'A section of a user profile',
+ },
+ 'profile.education.levels.p': {
+ id: 'profile.education.levels.p',
+ defaultMessage: 'Doctorate',
+ description: 'Selected by the user if their highest level of education is a doctorate degree.',
+ },
+ 'profile.education.levels.m': {
+ id: 'profile.education.levels.m',
+ defaultMessage: "Master's or professional degree",
+ description: "Selected by the user if their highest level of education is a master's or professional degree from a college or university.",
+ },
+ 'profile.education.levels.b': {
+ id: 'profile.education.levels.b',
+ defaultMessage: "Bachelor's Degree",
+ description: "Selected by the user if their highest level of education is a four year college or university bachelor's degree.",
+ },
+ 'profile.education.levels.a': {
+ id: 'profile.education.levels.a',
+ defaultMessage: "Associate's degree",
+ description: "Selected by the user if their highest level of education is an associate's degree. 1-2 years of college or university.",
+ },
+ 'profile.education.levels.hs': {
+ id: 'profile.education.levels.hs',
+ defaultMessage: 'Secondary/high school',
+ description: 'Selected by the user if their highest level of education is secondary or high school. 9-12 years of education.',
+ },
+ 'profile.education.levels.jhs': {
+ id: 'profile.education.levels.jhs',
+ defaultMessage: 'Junior secondary/junior high/middle school',
+ description: 'Selected by the user if their highest level of education is junior or middle school. 6-8 years of education.',
+ },
+ 'profile.education.levels.el': {
+ id: 'profile.education.levels.el',
+ defaultMessage: 'Elementary/primary school',
+ description: 'Selected by the user if their highest level of education is elementary or primary school. 1-5 years of education.',
+ },
+ 'profile.education.levels.none': {
+ id: 'profile.education.levels.none',
+ defaultMessage: 'No formal education',
+ description: 'Selected by the user to describe their education.',
+ },
+ 'profile.education.levels.o': {
+ id: 'profile.education.levels.o',
+ defaultMessage: 'Other education',
+ description: 'Selected by the user if they have a type of education not described by the other choices.',
+ },
+});
+
+export default messages;
diff --git a/src/profile-v2/forms/Name.jsx b/src/profile-v2/forms/Name.jsx
new file mode 100644
index 000000000..6b585299d
--- /dev/null
+++ b/src/profile-v2/forms/Name.jsx
@@ -0,0 +1,199 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+import { connect } from 'react-redux';
+import { useIntl } from '@edx/frontend-platform/i18n';
+
+import { InfoOutline } from '@openedx/paragon/icons';
+import { Form, OverlayTrigger, Tooltip } from '@openedx/paragon';
+import messages from './Name.messages';
+
+import FormControls from './elements/FormControls';
+import EditableItemHeader from './elements/EditableItemHeader';
+import EmptyContent from './elements/EmptyContent';
+import SwitchContent from './elements/SwitchContent';
+
+import { editableFormSelector } from '../data/selectors';
+import {
+ useCloseOpenHandler,
+ useHandleChange,
+ useHandleSubmit,
+ useIsVisibilityEnabled,
+} from '../data/hooks';
+
+const Name = ({
+ formId,
+ name,
+ visibilityName,
+ editMode,
+ saveState,
+ error,
+ changeHandler,
+ submitHandler,
+ closeHandler,
+ openHandler,
+}) => {
+ const isVisibilityEnabled = useIsVisibilityEnabled();
+ const intl = useIntl();
+
+ const handleChange = useHandleChange(changeHandler);
+ const handleSubmit = useHandleSubmit(submitHandler, formId);
+ const handleOpen = useCloseOpenHandler(openHandler, formId);
+ const handleClose = useCloseOpenHandler(closeHandler, formId);
+
+ return (
+
+
+ {
+ // Swallow clicks if the state is pending.
+ // We do this instead of disabling the button to prevent
+ // it from losing focus (disabled elements cannot have focus).
+ // Disabling it would causes upstream issues in focus management.
+ // Swallowing the onSubmit event on the form would be better, but
+ // we would have to add that logic for every field given our
+ // current structure of the application.
+ if (buttonState === 'pending') {
+ e.preventDefault();
+ }
+ }}
+ disabledStates={[]}
+ />
+
+ The page you're looking for is unavailable or there's an error in the URL. Please check the URL and try again.
+
+
+
+`;
diff --git a/src/profile-v2/__snapshots__/ProfilePage.test.jsx.snap b/src/profile-v2/__snapshots__/ProfilePage.test.jsx.snap
index 2280c1033..377fb6319 100644
--- a/src/profile-v2/__snapshots__/ProfilePage.test.jsx.snap
+++ b/src/profile-v2/__snapshots__/ProfilePage.test.jsx.snap
@@ -2017,3 +2017,1655 @@ exports[` Renders correctly in various states without credentials
+`;
+
+exports[` handles profile with no fields and no username renders empty profile state 1`] = ``;
+
+exports[` handles profile with no social links renders profile without social links 1`] = `
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ noSocialLinks
+
+
+
+ Member since
+
+
+ 2017
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Profile information
+
+
+
+
+
+
+
+
+ Username
+
+
+
+
+
+
+ noSocialLinks
+
+
+
+
+
+
+
+
+
+
+`;
+
+exports[` handles profile with only bio renders profile with only bio 1`] = `
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ onlyBio
+
+
+
+ Member since
+
+
+ 2017
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Profile information
+
+
+
+
+
+
+
+
+ Username
+
+
+
+
+
+
+ onlyBio
+
+
+
+
+
+
+
+
+
+
+`;
+
+exports[` handles profile with only country renders profile with only country 1`] = `
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ onlyCountry
+
+
+
+ Member since
+
+
+ 2017
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Profile information
+
+
+
+
+
+
+
+
+ Username
+
+
+
+
+
+
+ onlyCountry
+
+
+
+
+
+
+
+
+
+
+`;
+
+exports[` handles profile with only course certificates renders profile with only course certificates 1`] = `
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ onlyCourseCertificates
+
+
+
+ Member since
+
+
+ 2017
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Profile information
+
+
+
+
+
+
+
+
+ Username
+
+
+
+
+
+
+ onlyCourseCertificates
+
+
+
+
+
+
+
+
+
+
+`;
+
+exports[` handles profile with only language proficiencies renders profile with only language proficiencies 1`] = `
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ onlyLanguageProficiencies
+
+
+
+ Member since
+
+
+ 2017
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Profile information
+
+
+
+
+
+
+
+
+ Username
+
+
+
+
+
+
+ onlyLanguageProficiencies
+
+
+
+
+
+
+
+
+
+
+`;
+
+exports[` handles profile with only level of education renders profile with only level of education 1`] = `
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ onlyLevelOfEducation
+
+
+
+ Member since
+
+
+ 2017
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Profile information
+
+
+
+
+
+
+
+
+ Username
+
+
+
+
+
+
+ onlyLevelOfEducation
+
+
+
+
+
+
+
+
+
+
+`;
+
+exports[` handles profile with only name renders profile with only name 1`] = `
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ onlyName
+
+
+
+ Member since
+
+
+ 2017
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Profile information
+
+
+
+
+
+
+
+
+ Username
+
+
+
+
+
+
+ onlyName
+
+
+
+
+
+
+
+
+
+
+`;
+
+exports[` handles profile with only social links renders profile with only social links 1`] = `
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ onlySocialLinks
+
+
+
+ Member since
+
+
+ 2017
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Profile information
+
+
+
+
+
+
+
+
+ Username
+
+
+
+
+
+
+ onlySocialLinks
+
+
+
+
+
+
+
+
+
+
+`;
+
+exports[` handles profile with only username and no other fields renders profile with only username 1`] = `
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ onlyUsernameNoFields
+
+
+
+ Member since
+
+
+ 2017
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Profile information
+
+
+
+
+
+
+
+
+ Username
+
+
+
+
+
+
+ onlyUsernameNoFields
+
+
+
+
+
+
+
+
+
+
+`;
+
+exports[` handles profile with only username renders profile with only username 1`] = `
+