Release 0.4 Complete
In my previous blogs, I have planned out my release 0.4 contributions, I have been reading documents and watching tutorials, communicating with the developers of the project ever since. Today, I have finished my two contributions on the qasong repository. In the previous blog, I have talked about how I fixed one of the issues, in this one, I will talk about the other.
The second issue, which I considered to be the more challenging one, is an issue I opened in the repository myself, this is an issue I created from one of my release 0.2 contributions. The confirmation button on the clear queue section, produces a browser default confirmation window, I really should have worked with Material-UI based component to make a dialog component myself since this is the framework that the project relies on. The browser confirmation window looks ugly, but it got the job done, since I didn't know how to work with most Material-UI components back when I was working on 0.2, I gave up on the Dialog component implementation.
Since the repository team accepted my PR for 0.2, I felt like I needed to fix this issue that I created myself, I was confident enough that I could resolve this issue this time since I have been working with React applications a lot lately.
While working on the project, I ran into problems like unable to run the project locally and unable to make network requests to resources within the running application, etc. They were mostly webpack related issues, and was resolved by contacting the repository owner.
Throughout the process of working on these issues, I have enhanced my ability in working with React projects and learned a lot about functional components as well as the Material-UI framework.
Implementation Details:
-Add [confirmDialog, setConfirmDialog] useState hook, initial value is a json object, {open: false, title: "Please confirm to clear queue", subTitle: "Can't undo operation"}.
- Code confirmClearDialog component using Dialog, DialogTitle, DialogContent, and Dialog Actions(for the yes/no buttons)
- This component takes a props parameter, which consist of the json object mentioned above, the current queue object and the setQueue function.
- Add two click handlers for the yes/no buttons, handleClickNo does nothing but closing the dialog, handleClickYes removes empties the queue using the queue object and setQueue function passed down from the upper layer and then closes the dialog.
The Code could be found in the PR, which I will provide a link at the bottom.
To accomplish implementing this feature, I used the following resources:
Material-UI Documentations: https://material-ui.com/components/dialogs/
CodAffection's YouTube tutorial: https://www.youtube.com/watch?v=KOryCvYE4_s
Previous Blogs:
https://weihuangosd.blogspot.com/2020/12/contribution-plan.html
https://weihuangosd.blogspot.com/2020/12/update-on-release-04.html
qasong repo: https://github.com/IanWalston/qasong
Issues Mentioned:
https://github.com/IanWalston/qasong/issues/195
https://github.com/IanWalston/qasong/issues/186
Comments
Post a Comment