Add "fake" ticket page that DummyPlugin links to when autocreating tickets#1488
Add "fake" ticket page that DummyPlugin links to when autocreating tickets#1488stveit wants to merge 3 commits intoUninett:masterfrom
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1488 +/- ##
==========================================
- Coverage 78.97% 78.93% -0.04%
==========================================
Files 120 120
Lines 5294 5308 +14
==========================================
+ Hits 4181 4190 +9
- Misses 1113 1118 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
bd50714 to
ed7a5a5
Compare
ed7a5a5 to
c83949f
Compare
|
|
"Demo ticket" might be another option for showing that it is not a real ticket |
src/argus/htmx/incident/views.py
Outdated
| from django.utils.timezone import now as tznow | ||
| from django.urls import reverse |
There was a problem hiding this comment.
| from django.utils.timezone import now as tznow | |
| from django.urls import reverse | |
| from django.urls import reverse | |
| from django.utils.timezone import now as tznow |
src/argus/htmx/incident/views.py
Outdated
| from argus.incident.ticket.utils import get_ticket_plugin_path | ||
| from argus.incident.ticket.base import TicketPluginException | ||
| from argus.incident.serializers import IncidentSerializer |
There was a problem hiding this comment.
| from argus.incident.ticket.utils import get_ticket_plugin_path | |
| from argus.incident.ticket.base import TicketPluginException | |
| from argus.incident.serializers import IncidentSerializer | |
| from argus.incident.serializers import IncidentSerializer | |
| from argus.incident.ticket.utils import get_ticket_plugin_path | |
| from argus.incident.ticket.base import TicketPluginException |
| context = IncidentSerializer(incident).data | ||
| argus_url = urljoin( | ||
| getattr(settings, "FRONTEND_URL", ""), | ||
| reverse("htmx:incident-detail", kwargs={"pk": pk}), | ||
| ) | ||
| context["argus_url"] = argus_url |
There was a problem hiding this comment.
I think you could use
Argus/src/argus/incident/ticket/utils.py
Lines 64 to 72 in 4fc7811
| url = urljoin( | ||
| getattr(settings, "FRONTEND_URL", ""), | ||
| reverse("htmx:incident-detail", kwargs={"pk": serialized_incident["pk"]}), | ||
| ) |
There was a problem hiding this comment.
You could move this into the create function, just to keep the concern of "creating a ticket" separate for demonstration purposes on how to write a ticket plugin
| url = urljoin( | ||
| getattr(settings, "FRONTEND_URL", ""), | ||
| reverse("htmx:incident-detail", kwargs={"pk": serialized_incident["pk"]}), | ||
| ) |
There was a problem hiding this comment.
This returns the link to the incident detail page, not the fake ticket system page
| url = urljoin( | |
| getattr(settings, "FRONTEND_URL", ""), | |
| reverse("htmx:incident-detail", kwargs={"pk": serialized_incident["pk"]}), | |
| ) | |
| url = reverse("htmx:fake-ticket", kwargs={"pk": serialized_incident["pk"]}) |
|
I will hand-check this when I can, no merging or approves before that. |



Scope and purpose
Fixes #1194.
Adds a page with information from an incident that kinda simulates what a real ticket could look like on a ticket site (very basic page). DummyPlugin will return a URL to this page when you use the "Create ticket" function.
Example of the basic page (uses a ticket html file that already existed):

The url has the format
/incidents/fake_ticket/<pk>/. I'll happily take suggestions for URL names and such, or potentially other ways to generate a page like this. I kinda just went with the "fake" naming scheme, but maybe it should be called something else. Maybe/incidents/dummy_ticket/<pk>/instead?Contributor Checklist
Every pull request should have this checklist filled out, no matter how small it is.
More information about contributing to Argus can be found in the
Development docs.