Skip to content

Commit 59e4863

Browse files
committed
add popovers
Signed-off-by: Markus Blaschke <mblaschke82@gmail.com>
1 parent c675f2d commit 59e4863

File tree

2 files changed

+33
-5
lines changed

2 files changed

+33
-5
lines changed

templates/report.html

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,11 @@ <h2>{{if $root.RequestReport}}{{ $root.ReportTitle }} report "{{ $root.RequestRe
138138
<div class="row g-6">
139139
<div class="col-md-6">
140140
<div class="input-group mb-3">
141-
<label class="input-group-text" for="reportFilterStatus">Status</label>
141+
<label class="input-group-text" for="reportFilterStatus">
142+
<span class="d-inline-block" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-title="Validation status" data-bs-content="Filter results by validation status">
143+
Status
144+
</span>
145+
</label>
142146
<select class="form-select" id="reportFilterStatus" data-report-refresh="true" data-report-param="status" data-default="deny">
143147
<option value="">all</option>
144148
<option value="deny" selected>deny</option>
@@ -148,25 +152,41 @@ <h2>{{if $root.RequestReport}}{{ $root.ReportTitle }} report "{{ $root.RequestRe
148152
</div>
149153

150154
<div class="input-group mb-3">
151-
<span class="input-group-text" id="reportFilterResourceLabel">Resource</span>
155+
<label class="input-group-text" id="reportFilterResourceLabel">
156+
<span class="d-inline-block" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-title="Resource filters" data-bs-content="One filter per line, formats:\n\nfilter by content (contains):\n<strong>field: value</strong>\n\nregexp filter:\n<strong>field: /regexp/">
157+
Resource
158+
</span>
159+
</label>
152160
<textarea class="form-control" id="reportFilterResource" data-report-filter="resource" aria-label="Resource" aria-describedby="reportFilterResourceLabel" rows="2" data-default="{{ $root.ReportConfig.Report.Filter.Resource }}"></textarea>
153161
</div>
154162

155163
<div class="input-group mb-3">
156-
<span class="input-group-text" id="reportFilterRuleLabel">Rule</span>
164+
<label class="input-group-text" id="reportFilterRuleLabel">
165+
<span class="d-inline-block" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-title="Rule filter" data-bs-content="Filters results by validation rule">
166+
Rule
167+
</span>
168+
</label>
157169
<input type="text" class="form-control" id="reportFilterRuleSelector">
158170
<input type="text" class="form-control hidden" id="reportFilterRule" data-report-filter="rule" aria-label="Rule" aria-describedby="reportFilterRuleLabel" data-default="{{ $root.ReportConfig.Report.Filter.Rule }}">
159171
</div>
160172
</div>
161173

162174
<div class="col-md-6">
163175
<div class="input-group mb-3">
164-
<span class="input-group-text" id="reportGroupByLabel">groupBy</span>
176+
<label class="input-group-text" id="reportGroupByLabel">
177+
<span class="d-inline-block" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-title="Grouping" data-bs-content="Groups resources by fieldname">
178+
groupBy
179+
</span>
180+
</label>
165181
<input type="text" class="form-control" id="reportGroupBy" data-report-refresh="true" data-report-param="groupBy" aria-label="groupBy" aria-describedby="reportGroupByLabel" data-default="{{ $root.ReportConfig.Report.Settings.GroupBy }}">
166182
</div>
167183

168184
<div class="input-group mb-3">
169-
<span class="input-group-text" id="reportFieldsLabel">Fields</span>
185+
<label class="input-group-text" id="reportFieldsLabel">
186+
<span class="d-inline-block" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-title="Fields" data-bs-content="Selects fields which should be visible in results, similar results are grouped (see count value)">
187+
Fields
188+
</span>
189+
</label>
170190
<textarea class="form-control" id="reportFields" data-report-refresh="true" data-report-param="fields" aria-label="Fields" rows="4" data-default="{{ $root.ReportConfig.Report.Settings.Fields }}"></textarea>
171191
</div>
172192
</div>

templates/report.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,4 +417,12 @@ table.on("tableBuilt", () => {
417417
formSaveToHash();
418418
refreshTableFilter();
419419
});
420+
421+
const popoverTriggerList = document.querySelectorAll('[data-bs-toggle="popover"]');
422+
const popoverList = [...popoverTriggerList].map(popoverTriggerEl => new bootstrap.Popover(popoverTriggerEl, {
423+
container: 'body',
424+
html: true,
425+
content: $(popoverTriggerEl).data('bs-content').replaceAll("\\n", "<br>"),
426+
}));
427+
420428
});

0 commit comments

Comments
 (0)