Skip to content

Commit 1ee80b6

Browse files
ChrisChVrpenidoChristofer Chavez
authored
feat: Taxonomy export menu [FC-0036] (#645)
* feat: System-defined tooltip added * feat: Taxonomy card menu added. Export menu item added * feat: Modal for export taxonomy * feat: Connect with export API * test: Tests for API and selectors * feat: Use windows.location.href to call the export endpoint * test: ExportModal.test added * style: Delete unnecessary code * docs: README updated with taxonomy feature * style: TaxonomyCard updated to a better code style * style: injectIntl replaced by useIntl on taxonomy pages and components * refactor: Move and rename taxonomy UI components to match 0002 ADR * refactor: Move api to data to match with 0002 ADR * test: Refactor ExportModal tests * chore: Fix validations * chore: Lint * refactor: Moving hooks to apiHooks * style: Nit on return null --------- Co-authored-by: Rômulo Penido <[email protected]> Co-authored-by: Christofer Chavez <[email protected]>
1 parent 7c7ea1f commit 1ee80b6

24 files changed

+671
-177
lines changed

README.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,25 @@ Requirements
250250
* ``contentstore.new_studio_mfe.use_new_export_page``: this feature flag will change the CMS to link to the new export page.
251251
* ``contentstore.new_studio_mfe.use_new_import_page``: this feature flag will change the CMS to link to the new import page.
252252

253+
Feature: Tagging/Taxonomy Pages
254+
================================
255+
256+
.. image:: ./docs/readme-images/feature-tagging-taxonomy-pages.png
257+
258+
Requirements
259+
------------
260+
261+
* ``edx-platform`` Waffle flags:
262+
263+
* ``contentstore.new_studio_mfe.use_tagging_taxonomy_list_page``: this feature flag must be enabled.
264+
265+
Configuration
266+
-------------
267+
268+
In additional to the standard settings, the following local configuration items are required:
269+
270+
* ``ENABLE_TAGGING_TAXONOMY_PAGES``: must be enabled in order to actually present the new Tagging/Taxonomy pages.
271+
253272

254273
Developing
255274
**********
64.1 KB
Loading

src/index.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@
1818
@import "course-updates/CourseUpdates";
1919
@import "export-page/CourseExportPage";
2020
@import "import-page/CourseImportPage";
21+
@import "taxonomy/taxonomy-card/TaxonomyCard";
2122
@import "files-and-videos";

src/taxonomy/TaxonomyCard.jsx

Lines changed: 0 additions & 79 deletions
This file was deleted.

src/taxonomy/TaxonomyListPage.jsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,16 @@ import {
55
DataTable,
66
Spinner,
77
} from '@edx/paragon';
8-
import { injectIntl, intlShape } from '@edx/frontend-platform/i18n';
98
import { StudioFooter } from '@edx/frontend-component-footer';
9+
import { useIntl } from '@edx/frontend-platform/i18n';
1010
import Header from '../header';
1111
import SubHeader from '../generic/sub-header/SubHeader';
1212
import messages from './messages';
13-
import TaxonomyCard from './TaxonomyCard';
14-
import { useTaxonomyListDataResponse, useIsTaxonomyListDataLoaded } from './api/hooks/selectors';
13+
import TaxonomyCard from './taxonomy-card';
14+
import { useTaxonomyListDataResponse, useIsTaxonomyListDataLoaded } from './data/apiHooks';
1515

16-
const TaxonomyListPage = ({ intl }) => {
16+
const TaxonomyListPage = () => {
17+
const intl = useIntl();
1718
const useTaxonomyListData = () => {
1819
const taxonomyListData = useTaxonomyListDataResponse();
1920
const isLoaded = useIsTaxonomyListDataLoaded();
@@ -97,8 +98,6 @@ const TaxonomyListPage = ({ intl }) => {
9798
);
9899
};
99100

100-
TaxonomyListPage.propTypes = {
101-
intl: intlShape.isRequired,
102-
};
101+
TaxonomyListPage.propTypes = {};
103102

104-
export default injectIntl(TaxonomyListPage);
103+
export default TaxonomyListPage;

src/taxonomy/TaxonomyListPage.test.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ import { act, render } from '@testing-library/react';
77
import initializeStore from '../store';
88

99
import TaxonomyListPage from './TaxonomyListPage';
10-
import { useTaxonomyListDataResponse, useIsTaxonomyListDataLoaded } from './api/hooks/selectors';
10+
import { useTaxonomyListDataResponse, useIsTaxonomyListDataLoaded } from './data/apiHooks';
1111

1212
let store;
1313

14-
jest.mock('./api/hooks/selectors', () => ({
14+
jest.mock('./data/apiHooks', () => ({
1515
useTaxonomyListDataResponse: jest.fn(),
1616
useIsTaxonomyListDataLoaded: jest.fn(),
1717
}));

src/taxonomy/__mocks__/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// eslint-disable-next-line import/prefer-default-export
2+
export { default as taxonomyListMock } from './taxonomyListMock';
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
module.exports = {
2+
next: null,
3+
previous: null,
4+
count: 4,
5+
numPages: 1,
6+
currentPage: 1,
7+
start: 0,
8+
results: [
9+
{
10+
id: -2,
11+
name: 'Content Authors',
12+
description: 'Allows tags for any user ID created on the instance.',
13+
enabled: true,
14+
allowMultiple: false,
15+
allowFreeText: false,
16+
systemDefined: true,
17+
visibleToAuthors: false,
18+
},
19+
{
20+
id: -1,
21+
name: 'Languages',
22+
description: 'lang lang lang lang lang lang lang lang',
23+
enabled: true,
24+
allowMultiple: false,
25+
allowFreeText: false,
26+
systemDefined: true,
27+
visibleToAuthors: true,
28+
},
29+
{
30+
id: 1,
31+
name: 'Taxonomy',
32+
description: 'This is a Description',
33+
enabled: true,
34+
allowMultiple: false,
35+
allowFreeText: false,
36+
systemDefined: false,
37+
visibleToAuthors: true,
38+
},
39+
{
40+
id: 2,
41+
name: 'Taxonomy long long long long long long long long long long long long long long long long long long long',
42+
description: 'This is a Description long lon',
43+
enabled: true,
44+
allowMultiple: false,
45+
allowFreeText: false,
46+
systemDefined: false,
47+
visibleToAuthors: true,
48+
},
49+
],
50+
};

src/taxonomy/api/hooks/api.js

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/taxonomy/api/hooks/api.test.js

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)