Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: bare bones taxonomy detail page [FC-0036] #655

Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
4963124
feat: System-defined tooltip added
ChrisChV Oct 17, 2023
4077397
feat: Taxonomy card menu added. Export menu item added
ChrisChV Oct 18, 2023
e87c545
feat: Modal for export taxonomy
ChrisChV Oct 18, 2023
4922420
feat: Connect with export API
ChrisChV Oct 19, 2023
5e12a8f
test: Tests for API and selectors
ChrisChV Oct 20, 2023
09aa8b6
feat: Use windows.location.href to call the export endpoint
ChrisChV Oct 20, 2023
1925fae
test: ExportModal.test added
ChrisChV Oct 20, 2023
0be804c
style: Delete unnecesary code
ChrisChV Oct 21, 2023
da0156f
Merge branch 'master' into chris/FAL-3528-taxonomy-export-menu
rpenido Oct 25, 2023
0cc473c
Merge branch 'master' into chris/FAL-3528-taxonomy-export-menu
ChrisChV Oct 30, 2023
5af8d66
docs: README updated with taxonomy feature
ChrisChV Oct 30, 2023
a21fac2
style: TaxonomyCard updated to a better code style
ChrisChV Oct 31, 2023
61864d3
style: injectIntl replaced by useIntl on taxonomy pages and components
ChrisChV Oct 31, 2023
b09b86a
refactor: Move and rename taxonomy UI components to match 0002 ADR
ChrisChV Oct 31, 2023
df8432d
refactor: Move api to data to match with 0002 ADR
ChrisChV Oct 31, 2023
1abf034
test: Refactor ExportModal tests
Nov 6, 2023
1d6f9a5
chore: Merge conflicts solved
Nov 6, 2023
5c4c87a
chore: Fix validations
ChrisChV Nov 6, 2023
7e514b6
chore: Lint
ChrisChV Nov 6, 2023
080b03e
refactor: Moving hooks to apiHooks
ChrisChV Nov 8, 2023
56dbdd2
feat: add taxonomy detail page
rpenido Nov 11, 2023
9c582ed
Merge branch 'master' into rpenido/fal-3529-bare-bones-taxonomy-detai…
pomegranited Nov 15, 2023
9df1699
fix: address nits in PR review
pomegranited Nov 15, 2023
0fdaa07
refactor: move data/selectors to data/apiHooks
pomegranited Nov 15, 2023
0e19e99
fix: address nits in PR review
pomegranited Nov 20, 2023
3f0dbaa
fix: replace taxonomy menu ModalPopup with Dropdown menu
pomegranited Nov 20, 2023
0872d5d
Merge branch 'master' into rpenido/fal-3529-bare-bones-taxonomy-detai…
pomegranited Nov 20, 2023
a15e3a4
fix: change taxonomy URLs
pomegranited Nov 20, 2023
924e28e
chore: update this branch with master
bradenmacdonald Nov 20, 2023
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
Prev Previous commit
Next Next commit
style: injectIntl replaced by useIntl on taxonomy pages and components
ChrisChV committed Oct 31, 2023
commit 61864d3187a343edb2eaa56b643e7114cb237d12
11 changes: 5 additions & 6 deletions src/taxonomy/TaxonomyListPage.jsx
Original file line number Diff line number Diff line change
@@ -5,15 +5,16 @@ import {
DataTable,
Spinner,
} from '@edx/paragon';
import { injectIntl, intlShape } from '@edx/frontend-platform/i18n';
import { StudioFooter } from '@edx/frontend-component-footer';
import { useIntl } from '@edx/frontend-platform/i18n';
import Header from '../header';
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();
@@ -97,8 +98,6 @@ const TaxonomyListPage = ({ intl }) => {
);
};

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

export default injectIntl(TaxonomyListPage);
export default TaxonomyListPage;
7 changes: 3 additions & 4 deletions src/taxonomy/modals/ExportModal.jsx
Original file line number Diff line number Diff line change
@@ -6,16 +6,16 @@ import {
ModalDialog,
} from '@edx/paragon';
import PropTypes from 'prop-types';
import { injectIntl, intlShape } from '@edx/frontend-platform/i18n';
import { useIntl } from '@edx/frontend-platform/i18n';
import messages from '../messages';
import { callExportTaxonomy } from '../api/hooks/selectors';

const ExportModal = ({
taxonomyId,
isOpen,
onClose,
intl,
}) => {
const intl = useIntl();
const [outputFormat, setOutputFormat] = useState('csv');

const onClickExport = () => {
@@ -80,7 +80,6 @@ ExportModal.propTypes = {
taxonomyId: PropTypes.number.isRequired,
isOpen: PropTypes.bool.isRequired,
onClose: PropTypes.func.isRequired,
intl: intlShape.isRequired,
};

export default injectIntl(ExportModal);
export default ExportModal;
9 changes: 5 additions & 4 deletions src/taxonomy/taxonomy-card/TaxonomyCardMenu.jsx
Original file line number Diff line number Diff line change
@@ -8,12 +8,13 @@
} from '@edx/paragon';
import { MoreVert } from '@edx/paragon/icons';
import PropTypes from 'prop-types';
import { injectIntl, intlShape } from '@edx/frontend-platform/i18n';
import { useIntl } from '@edx/frontend-platform/i18n';
import messages from '../messages';

const TaxonomyCardMenu = ({
id, name, onClickMenuItem, intl,
id, name, onClickMenuItem,
}) => {
const intl = useIntl();
const [menuIsOpen, setMenuIsOpen] = useState(false);
const [menuTarget, setMenuTarget] = useState(null);

@@ -36,9 +37,10 @@
<ModalPopup
positionRef={menuTarget}
isOpen={menuIsOpen}
onClose={() => setMenuIsOpen(false)}

Check warning on line 40 in src/taxonomy/taxonomy-card/TaxonomyCardMenu.jsx

Codecov / codecov/patch

src/taxonomy/taxonomy-card/TaxonomyCardMenu.jsx#L40

Added line #L40 was not covered by tests
>
<Menu data-testid={`taxonomy-card-menu-${id}`}>
{/* Add more menu items here */}
<MenuItem className="taxonomy-menu-item" onClick={() => onClickItem('export')}>
{intl.formatMessage(messages.taxonomyCardExportMenu)}
</MenuItem>
@@ -52,7 +54,6 @@
id: PropTypes.number.isRequired,
name: PropTypes.string.isRequired,
onClickMenuItem: PropTypes.func.isRequired,
intl: intlShape.isRequired,
};

export default injectIntl(TaxonomyCardMenu);
export default TaxonomyCardMenu;

Unchanged files with check annotations Beta

export const useTaxonomyListData = () => (
useQuery({
queryKey: ['taxonomyList'],
queryFn: () => getAuthenticatedHttpClient().get(getTaxonomyListApiUrl())

Check warning on line 19 in src/taxonomy/api/hooks/api.js

Codecov / codecov/patch

src/taxonomy/api/hooks/api.js#L19

Added line #L19 was not covered by tests
.then(camelCaseObject),
})
);
case 'export':
setIsExportModalOpen(true);
break;
default:

Check warning on line 81 in src/taxonomy/taxonomy-card/TaxonomyCard.jsx

Codecov / codecov/patch

src/taxonomy/taxonomy-card/TaxonomyCard.jsx#L81

Added line #L81 was not covered by tests
/* istanbul ignore next */
break;
}