diff --git a/package-lock.json b/package-lock.json
index 14ec645e0..226cb413a 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -10,8 +10,8 @@
"license": "AGPL-3.0",
"dependencies": {
"@edx/brand": "npm:@openedx/brand-openedx@^1.2.2",
- "@edx/frontend-component-header": "5.3.4",
- "@edx/frontend-platform": "8.1.1",
+ "@edx/frontend-component-header": "5.5.0",
+ "@edx/frontend-platform": "8.1.2",
"@edx/openedx-atlas": "^0.6.0",
"@fortawesome/fontawesome-svg-core": "^6.6.0",
"@fortawesome/free-brands-svg-icons": "^6.6.0",
@@ -2010,7 +2010,9 @@
}
},
"node_modules/@edx/frontend-component-header": {
- "version": "5.3.4",
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/@edx/frontend-component-header/-/frontend-component-header-5.5.0.tgz",
+ "integrity": "sha512-nvpuTIx1o27LUGJ17HpOOm+PX0gg/YumWUMsrl1gSjbrTksyDLOxS1Y4thqlrWzD+dAgk5YKMowZM2BLiRDguQ==",
"license": "AGPL-3.0",
"dependencies": {
"@fortawesome/fontawesome-svg-core": "6.6.0",
@@ -2018,8 +2020,10 @@
"@fortawesome/free-regular-svg-icons": "6.6.0",
"@fortawesome/free-solid-svg-icons": "6.6.0",
"@fortawesome/react-fontawesome": "^0.2.0",
+ "@openedx/frontend-plugin-framework": "^1.3.0",
"axios-mock-adapter": "1.22.0",
"babel-polyfill": "6.26.0",
+ "classnames": "^2.5.1",
"jest-environment-jsdom": "^29.7.0",
"react-responsive": "8.2.0",
"react-transition-group": "4.4.5"
@@ -2033,7 +2037,9 @@
}
},
"node_modules/@edx/frontend-platform": {
- "version": "8.1.1",
+ "version": "8.1.2",
+ "resolved": "https://registry.npmjs.org/@edx/frontend-platform/-/frontend-platform-8.1.2.tgz",
+ "integrity": "sha512-xkSpzoxSp3bC4rrOHkHb/tj5bZQjZrOe5t3/kNzJVqqvziFGRU0fTAhh+Pv0aHboDAS8mAEhqZrJFpdeAFe1Tg==",
"license": "AGPL-3.0",
"dependencies": {
"@cospired/i18n-iso-languages": "4.2.0",
@@ -2053,7 +2059,7 @@
"lodash.merge": "4.6.2",
"lodash.snakecase": "4.1.1",
"pubsub-js": "1.9.4",
- "react-intl": "6.6.8",
+ "react-intl": "6.7.0",
"universal-cookie": "4.0.4"
},
"bin": {
@@ -2073,6 +2079,8 @@
},
"node_modules/@edx/frontend-platform/node_modules/axios": {
"version": "1.6.7",
+ "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.7.tgz",
+ "integrity": "sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==",
"license": "MIT",
"dependencies": {
"follow-redirects": "^1.15.4",
@@ -2082,6 +2090,8 @@
},
"node_modules/@edx/frontend-platform/node_modules/form-urlencoded": {
"version": "4.1.4",
+ "resolved": "https://registry.npmjs.org/form-urlencoded/-/form-urlencoded-4.1.4.tgz",
+ "integrity": "sha512-R7Vytos0gMYuPQTMwnNzvK9PBItNV+Qkm/pvghEZI3j2kMrzZmJlczAgHFmt12VV+IRYQXgTlSGP1PKAsMCIUA==",
"license": "MIT"
},
"node_modules/@edx/new-relic-source-map-webpack-plugin": {
@@ -2279,6 +2289,8 @@
},
"node_modules/@formatjs/fast-memoize": {
"version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/@formatjs/fast-memoize/-/fast-memoize-2.2.0.tgz",
+ "integrity": "sha512-hnk/nY8FyrL5YxwP9e4r9dqeM6cAbo8PeU9UjyXojZMNvVad2Z06FAVHyR3Ecw6fza+0GH7vdJgiKIVXTMbSBA==",
"license": "MIT",
"dependencies": {
"tslib": "^2.4.0"
@@ -2332,7 +2344,9 @@
}
},
"node_modules/@formatjs/intl": {
- "version": "2.10.4",
+ "version": "2.10.5",
+ "resolved": "https://registry.npmjs.org/@formatjs/intl/-/intl-2.10.5.tgz",
+ "integrity": "sha512-f9qPNNgLrh2KvoFvHGIfcPTmNGbyy7lyyV4/P6JioDqtTE7Akdmgt+ZzVndr+yMLZnssUShyTMXxM/6aV9eVuQ==",
"license": "MIT",
"dependencies": {
"@formatjs/ecma402-abstract": "2.0.0",
@@ -2354,6 +2368,8 @@
},
"node_modules/@formatjs/intl-displaynames": {
"version": "6.6.8",
+ "resolved": "https://registry.npmjs.org/@formatjs/intl-displaynames/-/intl-displaynames-6.6.8.tgz",
+ "integrity": "sha512-Lgx6n5KxN16B3Pb05z3NLEBQkGoXnGjkTBNCZI+Cn17YjHJ3fhCeEJJUqRlIZmJdmaXQhjcQVDp6WIiNeRYT5g==",
"license": "MIT",
"dependencies": {
"@formatjs/ecma402-abstract": "2.0.0",
@@ -2363,6 +2379,8 @@
},
"node_modules/@formatjs/intl-displaynames/node_modules/@formatjs/ecma402-abstract": {
"version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/@formatjs/ecma402-abstract/-/ecma402-abstract-2.0.0.tgz",
+ "integrity": "sha512-rRqXOqdFmk7RYvj4khklyqzcfQl9vEL/usogncBHRZfZBDOwMGuSRNFl02fu5KGHXdbinju+YXyuR+Nk8xlr/g==",
"license": "MIT",
"dependencies": {
"@formatjs/intl-localematcher": "0.5.4",
@@ -2371,6 +2389,8 @@
},
"node_modules/@formatjs/intl-displaynames/node_modules/@formatjs/intl-localematcher": {
"version": "0.5.4",
+ "resolved": "https://registry.npmjs.org/@formatjs/intl-localematcher/-/intl-localematcher-0.5.4.tgz",
+ "integrity": "sha512-zTwEpWOzZ2CiKcB93BLngUX59hQkuZjT2+SAQEscSm52peDW/getsawMcWF1rGRpMCX6D7nSJA3CzJ8gn13N/g==",
"license": "MIT",
"dependencies": {
"tslib": "^2.4.0"
@@ -2378,6 +2398,8 @@
},
"node_modules/@formatjs/intl-listformat": {
"version": "7.5.7",
+ "resolved": "https://registry.npmjs.org/@formatjs/intl-listformat/-/intl-listformat-7.5.7.tgz",
+ "integrity": "sha512-MG2TSChQJQT9f7Rlv+eXwUFiG24mKSzmF144PLb8m8OixyXqn4+YWU+5wZracZGCgVTVmx8viCf7IH3QXoiB2g==",
"license": "MIT",
"dependencies": {
"@formatjs/ecma402-abstract": "2.0.0",
@@ -2387,6 +2409,8 @@
},
"node_modules/@formatjs/intl-listformat/node_modules/@formatjs/ecma402-abstract": {
"version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/@formatjs/ecma402-abstract/-/ecma402-abstract-2.0.0.tgz",
+ "integrity": "sha512-rRqXOqdFmk7RYvj4khklyqzcfQl9vEL/usogncBHRZfZBDOwMGuSRNFl02fu5KGHXdbinju+YXyuR+Nk8xlr/g==",
"license": "MIT",
"dependencies": {
"@formatjs/intl-localematcher": "0.5.4",
@@ -2395,6 +2419,8 @@
},
"node_modules/@formatjs/intl-listformat/node_modules/@formatjs/intl-localematcher": {
"version": "0.5.4",
+ "resolved": "https://registry.npmjs.org/@formatjs/intl-localematcher/-/intl-localematcher-0.5.4.tgz",
+ "integrity": "sha512-zTwEpWOzZ2CiKcB93BLngUX59hQkuZjT2+SAQEscSm52peDW/getsawMcWF1rGRpMCX6D7nSJA3CzJ8gn13N/g==",
"license": "MIT",
"dependencies": {
"tslib": "^2.4.0"
@@ -2427,6 +2453,8 @@
},
"node_modules/@formatjs/intl/node_modules/@formatjs/ecma402-abstract": {
"version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/@formatjs/ecma402-abstract/-/ecma402-abstract-2.0.0.tgz",
+ "integrity": "sha512-rRqXOqdFmk7RYvj4khklyqzcfQl9vEL/usogncBHRZfZBDOwMGuSRNFl02fu5KGHXdbinju+YXyuR+Nk8xlr/g==",
"license": "MIT",
"dependencies": {
"@formatjs/intl-localematcher": "0.5.4",
@@ -2435,6 +2463,8 @@
},
"node_modules/@formatjs/intl/node_modules/@formatjs/intl-localematcher": {
"version": "0.5.4",
+ "resolved": "https://registry.npmjs.org/@formatjs/intl-localematcher/-/intl-localematcher-0.5.4.tgz",
+ "integrity": "sha512-zTwEpWOzZ2CiKcB93BLngUX59hQkuZjT2+SAQEscSm52peDW/getsawMcWF1rGRpMCX6D7nSJA3CzJ8gn13N/g==",
"license": "MIT",
"dependencies": {
"tslib": "^2.4.0"
@@ -3280,7 +3310,9 @@
}
},
"node_modules/@openedx/frontend-plugin-framework": {
- "version": "1.2.2",
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/@openedx/frontend-plugin-framework/-/frontend-plugin-framework-1.3.0.tgz",
+ "integrity": "sha512-qLtX/4HIuWXiIhBdtBuL6mPVbV2un0rsFYx3I5+3tIUf7+T7WRq81a6JHU5QGyAmZy9dfiv7QwbqwiEQOVXVuQ==",
"license": "AGPL-3.0",
"dependencies": {
"@edx/brand": "npm:@openedx/brand-openedx@^1.2.2",
@@ -3304,6 +3336,7 @@
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.37.1.tgz",
"integrity": "sha512-Xn6qmxrQZyB0FFY8E3bgRXei3lWDJHhvI+u0q9TKIYM49G8pAr0FgnnrFRAmsbptZL1yxRADVXn+x5AGsbBfyw==",
"hasInstallScript": true,
+ "license": "MIT",
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/core-js"
@@ -9418,6 +9451,8 @@
},
"node_modules/intl-messageformat": {
"version": "10.5.14",
+ "resolved": "https://registry.npmjs.org/intl-messageformat/-/intl-messageformat-10.5.14.tgz",
+ "integrity": "sha512-IjC6sI0X7YRjjyVH9aUgdftcmZK7WXdHeil4KwbjDnRWjnVitKpAx3rr6t6di1joFp5188VqKcobOPA6mCLG/w==",
"license": "BSD-3-Clause",
"dependencies": {
"@formatjs/ecma402-abstract": "2.0.0",
@@ -9428,6 +9463,8 @@
},
"node_modules/intl-messageformat/node_modules/@formatjs/ecma402-abstract": {
"version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/@formatjs/ecma402-abstract/-/ecma402-abstract-2.0.0.tgz",
+ "integrity": "sha512-rRqXOqdFmk7RYvj4khklyqzcfQl9vEL/usogncBHRZfZBDOwMGuSRNFl02fu5KGHXdbinju+YXyuR+Nk8xlr/g==",
"license": "MIT",
"dependencies": {
"@formatjs/intl-localematcher": "0.5.4",
@@ -9436,6 +9473,8 @@
},
"node_modules/intl-messageformat/node_modules/@formatjs/intl-localematcher": {
"version": "0.5.4",
+ "resolved": "https://registry.npmjs.org/@formatjs/intl-localematcher/-/intl-localematcher-0.5.4.tgz",
+ "integrity": "sha512-zTwEpWOzZ2CiKcB93BLngUX59hQkuZjT2+SAQEscSm52peDW/getsawMcWF1rGRpMCX6D7nSJA3CzJ8gn13N/g==",
"license": "MIT",
"dependencies": {
"tslib": "^2.4.0"
@@ -13383,12 +13422,14 @@
}
},
"node_modules/react-intl": {
- "version": "6.6.8",
+ "version": "6.7.0",
+ "resolved": "https://registry.npmjs.org/react-intl/-/react-intl-6.7.0.tgz",
+ "integrity": "sha512-f5QhjuKb+WEqiAbL5hDqUs2+sSRkF0vxkTbJ4A8ompt55XTyOHcrDlCXGq4o73ywFFrpgz+78C9IXegSLlya2A==",
"license": "BSD-3-Clause",
"dependencies": {
"@formatjs/ecma402-abstract": "2.0.0",
"@formatjs/icu-messageformat-parser": "2.7.8",
- "@formatjs/intl": "2.10.4",
+ "@formatjs/intl": "2.10.5",
"@formatjs/intl-displaynames": "6.6.8",
"@formatjs/intl-listformat": "7.5.7",
"@types/hoist-non-react-statics": "^3.3.1",
diff --git a/package.json b/package.json
index eabc30e20..89a63bb09 100644
--- a/package.json
+++ b/package.json
@@ -29,8 +29,8 @@
],
"dependencies": {
"@edx/brand": "npm:@openedx/brand-openedx@^1.2.2",
- "@edx/frontend-component-header": "5.3.4",
- "@edx/frontend-platform": "8.1.1",
+ "@edx/frontend-component-header": "5.5.0",
+ "@edx/frontend-platform": "8.1.2",
"@edx/openedx-atlas": "^0.6.0",
"@fortawesome/fontawesome-svg-core": "^6.6.0",
"@fortawesome/free-brands-svg-icons": "^6.6.0",
diff --git a/src/account-settings/AccountSettingsPage.jsx b/src/account-settings/AccountSettingsPage.jsx
index 6c2e336d8..f67e71762 100644
--- a/src/account-settings/AccountSettingsPage.jsx
+++ b/src/account-settings/AccountSettingsPage.jsx
@@ -120,7 +120,15 @@ class AccountSettingsPage extends React.Component {
countryOptions: [{
value: '',
label: this.props.intl.formatMessage(messages['account.settings.field.country.options.empty']),
- }].concat(getCountryList(locale).map(({ code, name }) => ({ value: code, label: name }))),
+ }].concat(
+ this.removeDisabledCountries(
+ getCountryList(locale).map(({ code, name }) => ({
+ value: code,
+ label: name,
+ disabled: this.isDisabledCountry(code),
+ })),
+ ),
+ ),
stateOptions: [{
value: '',
label: this.props.intl.formatMessage(messages['account.settings.field.state.options.empty']),
@@ -147,11 +155,28 @@ class AccountSettingsPage extends React.Component {
})),
}));
+ removeDisabledCountries = (countryList) => {
+ const { disabledCountries, committedValues } = this.props;
+
+ if (!disabledCountries.length) {
+ return countryList;
+ }
+
+ return countryList.filter(({ value, disabled }) => {
+ const isUserCountry = value === committedValues.country;
+ return !disabled || isUserCountry;
+ });
+ };
+
handleEditableFieldChange = (name, value) => {
this.props.updateDraft(name, value);
};
handleSubmit = (formId, values) => {
+ if (formId === 'country' && this.isDisabledCountry(values)) {
+ return;
+ }
+
const { formValues } = this.props;
let extendedProfileObject = {};
@@ -193,6 +218,11 @@ class AccountSettingsPage extends React.Component {
}
};
+ isDisabledCountry = (country) => {
+ const { disabledCountries } = this.props;
+ return disabledCountries.includes(country);
+ };
+
isEditable(fieldName) {
return !this.props.staticFields.includes(fieldName);
}
@@ -476,7 +506,8 @@ class AccountSettingsPage extends React.Component {
} = this.getLocalizedOptions(this.context.locale, this.props.formValues.country);
// Show State field only if the country is US (could include Canada later)
- const showState = this.props.formValues.country === COUNTRY_WITH_STATES;
+ const { country } = this.props.formValues;
+ const showState = country === COUNTRY_WITH_STATES && !this.isDisabledCountry(country);
const { verifiedName } = this.props;
const hasWorkExperience = !!this.props.formValues?.extended_profile?.find(field => field.field_name === 'work_experience');
@@ -880,6 +911,7 @@ AccountSettingsPage.propTypes = {
name: PropTypes.string,
useVerifiedNameForCerts: PropTypes.bool,
verified_name: PropTypes.string,
+ country: PropTypes.string,
}),
drafts: PropTypes.shape({}),
formErrors: PropTypes.shape({
@@ -938,6 +970,7 @@ AccountSettingsPage.propTypes = {
),
navigate: PropTypes.func.isRequired,
location: PropTypes.string.isRequired,
+ disabledCountries: PropTypes.arrayOf(PropTypes.string),
};
AccountSettingsPage.defaultProps = {
@@ -947,6 +980,7 @@ AccountSettingsPage.defaultProps = {
committedValues: {
useVerifiedNameForCerts: false,
verified_name: null,
+ country: '',
},
drafts: {},
formErrors: {},
@@ -963,6 +997,7 @@ AccountSettingsPage.defaultProps = {
verifiedName: null,
mostRecentVerifiedName: {},
verifiedNameHistory: [],
+ disabledCountries: [],
};
export default withLocation(withNavigate(connect(accountSettingsPageSelector, {
diff --git a/src/account-settings/EditableSelectField.jsx b/src/account-settings/EditableSelectField.jsx
index 63a1f7d1c..bc1757e07 100644
--- a/src/account-settings/EditableSelectField.jsx
+++ b/src/account-settings/EditableSelectField.jsx
@@ -107,6 +107,7 @@ const EditableSelectField = (props) => {
@@ -115,7 +116,7 @@ const EditableSelectField = (props) => {
);
}
return (
-
);
diff --git a/src/account-settings/data/reducers.js b/src/account-settings/data/reducers.js
index 7edb53a4e..35de9effc 100644
--- a/src/account-settings/data/reducers.js
+++ b/src/account-settings/data/reducers.js
@@ -39,6 +39,7 @@ export const defaultState = {
verifiedName: null,
mostRecentVerifiedName: {},
verifiedNameHistory: {},
+ disabledCountries: ['RU'],
};
const reducer = (state = defaultState, action = {}) => {
diff --git a/src/account-settings/data/selectors.js b/src/account-settings/data/selectors.js
index 1e6eb2497..99480a7f9 100644
--- a/src/account-settings/data/selectors.js
+++ b/src/account-settings/data/selectors.js
@@ -206,6 +206,11 @@ const activeAccountSelector = createSelector(
accountSettings => accountSettings.values.is_active,
);
+const disabledCountriesSelector = createSelector(
+ accountSettingsSelector,
+ accountSettings => accountSettings.disabledCountries,
+);
+
export const siteLanguageSelector = createSelector(
previousSiteLanguageSelector,
draftsSelector,
@@ -237,6 +242,7 @@ export const accountSettingsPageSelector = createSelector(
mostRecentApprovedVerifiedNameValueSelector,
mostRecentVerifiedNameSelector,
sortedVerifiedNameHistorySelector,
+ disabledCountriesSelector,
(
accountSettings,
siteLanguageOptions,
@@ -254,6 +260,7 @@ export const accountSettingsPageSelector = createSelector(
verifiedName,
mostRecentVerifiedName,
verifiedNameHistory,
+ disabledCountries,
) => ({
siteLanguageOptions,
siteLanguage,
@@ -274,6 +281,7 @@ export const accountSettingsPageSelector = createSelector(
verifiedName,
mostRecentVerifiedName,
verifiedNameHistory,
+ disabledCountries,
}),
);
diff --git a/src/notification-preferences/messages.js b/src/notification-preferences/messages.js
index d8035452d..49ffaea53 100644
--- a/src/notification-preferences/messages.js
+++ b/src/notification-preferences/messages.js
@@ -28,7 +28,7 @@ const messages = defineMessages({
contentReported {Reported content}
courseUpdates {Course updates}
oraStaffNotification {ORA new submissions}
- oraGradeAssigned {ORA grade received}
+ oraGradeAssigned {Essay assignment grade received}
other {{text}}
}`,
description: 'Display text for Notification Types',