Intro
For release 0.2, we are participating in the Hacktoberfest. I started to search for some issue with the label "good first issue" and I end up with one issue in the Canvasbird repo.
The issue was Unique name issue while creating workspace.
I started to ask if I could work on it. Then once the issue got assigned to me I started to work on it.
First I fork the repo, then clone it and install all packages needed to run in my local.
I tried to reproduce the bug in local once I was able to. I first try to locate the file for that component.
Added a function to get all current folder name
private getAllFolderNames(): string[] {
return [...document.querySelectorAll('h5.folder-title strong')].map(node => node.innerHTML.trim());
}
Used that function above when user updates or create a new folder to catch if the folder have to newest folder has the same name or not.
For updating folder name
if (newName === '' || (this.getAllFolderNames().includes(newName) && this.data.find(x => x._id === obj._id).folder_name.trim() != newName)){...}
For new folder name
if (!this.getAllFolderNames().includes(body.folder_name)){...}
After that, I committed my code then created a pull request PR#436.
I noticed that I had some conflicts to resolve. I updated my branch then committed the fix for the conflict.
Luckily my PR got merged quickly.
Conclusion
The bug wasn't something complex, but the learning outcome from this issue was very useful. I re-learned Angular a framework I haven't touched for a year. More and more I work on different frameworks I notice my ability to adapt to a new framework improved a lot. I spend less and less time figuring things out and being more efficient at reading documentation.
Top comments (0)