Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

[MM-42443]: fix selectionRange updates in edit_post component #10035

Merged
merged 7 commits into from
Mar 25, 2022

Conversation

michelengelen
Copy link
Contributor

Summary

Fixed updating the inputs selectionRange by using the state to determine whenever it has to be manually updated.

This should go hand in hand with #10034 since changes in this PR might affect it directly.

I discovered that only italic markdown is being handled differently and the italic markers are excluded from the selection. I would propose to add other markers as well (e.g. bold, strikethrough, etc.) and let the manual update on selectionRanges be handled by the component (maybe write a getter function in Utils, but let the actual updates to the input be handled inside the component)

Ticket Link

MM-42443

Related Pull Requests

n/a

Screenshots

n/a

Release Note

fixes markdown insert link behavior in edit post input field

@michelengelen michelengelen added 2: Dev Review Requires review by a core commiter 3: QA Review Requires review by a QA tester Setup Cloud Test Server Setup a test server using Mattermost Cloud 1: UX Review Requires review by a UX Designer labels Mar 21, 2022
@michelengelen michelengelen self-assigned this Mar 21, 2022
@mm-cloud-bot mm-cloud-bot added kind/bug Categorizes issue or PR as related to a bug. release-note labels Mar 21, 2022
@michelengelen
Copy link
Contributor Author

@amyblais 2/3 for cloud release

@amyblais amyblais added the CherryPick/Approved Meant for the quality or patch release tracked in the milestone label Mar 21, 2022
Copy link
Contributor

@matthewbirtch matthewbirtch left a comment

Choose a reason for hiding this comment

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

Works great @michelengelen

@amyblais amyblais removed the 1: UX Review Requires review by a UX Designer label Mar 21, 2022
@michelengelen michelengelen changed the title fixed setting selections with handling selectionRanges after state up… [MM-42443]: fix selectionRange updates in edit_post component Mar 22, 2022
@jgilliam17
Copy link
Contributor

/e2e-test

@mattermod
Copy link
Contributor

Triggering e2e testing with options:
<nil>

@mattermod
Copy link
Contributor

@jgilliam17
Copy link
Contributor

Thanks @michelengelen
Tested, looks good to merge - pending e2e report

  • Verified insert link keyboard shortcut is working as expected in edit post textbox.

@jgilliam17
Copy link
Contributor

@michelengelen
E2E report looks good overall
One test failure may be related - this test case is passing when testing manually
MM-T2139

@michelengelen
Copy link
Contributor Author

hi @jgilliam17 ... I adjusted the script to wait a bit before searching for the postMesage_<postId> container ... it now should not fail anymore.

@jgilliam17
Copy link
Contributor

Thanks @michelengelen Can you please update the branch so I can re-run the e2es. Thanks

@michelengelen
Copy link
Contributor Author

@jgilliam17 merged master just now ... feel free to re-run whenever you like!

@jgilliam17
Copy link
Contributor

/e2e-test

@jgilliam17
Copy link
Contributor

E2E test running here

@jgilliam17
Copy link
Contributor

Thanks @michelengelen I am starting to think this may be a flaky test MM-T2139, full report here
@saturninoabril thoughts?

@saturninoabril
Copy link
Member

I think most of those were recently addressed, especially by #10053. I'll update this PR then will run E2E again. Thanks Jelena!

@saturninoabril
Copy link
Member

/update-branch

@saturninoabril
Copy link
Member

Oopss, sorry, I thought other failed tests from the report. I'll take a look what's going on with MM-T2139.

@saturninoabril
Copy link
Member

@calebroseland calebroseland removed the 2: Dev Review Requires review by a core commiter label Mar 25, 2022
@saturninoabril
Copy link
Member

@jgilliam17 MM-T2139 should be good now. Please take a look again.

@jgilliam17
Copy link
Contributor

Thanks @michelengelen - looks good to merge.
And thank you @saturninoabril for taking care of the flaky test.
E2E report looks good.

@jgilliam17 jgilliam17 added 4: Reviews Complete All reviewers have approved the pull request and removed 3: QA Review Requires review by a QA tester Setup Cloud Test Server Setup a test server using Mattermost Cloud labels Mar 25, 2022
@mm-cloud-bot
Copy link

Test server destroyed

@jgilliam17 jgilliam17 merged commit e155dad into master Mar 25, 2022
@jgilliam17 jgilliam17 deleted the bugfix/MM-42443 branch March 25, 2022 13:49
@amyblais
Copy link
Member

/cherry-pick cloud

@mattermod
Copy link
Contributor

Cherry pick is scheduled.

mattermost-build pushed a commit to mattermost-build/mattermost-webapp that referenced this pull request Mar 25, 2022
…most#10035)

* fixed setting selections with handling selectionRanges after state updates

* adjusted waiting time on e2e test for aborting message edit in main channel view

* fixed some errors after merging master

* increased wait times for MM-T2139

* fix flaky MM-T2139

Co-authored-by: Mattermod <[email protected]>
Co-authored-by: Saturnino Abril <[email protected]>
(cherry picked from commit e155dad)
@mattermod mattermod added CherryPick/Done Successfully cherry-picked to the quality or patch release tracked in the milestone and removed CherryPick/Approved Meant for the quality or patch release tracked in the milestone labels Mar 25, 2022
@amyblais amyblais added Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation labels Mar 25, 2022
amyblais pushed a commit that referenced this pull request Mar 25, 2022
#10066)

* fixed setting selections with handling selectionRanges after state updates

* adjusted waiting time on e2e test for aborting message edit in main channel view

* fixed some errors after merging master

* increased wait times for MM-T2139

* fix flaky MM-T2139

Co-authored-by: Mattermod <[email protected]>
Co-authored-by: Saturnino Abril <[email protected]>
(cherry picked from commit e155dad)

Co-authored-by: Michel Engelen <[email protected]>
Willyfrog pushed a commit to Willyfrog/mattermost-webapp that referenced this pull request May 6, 2022
…most#10035)

* fixed setting selections with handling selectionRanges after state updates

* adjusted waiting time on e2e test for aborting message edit in main channel view

* fixed some errors after merging master

* increased wait times for MM-T2139

* fix flaky MM-T2139

Co-authored-by: Mattermod <[email protected]>
Co-authored-by: Saturnino Abril <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
4: Reviews Complete All reviewers have approved the pull request Changelog/Not Needed Does not require a changelog entry CherryPick/Done Successfully cherry-picked to the quality or patch release tracked in the milestone Docs/Not Needed Does not require documentation kind/bug Categorizes issue or PR as related to a bug. release-note
Projects
None yet
9 participants