Skip to content

Commit

Permalink
internal/gaby: clear old result when new query is made
Browse files Browse the repository at this point in the history
Clear old results/errors on submit of a new query for the Gaby
webpages.

Updates #55

Change-Id: Iaa2662a7c7fd11b14ebcd661494ee6ed1c6cf617
Reviewed-on: https://go-review.googlesource.com/c/oscar/+/631655
Reviewed-by: Jonathan Amsterdam <jba@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Tatiana Bradley <tatianabradley@google.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
  • Loading branch information
tatianab authored and gopherbot committed Nov 25, 2024
1 parent 338d69c commit a9be3a3
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion internal/gaby/tmpl/actionlog.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ license that can be found in the LICENSE file.
</script>

{{if .StartTime}}
<div class="section">
<div class="section" id="result">
<h2>Action Log from {{.StartTime}} to {{.EndTime}}</h2>

{{with .Entries}}
Expand Down
1 change: 1 addition & 0 deletions internal/gaby/tmpl/common.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ Templates in this file are defined on type [CommonPage].
const form = document.getElementById("form");
form.addEventListener("submit", (event) => {
document.getElementById("working").innerHTML = "<p style='margin-top:1rem'>Working...</p>"
document.getElementById("result").innerHTML = ""
})
</script>
{{end}}
Expand Down
2 changes: 1 addition & 1 deletion internal/gaby/tmpl/dbviewpage.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ license that can be found in the LICENSE file.
<body>
{{template "header" .}}

<div class="section">
<div class="section" id="result">
{{- with .Error -}}
<p>Error: {{.Error}}</p>
{{- else with .Result -}}
Expand Down
2 changes: 1 addition & 1 deletion internal/gaby/tmpl/overviewpage.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function togglePrompt() {
{{end}}

{{define "overview-result"}}
<div class="section">
<div class="section" id="result">
{{- with .Error -}}
<p>Error: {{.Error}}</p>
{{- else with .Result -}}
Expand Down
4 changes: 2 additions & 2 deletions internal/gaby/tmpl/rulespage.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ license that can be found in the LICENSE file.
<body>
{{template "header" .}}

<div class="section">
{{- with .Error -}}ß
<div class="section" id="result">
{{- with .Error -}}
<p>Error: {{.}}</p>
{{- else with .Result -}}
<div class="metadata">
Expand Down
2 changes: 1 addition & 1 deletion internal/gaby/tmpl/searchpage.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ license that can be found in the LICENSE file.
</html>

{{define "search-result"}}
<div class="section">
<div class="section" id="result">
{{- with .Error -}}
<p>Error: {{.}}</p>
{{- else with .Results -}}
Expand Down

0 comments on commit a9be3a3

Please sign in to comment.