-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to update input source tag in UI #708
Signed-off-by: tdruez <[email protected]>
- Loading branch information
Showing
5 changed files
with
73 additions
and
3 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
39 changes: 39 additions & 0 deletions
39
scanpipe/templates/scanpipe/modals/edit_input_tag_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,39 @@ | ||
<div id="edit-input-tag-modal" class="modal"> | ||
<div class="modal-background"></div> | ||
<form method="post">{% csrf_token %} | ||
<div class="modal-card"> | ||
<header class="modal-card-head"> | ||
<p class="modal-card-title">Edit tag</p> | ||
<button class="delete" type="button" aria-label="close"></button> | ||
</header> | ||
<section class="modal-card-body"> | ||
{{ edit_input_tag_from.input_source_uuid }} | ||
<div class="field"> | ||
<label class="label has-text-weight-semibold" for="{{ edit_input_tag_from.tag.id_for_label }}">{{ edit_input_tag_from.tag.label }}</label> | ||
<div class="control"> | ||
{{ edit_input_tag_from.tag }} | ||
</div> | ||
</div> | ||
</section> | ||
<footer class="modal-card-foot"> | ||
<button id="edit-input-tag-button" name="edit-input-tag-submit" class="button is-link is-no-close" type="submit">Update tag</button> | ||
<button class="button" type="button">Close</button> | ||
</footer> | ||
</div> | ||
</form> | ||
</div> | ||
<script> | ||
document.addEventListener("openModal", function(event) { | ||
const modal_id = event.detail.modal; | ||
if (modal_id !== "edit-input-tag-modal") return; | ||
|
||
const $modal = document.getElementById(modal_id); | ||
const $input_source_uuid_input = $modal.querySelector("input#id_input_source_uuid"); | ||
const $tag_input = $modal.querySelector("input#id_tag"); | ||
|
||
const input_source_uuid = event.detail.$button.dataset.inputSourceUuid; | ||
const tag_value = event.detail.$button.dataset.tagValue; | ||
$input_source_uuid_input.value = input_source_uuid; | ||
$tag_input.value = tag_value; | ||
}); | ||
</script> |
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