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

[temp] feat: add detail taxonomy page #5

Conversation

rpenido
Copy link
Member

@rpenido rpenido commented Oct 20, 2023

@rpenido rpenido force-pushed the rpenido/fal-3529-bare-bones-taxonomy-detail-page branch from 2520d22 to a52cc85 Compare October 20, 2023 18:36
@ChrisChV ChrisChV force-pushed the chris/FAL-3528-taxonomy-export-menu branch from 667bf1e to 09aa8b6 Compare October 20, 2023 18:45
@rpenido rpenido force-pushed the rpenido/fal-3529-bare-bones-taxonomy-detail-page branch 6 times, most recently from b3f724e to 3d45969 Compare October 24, 2023 22:00
Copy link
Member

@pomegranited pomegranited left a comment

Choose a reason for hiding this comment

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

I've run this on my devstack and it's looking great so far, @rpenido !

I've left a few suggestions, mainly around how the DataTable component is configured.

And as you've noted, there's some copy-paste code in here which should be factored out and moved up under src/taxonomy somewhere.

src/index.jsx Outdated Show resolved Hide resolved
src/taxonomy/api/hooks/api.js Outdated Show resolved Hide resolved
src/taxonomy/taxonomy-detail/TagListTable.jsx Outdated Show resolved Hide resolved
src/taxonomy/taxonomy-detail/TagListTable.jsx Outdated Show resolved Hide resolved
src/taxonomy/taxonomy-detail/TaxonomyDetailSideCard.jsx Outdated Show resolved Hide resolved
src/taxonomy/taxonomy-card/TaxonomyCard.jsx Outdated Show resolved Hide resolved
src/taxonomy/taxonomy-card/TaxonomyCard.scss Outdated Show resolved Hide resolved
src/index.jsx Outdated Show resolved Hide resolved
@rpenido rpenido force-pushed the rpenido/fal-3529-bare-bones-taxonomy-detail-page branch 3 times, most recently from a7d5cd7 to 3d6b0df Compare October 25, 2023 16:12
@codecov
Copy link

codecov bot commented Oct 25, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (chris/FAL-3528-taxonomy-export-menu@080b03e). Click here to learn what that means.

Additional details and impacted files
@@                          Coverage Diff                           @@
##             chris/FAL-3528-taxonomy-export-menu       #5   +/-   ##
======================================================================
  Coverage                                       ?   88.53%           
======================================================================
  Files                                          ?      435           
  Lines                                          ?     6679           
  Branches                                       ?     1432           
======================================================================
  Hits                                           ?     5913           
  Misses                                         ?      741           
  Partials                                       ?       25           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rpenido rpenido force-pushed the rpenido/fal-3529-bare-bones-taxonomy-detail-page branch from 5d927a9 to 87808bb Compare October 25, 2023 19:18
Copy link
Member

@pomegranited pomegranited left a comment

Choose a reason for hiding this comment

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

These latest changes look great, @rpenido ! I found some issues with the REST API being hit more than we need, but your addition of TaxonomyLayout, and your taxonomy-detail components look great.

src/taxonomy/taxonomy-detail/TagListTable.jsx Outdated Show resolved Hide resolved
src/taxonomy/taxonomy-detail/TagListTable.jsx Outdated Show resolved Hide resolved
src/index.jsx Outdated Show resolved Hide resolved
@bradenmacdonald
Copy link
Member

Here is the PR that will merge soon and affect how taxonomy data is returned from the API - hopefully making it more flexible for you: openedx/edx-platform#33553

Copy link
Member

@pomegranited pomegranited left a comment

Choose a reason for hiding this comment

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

Hi @rpenido there's a bug with the Export menu item, and I noted one optional nit.

But everything else is working great, so I'll approve pending that fix, and then it's ready for upstream review.

👍

  • I tested this on my devstack.
  • I read through the code
  • I checked for accessibility issues by using my keyboard to navigate the new and modified components.
  • Includes documentation N/A
  • Commit structure follows OEP-0051

