So that I can register and edit my proposal, and submit it for review
Overview
This is the front end and backend story for implementing the "Proposal" page. Note the acceptance criteria about tests, and that test driven development is encouraged, with the full End-To-End coverage that includes posting transactions to the smart contnract.
1) Implement Layout:
2) Implement Components
3) Backend (contract):
To add a proposal, user calls a function on devhub.near contract
devhub.near records the proposal internally and assigns the ID (just a sequential number: 1, 2, ...)
devhub.near contract will make a cross-contract call to social.near to publish the Social Post on behalf of devhub.near account
devhub.near contract needs to also capture the reference to the Social Feed post, which is referenced by the block height at the time of publication - this is now possible through https://github.com/NearSocial/social-db/pull/16
notifications on proposals can refer to the social feed post rather than the proposal itself, so that we can get functionality for likes, comment and repost notifications out of the box. Other types of notifications such as moderator changes on progress timeline can also be connected to the social feed post.
Acceptance Criteria
[ ] If the user is not the creator or reviewer, then Edit should not be visible.
[ ] If the user is the creator and the post is in draft, the edit button should be available.
[ ] If the user is the creator and the post is in review, the edit button should be disabled.
[ ] If the user is the reviewer and the post is in review, the edit button should be available.
[ ] If the user is the reviewer and the post is in draft, the edit button should be disabled.
[ ] When the user clicks Edit, the page should redirect to ?page=proposal.create&id=${proposal_id}
[ ] When the user clicks Ready for Review, a function call to set_proposal should be called to set the proposal state to "REVIEW" (see back end implementation story)
[ ] As an authenticated user, compose comment should be available
[ ] As an unauthenticated user, compose comment should not be visible
[ ] Verify that there is a form where the proposer can select category, type the title, write a summary and a description, as shown in the Figma illustration
[ ] Verify that the proposal form page has final consent checkboxes as shown in Figma
[ ] Verify that it is possible to provide funding details as specified in Figma
[ ] Verify that after submission, and marked as ready for review, the form is not editable anymore
[ ] Verify that only the proposer can edit the proposal form, both in the UI, and also on the contract side
[ ] Verify that a posted proposal also is a post to SocialDB
[ ] Verify that likes and comments are from SocialDB
[ ] Verify that the UI implementation corresponds to the Figma design
[ ] Verify frontend automatic tests
[ ] Verify that there's an automatic playwright test visualized in an automatically generated screen recording
[ ] Verify that the tests covers relevant usage and misuse scenarios
[ ] Verify that the tests demonstrates how the UI is guiding the user in an intuitive way by providing validation messages and hints
[ ] Verify backend
[ ] Verify that the contract implements the data structure that represents the frontend
[ ] Verify that the contract implements the same verification mechanisms and validation messages as the frontend
[ ] Verify backend automatic tests
[ ] Verify that there are unit test on the detailed level covering multiple variants of input and expectations
[ ] Verify that there are integration tests using near-workspaces-rs for covering the scenarios of input and expected output from the frontend
[ ] Verify that the playwright tests interacts with a testnet contract, to show the full end-to-end flow
[ ] Before merge: Verify that the functionality, test coverage (as shown by the screen recording), is according to expectations of the product owner.
User story
As someone who has a proposal
I need a proposal form
So that I can register and edit my proposal, and submit it for review
Overview
This is the front end and backend story for implementing the "Proposal" page. Note the acceptance criteria about tests, and that test driven development is encouraged, with the full End-To-End coverage that includes posting transactions to the smart contnract.
1) Implement Layout:
2) Implement Components
3) Backend (contract):
Acceptance Criteria
[ ] If the user is not the creator or reviewer, then Edit should not be visible.
[ ] If the user is the creator and the post is in draft, the edit button should be available.
[ ] If the user is the creator and the post is in review, the edit button should be disabled.
[ ] If the user is the reviewer and the post is in review, the edit button should be available.
[ ] If the user is the reviewer and the post is in draft, the edit button should be disabled.
[ ] When the user clicks Edit, the page should redirect to ?page=proposal.create&id=${proposal_id}
[ ] When the user clicks Ready for Review, a function call to set_proposal should be called to set the proposal state to "REVIEW" (see back end implementation story)
[ ] As an authenticated user, compose comment should be available
[ ] As an unauthenticated user, compose comment should not be visible
[ ] Verify that there is a form where the proposer can select category, type the title, write a summary and a description, as shown in the Figma illustration
[ ] Verify that the proposal form page has final consent checkboxes as shown in Figma
[ ] Verify that it is possible to provide funding details as specified in Figma
[ ] Verify that after submission, and marked as ready for review, the form is not editable anymore
[ ] Verify that only the proposer can edit the proposal form, both in the UI, and also on the contract side
[ ] Verify that a posted proposal also is a post to SocialDB
[ ] Verify that likes and comments are from SocialDB
[ ] Verify that the UI implementation corresponds to the Figma design
[ ] Verify frontend automatic tests
[ ] Verify backend
[ ] Verify backend automatic tests
[ ] Before merge: Verify that the functionality, test coverage (as shown by the screen recording), is according to expectations of the product owner.