fix: moved feedback widget behind env variable

This commit is contained in:
Awais Ansari
2023-08-15 19:00:29 +05:00
parent 2f85902d2c
commit ab5c205a7f
7 changed files with 8 additions and 4 deletions

1
.env
View File

@@ -31,3 +31,4 @@ MARKETING_EMAILS_OPT_IN=''
APP_ID=
MFE_CONFIG_API_URL=
PASSWORD_RESET_SUPPORT_LINK=''
LEARNER_FEEDBACK_URL=''

View File

@@ -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=''

View File

@@ -30,3 +30,4 @@ ENABLE_DOB_UPDATE=''
MARKETING_EMAILS_OPT_IN=''
APP_ID=
MFE_CONFIG_API_URL=
LEARNER_FEEDBACK_URL=''

View File

@@ -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);
}

View File

@@ -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');
},
},

View File

@@ -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());

View File

@@ -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();