getodk / getodk/central

Show message in news.html if Central is out-of-date

Open
#855 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
226
Forks
235
Avg merge
2d 22h
Merged PRs (30d)
19

Description

Now that #774 is in place, an admin user on v2024.3 or later will be informed if their version of Central is out-of-date. This is done based on the year part of their Central version tag. For example, if a user is using v2024.3 in 2026 (2024 from v2024.3 + 2 years), they will see a message.

However, this will only happen for users on v2024.3 or later. If a user is on an earlier version, their version of Central won't have the new functionality to inform them about their version. One idea we [discussed](https://github.com/getodk/central/issues/774#issuecomment-2466307676) in #744 was to show a message in news.html if a user's version of Central is out-of-date. If we did that, we would be able to show a short message to users on a version earlier than v2024.3.

The only thing that would need to change for this is news.html. As part of #744, Central v2024.3 and later now pass the query parameter outdatedVersionWarning=false to news.html. news.html could look for this query parameter, and if it doesn't see it, show a message. We would modify news.html only once the last version before v2024.3 (i.e., v2024.2) is considered out-of-date enough to warrant messaging users. (In two releases? In a year?)

It'd be nice to be able to give users the ability to dismiss the message in news.html, as we did in #744. There are two things to consider along those lines:

- Old versions of Central won't have [user preferences](https://github.com/getodk/central/issues/689), and even if they did, the iframe isn't able to send authenticated requests to Backend. If the user dismisses the message, we would need to persist that preference some other way (in local storage?).
- news.html has limited styles. Because it's loaded separately from Frontend, we want to avoid downloading all our styles twice. Currently, news.html doesn't have styles for buttons.

Note that the size of the news iframe has varied over time:

- Prior to v1.5, the iframe was the full width of the page.
- From v1.5–v2023.5 (7 releases), the width of the iframe was 300px, due to getodk/central-frontend#661.
- Since v2024.1, the width of the iframe has been a little less than half the width of the page.
- I think the height has been a consistent 40px. I also think the iframe will scroll if it doesn't fit within the 40px (not totally sure).

Given the limited size of the iframe, we should probably limit the length of the message that we show to users.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.