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

[FC-0059] Library info sidebar #1138

Merged

Conversation

ChrisChV
Copy link
Contributor

@ChrisChV ChrisChV commented Jul 1, 2024

Description

This adds the Library info sidebar in library-authoring.

image

Supporting information

Testing instructions

  • Go to Studio and create a new library.
  • Go to Studio > Libraries and open the new library
  • Verify that the Library info sidebar is opened by default.
  • Close the sidebar.
  • Open the Library info sidebar by clicking "Library Info".
  • Verify the publish state, which must be "Draft (Never Published)"
  • Click on Publish, verify that the new state is "Published"
  • Create a new component.
  • Verify the publish state, which must be "Draft (Unpublished Changes)"
  • Click on Publish, verify that the new state is "Published"
  • Create a new component.
  • Click on "Discard changes" TODO: It seems that discard changes is broken, fixing it is not in the scope of this task
  • Update the title of the library

Other information

  • It seems that discard changes is broken, fixing it is not in the scope of this task

@ChrisChV ChrisChV requested a review from a team as a code owner July 1, 2024 10:44
@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Jul 1, 2024
@openedx-webhooks
Copy link

openedx-webhooks commented Jul 1, 2024

Thanks for the pull request, @ChrisChV!

What's next?

Please work through the following steps to get your changes ready for engineering review:

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.

🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads

🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

🔘 Let us know that your PR is ready for review:

Who will review my changes?

This repository is currently maintained by @openedx/2u-tnl. Tag them in a comment and let them know that your changes are ready for review.

Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@ChrisChV ChrisChV marked this pull request as draft July 1, 2024 10:44
ChrisChV added 4 commits July 24, 2024 09:59
- Connection with API to publish an revert changes
- LibraryPublishStatus component created with draft and publish status
- Component create with the feature to publish and revert changes
Copy link

codecov bot commented Jul 26, 2024

Codecov Report

Attention: Patch coverage is 98.15951% with 3 lines in your changes missing coverage. Please review.

Project coverage is 92.99%. Comparing base (8285f8e) to head (0490452).

Files Patch % Lines
src/library-authoring/data/api.ts 87.50% 2 Missing ⚠️
src/library-authoring/common/context.tsx 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1138      +/-   ##
==========================================
+ Coverage   92.92%   92.99%   +0.07%     
==========================================
  Files         750      756       +6     
  Lines       13503    13653     +150     
  Branches     2942     2953      +11     
==========================================
+ Hits        12547    12696     +149     
- Misses        920      921       +1     
  Partials       36       36              

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

@mphilbrick211 mphilbrick211 added the FC Relates to an Axim Funded Contribution project label Jul 30, 2024
@ChrisChV ChrisChV marked this pull request as ready for review July 31, 2024 17:26
Copy link
Contributor

@rpenido rpenido left a comment

Choose a reason for hiding this comment

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

LGTM 👍
Thank you for your work, @ChrisChV!

  • I tested this using the instructions from this PR
  • I read through the code
  • I checked for accessibility issues
  • Includes documentation

I put some comments and suggestions. The only one that I think we must fix is the ContentLibrary type for dates.

While testing, I got the following after creating a library:
image
We have lastDraftCreated = null. I'm unsure if we need to create a draft when creating the library, or just handle the null in the frontend.

Also, as you said, the Discard changes not only doesn't work but also breaks the library. After clicking Discard changes one time, I was not able to publish the library anymore. I suggest that we let it disabled.

src/library-authoring/LibraryAuthoringPage.tsx Outdated Show resolved Hide resolved
src/library-authoring/LibraryAuthoringPage.tsx Outdated Show resolved Hide resolved
src/library-authoring/add-content/index.ts Outdated Show resolved Hide resolved
src/library-authoring/library-info/LibraryInfoHeader.tsx Outdated Show resolved Hide resolved
src/library-authoring/library-info/index.ts Outdated Show resolved Hide resolved
src/library-authoring/data/api.ts Outdated Show resolved Hide resolved
src/library-authoring/data/api.ts Outdated Show resolved Hide resolved
src/library-authoring/data/api.ts Outdated Show resolved Hide resolved
src/utils.js Outdated Show resolved Hide resolved
src/library-authoring/data/api.ts Outdated Show resolved Hide resolved
src/utils.js Outdated Show resolved Hide resolved
@ChrisChV
Copy link
Contributor Author

ChrisChV commented Aug 1, 2024

@rpenido

We have lastDraftCreated = null. I'm unsure if we need to create a draft when creating the library, or just handle the null in the frontend.

I fixed this using created in this case

Also, as you said, the Discard changes not only doesn't work but also breaks the library. After clicking Discard changes one time, I was not able to publish the library anymore. I suggest that we let it disabled.

Yes, I hid the button 8b27caa. I will create a new task to fix this CC @bradenmacdonald

Edit: Issue created: #1200

@bradenmacdonald
Copy link
Contributor

bradenmacdonald commented Aug 8, 2024

@ChrisChV This needs to be updated with master. Also, I noticed one issue when testing it just now: When I rename the library to a new name and press ENTER, it reverts back to the old name for a second until the mutation has completed, and then it updates to show the new name. Could you do an optimistic mutation with setQueryData() so that the name changes immediately? (But revert it as described here if there is an error returned)

Otherwise this looks good to go ✅

@ChrisChV
Copy link
Contributor Author

@bradenmacdonald It's ready for another review

Copy link
Contributor

@bradenmacdonald bradenmacdonald left a comment

Choose a reason for hiding this comment

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

Nice, thanks @ChrisChV

@bradenmacdonald bradenmacdonald merged commit 4f5346e into openedx:master Aug 13, 2024
7 checks passed
@openedx-webhooks
Copy link

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FC Relates to an Axim Funded Contribution project 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.

5 participants