Compare commits
32 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7c8876490d | ||
|
|
ba2e46bfa9 | ||
|
|
09cc332306 | ||
|
|
1f91a60b6d | ||
|
|
490da867df | ||
|
|
fd723e6063 | ||
|
|
664ca3e78f | ||
|
|
18a8a76105 | ||
|
|
0ad89f88a1 | ||
|
|
b0391866a3 | ||
|
|
3a9e3f8fba | ||
|
|
b2c55a09e5 | ||
|
|
6795147255 | ||
|
|
a87c111b3c | ||
|
|
655d6c058b | ||
|
|
923009191f | ||
|
|
80da098ec8 | ||
|
|
0197c85de5 | ||
|
|
0ef407458c | ||
|
|
c5d83f658a | ||
|
|
eb941181ea | ||
|
|
ed379258a8 | ||
|
|
8109ba39bb | ||
|
|
ebb87070da | ||
|
|
cbcaf4c9fe | ||
|
|
d3dda9e56d | ||
|
|
db3c54201c | ||
|
|
8f8b4645b4 | ||
|
|
194f93e85e | ||
|
|
10fc7a2d72 | ||
|
|
1d7a871cfd | ||
|
|
cf09847e95 |
2
.gitignore
vendored
@@ -10,4 +10,4 @@ src/i18n/transifex_input.json
|
||||
temp/babel-plugin-react-intl
|
||||
/.vscode
|
||||
module.config.js
|
||||
src/i18n/messages
|
||||
src/i18n/messages
|
||||
|
||||
@@ -95,9 +95,9 @@ This library has the following exports:
|
||||
|
||||
Plugin
|
||||
======
|
||||
The footer can be replaced using using `Frontend Plugin Framework <https://github.com/openedx/frontend-plugin-framework>`_.
|
||||
The footer can be replaced or modified using `Frontend Plugin Framework <https://github.com/openedx/frontend-plugin-framework>`_.
|
||||
|
||||
Information on how to utilize the ``FooterSlot`` component to do so is available in the `frontend-slot-footer repository <https://github.com/openedx/frontend-slot-footer/>`_.
|
||||
Information on how to replace or modify the footer is available `here </src/plugin-slots>`_.
|
||||
|
||||
Examples
|
||||
========
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
@import "@edx/brand/paragon/fonts";
|
||||
@import "@edx/brand/paragon/variables";
|
||||
@import "@openedx/paragon/scss/core/core";
|
||||
@import "@edx/brand/paragon/overrides";
|
||||
@use "@openedx/paragon/dist/core.min.css" as paragonCore;
|
||||
@use "@openedx/paragon/dist/light.min.css" as paragonLight;
|
||||
|
||||
@import "@edx/frontend-component-footer/footer";
|
||||
|
||||
3487
package-lock.json
generated
17
package.json
@@ -10,6 +10,7 @@
|
||||
"build": "make build",
|
||||
"i18n_extract": "fedx-scripts formatjs extract",
|
||||
"lint": "fedx-scripts eslint --ext .js --ext .jsx .",
|
||||
"lint:fix": "fedx-scripts eslint --fix --ext .js --ext .jsx .",
|
||||
"snapshot": "fedx-scripts jest --updateSnapshot",
|
||||
"start": "fedx-scripts webpack-dev-server --progress",
|
||||
"start:with-theme": "paragon install-theme && npm start && npm install",
|
||||
@@ -19,11 +20,6 @@
|
||||
"files": [
|
||||
"/dist"
|
||||
],
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "npm run lint"
|
||||
}
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/openedx/frontend-component-footer.git"
|
||||
@@ -40,18 +36,16 @@
|
||||
"@edx/frontend-platform": "^8.2.1",
|
||||
"@edx/reactifex": "^2.1.1",
|
||||
"@openedx/frontend-build": "^14.3.1",
|
||||
"@openedx/frontend-plugin-framework": "^1.5.0",
|
||||
"@openedx/paragon": "^22.15.1",
|
||||
"@openedx/paragon": "^23.3.0",
|
||||
"@testing-library/jest-dom": "^5.16.4",
|
||||
"@testing-library/react": "^16.2.0",
|
||||
"@testing-library/dom": "^10.4.0",
|
||||
"@testing-library/user-event": "^14.6.1",
|
||||
"husky": "8.0.3",
|
||||
"prop-types": "15.8.1",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
"react-redux": "8.1.1",
|
||||
"react-router-dom": "6.28.2",
|
||||
"react-redux": "8.1.3",
|
||||
"react-router-dom": "6.30.1",
|
||||
"react-test-renderer": "18.3.1",
|
||||
"redux": "4.2.1",
|
||||
"semantic-release": "21.1.2"
|
||||
@@ -62,6 +56,7 @@
|
||||
"@fortawesome/free-regular-svg-icons": "6.7.2",
|
||||
"@fortawesome/free-solid-svg-icons": "6.7.2",
|
||||
"@fortawesome/react-fontawesome": "0.2.2",
|
||||
"@openedx/frontend-plugin-framework": "^1.7.0",
|
||||
"classnames": "^2.5.1",
|
||||
"jest-environment-jsdom": "^29.7.0",
|
||||
"lodash": "^4.17.21",
|
||||
@@ -69,7 +64,7 @@
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@edx/frontend-platform": "^7.0.0 || ^8.0.0",
|
||||
"@openedx/paragon": ">= 21.11.3 < 23.0.0",
|
||||
"@openedx/paragon": ">= 21.11.3 < 24.0.0",
|
||||
"prop-types": "^15.5.10",
|
||||
"react": "^16.9.0 || ^17.0.0 || ^18.0.0",
|
||||
"react-dom": "^16.9.0 || ^17.0.0 || ^18.0.0"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
$gray-footer: #fcfcfc !default;
|
||||
|
||||
.footer {
|
||||
background-color: $gray-footer;
|
||||
background-color: var(--pgn-color-light-100, $gray-footer);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@ import { IntlProvider } from '@edx/frontend-platform/i18n';
|
||||
import { AppContext } from '@edx/frontend-platform/react';
|
||||
|
||||
import Footer from './Footer';
|
||||
import FooterSlot from '../plugin-slots/FooterSlot';
|
||||
import StudioFooterHelpSectionSlot from '../plugin-slots/StudioFooterHelpSectionSlot';
|
||||
|
||||
const FooterWithContext = ({ locale = 'es' }) => {
|
||||
const contextValue = useMemo(() => ({
|
||||
@@ -22,7 +24,7 @@ const FooterWithContext = ({ locale = 'es' }) => {
|
||||
<AppContext.Provider
|
||||
value={contextValue}
|
||||
>
|
||||
<Footer />
|
||||
<FooterSlot />
|
||||
</AppContext.Provider>
|
||||
</IntlProvider>
|
||||
);
|
||||
@@ -89,3 +91,32 @@ describe('<Footer />', () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('<StudioFooterHelpSectionSlot />', () => {
|
||||
const SectionWithContext = ({ locale = 'es' }) => {
|
||||
const contextValue = useMemo(() => ({
|
||||
authenticatedUser: null,
|
||||
config: {
|
||||
LOGO_TRADEMARK_URL: process.env.LOGO_TRADEMARK_URL,
|
||||
LMS_BASE_URL: process.env.LMS_BASE_URL,
|
||||
},
|
||||
}), []);
|
||||
|
||||
return (
|
||||
<IntlProvider locale={locale}>
|
||||
<AppContext.Provider
|
||||
value={contextValue}
|
||||
>
|
||||
<StudioFooterHelpSectionSlot />
|
||||
</AppContext.Provider>
|
||||
</IntlProvider>
|
||||
);
|
||||
};
|
||||
|
||||
it('renders correctly', () => {
|
||||
const tree = renderer
|
||||
.create(<SectionWithContext />)
|
||||
.toJSON();
|
||||
expect(tree).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -128,3 +128,68 @@ exports[`<Footer /> renders correctly renders without a language selector in es
|
||||
</div>
|
||||
</footer>
|
||||
`;
|
||||
|
||||
exports[`<StudioFooterHelpSectionSlot /> renders correctly 1`] = `
|
||||
[
|
||||
<div
|
||||
className="m-0 mt-6 row align-items-center justify-content-center"
|
||||
>
|
||||
<div
|
||||
className="col border-top mr-2"
|
||||
/>
|
||||
<button
|
||||
className="btn btn-outline-primary btn-sm"
|
||||
data-testid="helpToggleButton"
|
||||
disabled={false}
|
||||
onClick={[Function]}
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
className="pgn__icon pgn__icon__sm btn-icon-before"
|
||||
>
|
||||
<svg
|
||||
aria-hidden={true}
|
||||
fill="none"
|
||||
focusable={false}
|
||||
height={24}
|
||||
role="img"
|
||||
viewBox="0 0 24 24"
|
||||
width={24}
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2Zm1 17h-2v-2h2v2Zm2.07-7.75-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25Z"
|
||||
fill="currentColor"
|
||||
/>
|
||||
</svg>
|
||||
</span>
|
||||
Looking for help with Studio?
|
||||
<span
|
||||
className="pgn__icon pgn__icon__sm btn-icon-after"
|
||||
>
|
||||
<svg
|
||||
aria-hidden={true}
|
||||
fill="none"
|
||||
focusable={false}
|
||||
height={24}
|
||||
role="img"
|
||||
viewBox="0 0 24 24"
|
||||
width={24}
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6-1.41-1.41Z"
|
||||
fill="currentColor"
|
||||
/>
|
||||
</svg>
|
||||
</span>
|
||||
</button>
|
||||
<div
|
||||
className="col border-top ml-2"
|
||||
/>
|
||||
</div>,
|
||||
<div
|
||||
className="px-4 container-mw-xl container-fluid"
|
||||
/>,
|
||||
]
|
||||
`;
|
||||
|
||||
@@ -1,21 +1,19 @@
|
||||
import React, { useContext, useState } from 'react';
|
||||
import _ from 'lodash';
|
||||
import React, { useContext } from 'react';
|
||||
import isEmpty from 'lodash/isEmpty';
|
||||
import { useIntl, FormattedMessage } from '@edx/frontend-platform/i18n';
|
||||
import { ensureConfig } from '@edx/frontend-platform';
|
||||
import { AppContext } from '@edx/frontend-platform/react';
|
||||
import {
|
||||
ActionRow,
|
||||
Button,
|
||||
Container,
|
||||
Hyperlink,
|
||||
Image,
|
||||
TransitionReplace,
|
||||
} from '@openedx/paragon';
|
||||
import { ExpandLess, ExpandMore, Help } from '@openedx/paragon/icons';
|
||||
import classNames from 'classnames';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import messages from './messages';
|
||||
import StudioFooterLogoSlot from '../../plugin-slots/StudioFooterLogoSlot';
|
||||
import StudioFooterHelpSectionSlot from '../../plugin-slots/StudioFooterHelpSectionSlot';
|
||||
|
||||
ensureConfig([
|
||||
'LMS_BASE_URL',
|
||||
@@ -32,84 +30,26 @@ const StudioFooter = ({
|
||||
containerProps,
|
||||
}) => {
|
||||
const intl = useIntl();
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
const { config } = useContext(AppContext);
|
||||
|
||||
const { containerClassName, ...restContainerProps } = containerProps || {};
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="m-0 mt-6 row align-items-center justify-content-center">
|
||||
<div className="col border-top mr-2" />
|
||||
<Button
|
||||
data-testid="helpToggleButton"
|
||||
variant="outline-primary"
|
||||
onClick={() => setIsOpen(!isOpen)}
|
||||
iconBefore={Help}
|
||||
iconAfter={isOpen ? ExpandLess : ExpandMore}
|
||||
size="sm"
|
||||
>
|
||||
{isOpen ? intl.formatMessage(messages.closeHelpButtonLabel)
|
||||
: intl.formatMessage(messages.openHelpButtonLabel)}
|
||||
</Button>
|
||||
<div className="col border-top ml-2" />
|
||||
</div>
|
||||
<StudioFooterHelpSectionSlot containerProps={containerProps} />
|
||||
<Container
|
||||
size="xl"
|
||||
className={classNames('px-4', containerClassName)}
|
||||
{...restContainerProps}
|
||||
>
|
||||
<TransitionReplace>
|
||||
{isOpen ? (
|
||||
<ActionRow key="help-link-button-row" className="py-4" data-testid="helpButtonRow">
|
||||
<ActionRow.Spacer />
|
||||
<Button as="a" href="https://docs.edx.org/" size="sm">
|
||||
<FormattedMessage {...messages.edxDocumentationButtonLabel} />
|
||||
</Button>
|
||||
<Button
|
||||
as="a"
|
||||
href="https://open.edx.org/"
|
||||
size="sm"
|
||||
data-testid="openEdXPortalButton"
|
||||
>
|
||||
<FormattedMessage {...messages.openEdxPortalButtonLabel} />
|
||||
</Button>
|
||||
<Button
|
||||
as="a"
|
||||
href="https://www.edx.org/course/edx101-overview-of-creating-an-edx-course#.VO4eaLPF-n1"
|
||||
size="sm"
|
||||
>
|
||||
<FormattedMessage {...messages.edx101ButtonLabel} />
|
||||
</Button>
|
||||
<Button
|
||||
as="a"
|
||||
href="https://www.edx.org/course/studiox-creating-a-course-with-edx-studio"
|
||||
size="sm"
|
||||
>
|
||||
<FormattedMessage {...messages.studioXButtonLabel} />
|
||||
</Button>
|
||||
{!_.isEmpty(config.SUPPORT_EMAIL) && (
|
||||
<Button
|
||||
as="a"
|
||||
href={`mailto:${config.SUPPORT_EMAIL}`}
|
||||
size="sm"
|
||||
data-testid="contactUsButton"
|
||||
>
|
||||
<FormattedMessage {...messages.contactUsButtonLabel} />
|
||||
</Button>
|
||||
)}
|
||||
<ActionRow.Spacer />
|
||||
</ActionRow>
|
||||
) : null}
|
||||
</TransitionReplace>
|
||||
<ActionRow className="pt-3 m-0 x-small">
|
||||
© {new Date().getFullYear()} <Hyperlink destination={config.MARKETING_SITE_BASE_URL} target="_blank" className="ml-2">{config.SITE_NAME}</Hyperlink>
|
||||
<ActionRow.Spacer />
|
||||
{!_.isEmpty(config.TERMS_OF_SERVICE_URL) && (
|
||||
{!isEmpty(config.TERMS_OF_SERVICE_URL) && (
|
||||
<Hyperlink destination={config.TERMS_OF_SERVICE_URL} data-testid="termsOfService">
|
||||
{intl.formatMessage(messages.termsOfServiceLinkLabel)}
|
||||
</Hyperlink>
|
||||
)}{!_.isEmpty(config.PRIVACY_POLICY_URL) && (
|
||||
)}{!isEmpty(config.PRIVACY_POLICY_URL) && (
|
||||
<Hyperlink destination={config.PRIVACY_POLICY_URL} data-testid="privacyPolicy">
|
||||
{intl.formatMessage(messages.privacyPolicyLinkLabel)}
|
||||
</Hyperlink>
|
||||
@@ -134,13 +74,7 @@ const StudioFooter = ({
|
||||
<FormattedMessage {...messages.trademarkMessage} />
|
||||
<Hyperlink className="ml-1" destination="https://www.edx.org">edX Inc</Hyperlink>.
|
||||
<ActionRow.Spacer />
|
||||
<Hyperlink destination="https://open.edx.org" className="float-right">
|
||||
<Image
|
||||
width="120px"
|
||||
alt="Powered by Open edX"
|
||||
src="https://logos.openedx.org/open-edx-logo-tag.png"
|
||||
/>
|
||||
</Hyperlink>
|
||||
<StudioFooterLogoSlot />
|
||||
</ActionRow>
|
||||
</Container>
|
||||
</>
|
||||
|
||||
@@ -3,9 +3,10 @@ import React, { useMemo } from 'react';
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import '@testing-library/jest-dom/extend-expect';
|
||||
import '@testing-library/jest-dom';
|
||||
import { IntlProvider } from '@edx/frontend-platform/i18n';
|
||||
import { AppContext } from '@edx/frontend-platform/react';
|
||||
import StudioFooter from './StudioFooter';
|
||||
import StudioFooterSlot from '../../plugin-slots/StudioFooterSlot';
|
||||
import messages from './messages';
|
||||
|
||||
const config = {
|
||||
@@ -36,7 +37,7 @@ const Component = ({ updateVariable }) => {
|
||||
return (
|
||||
<IntlProvider locale="en">
|
||||
<AppContext.Provider value={contextValue}>
|
||||
<StudioFooter />
|
||||
<StudioFooterSlot />
|
||||
</AppContext.Provider>
|
||||
</IntlProvider>
|
||||
);
|
||||
@@ -77,7 +78,7 @@ describe('Footer', () => {
|
||||
render(<Component />);
|
||||
const helpToggleButton = screen.getByText(messages.openHelpButtonLabel.defaultMessage);
|
||||
await user.click(helpToggleButton);
|
||||
expect(screen.getByTestId('openEdXPortalButton')).toBeVisible();
|
||||
expect(screen.getByTestId('openEdXDemoCourseButton')).toBeVisible();
|
||||
});
|
||||
it('should not show contact us button', async () => {
|
||||
const user = userEvent.setup();
|
||||
|
||||
32
src/components/studio-footer/help-components/HelpButton.jsx
Normal file
@@ -0,0 +1,32 @@
|
||||
import React from 'react';
|
||||
import { useIntl } from '@edx/frontend-platform/i18n';
|
||||
import {
|
||||
Button,
|
||||
} from '@openedx/paragon';
|
||||
import { ExpandLess, ExpandMore, Help } from '@openedx/paragon/icons';
|
||||
import PropTypes from 'prop-types';
|
||||
import messages from '../messages';
|
||||
|
||||
const HelpButton = ({ isOpen, setIsOpen }) => {
|
||||
const intl = useIntl();
|
||||
return (
|
||||
<Button
|
||||
data-testid="helpToggleButton"
|
||||
variant="outline-primary"
|
||||
onClick={() => setIsOpen(!isOpen)}
|
||||
iconBefore={Help}
|
||||
iconAfter={isOpen ? ExpandLess : ExpandMore}
|
||||
size="sm"
|
||||
>
|
||||
{isOpen ? intl.formatMessage(messages.closeHelpButtonLabel)
|
||||
: intl.formatMessage(messages.openHelpButtonLabel)}
|
||||
</Button>
|
||||
);
|
||||
};
|
||||
|
||||
HelpButton.propTypes = {
|
||||
setIsOpen: PropTypes.func.isRequired,
|
||||
isOpen: PropTypes.bool.isRequired,
|
||||
};
|
||||
|
||||
export default HelpButton;
|
||||
@@ -0,0 +1,55 @@
|
||||
import React, { useMemo } from 'react';
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { IntlProvider } from '@edx/frontend-platform/i18n';
|
||||
import { AppContext } from '@edx/frontend-platform/react';
|
||||
import HelpButton from './HelpButton';
|
||||
import '@testing-library/jest-dom';
|
||||
|
||||
// eslint-disable-next-line react/prop-types
|
||||
const ButtonWithContext = ({ locale = 'en', isOpen, setIsOpen }) => {
|
||||
const contextValue = useMemo(() => ({
|
||||
authenticatedUser: null,
|
||||
config: { },
|
||||
}), []);
|
||||
|
||||
return (
|
||||
<IntlProvider locale={locale}>
|
||||
<AppContext.Provider
|
||||
value={contextValue}
|
||||
>
|
||||
<HelpButton isOpen={isOpen} setIsOpen={setIsOpen} />
|
||||
</AppContext.Provider>
|
||||
</IntlProvider>
|
||||
);
|
||||
};
|
||||
|
||||
describe('HelpButton', () => {
|
||||
const mockSetIsOpen = jest.fn();
|
||||
|
||||
beforeEach(() => {
|
||||
mockSetIsOpen.mockClear();
|
||||
});
|
||||
|
||||
it('renders with "open" label when isOpen is false', () => {
|
||||
render(<ButtonWithContext isOpen={false} setIsOpen={mockSetIsOpen} />);
|
||||
expect(screen.getByTestId('helpToggleButton')).toBeInTheDocument();
|
||||
expect(screen.getByRole('button')).toHaveTextContent(/help|open/i);
|
||||
});
|
||||
|
||||
it('renders with "close" label when isOpen is true', () => {
|
||||
render(<ButtonWithContext isOpen setIsOpen={mockSetIsOpen} />);
|
||||
expect(screen.getByTestId('helpToggleButton')).toBeInTheDocument();
|
||||
expect(screen.getByRole('button')).toHaveTextContent(/close|help/i);
|
||||
});
|
||||
|
||||
it('calls setIsOpen with the toggled value when clicked', async () => {
|
||||
const user = userEvent.setup();
|
||||
const { rerender } = render(<ButtonWithContext isOpen={false} setIsOpen={mockSetIsOpen} />);
|
||||
await user.click(screen.getByTestId('helpToggleButton'));
|
||||
expect(mockSetIsOpen).toHaveBeenCalledWith(true);
|
||||
rerender(<ButtonWithContext isOpen setIsOpen={mockSetIsOpen} />);
|
||||
await user.click(screen.getByTestId('helpToggleButton'));
|
||||
expect(mockSetIsOpen).toHaveBeenCalledWith(false);
|
||||
});
|
||||
});
|
||||
76
src/components/studio-footer/help-components/HelpContent.jsx
Normal file
@@ -0,0 +1,76 @@
|
||||
import React, { useContext } from 'react';
|
||||
import { AppContext } from '@edx/frontend-platform/react';
|
||||
import isEmpty from 'lodash/isEmpty';
|
||||
import { ensureConfig } from '@edx/frontend-platform';
|
||||
import { FormattedMessage } from '@edx/frontend-platform/i18n';
|
||||
import {
|
||||
ActionRow,
|
||||
Button,
|
||||
} from '@openedx/paragon';
|
||||
import messages from '../messages';
|
||||
|
||||
ensureConfig([
|
||||
'SUPPORT_EMAIL',
|
||||
], 'Studio Footer Help Content component');
|
||||
|
||||
const BUTTONS = [
|
||||
{
|
||||
as: 'a',
|
||||
href: 'https://docs.openedx.org/',
|
||||
size: 'sm',
|
||||
message: messages.edxDocumentationButtonLabel,
|
||||
dataTestid: null,
|
||||
},
|
||||
{
|
||||
as: 'a',
|
||||
href: 'https://openedx.org/',
|
||||
size: 'sm',
|
||||
message: messages.openEdxPortalButtonLabel,
|
||||
dataTestid: 'openEdXPortalButton',
|
||||
},
|
||||
{
|
||||
as: 'a',
|
||||
href: 'https://www.edx.org/course/edx101-overview-of-creating-an-edx-course#.VO4eaLPF-n1',
|
||||
size: 'sm',
|
||||
message: messages.edx101ButtonLabel,
|
||||
dataTestid: 'openEdXDemoCourseButton',
|
||||
},
|
||||
{
|
||||
as: 'a',
|
||||
href: 'https://www.edx.org/course/studiox-creating-a-course-with-edx-studio',
|
||||
size: 'sm',
|
||||
message: messages.studioXButtonLabel,
|
||||
dataTestid: null,
|
||||
},
|
||||
];
|
||||
|
||||
const HelpContent = () => {
|
||||
const { config } = useContext(AppContext);
|
||||
return (
|
||||
<ActionRow key="help-link-button-row" className="py-4" data-testid="helpButtonRow">
|
||||
<ActionRow.Spacer />
|
||||
|
||||
{BUTTONS.map(({
|
||||
as, href, size, message, dataTestid,
|
||||
}) => (
|
||||
<Button as={as} href={href} size={size} key={message.id} data-testid={dataTestid}>
|
||||
<FormattedMessage {...message} />
|
||||
</Button>
|
||||
))}
|
||||
|
||||
{!isEmpty(config.SUPPORT_EMAIL) && (
|
||||
<Button
|
||||
as="a"
|
||||
href={`mailto:${config.SUPPORT_EMAIL}`}
|
||||
size="sm"
|
||||
data-testid="contactUsButton"
|
||||
>
|
||||
<FormattedMessage {...messages.contactUsButtonLabel} />
|
||||
</Button>
|
||||
)}
|
||||
<ActionRow.Spacer />
|
||||
</ActionRow>
|
||||
);
|
||||
};
|
||||
|
||||
export default HelpContent;
|
||||
@@ -0,0 +1,44 @@
|
||||
import React, { useMemo } from 'react';
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import { IntlProvider } from '@edx/frontend-platform/i18n';
|
||||
import { AppContext } from '@edx/frontend-platform/react';
|
||||
import HelpContent from './HelpContent';
|
||||
import '@testing-library/jest-dom';
|
||||
import messages from '../messages';
|
||||
|
||||
// eslint-disable-next-line react/prop-types
|
||||
const ContentWithContext = ({ locale = 'en', config = {} }) => {
|
||||
const contextValue = useMemo(() => ({
|
||||
authenticatedUser: null,
|
||||
config,
|
||||
}), [config]);
|
||||
|
||||
return (
|
||||
<IntlProvider locale={locale}>
|
||||
<AppContext.Provider
|
||||
value={contextValue}
|
||||
>
|
||||
<HelpContent />
|
||||
</AppContext.Provider>
|
||||
</IntlProvider>
|
||||
);
|
||||
};
|
||||
|
||||
describe('HelpContent', () => {
|
||||
it('renders all help buttons', () => {
|
||||
const config = { SUPPORT_EMAIL: 'support@example.com' };
|
||||
render(<ContentWithContext config={config} />);
|
||||
expect(screen.getByText(messages.edxDocumentationButtonLabel.defaultMessage)).toBeInTheDocument();
|
||||
expect(screen.getByText(messages.edx101ButtonLabel.defaultMessage)).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('does not render contact button if SUPPORT_EMAIL is empty', () => {
|
||||
render(<ContentWithContext config={{ SUPPORT_EMAIL: null }} />);
|
||||
expect(screen.queryByTestId('contactUsButton')).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('renders ActionRow with correct test id', () => {
|
||||
render(<ContentWithContext />);
|
||||
expect(screen.getByTestId('helpButtonRow')).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
43
src/components/studio-footer/help-components/HelpSection.jsx
Normal file
@@ -0,0 +1,43 @@
|
||||
import React from 'react';
|
||||
import {
|
||||
Container,
|
||||
TransitionReplace,
|
||||
} from '@openedx/paragon';
|
||||
import classNames from 'classnames';
|
||||
import PropTypes from 'prop-types';
|
||||
import StudioFooterHelpButtonSlot from '../../../plugin-slots/StudioFooterHelpButtonSlot';
|
||||
import StudioFooterHelpContentlot from '../../../plugin-slots/StudioFooterHelpContentSlot';
|
||||
|
||||
const HelpSection = ({ containerProps }) => {
|
||||
const [isOpen, setIsOpen] = React.useState(false);
|
||||
const { containerClassName, ...restContainerProps } = containerProps || {};
|
||||
return (
|
||||
<>
|
||||
<div className="m-0 mt-6 row align-items-center justify-content-center">
|
||||
<div className="col border-top mr-2" />
|
||||
<StudioFooterHelpButtonSlot
|
||||
setIsOpen={setIsOpen}
|
||||
isOpen={isOpen}
|
||||
/>
|
||||
<div className="col border-top ml-2" />
|
||||
</div>
|
||||
<Container
|
||||
size="xl"
|
||||
className={classNames('px-4', containerClassName)}
|
||||
{...restContainerProps}
|
||||
>
|
||||
{isOpen && <TransitionReplace><StudioFooterHelpContentlot /></TransitionReplace> }
|
||||
</Container>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
HelpSection.propTypes = {
|
||||
containerProps: PropTypes.shape(Container.propTypes),
|
||||
};
|
||||
|
||||
HelpSection.defaultProps = {
|
||||
containerProps: {},
|
||||
};
|
||||
|
||||
export default HelpSection;
|
||||
@@ -0,0 +1,52 @@
|
||||
import React, { useMemo } from 'react';
|
||||
import { render, screen, fireEvent } from '@testing-library/react';
|
||||
import { IntlProvider } from '@edx/frontend-platform/i18n';
|
||||
import { AppContext } from '@edx/frontend-platform/react';
|
||||
import HelpSection from './HelpSection';
|
||||
import '@testing-library/jest-dom';
|
||||
|
||||
// eslint-disable-next-line react/prop-types
|
||||
const HelpSectionWithContext = ({ locale = 'en', config = {}, containerProps = null }) => {
|
||||
const contextValue = useMemo(() => ({
|
||||
authenticatedUser: null,
|
||||
config,
|
||||
}), [config]);
|
||||
|
||||
return (
|
||||
<IntlProvider locale={locale}>
|
||||
<AppContext.Provider
|
||||
value={contextValue}
|
||||
>
|
||||
<HelpSection containerProps={containerProps} />
|
||||
</AppContext.Provider>
|
||||
</IntlProvider>
|
||||
);
|
||||
};
|
||||
|
||||
describe('HelpSection', () => {
|
||||
it('renders the HelpButton', () => {
|
||||
render(<HelpSectionWithContext />);
|
||||
expect(screen.getByTestId('helpToggleButton')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('does not show HelpContent by default', () => {
|
||||
render(<HelpSectionWithContext />);
|
||||
expect(screen.queryByTestId('helpButtonRow')).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('shows HelpContent when HelpButton is clicked', () => {
|
||||
render(<HelpSectionWithContext />);
|
||||
const button = screen.getByTestId('helpToggleButton');
|
||||
fireEvent.click(button);
|
||||
expect(screen.getByTestId('helpButtonRow')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('hides HelpContent when HelpButton is clicked twice', () => {
|
||||
render(<HelpSectionWithContext containerProps={{ containerClassName: 'container', size: 'xl' }} />);
|
||||
const button = screen.getByTestId('helpToggleButton');
|
||||
fireEvent.click(button);
|
||||
expect(screen.queryByTestId('helpButtonRow')).toBeInTheDocument();
|
||||
fireEvent.click(button);
|
||||
expect(screen.queryByTestId('helpButtonRow')).not.toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
@@ -1,8 +1,10 @@
|
||||
import Footer, { EVENT_NAMES } from './components/Footer';
|
||||
import messages from './i18n/index';
|
||||
import StudioFooter from './components/studio-footer';
|
||||
import FooterSlot from './plugin-slots/FooterSlot';
|
||||
import StudioFooterSlot from './plugin-slots/StudioFooterSlot';
|
||||
|
||||
export default Footer;
|
||||
export {
|
||||
messages, EVENT_NAMES, StudioFooter,
|
||||
messages, EVENT_NAMES, StudioFooter, FooterSlot, StudioFooterSlot,
|
||||
};
|
||||
|
||||
51
src/plugin-slots/FooterSlot/README.md
Normal file
@@ -0,0 +1,51 @@
|
||||
# FooterSlot
|
||||
|
||||
### Slot ID: `org.openedx.frontend.layout.footer.v1`
|
||||
|
||||
### Slot ID Aliases
|
||||
* `footer_slot`
|
||||
|
||||
## Description
|
||||
|
||||
This slot is used to repace/modify/hide the entire footer.
|
||||
|
||||
## Example
|
||||
|
||||
The following `env.config.jsx` will replace the default footer.
|
||||
|
||||

|
||||
|
||||
with a simple custom footer
|
||||
|
||||

|
||||
|
||||
```jsx
|
||||
import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
|
||||
|
||||
const config = {
|
||||
pluginSlots: {
|
||||
'org.openedx.frontend.layout.footer.v1': {
|
||||
plugins: [
|
||||
{
|
||||
// Hide the default footer
|
||||
op: PLUGIN_OPERATIONS.Hide,
|
||||
widgetId: 'default_contents',
|
||||
},
|
||||
{
|
||||
// Insert a custom footer
|
||||
op: PLUGIN_OPERATIONS.Insert,
|
||||
widget: {
|
||||
id: 'custom_footer',
|
||||
type: DIRECT_PLUGIN,
|
||||
RenderWidget: () => (
|
||||
<h1 style={{textAlign: 'center'}}>🦶</h1>
|
||||
),
|
||||
},
|
||||
},
|
||||
]
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
export default config;
|
||||
```
|
||||
BIN
src/plugin-slots/FooterSlot/images/custom_footer.png
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
src/plugin-slots/FooterSlot/images/default_footer.png
Normal file
|
After Width: | Height: | Size: 6.5 KiB |
14
src/plugin-slots/FooterSlot/index.jsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import React from 'react';
|
||||
import { PluginSlot } from '@openedx/frontend-plugin-framework';
|
||||
import Footer from '../../components/Footer';
|
||||
|
||||
const FooterSlot = () => (
|
||||
<PluginSlot
|
||||
id="org.openedx.frontend.layout.footer.v1"
|
||||
idAliases={['footer_slot', 'footer_plugin_slot']}
|
||||
>
|
||||
<Footer />
|
||||
</PluginSlot>
|
||||
);
|
||||
|
||||
export default FooterSlot;
|
||||
5
src/plugin-slots/README.md
Normal file
@@ -0,0 +1,5 @@
|
||||
# `frontend-component-footer` Plugin Slots
|
||||
|
||||
* [`org.openedx.frontend.layout.footer.v1`](./FooterSlot/)
|
||||
* [`org.openedx.frontend.layout.studio_footer.v1`](./StudioFooterSlot/)
|
||||
* [`org.openedx.frontend.layout.studio_footer_logo.v1`](./StudioFooterLogoSlot/)
|
||||
47
src/plugin-slots/StudioFooterHelpButtonSlot/README.md
Normal file
@@ -0,0 +1,47 @@
|
||||
# StudioFooterLogoSlot
|
||||
|
||||
### Slot ID: `org.openedx.frontend.layout.studio_footer_help_button.v1`
|
||||
|
||||
## Description
|
||||
|
||||
This slot is used to repace/modify/hide the help button to the studio footer.
|
||||
|
||||
## Examples
|
||||
|
||||
### Add your custom button.
|
||||
|
||||
The following `env.config.jsx` will add a custom help button to the studio footer.
|
||||
|
||||

|
||||
|
||||
```jsx
|
||||
import { PLUGIN_OPERATIONS, DIRECT_PLUGIN } from '@openedx/frontend-plugin-framework';
|
||||
import {
|
||||
Button,
|
||||
} from '@openedx/paragon';
|
||||
|
||||
const config = {
|
||||
pluginSlots: {
|
||||
'org.openedx.frontend.layout.studio_footer_help_button.v1': {
|
||||
keepDefault: false,
|
||||
plugins: [
|
||||
{
|
||||
op: PLUGIN_OPERATIONS.Insert,
|
||||
widget: {
|
||||
id: 'studio_footer_helpbutton_addition',
|
||||
type: DIRECT_PLUGIN,
|
||||
priority: 40,
|
||||
RenderWidget: ({isOpen, setIsOpen}) => {
|
||||
return (
|
||||
<Button className="button button1" onClick={() => setIsOpen(!isOpen)}>Custom Help Button</Button>
|
||||
)
|
||||
}
|
||||
}
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
export default config;
|
||||
```
|
||||
|
After Width: | Height: | Size: 148 KiB |
17
src/plugin-slots/StudioFooterHelpButtonSlot/index.jsx
Normal file
@@ -0,0 +1,17 @@
|
||||
import React from 'react';
|
||||
import { PluginSlot } from '@openedx/frontend-plugin-framework';
|
||||
import PropTypes from 'prop-types';
|
||||
import HelpButton from '../../components/studio-footer/help-components/HelpButton';
|
||||
|
||||
const StudioFooterHelpButtonSlot = ({ isOpen, setIsOpen }) => (
|
||||
<PluginSlot id="org.openedx.frontend.layout.studio_footer_help_button.v1" pluginProps={{ isOpen, setIsOpen }}>
|
||||
<HelpButton isOpen={isOpen} setIsOpen={setIsOpen} />
|
||||
</PluginSlot>
|
||||
);
|
||||
|
||||
StudioFooterHelpButtonSlot.propTypes = {
|
||||
setIsOpen: PropTypes.func.isRequired,
|
||||
isOpen: PropTypes.bool.isRequired,
|
||||
};
|
||||
|
||||
export default StudioFooterHelpButtonSlot;
|
||||
50
src/plugin-slots/StudioFooterHelpContentSlot/README.md
Normal file
@@ -0,0 +1,50 @@
|
||||
# StudioFooterLogoSlot
|
||||
|
||||
### Slot ID: `org.openedx.frontend.layout.studio_footer_help-content.v1`
|
||||
|
||||
## Description
|
||||
|
||||
This slot is used to repace/modify/hide the help content to the studio footer.
|
||||
|
||||
## Examples
|
||||
|
||||
### Add a custom help content.
|
||||
|
||||
The following `env.config.jsx` will add a custom help content to the studio footer.
|
||||
|
||||

|
||||
|
||||
```jsx
|
||||
import { PLUGIN_OPERATIONS, DIRECT_PLUGIN } from '@openedx/frontend-plugin-framework';
|
||||
import {
|
||||
Hyperlink,
|
||||
} from '@openedx/paragon';
|
||||
|
||||
const config = {
|
||||
pluginSlots: {
|
||||
'org.openedx.frontend.layout.studio_footer_help-content.v1': {
|
||||
keepDefault: false,
|
||||
plugins: [
|
||||
{
|
||||
op: PLUGIN_OPERATIONS.Insert,
|
||||
widget: {
|
||||
id: 'studio_footer_helpcontent_addition',
|
||||
type: DIRECT_PLUGIN,
|
||||
priority: 40,
|
||||
RenderWidget: () => {
|
||||
return (
|
||||
<div style={{ display: 'flex', flexDirection: 'column', justifyContent: 'center', alignItems: 'center', padding: '20px 5px' }}>
|
||||
<p>Custom Help content</p>
|
||||
<Hyperlink destination="https://example.com/">more help</Hyperlink>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
export default config;
|
||||
```
|
||||
|
After Width: | Height: | Size: 129 KiB |
13
src/plugin-slots/StudioFooterHelpContentSlot/index.jsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import React from 'react';
|
||||
import { PluginSlot } from '@openedx/frontend-plugin-framework';
|
||||
import HelpContent from '../../components/studio-footer/help-components/HelpContent';
|
||||
|
||||
const StudioFooterHelpContentSlot = () => (
|
||||
<PluginSlot
|
||||
id="org.openedx.frontend.layout.studio_footer_help-content.v1"
|
||||
>
|
||||
<HelpContent />
|
||||
</PluginSlot>
|
||||
);
|
||||
|
||||
export default StudioFooterHelpContentSlot;
|
||||
53
src/plugin-slots/StudioFooterHelpSectionSlot/README.md
Normal file
@@ -0,0 +1,53 @@
|
||||
# StudioFooterLogoSlot
|
||||
|
||||
### Slot ID: `org.openedx.frontend.layout.studio_footer_help_section.v1`
|
||||
|
||||
## Description
|
||||
|
||||
This slot is used to repace/modify/hide the help section to the studio footer.
|
||||
|
||||

|
||||
|
||||
## Examples
|
||||
|
||||
### Customize help section.
|
||||
|
||||
The following `env.config.jsx` will add a custom help section to the studio footer.
|
||||
|
||||
```jsx
|
||||
import { PLUGIN_OPERATIONS, DIRECT_PLUGIN } from '@openedx/frontend-plugin-framework';
|
||||
import {
|
||||
Hyperlink,
|
||||
Button,
|
||||
} from '@openedx/paragon';
|
||||
|
||||
const config = {
|
||||
pluginSlots: {
|
||||
'org.openedx.frontend.layout.studio_footer_help_section.v1': {
|
||||
keepDefault: false,
|
||||
plugins: [
|
||||
{
|
||||
op: PLUGIN_OPERATIONS.Insert,
|
||||
widget: {
|
||||
id: 'studio_footer_helpsection_addition',
|
||||
type: DIRECT_PLUGIN,
|
||||
priority: 40,
|
||||
RenderWidget: () => {
|
||||
return (
|
||||
<div style={{ display: 'flex', flexDirection: 'column', justifyContent: 'center', alignItems: 'center', padding: '20px 5px' }}>
|
||||
<p>Custom Help Section custizable as needed </p>
|
||||
<Button className="button button1">Go to home</Button>
|
||||
<Hyperlink destination="https://example.com/">About</Hyperlink>
|
||||
<Hyperlink destination="https://example.com/">Info</Hyperlink>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
export default config;
|
||||
```
|
||||
|
After Width: | Height: | Size: 142 KiB |
19
src/plugin-slots/StudioFooterHelpSectionSlot/index.jsx
Normal file
@@ -0,0 +1,19 @@
|
||||
import React from 'react';
|
||||
import { PluginSlot } from '@openedx/frontend-plugin-framework';
|
||||
import PropTypes from 'prop-types';
|
||||
import {
|
||||
Container,
|
||||
} from '@openedx/paragon';
|
||||
import HelpSection from '../../components/studio-footer/help-components/HelpSection';
|
||||
|
||||
const StudioFooterHelpSectionSlot = ({ containerProps }) => (
|
||||
<PluginSlot id="org.openedx.frontend.layout.studio_footer_help_section.v1">
|
||||
<HelpSection containerProps={containerProps} />
|
||||
</PluginSlot>
|
||||
);
|
||||
|
||||
StudioFooterHelpSectionSlot.propTypes = {
|
||||
containerProps: PropTypes.shape(Container.propTypes),
|
||||
};
|
||||
|
||||
export default StudioFooterHelpSectionSlot;
|
||||
57
src/plugin-slots/StudioFooterLogoSlot/README.md
Normal file
@@ -0,0 +1,57 @@
|
||||
# StudioFooterLogoSlot
|
||||
|
||||
### Slot ID: `org.openedx.frontend.layout.studio_footer_logo.v1`
|
||||
|
||||
### Slot ID Aliases
|
||||
* `studio_footer_logo_slot`
|
||||
|
||||
## Description
|
||||
|
||||
This slot is used to add your site logo to the studio footer.
|
||||
|
||||
## Examples
|
||||
|
||||
### Add your site logo.
|
||||
|
||||
The following `env.config.jsx` will add your site logo to the studio footer.
|
||||
|
||||

|
||||
|
||||
```jsx
|
||||
import { PLUGIN_OPERATIONS, DIRECT_PLUGIN } from '@openedx/frontend-plugin-framework';
|
||||
import {
|
||||
Hyperlink,
|
||||
Image,
|
||||
} from '@openedx/paragon';
|
||||
|
||||
const config = {
|
||||
pluginSlots: {
|
||||
'org.openedx.frontend.layout.studio_footer_logo.v1': {
|
||||
keepDefault: true,
|
||||
plugins: [
|
||||
{
|
||||
op: PLUGIN_OPERATIONS.Insert,
|
||||
widget: {
|
||||
id: 'studio_footer_logo_addition',
|
||||
type: DIRECT_PLUGIN,
|
||||
priority: 40,
|
||||
RenderWidget: () => {
|
||||
return (
|
||||
<Hyperlink destination="https://example.com/" className="float-right">
|
||||
<Image
|
||||
height="48px"
|
||||
alt="Hosted by MySite"
|
||||
src="https://logos.openedx.org/generic-logo.svg"
|
||||
/>
|
||||
</Hyperlink>
|
||||
)
|
||||
}
|
||||
}
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
export default config;
|
||||
```
|
||||
|
After Width: | Height: | Size: 285 KiB |
17
src/plugin-slots/StudioFooterLogoSlot/index.jsx
Normal file
@@ -0,0 +1,17 @@
|
||||
import React from 'react';
|
||||
import { PluginSlot } from '@openedx/frontend-plugin-framework';
|
||||
import { Hyperlink, Image } from '@openedx/paragon';
|
||||
|
||||
const StudioFooterLogoSlot = () => (
|
||||
<PluginSlot id="org.openedx.frontend.layout.studio_footer_logo.v1" idAliases={['studio_footer_logo_slot']}>
|
||||
<Hyperlink destination="https://openedx.org" className="float-right">
|
||||
<Image
|
||||
width="120px"
|
||||
alt="Powered by Open edX"
|
||||
src="https://logos.openedx.org/open-edx-logo-tag.png"
|
||||
/>
|
||||
</Hyperlink>
|
||||
</PluginSlot>
|
||||
);
|
||||
|
||||
export default StudioFooterLogoSlot;
|
||||
51
src/plugin-slots/StudioFooterSlot/README.md
Normal file
@@ -0,0 +1,51 @@
|
||||
# StudioFooterSlot
|
||||
|
||||
### Slot ID: `org.openedx.frontend.layout.studio_footer.v1`
|
||||
|
||||
### Slot ID Aliases
|
||||
* `studio_footer_slot`
|
||||
|
||||
## Description
|
||||
|
||||
This slot is used to repace/modify/hide the entire studio footer.
|
||||
|
||||
## Example
|
||||
|
||||
The following `env.config.jsx` will replace the default studio footer.
|
||||
|
||||

|
||||
|
||||
with a simple custom footer
|
||||
|
||||

|
||||
|
||||
```jsx
|
||||
import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
|
||||
|
||||
const config = {
|
||||
pluginSlots: {
|
||||
'org.openedx.frontend.layout.studio_footer.v1': {
|
||||
plugins: [
|
||||
{
|
||||
// Hide the default footer
|
||||
op: PLUGIN_OPERATIONS.Hide,
|
||||
widgetId: 'default_contents',
|
||||
},
|
||||
{
|
||||
// Insert a custom footer
|
||||
op: PLUGIN_OPERATIONS.Insert,
|
||||
widget: {
|
||||
id: 'custom_footer',
|
||||
type: DIRECT_PLUGIN,
|
||||
RenderWidget: () => (
|
||||
<h1 style={{textAlign: 'center'}}>🦶</h1>
|
||||
),
|
||||
},
|
||||
},
|
||||
]
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
export default config;
|
||||
```
|
||||
BIN
src/plugin-slots/StudioFooterSlot/images/custom_footer.png
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
|
After Width: | Height: | Size: 79 KiB |
11
src/plugin-slots/StudioFooterSlot/index.jsx
Normal file
@@ -0,0 +1,11 @@
|
||||
import React from 'react';
|
||||
import { PluginSlot } from '@openedx/frontend-plugin-framework';
|
||||
import StudioFooter from '../../components/studio-footer';
|
||||
|
||||
const StudioFooterSlot = () => (
|
||||
<PluginSlot id="org.openedx.frontend.layout.studio_footer.v1" idAliases={['studio_footer_slot']}>
|
||||
<StudioFooter />
|
||||
</PluginSlot>
|
||||
);
|
||||
|
||||
export default StudioFooterSlot;
|
||||
@@ -2,7 +2,9 @@ const path = require('path');
|
||||
const { createConfig } = require('@openedx/frontend-build');
|
||||
|
||||
module.exports = createConfig('webpack-dev', {
|
||||
entry: path.resolve(__dirname, 'example'),
|
||||
entry: {
|
||||
app: path.resolve(__dirname, 'example'),
|
||||
},
|
||||
output: {
|
||||
path: path.resolve(__dirname, 'example/dist'),
|
||||
publicPath: '/',
|
||||
|
||||