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

feat(boards2): implement next boards version - WIP #2901

Draft
wants to merge 53 commits into
base: master
Choose a base branch
from

Conversation

ilgooz
Copy link
Contributor

@ilgooz ilgooz commented Oct 4, 2024

No description provided.

@github-actions github-actions bot added the 🧾 package/realm Tag used for new Realms or Packages. label Oct 4, 2024
@ilgooz ilgooz changed the title wip(boardsv2): add boardsv2 feat(boardsv2): add boardsv2 - WIP Oct 4, 2024
Copy link

codecov bot commented Oct 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@ilgooz ilgooz force-pushed the devx/feature/boardsv2 branch from be049e7 to baf9821 Compare October 4, 2024 13:04
Boards v2 package and realm API experimentation

<details><summary>Contributors' checklist...</summary>

- [ ] Added new tests, or not needed, or not feasible
- [ ] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [ ] Updated the official documentation or not needed
- [ ] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [ ] Added references to related issues and PRs
- [ ] Provided any useful hints for running manual tests
- [ ] Added new benchmarks to [generated
graphs](https://gnoland.github.io/benchmarks), if any. More info
[here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md).
</details>

---------

Co-authored-by: İlker G. Öztürk <[email protected]>
Co-authored-by: Denys Sedchenko <[email protected]>
@jeronimoalbi jeronimoalbi changed the title feat(boardsv2): add boardsv2 - WIP feat(boards2): implement next boards version - WIP Nov 11, 2024
@jeronimoalbi jeronimoalbi self-assigned this Nov 11, 2024
jeronimoalbi and others added 11 commits November 11, 2024 15:12
We won't continue in that direction right now, the current objective is
to finish new features for `boards` which will become `boards2`.
Co-authored-by: Manfred Touron <[email protected]>
Co-authored-by: Jae Kwon <[email protected]>
Co-authored-by: Jeff Thompson <[email protected]>
Co-authored-by: Hariom Verma <[email protected]>
Co-authored-by: Morgan <[email protected]>
Co-authored-by: Albert Le Batteux <[email protected]>
Co-authored-by: Guilhem Fanton <[email protected]>
Co-authored-by: Blake <[email protected]>
Co-authored-by: Jeff Thompson <[email protected]>
Co-authored-by: Leon Hudak <[email protected]>
Co-authored-by: Poroburu <[email protected]>
Co-authored-by: deelawn <[email protected]>
Co-authored-by: grepsuzette <[email protected]>
Co-authored-by: jon roethke <[email protected]>
Refactors the code copied from `gno.land/r/demo/boards` to simplify it
and to have it ready before introducing the new features.
Use correct package name for boards2 realm.
Related to #3139

Permissioner interface is defined based on Jae's idea to handle permissioned tasks.
---------

Co-authored-by: Jae Kwon <[email protected]>
@Gno2D2
Copy link
Collaborator

Gno2D2 commented Nov 29, 2024

🛠 PR Checks Summary

All Automated Checks passed. ✅

Manual Checks (for Reviewers):
  • IGNORE the bot requirements for this PR (force green CI check) (checked by @jeronimoalbi)
Read More

🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers.

✅ Automated Checks (for Contributors):

No automated checks match this pull request.

☑️ Contributor Actions:
  1. Fix any issues flagged by automated checks.
  2. Follow the Contributor Checklist to ensure your PR is ready for review.
    • Add new tests, or document why they are unnecessary.
    • Provide clear examples/screenshots, if necessary.
    • Update documentation, if required.
    • Ensure no breaking changes, or include BREAKING CHANGE notes.
    • Link related issues/PRs, where applicable.
☑️ Reviewer Actions:
  1. Complete manual checks for the PR, including the guidelines and additional checks if applicable.
📚 Resources:
Debug
Manual Checks
**IGNORE** the bot requirements for this PR (force green CI check)

If

🟢 Condition met
└── 🟢 On every pull request

Can be checked by

  • Any user with comment edit permission

jeronimoalbi and others added 30 commits January 7, 2025 19:03
## Description

This PR adjusts display of flagged comments with flow defined in #3480.

Now, flagged comments will be hidden but children replies still be
visible.

### Demo


![image](https://github.com/user-attachments/assets/78dae965-bed7-4fd8-a52e-404afa8bf20a)

> [!IMPORTANT]
> The "comment is hidden" message is actually italic, but [italic font
styles are broken](#3535) in Gnoweb

## Other Changes
In addition to that:

* Fixed Reply URL arguments.
* Added Flag thread/comment URL.
* Started adopting `strings.Builder` instead of string concatenation.

CC @jeronimoalbi 

Closes: #3480
…lies (#3606)

Replies are soft deleted by replacing their body with a deleted message
to keep sub comments

Related to
#3583 (review)
The PR simplifies the implementation of a couple public boards2 realm
functions and change them to be up to date with the latest permission
handling changes.

These changes also allow a creator of a thread to edit it without
permission, or creators of a reply/comment to delete the reply.

Also creators of a thread are allowed to delete it for now. This
behavior might change in future PRs.
Implement pagination for boards, threads and replies.

Closes #3200, #3539

CC @jeronimoalbi @salmad3
Add a missing filetests for `CreateBoard()` function.

Related to #3623 

This covers all tests for the function:
- Creation success
- Fail w/ empty board name
- Fail w/ existing board name
- Fail w/ non user call
- Fail w/ an address as board name
- Fail because name is registered and not owned in `users` realm
- Fail w/ short name
- Creation success with owned name registered in `users` realm
- Fail for non realm DAO member
Add a missing filetests for `RenameBoard()` function.

Related to #3623.

This covers all tests for the function:
- Rename success by default board owner
- Fail w/ empty board name
- Fail w/ existing board name
- Fail when renaming unexisting board
- Fail w/ an address as board name
- Rename success by another board owner
- Fail because name is registered and not owned in `users` realm
- Fail w/ short name
- Rename success with owned name registered in `users` realm
- Fail for non board DAO member
Add missing filetests for `InviteMember()` function.

Related to #3623

This covers all tests for the function:
- Invite to realm success
- Fail when admin invites a new realm owner
- Success when admin invites a new realm admin
- Fail w/ invalid invite role
- Invite to board success
- Fail w/ existing user
- Fail for non member (unauthorized)
Add missing filetests for `RemoveMember()` function.

Related to #3623

This covers all tests for the function:
- Success removing a realm member
- Fail for non member (unauthorized)
- Fail w/ unexisting user
Add missing filetests for `ChangeMemberRole()` function.

Related to #3623

This covers all tests for the function:
- Successful role change for realm member
- Successful role change for board member
- Fail for an admin removing an owner role
- Fail for an admin changing a role to owner
- Success changing a role to owner by another owner
- Fail when role doesn't exist
- Fail when user is not found
- Fail for non member (unauthorized)
Add missing filetests for`HasMemberRole()` and `IsMember()` functions.

Related to #3623

This covers all tests for the function:
- Successfully check valid member
- Successfully check non member
Add missing filetests for `CreateThread()` function.

Related to #3623

This covers all tests for the function:
- Successfully create a thread
- Fail because board is not found
- Fail because user has no permission to create a thread
- Fail w/ empty title
- Fail w/ empty body
Add missing filetests for `EditThread()` function.

Related to #3623

This covers all tests for the function:
- Successfully edit a thread
- Fail w/ empty title
- Fail w/ empty body
- Fail because board is not found
- Fail because thread is not found
- Fail because user has no permission to edit a thread
- Successfully edit a thread using a user with permission to delete
Add missing filetests for `FlagThread()` function.

Related to #3623

This covers all tests for the function:
- Successfully flag a thread
- Fail because board is not found
- Fail because user has no permission to flag a thread
- Fail because thread is not found
- Fail because default flag threshold of 1 is exceeded
- Successfully flag a thread using a user with permission to flag
Add missing filetests for `DeleteThread()` function.

Related to #3623

This covers all tests for the function:
- Successfully delete a thread
- Fail because board is not found
- Fail because thread is not found
- Fail because user has no permission to delete a thread
- Successfully delete a thread using a user with permission to delete
Add missing filetests for `GetBoardIDFromName()` function.

Related to #3623

This covers all tests for the function:
- Successfully get ID by name
- Fail because name is not found
Add missing filetests for `CreateReply()` function.

Related to #3623

This covers all tests for the function:
- Successfully create a reply
- Fail because board is not found
- Fail because thread is not found
- Fail because parent reply is not found
- Fail because thread is hidden
- Fail creating sub-reply because thread is hidden
- Fail creating sub-reply because parent reply is hidden
- Fail because user has no permission to create a reply
- Fail w/ empty body
- Successfully create a sub-reply
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧾 package/realm Tag used for new Realms or Packages.
Projects
Status: No status
Status: Triage
Development

Successfully merging this pull request may close these issues.

4 participants