Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AKPlanning
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KIF
AKPlanning
Commits
15914cf9
Commit
15914cf9
authored
10 months ago
by
Benjamin Hättasch
Committed by
Nadja Geisler
10 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Count only non-resolved CVs in scheduler and CV overview
This implements
#201
parent
53acfb9b
No related branches found
Branches containing commit
No related tags found
1 merge request
!215
Improve scheduling
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
AKScheduling/templates/admin/AKScheduling/constraint_violations.html
+12
-7
12 additions, 7 deletions
...g/templates/admin/AKScheduling/constraint_violations.html
AKScheduling/templates/admin/AKScheduling/scheduling.html
+12
-8
12 additions, 8 deletions
AKScheduling/templates/admin/AKScheduling/scheduling.html
with
24 additions
and
15 deletions
AKScheduling/templates/admin/AKScheduling/constraint_violations.html
+
12
−
7
View file @
15914cf9
...
...
@@ -23,26 +23,31 @@
const
callback_success
=
function
(
response
)
{
let
table_html
=
''
;
let
unresolved_constraint_violations
=
0
;
if
(
response
.
length
>
0
)
{
// Update violation count badge
$
(
'
#violationCountBadge
'
).
html
(
response
.
length
).
removeClass
(
'
bg-success
'
).
addClass
(
'
bg-warning
'
);
// Update violations table
for
(
let
i
=
0
;
i
<
response
.
length
;
i
++
)
{
if
(
response
[
i
].
manually_resolved
)
if
(
response
[
i
].
manually_resolved
)
{
table_html
+=
'
<tr class="text-muted"><td class="nowrap">{% fa6_icon "check" "fas" %}</td>
'
;
else
}
else
{
table_html
+=
'
<tr><td></td>
'
;
unresolved_constraint_violations
++
;
}
table_html
+=
"
<td>
"
+
response
[
i
].
level_display
+
"
</td><td>
"
+
response
[
i
].
type_display
+
"
</td><td>
"
+
response
[
i
].
details
+
"
</td><td class='nowrap'>
"
+
response
[
i
].
timestamp_display
+
"
</td><td><a href='
"
+
response
[
i
].
edit_url
+
"
'><i class='btn btn-primary fa fa-pen'></i></a></td></tr>
"
;
}
}
else
{
// Update violation count badge
$
(
'
#violationCountBadge
'
).
html
(
0
).
removeClass
(
'
bg-warning
'
).
addClass
(
'
bg-success
'
);
// Update violations table
table_html
=
'
<tr class="text-muted"><td colspan="5" class="text-center">{% trans "No violations" %}</td></tr>
'
}
// Update violation count badge
if
(
unresolved_constraint_violations
>
0
)
$
(
'
#violationCountBadge
'
).
html
(
unresolved_constraint_violations
).
removeClass
(
'
bg-success
'
).
addClass
(
'
bg-warning
'
);
else
$
(
'
#violationCountBadge
'
).
html
(
0
).
removeClass
(
'
bg-warning
'
).
addClass
(
'
bg-success
'
);
// Show violation list (potentially empty) in violations table
$
(
'
#violationsTableBody
'
).
html
(
table_html
);
...
...
This diff is collapsed.
Click to expand it.
AKScheduling/templates/admin/AKScheduling/scheduling.html
+
12
−
8
View file @
15914cf9
...
...
@@ -215,20 +215,24 @@
if
(
response
.
length
>
0
)
{
// Update violations table
for
(
let
i
=
0
;
i
<
response
.
length
;
i
++
)
{
if
(
response
[
i
].
manually_resolved
)
table_html
+=
'
<tr class="text-muted"><td class="nowrap">{% fa6_icon "check" "fas" %}
'
;
let
icon_html
=
''
;
let
muted_html
=
''
;
if
(
response
[
i
].
manually_resolved
)
{
icon_html
=
'
{% fa6_icon "check" "fas" %}
'
;
muted_html
=
'
text-muted
'
;
}
else
{
table_html
+=
'
<tr><td>
'
;
unresolved_violations_count
++
;
}
if
(
response
[
i
].
level_display
===
'
{% trans "Violation" %}
'
)
table
_html
+=
'
{% fa6_icon "exclamation-triangle" "fas" %}
'
;
icon
_html
+=
'
{% fa6_icon "exclamation-triangle" "fas" %}
'
;
else
table
_html
+=
'
{% fa6_icon "info-circle" "fas" %}
'
;
icon
_html
+=
'
{% fa6_icon "info-circle" "fas" %}
'
;
table_html
+=
'
<tr class="
'
+
muted_html
+
'
"><td class="nowrap">
'
+
icon_html
;
table_html
+=
"
</td><td class='small'>
"
+
response
[
i
].
type_display
+
"
</td></tr>
"
;
table_html
+=
"
<tr><td colspan='2' class='small'>
"
+
response
[
i
].
details
+
"
</td></tr>
"
table_html
+=
"
<tr
class='
"
+
muted_html
+
"
'
><td colspan='2' class='small'>
"
+
response
[
i
].
details
+
"
</td></tr>
"
}
}
else
{
...
...
@@ -238,7 +242,7 @@
// Update violation count badge
if
(
unresolved_violations_count
>
0
)
$
(
'
#violationCountBadge
'
).
html
(
res
ponse
.
length
).
removeClass
(
'
bg-success
'
).
addClass
(
'
bg-warning
'
);
$
(
'
#violationCountBadge
'
).
html
(
un
res
olved_violations_count
).
removeClass
(
'
bg-success
'
).
addClass
(
'
bg-warning
'
);
else
$
(
'
#violationCountBadge
'
).
html
(
0
).
removeClass
(
'
bg-warning
'
).
addClass
(
'
bg-success
'
);
...
...
@@ -358,7 +362,7 @@
{% endfor %}
</div>
<div
class=
"tab-pane fade"
id=
"violations"
>
<table
class=
"table
table-striped
mt-4 mb-4"
>
<table
class=
"table mt-4 mb-4"
>
<thead>
<tr>
<th>
{% trans "Level" %}
</th>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment