Skip to content

Commit

Permalink
fix: uncomment experiments and insert context to disable them
Browse files Browse the repository at this point in the history
  • Loading branch information
jsnwesson committed Oct 13, 2023
1 parent bdbe684 commit 086b3fb
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 11 deletions.
8 changes: 7 additions & 1 deletion src/ExperimentContext.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ export const useCountryCode = (setCountryCode) => {
}, []);
};

export const ExperimentContext = React.createContext();
export const PaintedDoorExperimentContext = React.createContext({
experimentVariation: '',
isPaintedDoorNavbarBtnVariation: false,
isPaintedDoorWidgetBtnVariation: false,
isPaintedDoorControlVariation: false,
experimentLoading: true,
});

export const ExperimentProvider = ({ children }) => {
const [countryCode, setCountryCode] = module.state.countryCode(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import { useIntl } from '@edx/frontend-platform/i18n';
import { AppContext } from '@edx/frontend-platform/react';
import { Button, Badge } from '@edx/paragon';

// import WidgetNavbar from 'containers/WidgetContainers/WidgetNavbar';
import WidgetNavbar from 'containers/WidgetContainers/WidgetNavbar';
import urls from 'data/services/lms/urls';
import { reduxHooks } from 'hooks';
// import { COLLAPSED_NAVBAR } from 'widgets/RecommendationsPaintedDoorBtn/constants';
import { COLLAPSED_NAVBAR } from 'widgets/RecommendationsPaintedDoorBtn/constants';

import { findCoursesNavDropdownClicked } from '../hooks';
import messages from '../messages';
Expand Down Expand Up @@ -40,7 +40,7 @@ export const CollapseMenuBody = ({ isOpen }) => {
>
{formatMessage(messages.discoverNew)}
</Button>
{/* <WidgetNavbar placement={COLLAPSED_NAVBAR} /> */}
<WidgetNavbar placement={COLLAPSED_NAVBAR} />
<Button as="a" href={getConfig().SUPPORT_URL} variant="inverse-primary">
{formatMessage(messages.help)}
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ exports[`CollapseMenuBody render 1`] = `
>
Discover New
</Button>
<WidgetNavbar
placement="collapsedNavbar"
/>
<Button
as="a"
href="http://localhost:18000/support"
Expand Down Expand Up @@ -92,6 +95,9 @@ exports[`CollapseMenuBody render unauthenticated 1`] = `
>
Discover New
</Button>
<WidgetNavbar
placement="collapsedNavbar"
/>
<Button
as="a"
href="http://localhost:18000/support"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ exports[`ExpandedHeader render 1`] = `
>
Discover New
</Button>
<WidgetNavbar
placement="expendedNavbar"
/>
<span
className="flex-grow-1"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { getConfig } from '@edx/frontend-platform';
import { useIntl } from '@edx/frontend-platform/i18n';
import { Button } from '@edx/paragon';

// import WidgetNavbar from 'containers/WidgetContainers/WidgetNavbar';
import WidgetNavbar from 'containers/WidgetContainers/WidgetNavbar';
import urls from 'data/services/lms/urls';
import { reduxHooks } from 'hooks';
// import { EXPANDED_NAVBAR } from 'widgets/RecommendationsPaintedDoorBtn/constants';
import { EXPANDED_NAVBAR } from 'widgets/RecommendationsPaintedDoorBtn/constants';

import AuthenticatedUserDropdown from './AuthenticatedUserDropdown';
import { useIsCollapsed, findCoursesNavClicked } from '../hooks';
Expand Down Expand Up @@ -52,7 +52,7 @@ export const ExpandedHeader = () => {
>
{formatMessage(messages.discoverNew)}
</Button>
{/* <WidgetNavbar placement={EXPANDED_NAVBAR} /> */}
<WidgetNavbar placement={EXPANDED_NAVBAR} />
<span className="flex-grow-1" />
<Button
as="a"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ exports[`WidgetSidebar snapshots default 1`] = `
<div
className="d-flex flex-column"
>
<RecommendationsPanel />
<injectIntl(ShimmedIntlComponent)
className="d-flex flex-column"
id="example"
Expand Down
4 changes: 2 additions & 2 deletions src/containers/WidgetContainers/LoadedSidebar/index.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';

// import RecommendationsPanel from 'widgets/RecommendationsPanel';
import RecommendationsPanel from 'widgets/RecommendationsPanel';
import hooks from 'widgets/ProductRecommendations/hooks';
import PluginSlot from '../../../../plugins/PluginSlot';

Expand All @@ -14,7 +14,7 @@ export const WidgetSidebar = ({ setSidebarShowing }) => {
return (
<div className="widget-sidebar">
<div className="d-flex flex-column">
{/* <RecommendationsPanel /> */}
<RecommendationsPanel />
<PluginSlot
id="example" // this is how PluginSlot knows which set of plugin URLs to grab from JS config
className="d-flex flex-column"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ exports[`WidgetSidebar snapshots default 1`] = `
<div
className="d-flex"
>
<RecommendationsPanel />
<injectIntl(ShimmedIntlComponent)
className="d-flex flex-column"
id="example"
Expand Down
4 changes: 2 additions & 2 deletions src/containers/WidgetContainers/NoCoursesSidebar/index.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';

// import RecommendationsPanel from 'widgets/RecommendationsPanel';
import RecommendationsPanel from 'widgets/RecommendationsPanel';
import hooks from 'widgets/ProductRecommendations/hooks';
import PluginSlot from '../../../../plugins/PluginSlot';

Expand All @@ -14,7 +14,7 @@ export const WidgetSidebar = ({ setSidebarShowing }) => {
return (
<div className="widget-sidebar px-2">
<div className="d-flex">
{/* <RecommendationsPanel /> */}
<RecommendationsPanel />
<PluginSlot
id="example" // this is how PluginSlot knows which set of plugin URLs to grab from JS config
className="d-flex flex-column"
Expand Down

0 comments on commit 086b3fb

Please sign in to comment.