mirror of
https://github.com/ansible/awx.git
synced 2026-02-20 12:40:06 -03:30
Merge pull request #3535 from mabashian/job-events-collapse
Fix inert event expand/collapse on refreshed job results
This commit is contained in:
@@ -79,6 +79,10 @@
|
|||||||
&:hover div {
|
&:hover div {
|
||||||
background-color: white;
|
background-color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&--hidden {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&-row--clickable {
|
&-row--clickable {
|
||||||
|
|||||||
@@ -439,7 +439,7 @@ function togglePanelExpand () {
|
|||||||
const iconCollapsed = 'fa-angle-right';
|
const iconCollapsed = 'fa-angle-right';
|
||||||
const iconExpanded = 'fa-angle-down';
|
const iconExpanded = 'fa-angle-down';
|
||||||
const iconSelector = '.at-Stdout-toggle > i';
|
const iconSelector = '.at-Stdout-toggle > i';
|
||||||
const lineCollapsed = 'hidden';
|
const lineCollapsed = 'at-Stdout-row--hidden';
|
||||||
|
|
||||||
function toggleCollapseAll () {
|
function toggleCollapseAll () {
|
||||||
if (scroll.isPaused()) return;
|
if (scroll.isPaused()) return;
|
||||||
@@ -524,11 +524,15 @@ function togglePlayCollapse (uuid) {
|
|||||||
taskIcons.addClass(iconCollapsed);
|
taskIcons.addClass(iconCollapsed);
|
||||||
|
|
||||||
lines.addClass(lineCollapsed);
|
lines.addClass(lineCollapsed);
|
||||||
|
|
||||||
|
descendants
|
||||||
|
.map(item => $(`.child-of-${item}`))
|
||||||
|
.forEach(line => line.addClass(lineCollapsed));
|
||||||
}
|
}
|
||||||
|
|
||||||
descendants
|
descendants
|
||||||
.map(item => render.records[item])
|
.map(item => render.records[item])
|
||||||
.filter(({ name }) => name === EVENT_START_TASK)
|
.filter((descRecord) => descRecord && descRecord.name === EVENT_START_TASK)
|
||||||
.forEach(rec => { render.records[rec.uuid].isCollapsed = true; });
|
.forEach(rec => { render.records[rec.uuid].isCollapsed = true; });
|
||||||
|
|
||||||
render.records[uuid].isCollapsed = !isCollapsed;
|
render.records[uuid].isCollapsed = !isCollapsed;
|
||||||
|
|||||||
@@ -204,7 +204,7 @@ function JobRenderService ($q, $compile, $sce, $window, strings) {
|
|||||||
return { html: '', count: 0 };
|
return { html: '', count: 0 };
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.uuid && this.records[event.uuid]) {
|
if (event.uuid && this.records[event.uuid] && !this.records[event.uuid]._isIncomplete) {
|
||||||
return { html: '', count: 0 };
|
return { html: '', count: 0 };
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -272,6 +272,9 @@ function JobRenderService ($q, $compile, $sce, $window, strings) {
|
|||||||
isClickable = true;
|
isClickable = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const children = (this.records[event.uuid] && this.records[event.uuid].children)
|
||||||
|
? this.records[event.uuid].children : [];
|
||||||
|
|
||||||
const record = {
|
const record = {
|
||||||
isClickable,
|
isClickable,
|
||||||
id: event.id,
|
id: event.id,
|
||||||
@@ -285,6 +288,7 @@ function JobRenderService ($q, $compile, $sce, $window, strings) {
|
|||||||
lineCount: lines.length,
|
lineCount: lines.length,
|
||||||
isCollapsed: this.state.collapseAll,
|
isCollapsed: this.state.collapseAll,
|
||||||
counters: [event.counter],
|
counters: [event.counter],
|
||||||
|
children
|
||||||
};
|
};
|
||||||
|
|
||||||
if (event.parent_uuid) {
|
if (event.parent_uuid) {
|
||||||
@@ -307,12 +311,18 @@ function JobRenderService ($q, $compile, $sce, $window, strings) {
|
|||||||
|
|
||||||
if (event.parent_uuid) {
|
if (event.parent_uuid) {
|
||||||
if (this.records[event.parent_uuid]) {
|
if (this.records[event.parent_uuid]) {
|
||||||
if (this.records[event.parent_uuid].children &&
|
if (this.records[event.parent_uuid].children) {
|
||||||
!this.records[event.parent_uuid].children.includes(event.uuid)) {
|
if (!this.records[event.parent_uuid].children.includes(event.uuid)) {
|
||||||
this.records[event.parent_uuid].children.push(event.uuid);
|
this.records[event.parent_uuid].children.push(event.uuid);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.records[event.parent_uuid].children = [event.uuid];
|
this.records[event.parent_uuid].children = [event.uuid];
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
this.records[event.parent_uuid] = {
|
||||||
|
_isIncomplete: true,
|
||||||
|
children: [event.uuid]
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -397,7 +407,7 @@ function JobRenderService ($q, $compile, $sce, $window, strings) {
|
|||||||
|
|
||||||
if (record && record.isCollapsed) {
|
if (record && record.isCollapsed) {
|
||||||
if (record.level === 3 || record.level === 0) {
|
if (record.level === 3 || record.level === 0) {
|
||||||
classList += ' hidden';
|
classList += ' at-Stdout-row--hidden';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user