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 logo max constraints #2755

Merged
merged 4 commits into from
Jan 25, 2024
Merged

Add logo max constraints #2755

merged 4 commits into from
Jan 25, 2024

Conversation

FrancescoMolinaro
Copy link
Contributor

References
Fixes #2745

Description
To prevent logos to be over sized we added a configuration possibility so that on each environment we can restrict the size to a number of defined pixels.

Instructions for Reviewers
In order to test try creating a new collection or community uploading a very large picture as logo to check if it is rendered within the defined configuration sizes.

Checklist
My PR is small in size (e.g. less than 1,000 lines of code, not including comments & specs/tests), or I have provided reasons as to why that's not possible.
My PR passes ESLint validation using yarn lint
My PR doesn't introduce circular dependencies (verified via yarn check-circ-deps)
My PR includes TypeDoc comments for all new (or modified) public methods and classes. It also includes TypeDoc for large or complex private methods.
My PR passes all specs/tests and includes new/updated specs or tests based on the Code Testing Guide.
If my PR includes new libraries/dependencies (in package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.
If my PR includes new features or configurations, I've provided basic technical documentation in the PR itself.
If my PR fixes an issue ticket, I've linked them together.

@tdonohue tdonohue added bug themes 1 APPROVAL pull request only requires a single approval to merge port to dspace-7_x This PR needs to be ported to `dspace-7_x` branch for next bug-fix release component: Community Community display or editing component: Collection Collection display or editing labels Jan 19, 2024
@tdonohue
Copy link
Member

@alexandrevryghem : If you have a moment, it'd be wonderful if you could review this follow up to #2744... as it seems to provide the changes you requested. If you don't have time, I'll look for a different reviewer. But, I was hopeful it'd be a quick review for you.

@tdonohue tdonohue added this to the 8.0 milestone Jan 19, 2024
Copy link
Contributor

@nwoodward nwoodward left a comment

Choose a reason for hiding this comment

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

👍 Tested and it works well for communities and collections.

Copy link
Member

@alexandrevryghem alexandrevryghem left a comment

Choose a reason for hiding this comment

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

@FrancescoMolinaro: I tested your PR but it doesn't work, I tried uploading an image with a width larger than 500px & one with a height larger than 500px. I added an inline comment with the fix, could you update it & retest it yourself.

.logo-container {
max-width: var(--ds-comcol-logo-max-width);
max-height: var(--ds-comcol-logo-max-height);
}
Copy link
Member

Choose a reason for hiding this comment

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

img {
  max-width: var(--ds-comcol-logo-max-width);
  max-height: var(--ds-comcol-logo-max-height);
  height: auto;
  width: auto;
}

Copy link
Contributor Author

@FrancescoMolinaro FrancescoMolinaro Jan 22, 2024

Choose a reason for hiding this comment

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

Hi @alexandrevryghem , thanks for your feedback.

May I ask you how you performed the tests?
I was not able to reproduce the problem on communities and collections with the current code, the image sizes result capped to 500px and I would like to know how to reproduce the error, so that I can properly check if the current or the proposed change are correctly working.

On my side I have tested the solution creating a new community or collection and uploading a very large image (7724 × 5148 pixels) and it seems fine for both.
Thanks in advance for the clarification.

Copy link
Member

Choose a reason for hiding this comment

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

This is the test image I used:

Results in this:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @alexandrevryghem , thanks again for the feedback and the test scenario.
I ran some tests and actually the image you provided is rendered out of the container.
I have adapted the solution setting the max sizes directly on the img as you suggested, I've just omitted the auto values since they are the default and not necessary.

Copy link
Member

Choose a reason for hiding this comment

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

Hi @FrancescoMolinaro, it's almost good. I also tested it in mobile mode today and I saw that the image overflowed out of the page this can easily be fixed by applying a width: 100%; on the img.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @alexandrevryghem , thanks again for checking, i have adapted the pull request it looks good also on mobile now:

image

Copy link
Member

@alexandrevryghem alexandrevryghem left a comment

Choose a reason for hiding this comment

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

Thanks @FrancescoMolinaro! Everything now seems to work like expected.

@tdonohue
Copy link
Member

As this is now at +2, I'm merging immediately. I'll also auto-port this to 7.6.x as the changes are only in CSS/styling which is compatible with a bug fix release. Thanks @FrancescoMolinaro !

@tdonohue tdonohue merged commit 5b9a98a into DSpace:main Jan 25, 2024
13 checks passed
@dspace-bot
Copy link
Contributor

Successfully created backport PR for dspace-7_x:

@tdonohue tdonohue removed the port to dspace-7_x This PR needs to be ported to `dspace-7_x` branch for next bug-fix release label Jan 25, 2024
4science-it pushed a commit to 4Science/dspace-angular that referenced this pull request Jan 28, 2025
[DSC-2050] fix missing queryParam in url from download metric

Approved-by: Francesco Molinaro
Approved-by: Giuseppe Digilio
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 APPROVAL pull request only requires a single approval to merge bug component: Collection Collection display or editing component: Community Community display or editing themes
Projects
No open projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

Community/Collection logo over sized if image is big
5 participants