From b49dd674b6d83cb054357809d4bc7dbc08d31145 Mon Sep 17 00:00:00 2001 From: Michael Collins <15347726+michaeljcollinsuk@users.noreply.github.com> Date: Mon, 9 Dec 2024 15:18:39 +0000 Subject: [PATCH] Display deprecation message as a warning --- controlpanel/frontend/jinja2/tool-list.html | 4 ++-- .../frontend/static/javascripts/modules/tool-status.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/controlpanel/frontend/jinja2/tool-list.html b/controlpanel/frontend/jinja2/tool-list.html index 3da29b75..c8ac20a9 100644 --- a/controlpanel/frontend/jinja2/tool-list.html +++ b/controlpanel/frontend/jinja2/tool-list.html @@ -113,14 +113,14 @@

{{ tool_info.name }}

-

{{ deployment.deprecated_message }}

+
Warning{{ deployment.deprecated_message }}
{% if deployment and deployment.tool_id == -1 %}

Your previous deployment ({{ deployment.chart_name}}-{{ deployment.chart_version }}: {{ deployment.image_tag }}) - is no longer maintained. You will need to deploy a new version from the dropdown list. + has been retired. You will need to deploy a new version from the dropdown list.

{% endif %} diff --git a/controlpanel/frontend/static/javascripts/modules/tool-status.js b/controlpanel/frontend/static/javascripts/modules/tool-status.js index ddc61b8e..79c1ce9a 100644 --- a/controlpanel/frontend/static/javascripts/modules/tool-status.js +++ b/controlpanel/frontend/static/javascripts/modules/tool-status.js @@ -166,11 +166,11 @@ moj.Modules.toolStatus = { const deprecationMessage = selected.attributes["data-deprecated-message"].value; if (isDeprecated) { - deprecationMessageElement.firstChild.innerText = deprecationMessage; + deprecationMessageElement.lastChild.innerText = deprecationMessage; deprecationMessageElement.classList.remove(this.hidden); } else { deprecationMessageElement.classList.add(this.hidden); - deprecationMessageElement.firstChild.innerText = ""; + deprecationMessageElement.lastChild.innerText = ""; } } };