summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/jobs
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-09-24 09:06:04 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-09-24 09:06:04 +0000
commitbc89882970d6a14b1f72eb9c715fae90b26d066c (patch)
treef5cb59d5130d7585980eb39437071e07ebc12f87 /app/assets/javascripts/jobs
parent4a45a787703cb78c6101750cfbdc9f656b934b42 (diff)
downloadgitlab-ce-bc89882970d6a14b1f72eb9c715fae90b26d066c.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/jobs')
-rw-r--r--app/assets/javascripts/jobs/components/log/collapsible_section.vue16
-rw-r--r--app/assets/javascripts/jobs/components/log/line.vue2
-rw-r--r--app/assets/javascripts/jobs/store/utils.js22
3 files changed, 23 insertions, 17 deletions
diff --git a/app/assets/javascripts/jobs/components/log/collapsible_section.vue b/app/assets/javascripts/jobs/components/log/collapsible_section.vue
index 7c0deb08488..0c7b78a3da7 100644
--- a/app/assets/javascripts/jobs/components/log/collapsible_section.vue
+++ b/app/assets/javascripts/jobs/components/log/collapsible_section.vue
@@ -40,16 +40,12 @@ export default {
@toggleLine="handleOnClickCollapsibleLine(section)"
/>
<template v-if="!section.isClosed">
- <template v-for="line in section.lines">
- <collpasible-log-section
- v-if="line.isHeader"
- :key="`collapsible-nested-${line.offset}`"
- :section="line"
- :trace-endpoint="traceEndpoint"
- @toggleLine="handleOnClickCollapsibleLine"
- />
- <log-line v-else :key="line.offset" :line="line" :path="traceEndpoint" />
- </template>
+ <log-line
+ v-for="line in section.lines"
+ :key="line.offset"
+ :line="line"
+ :path="traceEndpoint"
+ />
</template>
</div>
</template>
diff --git a/app/assets/javascripts/jobs/components/log/line.vue b/app/assets/javascripts/jobs/components/log/line.vue
index 4e09c85b25a..9fae541125e 100644
--- a/app/assets/javascripts/jobs/components/log/line.vue
+++ b/app/assets/javascripts/jobs/components/log/line.vue
@@ -19,7 +19,7 @@ export default {
</script>
<template>
- <div class="log-line">
+ <div class="js-line log-line">
<line-number :line-number="line.lineNumber" :path="path" />
<span v-for="(content, i) in line.content" :key="i" :class="content.style">{{
content.text
diff --git a/app/assets/javascripts/jobs/store/utils.js b/app/assets/javascripts/jobs/store/utils.js
index 261ec90cd12..3838c759354 100644
--- a/app/assets/javascripts/jobs/store/utils.js
+++ b/app/assets/javascripts/jobs/store/utils.js
@@ -9,6 +9,21 @@ export const parseLine = (line = {}, lineNumber) => ({
});
/**
+ * When a line has `section_header` set to true, we create a new
+ * structure to allow to nest the lines that belong to the
+ * collpasible section
+ *
+ * @param Object line
+ * @param Number lineNumber
+ */
+export const parseHeaderLine = (line = {}, lineNumber) => ({
+ isClosed: true,
+ isHeader: true,
+ line: parseLine(line, lineNumber),
+ lines: [],
+});
+
+/**
* Parses the job log content into a structure usable by the template
*
* For collaspible lines (section_header = true):
@@ -28,12 +43,7 @@ export const logLinesParser = (lines = [], lineNumberStart) =>
const last = acc[acc.length - 1];
if (line.section_header) {
- acc.push({
- isClosed: true,
- isHeader: true,
- line: parseLine(line, lineNumber),
- lines: [],
- });
+ acc.push(parseHeaderLine(line, lineNumber));
} else if (acc.length && last.isHeader && !line.section_duration && line.content.length) {
last.lines.push(parseLine(line, lineNumber));
} else if (acc.length && last.isHeader && line.section_duration) {