Commit 3d80e0e2 authored by unknown's avatar unknown

add report scrollbar

parent 248e42e6
Pipeline #3289 passed with stage
in 27 seconds
......@@ -260,7 +260,9 @@ export default {
originalFolder: '',
selectedFolder: {},
validateOk: false,
loading: false
loading: false,
windowHeight: '',
displayScrollBar: false
}
},
props: {
......@@ -279,6 +281,11 @@ export default {
id: this.fileIndex++,
bundle: this.newObj(this.uploaded_bundle)
})
// compute history column height
// const el = document.getElementById('history').clientHeight
// this.displayScrollBar = el > this.windowHeight
// store whole fileList, which contains all uploaded bundles into fileStorage
// this.lsw.set(this.filesList, local_storage_target, 4);
this.$emit('empty-uploaded-bundle') // set uploaded_bundle prop to empty object
......@@ -404,9 +411,6 @@ export default {
}
})
}
},
loadAndSync () {
},
synchronizeFromLocalStorage (cached) {
const arr = []
......@@ -552,7 +556,7 @@ export default {
// if (cached && hash) {
// this.synchronizeFromLocalStorage(cached)
// } else {
this.windowHeight = Math.round(window.innerHeight / 100) * 70
this.synchronizeFromBackend()
// }
},
......@@ -589,6 +593,13 @@ export default {
},
outline () {
return this.$q.dark.isActive
},
historyHeight () {
const el = document.getElementById('adas').offsetHeight
return {
maxHeight: 'calc(93vh - ' + el + 'px)'
}
}
}
}
......
......@@ -10,9 +10,9 @@
<div class="q-pr-md">
<q-btn
:color="$q.dark.isActive ? 'blue-2': 'blue'"
outline
@click="editReport"
class=""
outline
size="sm"
style="width: 25px; height: 25px;"
>
......@@ -22,13 +22,13 @@
style="margin-right: 5px"
/>
<q-tooltip
:content-style="$q.dark.isActive ? 'font-size: 13px;' : 'font-size: 13px; border: 1px solid black'"
:offset="[10, 10]"
anchor="center left"
content-class="bg-grey-3 text-black"
self="center right"
transition-hide="jump-left"
transition-show="jump-left"
content-class="bg-grey-3 text-black"
:content-style="$q.dark.isActive ? 'font-size: 13px;' : 'font-size: 13px; border: 1px solid black'"
>
Edit
</q-tooltip>
......@@ -65,26 +65,37 @@
</q-card>
</q-dialog>
<q-separator :color="separator" size="20px" style="height: 1px"/>
<div :style="reportBg" class="text-left " style="font-size: 15px!important;">
<span style="white-space: pre;">
<text-highlight :queries="word">
{{report}}
</text-highlight>
</span>
<div :style="reportBg" class="text-left " style="font-size: 15px!important;" v-if="report">
<div v-if="displayScrollBar">
<span style="white-space: pre;">
<q-scroll-area :style="reportStyle" >
<text-highlight :queries="word" >
{{report}}
</text-highlight>
</q-scroll-area>
</span>
</div>
<div v-else>
<span style="white-space: pre;">
<text-highlight :queries="word" id="withoutScroll">
{{report}}
</text-highlight>
</span>
</div>
<q-separator :color="separator" size="20px" style="height: 1px" v-if="report"/>
</div>
<q-separator :color="separator" size="20px" style="height: 1px" v-if="report"/>
</div>
</div>
</template>
<script>
/*
* --------------------------------------------------------
* Report component
*
* Author: Jakub Dolejsi
* --------------------------------------------------------
*/
* --------------------------------------------------------
* Report component
*
* Author: Jakub Dolejsi
* --------------------------------------------------------
*/
const Environment = require('../config/environment')
......@@ -114,7 +125,8 @@ export default {
editData: '',
target: null,
nodeDragg: null,
word: ''
word: '',
displayScrollBar: false
}
},
watch: {
......@@ -130,6 +142,10 @@ export default {
} else {
this.word = newQueries[1] // otherwise set function name to highlight
}
},
report () {
const lines = this.report.split(/\r\n|\r|\n/).length
this.displayScrollBar = lines > 30
}
},
computed: {
......@@ -157,6 +173,14 @@ export default {
},
outline () {
return this.$q.dark.isActive
},
reportStyle () {
const el = document.getElementById('adas').offsetHeight
return {
height: 'calc(90vh - ' + el + 'px)',
maxWidth: 'inherit'
}
}
},
methods: {
......
......@@ -26,7 +26,7 @@ def step_impl(context):
@then("files are successfully uploaded")
def step_impl(context):
uploaded_content = context.driver.find_element_by_xpath('//*[@id="rep"]/div[2]/span/span').text
uploaded_content = context.driver.find_element_by_xpath('//*[@id="withoutScroll"]').text
context.driver.get(context.driver.current_url)
assert uploaded_content
......@@ -52,7 +52,7 @@ def step_impl(context):
time.sleep(3)
# get report content
uploaded_content = context.driver.find_element_by_xpath('//*[@id="rep"]/div[2]/span/span').text
uploaded_content = context.driver.find_element_by_xpath('//*[@id="withoutScroll"]').text
assert uploaded_content
# pass
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment