Skip to content

[FC-0036] Tags Sidebar - #852

Merged
xitij2000 merged 18 commits into
openedx:masterfrom
open-craft:chris/FAL-3642-tags-sidebar
Mar 15, 2024
Merged

[FC-0036] Tags Sidebar#852
xitij2000 merged 18 commits into
openedx:masterfrom
open-craft:chris/FAL-3642-tags-sidebar

Conversation

@ChrisChV

@ChrisChV ChrisChV commented Feb 22, 2024

Copy link
Copy Markdown
Contributor

Description

Adds a new tag sidebar. Important: This PR uses #832 as base, if you want to review the tag sidebar changes you can review this commits

Screenshots

image

Testing instructions

Support information

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Feb 22, 2024
@openedx-webhooks

openedx-webhooks commented Feb 22, 2024

Copy link
Copy Markdown

Thanks for the pull request, @ChrisChV! Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket as you can:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

Please let us know once your PR is ready for our review and all tests are green.

@ChrisChV
ChrisChV marked this pull request as draft February 22, 2024 20:45
@ChrisChV
ChrisChV marked this pull request as ready for review February 26, 2024 21:28
@ChrisChV
ChrisChV requested a review from a team February 27, 2024 15:12

@rpenido rpenido left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi @ChrisChV!
Good work here!
I only added some missing type checks and nits.

Let me know what you think!

Comment thread src/content-tags-drawer/tags-sidebar/TagsSidebarBody.jsx Outdated
Comment thread src/content-tags-drawer/messages.js Outdated
Comment thread src/course-unit/CourseUnit.jsx Outdated
Comment on lines +101 to +103
<Sidebar variant="publish" />
<Sidebar variant="tags" />
<Sidebar variant="location" />

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think these should be different components. As this is coming from upstream, what do you think about separating at least the TagsSideBar?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I also thought the same thing, but then I saw that they shared the same styles in different places, that's why I decided to integrate it CC @bradenmacdonald

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That seems weird to me. Why not just make <Sidebar> into a wrapper component, so we can use

<Sidebar><PublishControls /></Sidebar>
<Sidebar><TagControls /></Sidebar>
<Sidebar><LocationInfo /></Sidebar>

or something like that? Of course you need to discuss with the other authors of the upstream PR. And maybe do that later as a follow-on. But that feels a lot cleaner to me.

Comment on lines +26 to +42
const params = useParams();
let contentId = id;

if (contentId === undefined) {
contentId = params.contentId;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I didn't like this, but I don't know a better way to do it and maintain compatibility with the iframe in the studio. Could you comment on why we use the component props and the query params?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this is fine for now, but I agree we should add a comment saying that once the legacy iframe is no longer used, we can remove useParams()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added here

Comment thread src/content-tags-drawer/tags-sidebar/TagsSidebarBody.jsx Outdated
Comment thread src/content-tags-drawer/tags-sidebar/TagsSidebarHeader.jsx Outdated
Comment thread src/content-tags-drawer/tags-sidebar/TagsTree.jsx
@codecov

codecov Bot commented Mar 4, 2024

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 98.80952% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 91.93%. Comparing base (6baec5b) to head (c9261e4).
Report is 3 commits behind head on master.

Files Patch % Lines
src/content-tags-drawer/data/apiHooks.jsx 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #852      +/-   ##
==========================================
+ Coverage   91.86%   91.93%   +0.06%     
==========================================
  Files         561      568       +7     
  Lines        9725     9844     +119     
  Branches     2079     2098      +19     
==========================================
+ Hits         8934     9050     +116     
- Misses        764      767       +3     
  Partials       27       27              

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

@xitij2000

Copy link
Copy Markdown
Contributor

@ChrisChV Could you rebase this PR and fix the conflicts?

@ChrisChV
ChrisChV force-pushed the chris/FAL-3642-tags-sidebar branch from 845e5ed to 7a70d81 Compare March 11, 2024 17:04
@ChrisChV

Copy link
Copy Markdown
Contributor Author

@xitij2000 Done 👍 It's ready

@xitij2000

Copy link
Copy Markdown
Contributor

@ChrisChV Do I need a specific edx-platform PR for this?

@ChrisChV

Copy link
Copy Markdown
Contributor Author

Do I need a specific edx-platform PR for this?

@xitij2000 sorry, if is about this issue, is fixed in openedx/openedx-platform#34055. You need to pull your master branch

@rpenido rpenido left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@ChrisChV Nice work refactoring the components! LGTM 👍

  • I tested this in my local tutor dev following the PR instructions
  • I read through the code
  • I checked for accessibility issues
  • Includes documentation

Comment thread src/content-tags-drawer/data/api.test.js Outdated
Co-authored-by: Rômulo Penido <romulo@opencraft.com>

@xitij2000 xitij2000 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is working well, however, I think the manage tags UI is a bit inconsistent.

As you can see in the screenshot below, the expand/contract icons are not well aligned, and neither are the tags.

If that is part of a future refinement task then do tell. Other than that things seem fine.

Screen Shot 2024-03-13 at 19 15 40

Comment thread src/course-unit/sidebar/index.jsx Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think most if not all of the styling here can be applied via paragon / bootstrap classes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated here 94d3f1f
I have left the styles that are applied to the internal components of the collapsible

@ChrisChV
ChrisChV requested a review from a team as a code owner March 13, 2024 14:37
@ChrisChV

Copy link
Copy Markdown
Contributor Author

@xitij2000 It's ready for merge

},
tagsSidebarTitle: {
id: 'course-authoring.course-unit.sidebar.tags.title',
defaultMessage: 'Unit Tags',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It would be awesome if you could add some descriptions to these new messages. We'll be making them a requirement pretty soon. See openedx/frontend-build#517.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done c9261e4

@ChrisChV

Copy link
Copy Markdown
Contributor Author

If that is part of a future refinement task then do tell. Other than that things seem fine.

@xitij2000 Yes, all about the drawer is part of this task: openedx/modular-learning#190

@xitij2000
xitij2000 merged commit d57ecc6 into openedx:master Mar 15, 2024
@openedx-webhooks

Copy link
Copy Markdown

@ChrisChV 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.

@bradenmacdonald
bradenmacdonald deleted the chris/FAL-3642-tags-sidebar branch March 18, 2024 01:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

open-source-contribution PR author is not from Axim or 2U

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

[Tagging] New Tag Sidebar Widget - Unit Page (in MFE)

6 participants