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

fix: remove unnecessary toast notification on adding component [FC-0062] #1490

Merged

Conversation

navinkarkera
Copy link
Contributor

@navinkarkera navinkarkera commented Nov 8, 2024

Fix for: #1489

Private-ref: FAL-3922

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Nov 8, 2024
@openedx-webhooks
Copy link

openedx-webhooks commented Nov 8, 2024

Thanks for the pull request, @navinkarkera!

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.

@navinkarkera
Copy link
Contributor Author

It seems like many of library tests are failing after merge of this commit:f9ef00e

Copy link

codecov bot commented Nov 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.02%. Comparing base (9b4cf87) to head (efe8d52).
Report is 15 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1490   +/-   ##
=======================================
  Coverage   93.01%   93.02%           
=======================================
  Files        1048     1048           
  Lines       20480    20479    -1     
  Branches     4402     4401    -1     
=======================================
+ Hits        19049    19050    +1     
+ Misses       1361     1359    -2     
  Partials       70       70           

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


🚨 Try these New Features:

@navinkarkera navinkarkera marked this pull request as ready for review November 8, 2024 12:44
@navinkarkera navinkarkera requested a review from a team as a code owner November 8, 2024 12:44
@bradenmacdonald
Copy link
Contributor

@navinkarkera That fixed the bug, but now I am seeing weird behavior where a blank editor opens up after I save the new component.

New.Bug.mov

Also, the changes I made ("This is the new text") don't seem to have been saved.

@bradenmacdonald
Copy link
Contributor

Hmm, I cleared my cache and the bug is slightly different - now it does save changes and the second editor only flickers briefly on the screen. But still definitely a bug with the editor appearing again:

New.bug.2.mov

@navinkarkera
Copy link
Contributor Author

navinkarkera commented Nov 9, 2024

@bradenmacdonald I think it is the same issue that I posted here. I'll investigate and see if I can fix it here.

Update: The linkComponent function that links a component to collection is responsible for this bug.

@navinkarkera navinkarkera force-pushed the navin/remove-unnecessary-toast-notification branch from 13eec2a to 3f95ab6 Compare November 9, 2024 16:58
@navinkarkera
Copy link
Contributor Author

It is fixed now, had to link component after editor closing. I believe it will also help when we work on #1482 as we can trigger creation of new block on editor close using the same function.

@navinkarkera navinkarkera force-pushed the navin/remove-unnecessary-toast-notification branch 2 times, most recently from 1f0761c to 1f7c6ce Compare November 11, 2024 07:48
@navinkarkera navinkarkera force-pushed the navin/remove-unnecessary-toast-notification branch from efbad92 to 816dd4d Compare November 11, 2024 16:53
@navinkarkera navinkarkera force-pushed the navin/remove-unnecessary-toast-notification branch from 816dd4d to 2734338 Compare November 11, 2024 16:57
Copy link
Contributor

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

👍 Thank you for this fix, and for cleaning up and improving tests @navinkarkera !

  • I tested this by ensuring that no toast is shown with the editor modal when adding new components to a library or collection. Also tested that the toast is still shown when pasting components into a library or collection, and that the "Content linked successfully" toast and message have been removed.
  • I read through the code
  • I checked for accessibility issues by using my keyboard to navigate
  • Improves the code documentation
  • User-facing strings are extracted for translation

Comment on lines 107 to 109
/** If the editor is open and the user is editing some component, this is its usageKey
and the callback function that should be called on closing the editor.
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: componentBeingEdited isn't a usageKey anymore:

Suggested change
/** If the editor is open and the user is editing some component, this is its usageKey
and the callback function that should be called on closing the editor.
*/
// If the editor is open and the user is editing some component, this is the component being edited.

and the callback function that should be called on closing the editor.
*/
componentBeingEdited: ComponentEditorInfo | undefined;
openComponentEditor: (usageKey: string, onClose?: () => void) => void;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit (continued): ...and the rest of this comment can go here:

Suggested change
openComponentEditor: (usageKey: string, onClose?: () => void) => void;
// If an onClose callback is provided, it will be called when the editor is closed.
openComponentEditor: (usageKey: string, onClose?: () => void) => void;

Copy link
Contributor

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

@navinkarkera is this ready to merge?

@navinkarkera
Copy link
Contributor Author

@ChrisChV Yes, thank you!

@ChrisChV ChrisChV merged commit 033acc4 into openedx:master Nov 14, 2024
7 checks passed
@ChrisChV ChrisChV deleted the navin/remove-unnecessary-toast-notification branch November 14, 2024 17:03
@bradenmacdonald
Copy link
Contributor

@navinkarkera

Hmm, I cleared my cache and the bug is slightly different - now it does save changes and the second editor only flickers briefly on the screen. But still definitely a bug with the editor appearing again:

I'm still seeing this on my sumac devstack (sumac.master branch). Do we need to backport the fix still?

@navinkarkera
Copy link
Contributor Author

@bradenmacdonald Yes, here is the backport PR: #1528

bradenmacdonald pushed a commit that referenced this pull request Nov 22, 2024
@bradenmacdonald bradenmacdonald added the FC Relates to an Axim Funded Contribution project label Nov 22, 2024
@bradenmacdonald bradenmacdonald changed the title fix: remove unnecessary toast notification on adding component fix: remove unnecessary toast notification on adding component [FC-0062] Nov 22, 2024
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
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants