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

Add remote Attachment select to Link Dialog #2803

Merged
merged 5 commits into from
Apr 10, 2024
Merged

Add remote Attachment select to Link Dialog #2803

merged 5 commits into from
Apr 10, 2024

Conversation

tvdeyen
Copy link
Member

@tvdeyen tvdeyen commented Mar 25, 2024

What is this pull request for?

Use a RemoteSelect for attachments in the link dialog. This has a positive impact on load times of the link dialog
for sites with lots of attachments.

Checklist

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • I have added tests to cover this change

@tvdeyen tvdeyen added this to the 7.2 milestone Mar 25, 2024
@tvdeyen tvdeyen force-pushed the attachment-select branch from ed01d87 to e738d73 Compare March 25, 2024 15:18
@tvdeyen tvdeyen force-pushed the attachment-select branch from e738d73 to 228ee7c Compare April 2, 2024 15:16
@tvdeyen tvdeyen changed the title Attachment select Add remote Attachment select to Link Dialog Apr 2, 2024
@tvdeyen tvdeyen marked this pull request as ready for review April 2, 2024 15:19
@tvdeyen tvdeyen requested a review from a team as a code owner April 2, 2024 15:19
@tvdeyen tvdeyen self-assigned this Apr 4, 2024
@tvdeyen tvdeyen marked this pull request as draft April 4, 2024 06:42
@tvdeyen tvdeyen force-pushed the attachment-select branch from c767c12 to 9007cbc Compare April 5, 2024 09:13
@tvdeyen tvdeyen marked this pull request as ready for review April 5, 2024 09:14
@tvdeyen tvdeyen removed their assignment Apr 5, 2024
@tvdeyen tvdeyen enabled auto-merge April 5, 2024 09:14
Copy link

codecov bot commented Apr 5, 2024

Codecov Report

Attention: Patch coverage is 95.74468% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 95.84%. Comparing base (17908f9) to head (9e3b319).

Files Patch % Lines
app/components/alchemy/admin/attachment_select.rb 95.00% 1 Missing ⚠️
.../controllers/alchemy/api/attachments_controller.rb 95.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2803      +/-   ##
==========================================
- Coverage   95.84%   95.84%   -0.01%     
==========================================
  Files         225      227       +2     
  Lines        6143     6185      +42     
==========================================
+ Hits         5888     5928      +40     
- Misses        255      257       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

tvdeyen added 5 commits April 10, 2024 13:15
Instead of a custom event for each subclass of
`Alchemy.RemoteSelect` we fire a custom
`Alchemy.RemoteSelect.Change` event.

This event then has a `added` and `removed` information
on the `detail` object that can be used to act accordingly.
The page select and attachment select allow to clear
the selection. In this case we should correctly remove
the link.
We need to trick a bit with the width here, because
the flex container is calculating 4 items, while we have
5 buttons.
@tvdeyen tvdeyen force-pushed the attachment-select branch from 9007cbc to 9e3b319 Compare April 10, 2024 11:16
@tvdeyen tvdeyen disabled auto-merge April 10, 2024 12:35
@tvdeyen tvdeyen merged commit 099d488 into main Apr 10, 2024
33 of 35 checks passed
@tvdeyen tvdeyen deleted the attachment-select branch April 10, 2024 14:38
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.

1 participant