Skip to content

Commit

Permalink
Merge branch 'chris/FAL-3528-taxonomy-export-menu' into rpenido/fal-3…
Browse files Browse the repository at this point in the history
…529-bare-bones-taxonomy-detail-page
  • Loading branch information
rpenido authored Oct 31, 2023
2 parents a12f262 + 61864d3 commit 5c0c275
Show file tree
Hide file tree
Showing 19 changed files with 263 additions and 93 deletions.
115 changes: 99 additions & 16 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ This is the Course Authoring micro-frontend, currently under development by `2U
Its purpose is to provide both a framework and UI for new or replacement React-based authoring features outside ``edx-platform``. You can find the current set described below.


************
Getting Started
************

Expand All @@ -32,6 +31,11 @@ to the `relevant tutor-mfe documentation`_ to get started using it.

.. _relevant tutor-mfe documentation: https://github.com/overhangio/tutor-mfe#mfe-development

Configuration
=============

All features that integrate into the edx-platform CMS require that the ``COURSE_AUTHORING_MICROFRONTEND_URL`` Django setting is set in the CMS environment and points to this MFE's deployment URL. This should be done automatically if you are using devstack or tutor-mfe.

Cloning and Startup
===================

Expand Down Expand Up @@ -60,7 +64,7 @@ Cloning and Startup
The dev server is running at `http://localhost:2001 <http://localhost:2001>`_.
or whatever port you setup.

********

Features
********

Expand All @@ -69,14 +73,12 @@ Feature: Pages and Resources Studio Tab

Enables a "Pages & Resources" menu item in Studio, under the "Content" menu.

.. image:: ./docs/readme-images/feature-pages-resources.png

Requirements
------------

The following are external requirements for this feature to function correctly:

* ``edx-platform`` Django settings:

* ``COURSE_AUTHORING_MICROFRONTEND_URL``: must be set in the CMS environment and point to this MFE's deployment URL.
The following are requirements for this feature to function correctly:

* ``edx-platform`` Waffle flags:

Expand Down Expand Up @@ -125,15 +127,13 @@ For a particular course, this page allows one to:
Feature: New React XBlock Editors
=================================

.. image:: ./docs/readme-images/feature-problem-editor.png

This allows an operator to enable the use of new React editors for the HTML, Video, and Problem XBlocks, all of which are provided here.

Requirements
------------

* ``edx-platform`` Django settings:

* ``COURSE_AUTHORING_MICROFRONTEND_URL``: must be set in the CMS environment and point to this MFE's deployment URL.

* ``edx-platform`` Waffle flags:

* ``new_core_editors.use_new_text_editor``: must be enabled for the new HTML Xblock editor to be used in Studio
Expand All @@ -145,7 +145,7 @@ Configuration

In additional to the standard settings, the following local configuration item is required:

* ``ENABLE_NEW_EDITOR_PAGES``: must be enabled in order to actually present the new XBlock editors
* ``ENABLE_NEW_EDITOR_PAGES``: must be enabled in order to actually present the new XBlock editors (on by default)

Feature Description
-------------------
Expand All @@ -159,12 +159,13 @@ When a corresponding waffle flag is set, upon editing a block in Studio, the vie
Feature: New Proctoring Exams View
==================================

.. image:: ./docs/readme-images/feature-proctored-exams.png

Requirements
------------

* ``edx-platform`` Django settings:

* ``COURSE_AUTHORING_MICROFRONTEND_URL``: must be set in the CMS environment and point to this MFE's deployment URL.
* ``ZENDESK_*``: necessary if automatic ZenDesk ticket creation is desired

* ``edx-platform`` Feature flags:
Expand All @@ -190,8 +191,85 @@ In Studio, a new item ("Proctored Exam Settings") is added to "Other Course Sett
* Select a proctoring provider
* Enable automatic creation of Zendesk tickets for "suspicious" proctored exam attempts

Feature: Advanced Settings
==========================

.. image:: ./docs/readme-images/feature-advanced-settings.png

Requirements
------------

* ``edx-platform`` Waffle flags:

* ``contentstore.new_studio_mfe.use_new_advanced_settings_page``: this feature flag must be enabled for the link to the settings view to be shown. It can be enabled on a per-course basis.

Feature Description
-------------------

In Studio, the "Advanced Settings" page for each enabled course will now be served by this frontend, instead of the UI built into edx-platform. The advanced settings page holds many different settings for the course, such as what features or XBlocks are enabled.

Feature: Files & Uploads
==========================

.. image:: ./docs/readme-images/feature-files-uploads.png

