Skip to content

Commit f37432e

Browse files
committed
fix: aggregate visible elements by files
Signed-off-by: Vitor Mattos <[email protected]>
1 parent 507db16 commit f37432e

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

src/components/Request/VisibleElements.vue

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,25 @@ export default {
213213
})
214214
const childFiles = response?.data?.ocs?.data?.data || []
215215
this.document.files = Array.isArray(childFiles) ? childFiles : []
216+
217+
const allVisibleElements = this.aggregateVisibleElementsByFiles(this.document.files)
218+
if (allVisibleElements.length > 0) {
219+
this.document.visibleElements = allVisibleElements
220+
}
221+
},
222+
aggregateVisibleElementsByFiles(files) {
223+
if (!Array.isArray(files) || files.length === 0) {
224+
return []
225+
}
226+
227+
const allVisibleElements = []
228+
files.forEach(file => {
229+
if (Array.isArray(file?.visibleElements)) {
230+
allVisibleElements.push(...file.visibleElements)
231+
}
232+
})
233+
234+
return allVisibleElements
216235
},
217236
buildFilePagesMap() {
218237
this.filePagesMap = {}

0 commit comments

Comments
 (0)