Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jlpereira committed Sep 20, 2019
1 parent 889d87e commit f5df38f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 150 deletions.
99 changes: 0 additions & 99 deletions app/javascript/vue/tasks/nomenclature/stats/components/filter.vue

This file was deleted.

51 changes: 0 additions & 51 deletions app/javascript/vue/tasks/nomenclature/stats/components/table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,6 @@ export default {
}
},
computed: {
rankList () {
return this.$store.getters[GetterNames.GetRanks]
},
taxon: {
get () {
return this.$store.getters[GetterNames.GetTaxon]
Expand Down Expand Up @@ -135,12 +132,6 @@ export default {
}
},
watch: {
rankList: {
handler (newVal) {
this.rankNames = [...new Set(this.getRankNames(newVal))]
},
deep: true
},
tableList: {
handler (newVal) {
this.sorting = true
Expand All @@ -158,51 +149,9 @@ export default {
getBrowseUrl (id) {
return `${RouteNames.BrowseNomenclature}?taxon_name_id=${id}`
},
isFiltered (header) {
return this.selectedFieldSet.set.find((item) => { return header.indexOf(item) > -1 }) || this.ranksSelected.includes(header)
},
resetList () {
this.tableRanks = this.tableList
},
getRankNames (list, nameList = []) {
for (var key in list) {
if (typeof list[key] === 'object') {
this.getRankNames(list[key], nameList)
} else {
if (key === 'name') {
nameList.push(list[key])
}
}
}
return nameList
},
orderRanksTable (list) {
let newDataList = []
let headerRanksOrder = []
let ranksOrder = this.rankNames.filter(rank => {
return list.column_headers.includes(`valid_${rank}`) || list.column_headers.includes(`invalid_${rank}`)
})
ranksOrder.forEach(item => {
headerRanksOrder.push(`valid_${item}`)
headerRanksOrder.push(`invalid_${item}`)
})
ranksOrder = ranksOrder.concat(headerRanksOrder)
ranksOrder = list.column_headers.filter(item => {
return !ranksOrder.includes(item)
}).concat(ranksOrder)
ranksOrder.forEach((rank, index) => {
const indexHeader = list.column_headers.findIndex(item => { return item === rank })
if (indexHeader >= 0) {
list.data.forEach((row, rIndex) => {
newDataList[rIndex] ? newDataList[rIndex].push(row[indexHeader]) : newDataList[rIndex] = [row[indexHeader]]
})
}
})
return { column_headers: ranksOrder, data: newDataList }
},
getValueFromTable (header, rowIndex) {
const otuIndex = this.tableRanks.column_headers.findIndex(item => {
return item === header
Expand Down

0 comments on commit f5df38f

Please sign in to comment.