Requirements
------------

* ``edx-platform`` Waffle flags:

* ``contentstore.new_studio_mfe.use_new_files_uploads_page``: this feature flag must be enabled for the link to the Files & Uploads page to go to the MFE. It can be enabled on a per-course basis.

Feature Description
-------------------

In Studio, the "Files & Uploads" page for each enabled course will now be served by this frontend, instead of the UI built into edx-platform. This page allows managing static asset files like PDFs, images, etc. used for the course.

Feature: Course Updates
==========================

.. image:: ./docs/readme-images/feature-course-updates.png

Requirements
------------

* ``edx-platform`` Waffle flags:

* ``contentstore.new_studio_mfe.use_new_updates_page``: this feature flag must be enabled.

Feature: Import/Export Pages
============================

.. image:: ./docs/readme-images/feature-export.png

Requirements
------------

* ``edx-platform`` Waffle flags:

* ``contentstore.new_studio_mfe.use_new_export_page``: this feature flag will change the CMS to link to the new export page.
* ``contentstore.new_studio_mfe.use_new_import_page``: this feature flag will change the CMS to link to the new import page.

Feature: Tagging/Taxonomy Pages
================================

.. image:: ./docs/readme-images/feature-tagging-taxonomy-pages.png

Requirements
------------

* ``edx-platform`` Waffle flags:

* ``contentstore.new_studio_mfe.use_tagging_taxonomy_list_page``: this feature flag must be enabled.

Configuration
-------------

In additional to the standard settings, the following local configuration items are required:

* ``ENABLE_TAGGING_TAXONOMY_PAGES``: must be enabled in order to actually present the new Tagging/Taxonomy pages.


**********
Developing
**********

Expand All @@ -201,7 +279,7 @@ Developing
If your devstack includes the default Demo course, you can visit the following URLs to see content:

- `Proctored Exam Settings <http://localhost:2001/course/course-v1:edX+DemoX+Demo_Course/proctored-exam-settings>`_
- `Pages and Resources <http://localhost:2001/course/course-v1:edX+DemoX+Demo_Course/pages-and-resources>`_ (work in progress)
- `Pages and Resources <http://localhost:2001/course/course-v1:edX+DemoX+Demo_Course/pages-and-resources>`_

