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

TODO: Handle Error for Existing Branch on Word Submission #52

Open
babblebey opened this issue Apr 21, 2024 · 0 comments
Open

TODO: Handle Error for Existing Branch on Word Submission #52

babblebey opened this issue Apr 21, 2024 · 0 comments
Labels
↗️ medium priority This issue is crucial 🐛 bug Something isn't working 🗒️ todo This issue is a follow-up task

Comments

@babblebey
Copy link
Member

When a user submits a new word or edits an existing word in the dictionary, the system should check if the branch already exists before attempting to create a new branch. Currently, if a branch with the same name already exists, the submission process fails without providing a clear error message to the user.

https://github.com/babblebey/jargons.dev/blob/0eeb366b4346c28a400586082fadb331c0ee342f/src/lib/branch.js#L10

Proposed Solution:

  1. Add a check in the submission process to verify if the branch already exists. (but this will assume that a fork has already been created before-hand)
  2. If the branch exists, display a user-friendly error message indicating that the word already exists in the dictionary.
  3. Provide guidance on how to proceed, such as editing the existing word instead of creating a new one.

Additional Notes:

  • Important to state that the proposed solution is pretty much me thinking out loud, I have some thought which really looks like it will change how/when we fork in order to address this in the way I am thinking about
  • Its also important to know how/when we fork too, I can shed more lights on this
@babblebey babblebey added 🐛 bug Something isn't working ↗️ medium priority This issue is crucial 🗒️ todo This issue is a follow-up task labels Apr 21, 2024
babblebey added a commit that referenced this issue May 29, 2024
### Description
<!-- Please add PR description (don't leave blank) - example: This PR
[adds/removes/fixes/replaces] the [feature/bug/etc] -->

This PR commits some fixes to bugs and improvement suggestions received
as feedback from the whirl version of jargons.dev.

#### Changes Made

- Added missing `default_branch_only` property to `fork` script, to
allow forking of only the project's default branch.
- Replaced implementation of `javascript:history.back()` on `editor/new`
page return navigation wih=th navigation back to `/editor` page
- Updated repo git link in README.md clone repo step to `git clone
https://github.com/jargons-dev/jargons.dev.git` following org transfer
- Updated hey.new link to hi.new in CODE_OF_CONDUCT.md support contact
and in `ISSUE_TEMPLATE/config.yml` `contact_link` url
- Added `browse words` link to homepage under the search trigger
- Wrote login page message (Fixes
#12)
- Made jargons editor mobile responsiveness (Related to
#9)
- Implemented temporary workaround for handling deletion of existing
reference/branch (Related to #52)
- Added `jargons.dev` logo/sticker to README.md
- Addressed some todos
  - todo: deprecated the `options` params in the `word-editor` script

### Related Issue
<!-- Please prefix the issue number with Fixes/Resolves - example: Fixes
#123 or Resolves #123 -->

- Fixes #12
- Related to #9
- Related to #52

### Screenshots/Screencasts
<!-- Please provide screenshots or video recording that demos your
changes (especially if it's a visual change) -->

![image](https://github.com/devjargons/jargons.dev/assets/25631971/9e50d713-87a7-41e9-99dc-b295f0cf8dfb)

### Notes to Reviewer
<!-- Please state here if you added a new npm packages, or any extra
information that can help reviewer better review you changes -->

NA
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
↗️ medium priority This issue is crucial 🐛 bug Something isn't working 🗒️ todo This issue is a follow-up task
Projects
None yet
Development

No branches or pull requests

1 participant