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

Show new invitation quota on ProposalDetails (#3902) #3926

Merged
merged 6 commits into from
Dec 12, 2022

Conversation

traumschule
Copy link
Collaborator

@traumschule traumschule commented Dec 6, 2022

Fixes #3902

@vercel
Copy link

vercel bot commented Dec 6, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
dao ✅ Ready (Inspect) Visit Preview Dec 8, 2022 at 9:59PM (UTC)
pioneer-2 ✅ Ready (Inspect) Visit Preview Dec 8, 2022 at 9:59PM (UTC)
pioneer-2-storybook ✅ Ready (Inspect) Visit Preview Dec 8, 2022 at 9:59PM (UTC)

@oleksanderkorn
Copy link
Contributor

oleksanderkorn commented Dec 6, 2022

@traumschule what do you mean by parameter doesn't show up. ?
I see it on the preview branch:
image

Oh you mean in the created proposal.. nvm :) checking

@oleksanderkorn
Copy link
Contributor

oleksanderkorn commented Dec 6, 2022

@traumschule the proposalDetails are not defined for such type:
image

The trick is the missing definition of SetMembershipLeadInvitationQuotaDetails:
image
See for example const asSetReferralCut: DetailsCast<'SetReferralCutProposalDetails'> = (fragment): SetReferralCutDetails => ({
It is autogenerated from graphql schema, same should be done here for our type setMembershipLeadInvitationQuota
image

image

@oleksanderkorn
Copy link
Contributor

image

@oleksanderkorn
Copy link
Contributor

@traumschule check this out https://github.com/traumschule/pioneer/pull/4/files :)

@traumschule traumschule marked this pull request as ready for review December 6, 2022 11:43
@traumschule
Copy link
Collaborator Author

Thanks!

count

Copy link
Contributor

@oleksanderkorn oleksanderkorn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we change type to count should it also be the count on proposal creation? Because currently this is treat as amount:

image

@traumschule
Copy link
Collaborator Author

traumschule commented Dec 6, 2022

FAIL test/proposals/modals/AddNewProposalModal.test.tsx (307.649 s)
 |   ● UI: AddNewProposalModal › Stepper modal › Specific parameters › Type - Set Membership lead invitation quota proposal › Valid form
 | 
 |     expect(received).toEqual(expected) // deep equality
 | 
 |     Expected: 100
 |     Received: 0
 | 
 |       1006 |           const [, txSpecificParameters] = last(createProposalTxMock.mock.calls)
 |       1007 |           const parameters = txSpecificParameters.asSetMembershipLeadInvitationQuota.toJSON()
 |     > 1008 |           expect(parameters).toEqual(amount)

@traumschule traumschule requested a review from thesan December 6, 2022 17:11
Copy link
Collaborator

@thesan thesan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but I don't really understand how it fixes #3902 😕

@thesan thesan merged commit 1b163bc into Joystream:dev Dec 12, 2022
type: 'setMembershipLeadInvitationQuota',
amount: new BN(fragment.newLeadInvitationQuota),
})

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the key was to cast the detail

XxFlameCatxX pushed a commit to XxFlameCatxX/pioneer that referenced this pull request Dec 27, 2022
…tream#3926)

* Show new invitation quota on `ProposalDetails` (Joystream#3902)

* Generate SetMembershipLeadInvitationQuotaProposalDetails

* fix amount -> count type in `ProposalDetails`

* Do not use currency for setMembershipLeadInvitationQuota

* lint

* fix field and test

Co-authored-by: Joystream Stats <dev@joystreamstats.live>
Co-authored-by: Oleksandr Korniienko <oleksanderkorn@gmail.com>
XxFlameCatxX pushed a commit to XxFlameCatxX/pioneer that referenced this pull request Jan 14, 2023
…tream#3926)

* Show new invitation quota on `ProposalDetails` (Joystream#3902)

* Generate SetMembershipLeadInvitationQuotaProposalDetails

* fix amount -> count type in `ProposalDetails`

* Do not use currency for setMembershipLeadInvitationQuota

* lint

* fix field and test

Co-authored-by: Joystream Stats <dev@joystreamstats.live>
Co-authored-by: Oleksandr Korniienko <oleksanderkorn@gmail.com>
XxFlameCatxX pushed a commit to XxFlameCatxX/pioneer that referenced this pull request Jan 14, 2023
…tream#3926)

* Show new invitation quota on `ProposalDetails` (Joystream#3902)

* Generate SetMembershipLeadInvitationQuotaProposalDetails

* fix amount -> count type in `ProposalDetails`

* Do not use currency for setMembershipLeadInvitationQuota

* lint

* fix field and test

Co-authored-by: Joystream Stats <dev@joystreamstats.live>
Co-authored-by: Oleksandr Korniienko <oleksanderkorn@gmail.com>
XxFlameCatxX pushed a commit to XxFlameCatxX/pioneer that referenced this pull request Jan 14, 2023
…tream#3926)

* Show new invitation quota on `ProposalDetails` (Joystream#3902)

* Generate SetMembershipLeadInvitationQuotaProposalDetails

* fix amount -> count type in `ProposalDetails`

* Do not use currency for setMembershipLeadInvitationQuota

* lint

* fix field and test

Co-authored-by: Joystream Stats <dev@joystreamstats.live>
Co-authored-by: Oleksandr Korniienko <oleksanderkorn@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community-dev issue suitable for community-dev pipeline jsg-code-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[USERSNAP] Proposal does not display the necessary information
3 participants