stakwork / sphinx-tribes

Backend for sphinx tribes and bounties. The bounty platform pays out in bitcoin. Sign up with Sphinx Chat, complete a bounty, and earn bitcoin! Go to our website for available bounties.
https://community.sphinx.chat/bounties
33 stars 60 forks source link

Trim spaces in org names and fix org dropdown issue #1339

Closed ecurrencyhodler closed 9 months ago

ecurrencyhodler commented 9 months ago

Describe the bug Bounties aren't displaying if you are signed in.

https://github.com/stakwork/sphinx-tribes/assets/32662508/1b85c308-9aa8-46c9-9487-1de956e8d4aa

However if you are NOT signed in you can view the bounty.

Expected behavior I should be able to view the bounty if I am signed in.

Desktop (please complete the following information):

Acceptance Criteria

aliraza556 commented 9 months ago

@ecurrencyhodler can you assign me?

ecurrencyhodler commented 9 months ago

This is a fairly complex issue. I think someone from our team needs to take a look.

ecurrencyhodler commented 9 months ago

https://github.com/stakwork/sphinx-tribes/assets/32662508/f06db633-5307-42e8-a60d-3af599ad77bf

@kevkevinpal @elraphty Some logs from console.

wright-eric commented 9 months ago

2 issues found in this

  1. The extra spaces at the beginning or end of an organization are not handled by the toCapitalize function here resulting in panic and hence the white screen.

  2. The function getUserDropdownOrganizations update the current organizations in main store. This function is called on two occasion. a. When we load the page we fetch current user organization. b. When we visit other users profile, it loads their organization. This should not be stored as dropdownOrganization because when i would then try to create new bounty it would show the other user organizations in dropdown image

elraphty commented 9 months ago

@wright-eric the dropdownOrganization should display the organizations a user is an admin to or has a manage bounty role, this error is coming from line 178 in https://github.com/stakwork/sphinx-tribes/blob/7ee0aeabf84ec77442b8ea8ab70be3259fd8abce/frontend/app/src/people/widgetViews/OrganizationView.tsx the dropdown query should only be called with uiStore.meInfo?.idwhich is the logged in user, making this change will fix the error.

ecurrencyhodler commented 9 months ago

@wright-eric I can create a bounty for you for addressing these two issues.

ecurrencyhodler commented 9 months ago

https://community.sphinx.chat/bounty/1208

ecurrencyhodler commented 9 months ago

Hey @wright-eric or @elraphty would this PR affect the bounty creation modal? It looks like some of the UI elements got altered.

Screenshot 2024-01-22 at 8 41 39 AM
wright-eric commented 9 months ago

@ecurrencyhodler i dont think it should as there were no UI changes. What do you think @elraphty ?

I think its because of this https://github.com/stakwork/sphinx-tribes/pull/1383/files#diff-e1c7c9cb04490ebf3dac085d668ba80d5c7e349201fbc26245487c468cd5b6d4L16 it makes sense to not use hardcoded width but i think this input is used in other component as well such as bounty creation form.