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 a scrollbar to the duplicate import modal #71

Conversation

borelkoumo
Copy link
Contributor

@borelkoumo borelkoumo commented Jul 24, 2024

Summary

The apostrophe duplicate imports modal component displays a table of all duplicated docs, that can overflow the visible area when there are too many duplicates (> 50). To improve usability, I added a vertical scrollbar with a maximum height of 50vh to the table body and introduce a sticky thead to keep the table headers visible while scrolling.

I also fixed the type column values: Previously, only 'Page' was displayed, regardless of the actual document type. With this fix, the correct document type will now be displayed in the type column, ensuring accurate representation of each document's type.

What are the specific steps to test this change?

  1. Run the website and log in as an admin
  2. Create a page with many images (let's say more than 50). Export that page
  3. Import the archive generated
  4. You should now see a scrollbar in the duplicates section (the entire modal content is always visible), and correct document type displayed

What kind of change does this PR introduce?

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Build-related changes
  • Other

Make sure the PR fulfills these requirements:

  • It includes a) the existing issue ID being resolved, b) a convincing reason for adding this feature, or c) a clear description of the bug it resolves
  • The changelog is updated
  • Related documentation has been updated
  • Related tests have been updated

If adding a new feature without an already open issue, it's best to open a feature request issue first and wait for approval before working on it.

Other information:

borelkoumo

This comment was marked as resolved.

@ETLaurent ETLaurent self-requested a review July 25, 2024 14:36
Copy link
Contributor

@ETLaurent ETLaurent 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 good! I tested it and it looks great.
Thanks a lot for your contribution.
Just a few things to change.

@@ -323,6 +325,15 @@ export default {
display: flex;
flex-direction: column;
align-items: baseline;
max-height: 50vh;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
max-height: 50vh;
max-height: 210px;

In order to keep the same max-height as the related types modal

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Change done!

@@ -21,31 +21,33 @@

<div class="apos-import-duplicate__section">
<table class="apos-table">
<thead>
Copy link
Contributor

Choose a reason for hiding this comment

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

Good idea 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks

Comment on lines 333 to 336
position: sticky;
top: 0;
z-index: 1;
backgroud-color: var(--a-base-10);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
position: sticky;
top: 0;
z-index: 1;
backgroud-color: var(--a-base-10);
position: sticky;
top: 0;
background-color: var(--a-background-primary);
  • sticky, good stuff.
  • no need for z-index it appears
  • please change background color to white (var(--a-background-primary)) and fix typo

Copy link
Contributor Author

Choose a reason for hiding this comment

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

DOne!

CHANGELOG.md Outdated
@@ -1,5 +1,11 @@
# Changelog

## 2.3.0 (2024-07-24)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
## 2.3.0 (2024-07-24)
## UNRELEASED

We will set the version and the date when we will release the module

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

@@ -243,7 +245,7 @@ export default {
: this.duplicatedDocs.map(({ aposDocId }) => aposDocId);
},
docLabel(doc) {
const moduleOptions = apos.modules[this.type];
const moduleOptions = apos.modules[doc.type];
Copy link
Contributor

Choose a reason for hiding this comment

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

yes! 👌

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks

@borelkoumo
Copy link
Contributor Author

Changes are done now.
You can review once more. Thanks!

Copy link
Contributor

@ETLaurent ETLaurent left a comment

Choose a reason for hiding this comment

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

@ETLaurent ETLaurent merged commit 19adf1b into apostrophecms:main Jul 27, 2024
9 checks passed
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