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(backend): function to add hidden dapps #3777

Merged
merged 58 commits into from
Dec 4, 2024

Conversation

AntonioVentilii
Copy link
Collaborator

@AntonioVentilii AntonioVentilii commented Nov 28, 2024

Motivation

We want to add an endpoint to add dApps that the user wants hidden in the dApps Carousel.

Changes

  • Add function add_hidden_dapp_id to user_profile implementation.
  • Create error types and returns types
  • Propagate the function up to open endpoint in lib

Tests

Included tests for new endpoint.

@AntonioVentilii AntonioVentilii enabled auto-merge (squash) December 4, 2024 13:19
Copy link
Member

@bitdivine bitdivine left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

#[update(guard = "may_write_user_data")]
pub fn add_user_hidden_dapp_id(
request: AddHiddenDappIdRequest,
) -> Result<(), AddDappSettingsError> {
Copy link
Member

Choose a reason for hiding this comment

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

Sounds like a good idea. :-) But doesn't have to be in this PR.

src/backend/src/user_profile.rs Show resolved Hide resolved
src/shared/src/impls.rs Show resolved Hide resolved
@AntonioVentilii AntonioVentilii enabled auto-merge (squash) December 4, 2024 14:44
@AntonioVentilii AntonioVentilii merged commit 4e35f00 into main Dec 4, 2024
26 checks passed
@AntonioVentilii AntonioVentilii deleted the feat(backend)/function-to-add-hidden-dapps branch December 4, 2024 15:20
AntonioVentilii added a commit that referenced this pull request Dec 5, 2024
# Motivation

Thanks to PR #3777 , we add `addUserHiddenDappId` to the methods of
class `BackendCanister`.
AntonioVentilii added a commit that referenced this pull request Dec 6, 2024
# Motivation

We add a close button to the carousel slides to hide them.

# Note

This affects only current navigation. Persisting that will be applied in
another PR, using the backend method `add_hidden_dapp_id` introduced
with PR #3777

# Changes

- Add button close to component `DappsCarouselSlide`.
- Bubble event `icCloseCarouselSlide` that provides the dApp that is
being closed.
- Create function in `DappsCarousel` to manage the event and remove the
correspondent slide.
- Adjust `Carousel` function removeSlide to refresh all needed
variables.
- Add transitions.

# Tests



https://github.com/user-attachments/assets/873fa742-5307-48a2-b81a-2276e54afdc7
AntonioVentilii added a commit that referenced this pull request Dec 6, 2024
# Motivation

We use the backend method `add_hidden_dapp_id` introduced with PR #3777
, to save the hidden slides/dApps in the backend.

# Changes

- Add event `oisyRefreshUserProfile` to refresh the user profile in
`LoaderUserProfile`. It is useful to emit it when we know that we change
the user profile.
- Add method `add_hidden_dapp_id` in `DappCarousel` when closing a
slide.

# Tests



https://github.com/user-attachments/assets/c849ed22-dfa3-4f51-90e8-5d6a446b5dfb

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
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.

2 participants