Troubleshooting
========================
Expand All @@ -212,7 +290,7 @@ Troubleshooting
If there is still an error, look for "no package [...] found" in the error message and install missing package via brew.
(https://github.com/Automattic/node-canvas/issues/1733)

*********

Deploying
*********

Expand All @@ -236,6 +314,7 @@ internationalization.

.. _frontend-platform i18n howto: https://github.com/openedx/frontend-platform/blob/master/docs/how_tos/i18n.rst


Getting Help
************

Expand All @@ -259,6 +338,7 @@ For more information about these options, see the `Getting Help`_ page.
.. _#wg-frontend channel: https://openedx.slack.com/archives/C04BM6YC7A6
.. _Getting Help: https://openedx.org/community/connect


License
*******

Expand All @@ -267,6 +347,7 @@ noted.

Please see `LICENSE <LICENSE>`_ for details.


Contributing
************

Expand All @@ -281,6 +362,7 @@ beginning development to maximize the chances of your change being accepted.
You can start a conversation by creating a new issue on this repo summarizing
your idea.


The Open edX Code of Conduct
****************************

Expand All @@ -297,6 +379,7 @@ file in this repo.

.. _Backstage: https://open-edx-backstage.herokuapp.com/catalog/default/component/frontend-app-course-authoring


Reporting Security Issues
*************************

Expand Down
Binary file added docs/readme-images/feature-advanced-settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/readme-images/feature-course-updates.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/readme-images/feature-export.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/readme-images/feature-files-uploads.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/readme-images/feature-pages-resources.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/readme-images/feature-problem-editor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/readme-images/feature-proctored-exams.png
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.
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>Course Authoring | <%= process.env.SITE_NAME %></title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="<%= process.env.FAVICON_URL %>" type="image/x-icon" />
<link rel="shortcut icon" href="<%=htmlWebpackPlugin.options.FAVICON_URL%>" type="image/x-icon" />
</head>
<body>
<div id="root"></div>
Expand Down
5 changes: 4 additions & 1 deletion src/export-page/CourseExportPage.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
@import "./export-stepper/ExportStepper";
@import "./export-footer/ExportFooter";

.export {
.help-sidebar {
margin-top: 7.188rem;
}

.pgn__stepper-header-step-list {
flex-direction: column;
}
}
3 changes: 0 additions & 3 deletions src/export-page/export-stepper/ExportStepper.scss

This file was deleted.

2 changes: 2 additions & 0 deletions src/files-and-uploads/FilesAndUploads.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import { AccessColumn, MoreInfoColumn, ThumbnailColumn } from './table-component
import ApiStatusToast from './ApiStatusToast';
import { clearErrors } from './data/slice';
import getPageHeadTitle from '../generic/utils';
import FilterStatus from './table-components/FilterStatus';

const FilesAndUploads = ({
courseId,
Expand Down Expand Up @@ -297,6 +298,7 @@ const FilesAndUploads = ({
itemCount={totalCount}
pageCount={Math.ceil(totalCount / 50)}
data={assets}
FilterStatusComponent={FilterStatus}
>
{isEmpty(assets) && loadingStatus !== RequestStatus.IN_PROGRESS ? (
<Dropzone
Expand Down
69 changes: 69 additions & 0 deletions src/files-and-uploads/table-components/FilterStatus.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import React, { useContext } from 'react';
import PropTypes from 'prop-types';
import { FormattedMessage } from '@edx/frontend-platform/i18n';
import { DataTableContext, Button } from '@edx/paragon';

const FilterStatus = ({
className, variant, size, clearFiltersText, buttonClassName,
}) => {
const {
setAllFilters, RowStatusComponent, page, rows,
} = useContext(DataTableContext);
if (!setAllFilters) {
return null;
}

const RowStatus = RowStatusComponent;

const pageSize = page?.length || rows?.length;

return (
<div className={className}>
<div className="pl-1">
<span>Filters applied</span>
{!!pageSize && ' ('}
<RowStatus className="d-inline" />
{!!pageSize && ')'}
</div>
<Button
className={buttonClassName}
variant={variant}
size={size}
onClick={() => setAllFilters([])}
>
{clearFiltersText === undefined
? (
<FormattedMessage
id="pgn.DataTable.FilterStatus.clearFiltersText"
defaultMessage="Clear filters"
description="A text that appears on the `Clear filters` button"
/>
)
: clearFiltersText}
</Button>
</div>
);
};

FilterStatus.defaultProps = {
/** Specifies class name to append to the base element. */
className: null,
/** Specifies class name to append to the button. */
buttonClassName: 'pgn__smart-status-button',
/** The visual style of the `FilterStatus`. */
variant: 'link',
/** The size of the `FilterStatus`. */
size: 'inline',
/** A text that appears on the `Clear filters` button, defaults to 'Clear filters'. */
clearFiltersText: undefined,
};

FilterStatus.propTypes = {
className: PropTypes.string,
buttonClassName: PropTypes.string,
variant: PropTypes.string,
size: PropTypes.string,
clearFiltersText: PropTypes.oneOfType([PropTypes.element, PropTypes.string]),
};

export default FilterStatus;
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const AppConfigFormSaveButton = ({ intl, labelText }) => {
// cancelable: (optional) a Boolean indicating whether the event can be canceled. The default is false.
// cancelable: true cancels the untrusted event and safari, chrome cancel the untrusted event by default
formRef.current.dispatchEvent(new Event('submit', {
cancelable: true,
cancelable: true, bubbles: true,
}));
}, [formRef]);

Expand Down
11 changes: 5 additions & 6 deletions src/taxonomy/TaxonomyListPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ import {
DataTable,
Spinner,
} from '@edx/paragon';
import { injectIntl, intlShape } from '@edx/frontend-platform/i18n';
import { useIntl } from '@edx/frontend-platform/i18n';
import SubHeader from '../generic/sub-header/SubHeader';
import messages from './messages';
import TaxonomyCard from './taxonomy-card/TaxonomyCard';
import { useTaxonomyListDataResponse, useIsTaxonomyListDataLoaded } from './api/hooks/selectors';

const TaxonomyListPage = ({ intl }) => {
const TaxonomyListPage = () => {
const intl = useIntl();
const useTaxonomyListData = () => {
const taxonomyListData = useTaxonomyListDataResponse();
const isLoaded = useIsTaxonomyListDataLoaded();
Expand Down Expand Up @@ -86,8 +87,6 @@ const TaxonomyListPage = ({ intl }) => {
);
};

TaxonomyListPage.propTypes = {
intl: intlShape.isRequired,
};
TaxonomyListPage.propTypes = {};

export default injectIntl(TaxonomyListPage);
export default TaxonomyListPage;
Loading

0 comments on commit 5c0c275

Please sign in to comment.