fix: moved feedback widget behind env variable
This commit is contained in:
1
.env
1
.env
@@ -31,3 +31,4 @@ MARKETING_EMAILS_OPT_IN=''
|
||||
APP_ID=
|
||||
MFE_CONFIG_API_URL=
|
||||
PASSWORD_RESET_SUPPORT_LINK=''
|
||||
LEARNER_FEEDBACK_URL=''
|
||||
|
||||
@@ -32,4 +32,4 @@ MARKETING_EMAILS_OPT_IN=''
|
||||
APP_ID=
|
||||
MFE_CONFIG_API_URL=
|
||||
PASSWORD_RESET_SUPPORT_LINK='mailto:support@example.com'
|
||||
|
||||
LEARNER_FEEDBACK_URL=''
|
||||
|
||||
@@ -30,3 +30,4 @@ ENABLE_DOB_UPDATE=''
|
||||
MARKETING_EMAILS_OPT_IN=''
|
||||
APP_ID=
|
||||
MFE_CONFIG_API_URL=
|
||||
LEARNER_FEEDBACK_URL=''
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
import { getConfig } from '@edx/frontend-platform';
|
||||
import { logError } from '@edx/frontend-platform/logging';
|
||||
|
||||
import {
|
||||
@@ -59,7 +60,7 @@ export function useFeedbackWrapper() {
|
||||
useEffect(() => {
|
||||
try {
|
||||
// eslint-disable-next-line no-undef
|
||||
window.usabilla_live = lightningjs?.require('usabilla_live', '//w.usabilla.com/2655de034958.js');
|
||||
window.usabilla_live = lightningjs?.require('usabilla_live', getConfig().LEARNER_FEEDBACK_URL);
|
||||
} catch (error) {
|
||||
logError('Error loading usabilla_live', error);
|
||||
}
|
||||
|
||||
@@ -69,6 +69,7 @@ initialize({
|
||||
ENABLE_DOB_UPDATE: (process.env.ENABLE_DOB_UPDATE || false),
|
||||
MARKETING_EMAILS_OPT_IN: (process.env.MARKETING_EMAILS_OPT_IN || false),
|
||||
PASSWORD_RESET_SUPPORT_LINK: process.env.PASSWORD_RESET_SUPPORT_LINK,
|
||||
LEARNER_FEEDBACK_URL: process.env.LEARNER_FEEDBACK_URL,
|
||||
}, 'App loadConfig override handler');
|
||||
},
|
||||
},
|
||||
|
||||
@@ -15,8 +15,10 @@ import {
|
||||
} from '../constants';
|
||||
import { messages } from './messages';
|
||||
import { NotFoundPage } from '../account-settings';
|
||||
import { useFeedbackWrapper } from '../hooks';
|
||||
|
||||
const NotificationCourses = ({ intl }) => {
|
||||
useFeedbackWrapper();
|
||||
const dispatch = useDispatch();
|
||||
const coursesList = useSelector(selectCourseList());
|
||||
const courseListStatus = useSelector(selectCourseListStatus());
|
||||
|
||||
@@ -22,10 +22,8 @@ import {
|
||||
SUCCESS_STATUS,
|
||||
} from '../constants';
|
||||
import { NotFoundPage } from '../account-settings';
|
||||
import { useFeedbackWrapper } from '../hooks';
|
||||
|
||||
const NotificationPreferences = () => {
|
||||
useFeedbackWrapper();
|
||||
const { courseId } = useParams();
|
||||
const dispatch = useDispatch();
|
||||
const intl = useIntl();
|
||||
|
||||
Reference in New Issue
Block a user