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

Community Announcements #603

Merged
merged 30 commits into from
Jan 18, 2024
Merged

Community Announcements #603

merged 30 commits into from
Jan 18, 2024

Conversation

elliotBraem
Copy link
Contributor

@elliotBraem elliotBraem commented Dec 26, 2023

Resolves #540

This pull request holds the full announcements feature with contract changes.

Testnet Preview

Note: If developing, use the command:

npm run dev:testnet -- -a devhub-dev.testnet -c bodevhub.testnet -n dev

TODO

  • Set replacements and track bodevhub.testnet contract
  • Attach 2N when creating a community
  • Creating community should create dedicated account (Successful Transaction)
  • Communities should show when queried
  • Feed module should be adapted to allow an adapter (Successful set_community_socialdb, followed by Successful social.set. Post on main feed)
  • Preview post should show the post item
  • Commenting (does not work in testnet)
  • Test coverage
    • Compose does not show for unauthenticated users
    • Compose shows for admins and moderators users
    • Contract call is correct after commit
    • Comment button is visible
    • Like button is visible
    • A post shows in feed (socialdb query)
    • A comment shows on post in feed (socialdb query)
    • A post shows in feed (near-query-api query)
    • A comment shows on post in feed (near-query-api query)

Acceptance Criteria

DevHub community page requirements:

  • There is a new Discussions tab, which is the second tab that users see when they land on a given community
  • All users see a share update input text area field (e.g. What's happening)
    • The share update input text area field contains all the same elements from the near.org, including supporting markdown, image update, as well as the preview.
    • Users can type their update, preview it, upload image, and click post. Upon post, the update shows up in the discussions section with the user's profile/name.
  • The discussion feed is sorted by latest, but users can also filter by recent comments
  • Users can click Load More to load additional posts
  • Users can interact with discussions posts (like, add comment, copy link to post, or share).
  • Users can report posts (clicking the three dots). Note: @ailisp will handle this part in a separate ticket. Please check in with him.

near.org and near social requirements:

  • Any discussion posted on DevHub communities will also show up on near.org and near social gateways

Backend storage requirements:

  • Use Social DB and follow near.org conventions-

Mockups (See discussion section)

https://www.figma.com/file/6bdpB5IrHztN7E40Rjle1N/Community-Feature%3A-Announcements?type=design&node-id=12%3A6010&mode=design&t=M1jwBsC4NvLrn35p-1

Technical Details

See technical considerations from #540

Megha-Dev-19 and others added 4 commits December 26, 2023 18:23
* fix solution action

* added community announcements UI

* added compose field

* minor css updates

* use community data instead of dummy data

* minor UI updates

* add mentions notifications

* remove unecessary code

* remove hover effect

* sets up for contract, adds admin check

* fix: Fixed deposit error for grant_write_permissions call to social.near (#563)

* add elliot and thomas to CODEOWNERS (#570)

* Fix telegram string and array issue (#571)

* fix solution action

* fix telegram string and array issue

* update telegram_handle

* fix handle and URL

* fix tests

* prettier update

* fix tests

* prettier update

* Bugfix/559 error flashes (#569)

* fix: flash on home screen

* fix: error flash on addon tabs

* fix: telegram bug

* test fix Tile error flash

* fix: catch Tile error flash in every component it is used

* remove console.log

* Playwright test for input validatiojn (#577)

* feature: Added input validation when creating and editing a community (#172)

* feature: Added input validation when creating and editing a community

* feature: Added input validation when creating and editing a community

* feature: Added input validation when creating and editing a community

* test: Added test for input validation

* fix CI (#581)

* fix the test case

* Improve robustness of admin moderator tests

* Clear draft changes after txn is approved (#588)

* remove `onDraftStateChange` from editor

* updated changes

* move txn hash as props

* update draft change

---------

Co-authored-by: Elliot Braem <[email protected]>
Co-authored-by: T guntenaar <[email protected]>
Co-authored-by: Espen Simensen <[email protected]>
@elliotBraem elliotBraem changed the title Community Announcements Page Community Announcements Dec 29, 2023
@elliotBraem
Copy link
Contributor Author

I realize I still need to complete test coverage, otherwise ready for review

@ailisp
Copy link
Collaborator

ailisp commented Jan 5, 2024

@elliotBraem Great job!

@@ -61,16 +61,16 @@ return (
{renderFaces.map((accountId, i) => (
<a
key={i}
href={`#/mob.near/widget/ProfilePage?accountId=${accountId}`}
href={`#/${REPL_MOB}/widget/ProfilePage?accountId=${accountId}`}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice, we can have these testnet widgets now

@ailisp
Copy link
Collaborator

ailisp commented Jan 5, 2024

The code looks good, but I'm unable to see the preview. stucking at this screen:

image

elliotBraem and others added 9 commits January 4, 2024 22:49
* fix solution action

* added required components

* remove unnecessary code

* add hidden btn

* update github configurator

* prettier update

* fix flash error issue

* more improvements

* prettier update

* refactor code

* add comment

* added state for when no configurations exists

* fix pagination error

* handle error

* fix map error

* fix amount issue

* updated UI

* decoupled state

* remove replace fn

* remove title on new column

---------

Co-authored-by: T guntenaar <[email protected]>
* fix solution action

* added required components

* remove unnecessary code

* add hidden btn

* update github configurator

* prettier update

* fix flash error issue

* more improvements

* prettier update

* refactor code

* add comment

* added state for when no configurations exists

* fix pagination error

* handle error

* fix map error

* fix amount issue

* updated UI

* decoupled state

* added styling

* added table view

* updated UI for github

* more style updates

* added border to table

* refactor code

* cleaned UI

* refactor code

* added sorting mechanism

* prettier update

* reduce border size

* remove table and few style updates

* fix normalize error and suggestive UI changes

* fix .map error

* remove table view data
* converts devgovgigs to devhub

* fix: type
Megha-Dev-19 and others added 6 commits January 17, 2024 00:08
* added few announcements tests

* hide card when no posts exists

* add more tests and fix announcements UI

* add feed tests

* fixed UI

* fix community tests
@elliotBraem elliotBraem marked this pull request as ready for review January 17, 2024 23:21
Copy link
Collaborator

@ailisp ailisp left a comment

Choose a reason for hiding this comment

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

This is an awesome work! Thank you

@ailisp ailisp merged commit 43f4646 into main Jan 18, 2024
3 checks passed
@ailisp ailisp deleted the develop branch January 18, 2024 02:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Announcements for community moderators
3 participants