AutarkLabs / open-enterprise

A suite of apps that includes allocation, dot voting, issue curation, and other planning tools so organizations can collectively budget and design custom reward & bounty systems.
GNU General Public License v3.0
92 stars 54 forks source link

Invalid action dropdown statuses in the IssueDetail View #696

Closed Schwartz10 closed 5 years ago

Schwartz10 commented 5 years ago

There are a few issues with the status of bounties in the dropdown menu

  1. after creating an action, the state doesn't update until you refresh the page
  2. after being rejected as an applicant, i still have an option to submit my work image.png
Schwartz10 commented 5 years ago

relates to https://github.com/AutarkLabs/planning-suite/issues/657

stellarmagnet commented 5 years ago

@Schwartz10 are you reviewing this PR ? https://github.com/AutarkLabs/planning-suite/pull/690

We need to merge this before any work on Issue details

stellarmagnet commented 5 years ago

Woops, I mean https://github.com/AutarkLabs/planning-suite/pull/661. But ideally they should both be merged together and into dev

Schwartz10 commented 5 years ago

Yeah i'm working off #661 now, and #690 doesn't contain fixes for state management

stellarmagnet commented 5 years ago

Yeah #690 was a typo, but I mean we should merge them all together since its similar code areas and 690 pretty small

Schwartz10 commented 5 years ago

Some notes:

It seems that the issue inside the IssueDetail component isn't causing the IssueDetail to rerender. However, in the actual Issues component, rendering a list of Issues, the issues do get rerendered.

How an issue looks after bounty in IssueDetail.js:

body: "Need to figure out the best way to update the redux store on a metamask change event.
↵
↵As of March - Metamask has not supported websockets and web3 1.0 - so maybe just use a simple `setTimeout`? TBD"
createdAt: "2018-03-31T02:17:55Z"
id: "MDU6SXNzdWUzMTAyMDQ3OTU="
labels: {totalCount: 0, edges: Array(0), __typename: "LabelConnection"}
milestone: null
number: 1
repo: undefined
repoId: undefined
state: "CLOSED"
title: "Update Redux store on Metamask change event"
url: "https://github.com/Schwartz10/blockchain-ReactRedux-boilerplate/issues/1"

and in Issue.js:

assignee: "0x0000000000000000000000000000000000000000"
balance: "1"
body: "Funds would be withdrawn from vault instead"
createdAt: "2019-03-20T20:38:52Z"
deadline: "2019-04-14T15:27:07.485Z"
detailsOpen: 0
exp: 0
expLevel: "Beginner"
hasBounty: true
hours: 1
id: "MDU6SXNzdWU0MjM0NjE2MzE="
key: "MDU6SXNzdWU0MjM0NjE2MzE="
labels: {totalCount: 0, edges: Array(0), __typename: "LabelConnection"}
milestone: null
number: 609
repo: "planning-suite"
repoId: "MDEwOlJlcG9zaXRvcnkxMjY4OTkxNDM="
size: 1
slots: 1
slotsIndex: 0
standardBountyId: "6"
state: "OPEN"
symbol: "autark"
title: "Ability to create a New Allocation without an account"
token: "0xB1Aa712237895EF25fb8c6dA491Ba8662bB80256"
url: "https://github.com/AutarkLabs/planning-suite/issues/609"
workStatus: "funded"

Looks like the full issue isn't making it into the issueDetail component.

Schwartz10 commented 5 years ago

AH here it is i believe:

the issues array passed to shapeIssues https://github.com/AutarkLabs/planning-suite/blob/dev/apps/projects/app/components/Content/Issues.js#L287

is an array of issues, but when its the single detail view, the repository field is an array. In the multiple detail view, the repository field is just a single object.

because of this: https://github.com/AutarkLabs/planning-suite/blob/471-finalize-issue-detail/apps/projects/app/components/Content/Issues.js#L367