Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 30 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
"@dnd-kit/utilities": "^3.2.2",
"@edx/brand": "npm:@openedx/brand-openedx@^1.2.3",
"@edx/browserslist-config": "1.2.0",
"@edx/frontend-component-footer": "^14.3.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to keep this dependency in here. frontend-slot-footer has an unversioned peer dependency on frontend-component-footer, so keeping a versioned dependency in here is helpful.

"@edx/frontend-component-header": "^6.2.0",
"@edx/frontend-enterprise-hotjar": "^7.2.0",
"@edx/frontend-platform": "^8.3.1",
Expand All @@ -60,6 +59,7 @@
"@openedx-plugins/course-app-wiki": "file:plugins/course-apps/wiki",
"@openedx-plugins/course-app-xpert_unit_summary": "file:plugins/course-apps/xpert_unit_summary",
"@openedx/frontend-build": "^14.3.3",
"@openedx/frontend-slot-footer": "^1.2.0",
"@openedx/frontend-plugin-framework": "^1.6.0",
"@openedx/paragon": "^22.16.0",
"@redux-devtools/extension": "^3.3.0",
Expand Down
4 changes: 2 additions & 2 deletions src/CourseAuthoringPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useDispatch, useSelector } from 'react-redux';
import {
useLocation,
} from 'react-router-dom';
import { StudioFooter } from '@edx/frontend-component-footer';
import { StudioFooterSlot } from '@openedx/frontend-slot-footer';
import Header from './header';
import { fetchCourseDetail, fetchWaffleFlags } from './data/thunks';
import { useModel } from './generic/model-store';
Expand Down Expand Up @@ -66,7 +66,7 @@ const CourseAuthoringPage = ({ courseId, children }) => {
)
)}
{children}
{!inProgress && !isEditor && <StudioFooter />}
{!inProgress && !isEditor && <StudioFooterSlot />}
</div>
);
};
Expand Down
4 changes: 2 additions & 2 deletions src/accessibility-page/AccessibilityPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 { StudioFooter } from '@edx/frontend-component-footer';
import { StudioFooterSlot } from '@openedx/frontend-slot-footer';

import Header from '../header';
import messages from './messages';
Expand All @@ -29,7 +29,7 @@ const AccessibilityPage = ({
<AccessibilityBody {...{ email, communityAccessibilityLink }} />
<AccessibilityForm accessibilityEmail={email} />
</Container>
<StudioFooter />
<StudioFooterSlot />
</>
);
};
Expand Down
5 changes: 3 additions & 2 deletions src/course-rerun/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import {
ActionRow,
Button,
} from '@openedx/paragon';
import { StudioFooter } from '@edx/frontend-component-footer';
import { StudioFooterSlot } from '@openedx/frontend-slot-footer';

import { useNavigate, useParams } from 'react-router-dom';

import Header from '../header';
Expand Down Expand Up @@ -88,7 +89,7 @@ const CourseRerun = () => {
isQueryPending={savingStatus === RequestStatus.PENDING}
/>
</div>
<StudioFooter />
<StudioFooterSlot />
</>
);
};
Expand Down
4 changes: 2 additions & 2 deletions src/library-authoring/LibraryAuthoringPage.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useCallback, useEffect, useState } from 'react';
import { Helmet } from 'react-helmet';
import classNames from 'classnames';
import { StudioFooter } from '@edx/frontend-component-footer';
import { StudioFooterSlot } from '@openedx/frontend-slot-footer';
import { useIntl } from '@edx/frontend-platform/i18n';
import {
ActionRow,
Expand Down Expand Up @@ -285,7 +285,7 @@ const LibraryAuthoringPage = ({ returnToLibrarySelection }: LibraryAuthoringPage
<LibraryContent contentType={activeKey} />
</SearchContextProvider>
</Container>
{!componentPickerMode && <StudioFooter containerProps={{ size: undefined }} />}
{!componentPickerMode && <StudioFooterSlot containerProps={{ size: undefined }} />}
</div>
{!!sidebarComponentInfo?.type && (
<div className="library-authoring-sidebar box-shadow-left-1 bg-white" data-testid="library-sidebar">
Expand Down
4 changes: 2 additions & 2 deletions src/library-authoring/collections/LibraryCollectionPage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useEffect } from 'react';
import { StudioFooter } from '@edx/frontend-component-footer';
import { StudioFooterSlot } from '@openedx/frontend-slot-footer';
import { useIntl } from '@edx/frontend-platform/i18n';
import {
ActionRow,
Expand Down Expand Up @@ -220,7 +220,7 @@ const LibraryCollectionPage = () => {
<LibraryCollectionComponents />
</SearchContextProvider>
</Container>
{!componentPickerMode && <StudioFooter containerProps={{ size: undefined }} />}
{!componentPickerMode && <StudioFooterSlot containerProps={{ size: undefined }} />}
</div>
{!!sidebarComponentInfo?.type && (
<div className="library-authoring-sidebar box-shadow-left-1 bg-white" data-testid="library-sidebar">
Expand Down
4 changes: 2 additions & 2 deletions src/library-authoring/create-library/CreateLibrary.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { StudioFooter } from '@edx/frontend-component-footer';
import { StudioFooterSlot } from '@openedx/frontend-slot-footer';
import { useIntl } from '@edx/frontend-platform/i18n';
import {
Container,
Expand Down Expand Up @@ -162,7 +162,7 @@ const CreateLibrary = () => {
</Formik>
{isError && (<AlertError error={error} />)}
</Container>
<StudioFooter />
<StudioFooterSlot />
</>
);
};
Expand Down
3 changes: 3 additions & 0 deletions src/plugin-slots/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@
## Course Unit page

* [`course_unit_header_actions_slot`](./CourseUnitHeaderActionsSlot/)

## Footer Slot
* [`studio_footer_slot`](./StudioFooterSlot/)
50 changes: 50 additions & 0 deletions src/plugin-slots/StudioFooterSlot/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Studio Footer Slot

### Slot ID: `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/).

## Example

The following `env.config.jsx` will replace the default footer.

![Screenshot of Default Studio Footer](./images/default_studio_footer.png)

with a simple custom footer

![Screenshot of Custom Footer](./images/custom_footer.png)

```jsx
import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';

const config = {
pluginSlots: {
studio_footer_slot: {
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;
```
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/studio-home/StudioHome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 { StudioFooter } from '@edx/frontend-component-footer';
import { StudioFooterSlot } from '@openedx/frontend-slot-footer';
import { getConfig } from '@edx/frontend-platform';
import { useLocation, useNavigate } from 'react-router-dom';

Expand Down Expand Up @@ -188,7 +188,7 @@ const StudioHome = () => {
isQueryPending={anyQueryIsPending}
/>
</div>
<StudioFooter />
<StudioFooterSlot />
</>
);
};
Expand Down
4 changes: 2 additions & 2 deletions src/taxonomy/TaxonomyLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useMemo, useState } from 'react';
import { StudioFooter } from '@edx/frontend-component-footer';
import { StudioFooterSlot } from '@openedx/frontend-slot-footer';
import { Outlet, ScrollRestoration } from 'react-router-dom';
import { Toast } from '@openedx/paragon';

Expand Down Expand Up @@ -28,7 +28,7 @@ export const TaxonomyLayout = () => {
/>
)}
<Outlet />
<StudioFooter />
<StudioFooterSlot />
{toastMessage && (
<Toast
show
Expand Down