src/taxonomy/TaxonomyLayout.jsx Outdated Show resolved Hide resolved
@@ -0,0 +1,3 @@
.taxonomy-layout {
background-color: #E9E6E4;
Copy link
Member

Choose a reason for hiding this comment

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

This is equivalent to bg-light-400, so you can avoid the custom css.

Copy link
Member Author

@rpenido rpenido Oct 31, 2023

Choose a reason for hiding this comment

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

Thank you! Fixed here: a12f262

expect(getByTestId('mock-content')).toBeInTheDocument();
expect(getByTestId('mock-footer')).toBeInTheDocument();
});
});
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this test is adding anything. There is no logic in this component so I think this file can be entirely skipped.

Copy link
Member Author

Choose a reason for hiding this comment

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

It only helps the code coverage. If this metric is not an issue here, let me know, and I remove it!

const { tagList } = useTagListData(taxonomyId);

if (!tagList || !tagList.results) {
return 'Loading...';
Copy link
Member

Choose a reason for hiding this comment

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

I think you could use the Paragon Spinner instead

Copy link
Member Author

Choose a reason for hiding this comment

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

This code is outdated. I'm using the Loading status from the DataTable

@rpenido rpenido force-pushed the rpenido/fal-3529-bare-bones-taxonomy-detail-page branch 2 times, most recently from d408b52 to a12f262 Compare October 31, 2023 18:45
@bradenmacdonald
Copy link
Member

@rpenido @xitij2000 What's the status of this PR? And how does it relate to openedx#655 ?

@rpenido
Copy link
Member Author

rpenido commented Nov 3, 2023

@rpenido @xitij2000 What's the status of this PR? And how does it relate to openedx#655 ?

This is a temp PR against that branch to allow us to review the changes before openedx#645 is merged.

I'm waiting for openedx#645 approval to rebase this branch and bring the improvements from the review to here.

…x#647)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
openedx#650)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…x#641)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Copy link
Member

@pomegranited pomegranited left a comment

Choose a reason for hiding this comment

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

👍 Thanks for that @rpenido ! This is good for upstream review now. CC @bradenmacdonald

  • I tested this using the REST API on my devstack
  • I read through the code
  • I checked for accessibility issues N/A
  • Includes documentation
  • Commit structure follows OEP-0051

@bradenmacdonald
Copy link
Member

I guess this is blocked on openedx#645 now ? Once that PR is merged, please open a new PR for this on the upstream repo.

@rpenido
Copy link
Member Author

rpenido commented Nov 7, 2023

I guess this is blocked on openedx#645 now ? Once that PR is merged, please open a new PR for this on the upstream repo.

Sure!
The PR on upstream is here: openedx#655. I will rebase as soon as we get openedx#645 merged.

renovate bot and others added 4 commits November 7, 2023 15:43
…v1.175.1 (openedx#663)

* fix(deps): update dependency @edx/frontend-lib-content-components to v1.175.1

* fix: upgrade paragon

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: KristinAoki <[email protected]>
@rpenido rpenido force-pushed the rpenido/fal-3529-bare-bones-taxonomy-detail-page branch from 9ae8dc1 to c6b68bf Compare November 11, 2023 13:10
@rpenido rpenido force-pushed the rpenido/fal-3529-bare-bones-taxonomy-detail-page branch from 568ee3e to 56dbdd2 Compare November 11, 2023 15:07
@@ -0,0 +1,42 @@
// @ts-check
Copy link
Member

Choose a reason for hiding this comment

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

@rpenido From what I understand from here, these would not be considered selectors in the context of the other MFE modules. To avoid colliding with that context is why I have placed functions like this in apiHooks.js. But you can wait until openedx#645 is approved to make those changes

Copy link
Member

@ChrisChV ChrisChV left a comment

Choose a reason for hiding this comment

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

@rpenido Looks good 👍 Check my comments, but I think you can wait until openedx#645 is merged to do any change.

src/taxonomy/taxonomy-detail/TaxonomyDetailMenu.jsx Outdated Show resolved Hide resolved
KristinAoki and others added 3 commits November 14, 2023 10:43
* 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]>
renovate bot and others added 6 commits November 15, 2023 16:47
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…x#676)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…#678)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
and fix tests to mock useQuery.
@pomegranited
Copy link
Member

Closed in favor of openedx#655

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants