-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make it possible to create and select incident filters (#1122)
* Add basic logic to render filter select component * Make it possible to select existing filter (both filter params and the incidents table are updated accordingly to a selected filter) * Persist selected filter in session * Unselect filter when user manually updates filter params * Initialize filter params with chosen filter if selected * Rename sources field (in order to match expected FilterKey and the rest of the filter related classes in Argus) * Add logic to create filter * Make tristates logic compatible with Filter object (so that filter is not created and selected with incorrect tristate selector values) * Align filter selector and filter control button * Align contents of filter-incidents-tab
- Loading branch information
1 parent
249b681
commit 605b38e
Showing
13 changed files
with
220 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Implemented functionality that allows users to create new incident filters, and to select from existing ones via HTMX UI. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<div class="join join-horizontal items-center"> | ||
{% include "htmx/incident/_filter_select.html" %} | ||
{% include "htmx/incident/_filter_create_modal.html" with dialog_id="create-filter-dialog" button_title="Create filter" button_class="btn-sm join-item !rounded-ee-[inherit] !rounded-se-[inherit]" header="Create new filter" explanation="Create new filter from currently selected filter parameters" cancel_text="Cancel" submit_text="Submit" %} | ||
</div> |
17 changes: 17 additions & 0 deletions
17
src/argus/htmx/templates/htmx/incident/_filter_create_modal.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{% extends "htmx/_base_form_modal.html" %} | ||
{% block form_control %} | ||
hx-post="{% url 'htmx:filter-create' %}" | ||
hx-include="#incident-filter-box fieldset, [name='filter_name']" | ||
hx-target="#incident-filter-box" | ||
hx-swap="outerHTML" | ||
{% endblock form_control %} | ||
{% block dialogform %} | ||
<label class="indicator input input-bordered flex items-center gap-2 w-full"> | ||
Filter name | ||
<span class="indicator-item indicator-top indicator-start badge border-none mask mask-circle text-warning text-base">*</span> | ||
<input name="filter_name" | ||
type="text" | ||
required | ||
class="appearance-none grow border-none" /> | ||
</label> | ||
{% endblock dialogform %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<form id="filter-selector-form" | ||
hx-get="{% url 'htmx:filter-list' %}" | ||
hx-trigger="load, unselect" | ||
hx-swap="innerHTML"> | ||
<p>Loading existing filters...</p> | ||
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.