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 HTML support on system-wide alert (Fixes #3019) #3028

Merged
merged 2 commits into from
May 14, 2024

Conversation

abelgomez
Copy link
Contributor

@abelgomez abelgomez commented May 10, 2024

References

Description

Adds HTML support to the system-wide alert banner.

Instructions for Reviewers

The commit only includes two simple changes, as explained in #3019 (comment).

In a second commit (I did it in a separate commit to ease the PR review), I also reformatted the code of the HTML templates, since the indenting was a bit mangled.

To test, log in as an admin, and set a system-wide alert message with HTML code in it.

Some examples of the result:

imagen

imagen

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.

@abelgomez abelgomez changed the title Issue 3019 Add HTML support on system-wide-alert (Fixes #3019) May 10, 2024
@abelgomez abelgomez changed the title Add HTML support on system-wide-alert (Fixes #3019) Add HTML support on system-wide alert (Fixes #3019) May 10, 2024
@tdonohue tdonohue added improvement 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 labels May 10, 2024
@AgustinAlfieri
Copy link

Just tested this, I can add HTML to the system-wide alert banner but It gave me problems trying to set up a timer:
image


The issue persists even if I don't use HTML on the form:

image


If I roll back the changes, the timer works just fine:

image

@abelgomez
Copy link
Contributor Author

Can anybody else try this PR?

I cannot reproduce the misbehavior with the timer... 😞

imagen

@AgustinAlfieri
Copy link

Just in case this is why, I tested using yarn start:dev not by doing the yarn build.

@abelgomez
Copy link
Contributor Author

I also tested this PR in the dev environment with yarn start:dev using the main branch of DSpace 8.

But I deployed this patch in a stable server running DSpace 7.6/7.6.1 months ago without issues: https://biblioteca.sistedes.es

@AgustinAlfieri
Copy link

Just re-tested, it works perfectly. Sorry I had something else generating the problem.

@abelgomez
Copy link
Contributor Author

No worries! Great! ☺🤗

Copy link
Member

@tdonohue tdonohue left a comment

Choose a reason for hiding this comment

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

👍 Thanks @abelgomez ! Tested this today and it works well. It's a very simple change (basically a "one-liner" style bug fix), so I'm going to also port this back to 7.x

@tdonohue tdonohue added this to the 8.0 milestone May 14, 2024
@tdonohue tdonohue merged commit 74f89f2 into DSpace:main May 14, 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 May 14, 2024
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 improvement
Projects
No open projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

HTML support on system-wide-alert
4 participants