feat: import StudioFooterSlot from component package instead of slot package (#1832)
This commit is contained in:
15
package-lock.json
generated
15
package-lock.json
generated
@@ -38,7 +38,6 @@
|
||||
"@openedx-plugins/course-app-xpert_unit_summary": "file:plugins/course-apps/xpert_unit_summary",
|
||||
"@openedx/frontend-build": "^14.3.3",
|
||||
"@openedx/frontend-plugin-framework": "^1.7.0",
|
||||
"@openedx/frontend-slot-footer": "^1.2.0",
|
||||
"@openedx/paragon": "^22.16.0",
|
||||
"@redux-devtools/extension": "^3.3.0",
|
||||
"@reduxjs/toolkit": "1.9.7",
|
||||
@@ -4269,20 +4268,6 @@
|
||||
"@babel/runtime": "^7.9.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@openedx/frontend-slot-footer": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@openedx/frontend-slot-footer/-/frontend-slot-footer-1.2.0.tgz",
|
||||
"integrity": "sha512-bJuqgdiAlPRj1QuUOJWtNqGTCTcdsk4vHeOM3jRkxtWycq+j1JpGnnZEWAmjoRv9dDKr39vt2buNrmvj0sCTbA==",
|
||||
"license": "AGPL-3.0",
|
||||
"dependencies": {
|
||||
"@openedx/frontend-plugin-framework": "^1.5.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@edx/frontend-component-footer": "*",
|
||||
"react": "^17.0.0 || ^18.0.0",
|
||||
"react-dom": "^17.0.0 || ^18.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@openedx/paragon": {
|
||||
"version": "22.17.0",
|
||||
"resolved": "https://registry.npmjs.org/@openedx/paragon/-/paragon-22.17.0.tgz",
|
||||
|
||||
@@ -62,7 +62,6 @@
|
||||
"@openedx-plugins/course-app-xpert_unit_summary": "file:plugins/course-apps/xpert_unit_summary",
|
||||
"@openedx/frontend-build": "^14.3.3",
|
||||
"@openedx/frontend-plugin-framework": "^1.7.0",
|
||||
"@openedx/frontend-slot-footer": "^1.2.0",
|
||||
"@openedx/paragon": "^22.16.0",
|
||||
"@redux-devtools/extension": "^3.3.0",
|
||||
"@reduxjs/toolkit": "1.9.7",
|
||||
|
||||
@@ -5,7 +5,7 @@ import { useDispatch, useSelector } from 'react-redux';
|
||||
import {
|
||||
useLocation,
|
||||
} from 'react-router-dom';
|
||||
import { StudioFooterSlot } from '@openedx/frontend-slot-footer';
|
||||
import { StudioFooterSlot } from '@edx/frontend-component-footer';
|
||||
import Header from './header';
|
||||
import { fetchCourseDetail, fetchWaffleFlags } from './data/thunks';
|
||||
import { useModel } from './generic/model-store';
|
||||
|
||||
@@ -2,7 +2,7 @@ import React from 'react';
|
||||
import { injectIntl, intlShape } from '@edx/frontend-platform/i18n';
|
||||
import { Helmet } from 'react-helmet';
|
||||
import { Container } from '@openedx/paragon';
|
||||
import { StudioFooterSlot } from '@openedx/frontend-slot-footer';
|
||||
import { StudioFooterSlot } from '@edx/frontend-component-footer';
|
||||
|
||||
import Header from '../header';
|
||||
import messages from './messages';
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
ActionRow,
|
||||
Button,
|
||||
} from '@openedx/paragon';
|
||||
import { StudioFooterSlot } from '@openedx/frontend-slot-footer';
|
||||
import { StudioFooterSlot } from '@edx/frontend-component-footer';
|
||||
|
||||
import { useNavigate, useParams } from 'react-router-dom';
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
} from 'react';
|
||||
import { Helmet } from 'react-helmet';
|
||||
import classNames from 'classnames';
|
||||
import { StudioFooterSlot } from '@openedx/frontend-slot-footer';
|
||||
import { StudioFooterSlot } from '@edx/frontend-component-footer';
|
||||
import { useIntl } from '@edx/frontend-platform/i18n';
|
||||
import {
|
||||
ActionRow,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useEffect } from 'react';
|
||||
import { StudioFooterSlot } from '@openedx/frontend-slot-footer';
|
||||
import { StudioFooterSlot } from '@edx/frontend-component-footer';
|
||||
import { useIntl } from '@edx/frontend-platform/i18n';
|
||||
import {
|
||||
ActionRow,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { StudioFooterSlot } from '@openedx/frontend-slot-footer';
|
||||
import { StudioFooterSlot } from '@edx/frontend-component-footer';
|
||||
import { useIntl } from '@edx/frontend-platform/i18n';
|
||||
import {
|
||||
Container,
|
||||
|
||||
@@ -16,4 +16,4 @@
|
||||
* [`org.openedx.frontend.authoring.video_transcript_additional_translations_component.v1`](./AdditionalTranslationsComponentSlot/)
|
||||
|
||||
## Footer Slot
|
||||
* [`studio_footer_slot`](./StudioFooterSlot/)
|
||||
* [`org.openedx.frontend.layout.studio_footer.v1`](./StudioFooterSlot/)
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
# Studio Footer Slot
|
||||
|
||||
### Slot ID: `studio_footer_slot`
|
||||
### Slot ID: `org.openedx.frontend.layout.studio_footer.v1`
|
||||
|
||||
### Slot ID Aliases
|
||||
* `studio_footer_slot`
|
||||
|
||||
## Description
|
||||
|
||||
This slot is used to replace/modify/hide the footer.
|
||||
|
||||
The implementation of the `StudioFooterSlot` component lives in [the `frontend-slot-footer` repository](https://github.com/openedx/frontend-slot-footer/).
|
||||
The implementation of the `StudioFooterSlot` component lives in [the `frontend-component-footer` repository](https://github.com/openedx/frontend-component-footer/).
|
||||
|
||||
## Example
|
||||
|
||||
@@ -23,7 +26,7 @@ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-frame
|
||||
|
||||
const config = {
|
||||
pluginSlots: {
|
||||
studio_footer_slot: {
|
||||
'org.openedx.frontend.layout.studio_footer.v1': {
|
||||
plugins: [
|
||||
{
|
||||
// Hide the default footer
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
} from '@openedx/paragon';
|
||||
import { Add as AddIcon, Error } from '@openedx/paragon/icons';
|
||||
import { useIntl } from '@edx/frontend-platform/i18n';
|
||||
import { StudioFooterSlot } from '@openedx/frontend-slot-footer';
|
||||
import { StudioFooterSlot } from '@edx/frontend-component-footer';
|
||||
import { getConfig } from '@edx/frontend-platform';
|
||||
import { useLocation, useNavigate } from 'react-router-dom';
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ const MockChildComponent = () => {
|
||||
|
||||
jest.mock('../header', () => jest.fn(() => <div data-testid="mock-header" />));
|
||||
jest.mock('@edx/frontend-component-footer', () => ({
|
||||
StudioFooter: jest.fn(() => <div data-testid="mock-footer" />),
|
||||
StudioFooterSlot: jest.fn(() => <div data-testid="mock-footer" />),
|
||||
}));
|
||||
jest.mock('react-router-dom', () => ({
|
||||
...jest.requireActual('react-router-dom'),
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useMemo, useState } from 'react';
|
||||
import { StudioFooterSlot } from '@openedx/frontend-slot-footer';
|
||||
import { StudioFooterSlot } from '@edx/frontend-component-footer';
|
||||
import { Outlet, ScrollRestoration } from 'react-router-dom';
|
||||
import { Toast } from '@openedx/paragon';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user