SelectionMixin.js: fix whitespace to eslint settings

This commit is contained in:
Seth Ladygo
2019-05-03 00:04:54 -07:00
parent d61e8d8dd4
commit c5105647b2

View File

@ -1,72 +1,72 @@
const SelectionMixin = { // eslint-disable-line no-unused-vars
computed: {
selectedSectionID: {
get () {
get() {
return this.$store.getters.SELECTED_SECTION_ID
},
set (value) {
set(value) {
this.$store.dispatch('SET_SELECTED_SECTION_ID', value)
}
},
selectedFamilyID: {
get () {
get() {
return this.$store.getters.SELECTED_FAMILY_ID
},
set (value) {
set(value) {
this.$store.dispatch('SET_SELECTED_FAMILY_ID', value)
}
},
selectedModelID: {
get () {
get() {
return this.$store.getters.SELECTED_MODEL_ID
},
set (value) {
set(value) {
this.$store.dispatch('SET_SELECTED_MODEL_ID', value)
}
},
selectedMaterial: {
get () {
get() {
return this.$store.getters.SELECTED_MATERIAL_ID
},
set (value) {
set(value) {
this.$store.dispatch('SET_SELECTED_MATERIAL_ID', value)
}
},
},
methods: {
selectSection: function (id) {
selectSection: function(id) {
this.selectedSectionID = id
// this.selectedFamilyID = null
// this.selectedModelID = null
// this.selectedMaterial = null
},
selectFamily: function (id) {
selectFamily: function(id) {
this.selectedFamilyID = id
// this.selectedModelID = null
// this.selectedMaterial = null
},
selectModel: function (id) {
selectModel: function(id) {
this.selectedModelID = id
// this.selectedFamilyID = null
// this.selectedMaterial = null
},
selectMaterial: function (id) {
selectMaterial: function(id) {
this.selectedMaterial = id
},
selectedFamilies: function () {
selectedFamilies: function() {
let section = this.$store.getters.CAT_SECTION(this.selectedSectionID)
let ids = this.sectionIDs(section)
let materials = this.findMaterials(ids)
return this.makeFamilies(materials)
},
selectedFamily: function () {
selectedFamily: function() {
let families = this.selectedFamilies()
return families.find(s => s.id === this.selectedFamilyID)
},
sectionIDs: function (section) {
sectionIDs: function(section) {
let ids = []
if (section !== undefined) {
if (section) {
for (let page of section.pages) {
for (let block of page) {
ids.push(...block.ids)
@ -76,10 +76,10 @@ const SelectionMixin = { // eslint-disable-line no-unused-vars
return ids
},
findMaterials: function (ids) {
findMaterials: function(ids) {
return ids.map(id => this.$store.getters.MATERIAL(id))
},
makeFamilies: function (materials) {
makeFamilies: function(materials) {
let families = []
for (let mat of materials) {
@ -102,7 +102,7 @@ const SelectionMixin = { // eslint-disable-line no-unused-vars
return families
},
uniquify: function (arr) {
uniquify: function(arr) {
return [...new Set(arr)]
},
}