human-essentials icon indicating copy to clipboard operation
human-essentials copied to clipboard

[BUG] On new item, category dropdown disappears after error

Open cielf opened this issue 1 year ago • 3 comments

Summary

If you have an error on new item, the category list for selection disappears. It shouldn't.

Details

Recreation

login as [email protected] Select Inventory, then Items & Inventory, then Items, then New Item Click in the "Category" field. You will see a list of categories to choose from Click Save Click in the "Category" field. You no longer see a list of categories to choose from.

Hint

It's probably re-rendering without resetting up the category stuff.

Required change

The ability to select "Category" should still be available after having an error on this screen.

Criteria for completion

  • [ ] Behaviour as described above
  • [ ] tests to confirm the behaviour.

Noted by Gabe Torres, June 4 2024 "Thanks for posting, Daniela. It reminded me of something I noticed that also concerns forms. I thought it could have been my branch, but I tried it on main, and the issue persisted. Recreating: When logged in as a bank, navigate to http://localhost:3000/items/new Submit a blank form. Bug: The drop-down menu for category no longer functions and changes into some kind of numeric input that can be decreased or increased. I’m not sure if this is a known issue or not, but I thought I’d share."

cielf avatar Sep 29 '24 14:09 cielf

I tackled this one! Here's my PR https://github.com/rubyforgood/human-essentials/pull/4703

bdeanhardt avatar Oct 03 '24 17:10 bdeanhardt

Hi! @cielf I'm new to this project, and I would love to work on this issue. Looking forward to contributing!

princekumarg12 avatar Oct 09 '24 06:10 princekumarg12

@princekumarg12 There was already a PR in progress for this one, so I think we'll go with that one, if it works.

cielf avatar Oct 09 '24 14:10 cielf

This issue is marked as stale due to no activity within 30 days. If no further activity is detected within 7 days, it will be unassigned.

github-actions[bot] avatar Nov 09 '24 00:11 github-actions[bot]

Automatically unassigned after 7 days of inactivity.

github-actions[bot] avatar Nov 16 '24 00:11 github-actions[bot]

This is in the latter cycles of the pull request review and fix.

cielf avatar Nov 16 '24 01:11 cielf

This issue is marked as stale due to no activity within 30 days. If no further activity is detected within 7 days, it will be unassigned.

github-actions[bot] avatar Dec 18 '24 00:12 github-actions[bot]

Hey @bdeanhardt -- it looks like this still needs a little bit to push it over the finish line! Are you still working on it?

cielf avatar Dec 18 '24 00:12 cielf

This issue is marked as stale due to no activity within 30 days. If no further activity is detected within 7 days, it will be unassigned.

github-actions[bot] avatar Jan 19 '25 00:01 github-actions[bot]

Automatically unassigned after 7 days of inactivity.

github-actions[bot] avatar Jan 27 '25 00:01 github-actions[bot]

At this point, this is open for someone else to take the PR the last mile.

cielf avatar Jan 27 '25 00:01 cielf

šŸ‘‹ hey @cielf! I can try to wrap this PR up

tatheerf02 avatar Jan 29 '25 00:01 tatheerf02

Cool! Please do.

cielf avatar Jan 29 '25 01:01 cielf

@cielf Bit of a dumb q - would you know how I can contribute to someone else's fork? Wouldn't want to manually copy the changes and open a new PR as that would cause the original author to lose credit šŸ¤”

tatheerf02 avatar Jan 29 '25 03:01 tatheerf02

It's not a dumb q. I'm not a git expert, and don't know the full answer immediately. @coalest - can you cover this in more detail?

I think that you can just check out the branch, make the changes, and then push your changes - but that that may depend on their settings, and/or your status on the project.

cielf avatar Jan 29 '25 16:01 cielf

@tatheerf02 Yea definitely not a dumb q. Here is a tutorial I've used previously with success: https://tighten.com/insights/adding-commits-to-a-pull-request/

In this case, the commands would be something like:

$  git remote add bdeanhardt [email protected]:bdeanhardt/human-essentials.git
$  git fetch bdeanhardt
$  git checkout bdeanhardt/main 
// make your commits
$  git push bdeanhardt HEAD:main

One thing I'm not sure about is if there will be any issues with the fact that bdeanhardt didn't create a feature branch and instead committed directly to main. I guess you'll find out :)

Note: The two conditions for this to work on Github are 1) the user hasn't deleted their forked repository on Github and 2) the user's PR has "Maintainers are allowed to edit this pull request. " checked (which is the default so almost all PR's have it checked).

coalest avatar Jan 30 '25 11:01 coalest

Ah, the step I was missing was setting up a SSH key. All good now, thank you both for the help!

@coalest I was able to fetch the fork and commit my changes, but I'm blocked from pushing them to main due to lack of permissions. I've tried various debugging steps and am fairly confident it's not an issue on my side. Would you recommend manually copying the PR changes in this case, or opening a PR with the existing one set as upstream? Appreciate your insight in advance šŸ™

tatheerf02 avatar Jan 31 '25 03:01 tatheerf02

@tatheerf02 Since you can't add commits to bdeanhardt's PR, you'll have to create your own. It's up to you know you go about it.

If you want to carry on where they left off including their commits, you can create a branch from bdeanhardt/main:

$ git checkout bdeanhardt/main
$ git checkout -b my-feature-branch
// add your commits
// git push and create a new PR

Or if you want to use their branch as inspiration but do things your own way, I would just add bdeanhardt as a co-author (like here).

coalest avatar Jan 31 '25 17:01 coalest