-
Notifications
You must be signed in to change notification settings - Fork 178
refactor: Replace connect with useSelector() and useDispatch() 5/5 #2318 #2423
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
base: master
Are you sure you want to change the base?
Conversation
|
Thanks for the pull request, @ahtesham-quraish! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo 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:
🔘 Submit a signed contributor agreement (CLA)
If you've signed an agreement in the past, you may need to re-sign. Once you've signed the CLA, please allow 1 business day for it to be processed. 🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere 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:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
1edb908 to
eb34199
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2423 +/- ##
==========================================
+ Coverage 94.71% 94.75% +0.04%
==========================================
Files 1202 1202
Lines 26845 26816 -29
Branches 6025 6024 -1
==========================================
- Hits 25425 25409 -16
+ Misses 1350 1338 -12
+ Partials 70 69 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
eb34199 to
61fd599
Compare
|
I'm going to try closing and re-opening this PR to see if it resolves the CLA check issue |
bradenmacdonald
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ahtesham-quraish.
...deoEditor/components/VideoSettingsModal/components/TranscriptWidget/ImportTranscriptCard.jsx
Outdated
Show resolved
Hide resolved
...deoEditor/components/VideoSettingsModal/components/TranscriptWidget/ImportTranscriptCard.jsx
Show resolved
Hide resolved
...itor/components/VideoSettingsModal/components/TranscriptWidget/ImportTranscriptCard.test.tsx
Outdated
Show resolved
Hide resolved
...s/VideoEditor/components/VideoSettingsModal/components/TranscriptWidget/LanguageSelector.jsx
Show resolved
Hide resolved
...s/VideoEditor/components/VideoSettingsModal/components/TranscriptWidget/LanguageSelector.jsx
Show resolved
Hide resolved
...s/containers/VideoEditor/components/VideoSettingsModal/components/TranscriptWidget/index.jsx
Outdated
Show resolved
Hide resolved
...s/containers/VideoEditor/components/VideoSettingsModal/components/TranscriptWidget/index.jsx
Outdated
Show resolved
Hide resolved
...s/containers/VideoEditor/components/VideoSettingsModal/components/TranscriptWidget/index.jsx
Outdated
Show resolved
Hide resolved
...containers/VideoEditor/components/VideoSettingsModal/components/VideoPreviewWidget/index.jsx
Outdated
Show resolved
Hide resolved
...iners/VideoEditor/components/VideoSettingsModal/components/VideoPreviewWidget/index.test.tsx
Outdated
Show resolved
Hide resolved
|
@ahtesham-quraish Can you please also update the PR "Testing instructions" with instructions for how to test this manually? I want to make sure the editor components are still working after the refactor. |
fix: merge with master
|
@bradenmacdonald I have addressed the comments please check now. I normal follow Unit tests strategy to test the components behaviour and run regression test on all the relevant function/feature. Like in this case I see if all the component types which use texteditor are working. |
| const intl = useIntl(); | ||
| const dispatch = useDispatch(); | ||
|
|
||
| const openLanguages = useSelector(selectors.video.openLanguages); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to only import required selectors and thunk actions from the redux store instead of importing all selectors and thunk actions
| const launchDeleteConfirmation = jest.fn(); | ||
| jest.spyOn(hooks, 'setUpDeleteConfirmation').mockReturnValue({ | ||
| inDeleteConfirmation: false, | ||
| launchDeleteConfirmation, | ||
| cancelDelete, | ||
| }); | ||
| render(<Transcript {...defaultProps} />); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this mocking is a duplicate because you are already mocking it beforeEach.
| import { initializeMocks } from '@src/testUtils'; | ||
| import { VideoPreviewWidget } from '.'; | ||
|
|
||
| describe('VideoPreviewWidget', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any reason to change jsx file into tsx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we are trying to migrate all code in this repo to TypeScript.
|
I have a few minor concerns, but overall, the PR looks good to me. |
I meant manual testing. Making sure it actually works by using it yourself. This PR is mostly affecting the Video editor, not the text editor. When I tried the "Add Transcript" button in the video editor, there is a new bug that wasn't happening before: Transcript.Error.movPlease fix that, and the duplicate mock that @awais-ansari pointed out, and then I think this is ready. |
|
@ahtesham-quraish are you planning to finish this? |
Description
Replace connect with useSelector() and useDispatch() 5/5 #2318
Supporting information
Link to other information about the change, such as GitHub issues, or Discourse discussions.
Be sure to check they are publicly readable, or if not, repeat the information here.
Testing instructions
Please provide detailed step-by-step instructions for manually testing this change.
Other information
Include anything else that will help reviewers and consumers understand the change.
Best Practices Checklist
We're trying to move away from some deprecated patterns in this codebase. Please
check if your PR meets these recommendations before asking for a review:
.ts,.tsx).propTypes,defaultProps, andinjectIntlpatterns are not used in any new or modified code.src/testUtils.tsx(specificallyinitializeMocks)apiHooks.tsin this repo for examples.messages.tsfiles have adescriptionfor translators to use.../. To import from parent folders, use@src, e.g.import { initializeMocks } from '@src/testUtils';instead offrom '../../../../testUtils'