From a18cfcc80cedba6f22ae548c6adef1bdfb30e361 Mon Sep 17 00:00:00 2001 From: Johanna England Date: Fri, 24 Jan 2025 08:53:16 +0100 Subject: [PATCH 1/3] Upgrade ruff in pre-commit to v0.9.3 https://github.com/astral-sh/ruff/releases/tag/0.9.3 --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4c6f73c51..ebbc91a33 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,7 +8,7 @@ repos: exclude: &exclude_pattern '^changelog.d/' - id: debug-statements - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.9.2 + rev: v0.9.3 hooks: # Run the linter - id: ruff From 24d751cb9372dfa2f923d342834e58056b1da664 Mon Sep 17 00:00:00 2001 From: podliashanyk <60876078+podliashanyk@users.noreply.github.com> Date: Fri, 24 Jan 2025 10:54:29 +0100 Subject: [PATCH 2/3] Add initial and max width to main sections in detailed view (#1155) --- src/argus/htmx/static/styles.css | 12 ++++++++++-- .../templates/htmx/incident/incident_detail.html | 6 +++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/argus/htmx/static/styles.css b/src/argus/htmx/static/styles.css index e8c0cc19a..a5b7e14ff 100644 --- a/src/argus/htmx/static/styles.css +++ b/src/argus/htmx/static/styles.css @@ -4304,6 +4304,10 @@ details.collapse summary::-webkit-details-marker { max-width: 56rem; } +.max-w-\[30\%\] { + max-width: 30%; +} + .max-w-xs { max-width: 20rem; } @@ -4316,12 +4320,16 @@ details.collapse summary::-webkit-details-marker { flex: none; } +.shrink-0 { + flex-shrink: 0; +} + .grow { flex-grow: 1; } -.border-collapse { - border-collapse: collapse; +.basis-1\/4 { + flex-basis: 25%; } .border-separate { diff --git a/src/argus/htmx/templates/htmx/incident/incident_detail.html b/src/argus/htmx/templates/htmx/incident/incident_detail.html index d5ee6d8e9..62ee62f15 100644 --- a/src/argus/htmx/templates/htmx/incident/incident_detail.html +++ b/src/argus/htmx/templates/htmx/incident/incident_detail.html @@ -4,7 +4,7 @@ {% block incident_detail %}

{{ incident.pk }}: {{ incident.description }}

-
+

Level

{{ incident.level }}

@@ -82,7 +82,7 @@

Ticket

-
+

Acknowledgements

{% for ack in incident.acks %} @@ -100,7 +100,7 @@

Acknowledgements

-
+

Related events

{% for event in incident.events.all %} From 7564dae48260059d1d0cc6774acd9edd59c0688a Mon Sep 17 00:00:00 2001 From: podliashanyk <60876078+podliashanyk@users.noreply.github.com> Date: Fri, 24 Jan 2025 11:10:11 +0100 Subject: [PATCH 3/3] More precise error msg on destination delete (#1148) * Show original exception message on destination delete --- changelog.d/1147.fixed.md | 1 + src/argus/htmx/destination/views.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 changelog.d/1147.fixed.md diff --git a/changelog.d/1147.fixed.md b/changelog.d/1147.fixed.md new file mode 100644 index 000000000..e489a6978 --- /dev/null +++ b/changelog.d/1147.fixed.md @@ -0,0 +1 @@ +Show relevant error message on destination delete by passing the original exception message to the UI. diff --git a/src/argus/htmx/destination/views.py b/src/argus/htmx/destination/views.py index fdd4cd489..df3c102c4 100644 --- a/src/argus/htmx/destination/views.py +++ b/src/argus/htmx/destination/views.py @@ -34,8 +34,8 @@ def delete_htmx(request, pk: int) -> HttpResponse: try: medium = api_safely_get_medium_object(destination.media.slug) medium.raise_if_not_deletable(destination) - except NotificationMedium.NotDeletableError: - error_msg = "That destination cannot be deleted." + except NotificationMedium.NotDeletableError as e: + error_msg = " ".join(e.args) else: destination.delete()