diff --git a/cateditor/src/components/MaterialList.vue b/cateditor/src/components/MaterialList.vue deleted file mode 100644 index 7943248..0000000 --- a/cateditor/src/components/MaterialList.vue +++ /dev/null @@ -1,117 +0,0 @@ - - - - Styles - - - - - - - - - - {{ item.id }} {{ item.name }} - - - - - - - info - - - delete - - - - - - - - - - - - - - - - - - diff --git a/cateditor/src/components/ProductFamilyList.vue b/cateditor/src/components/ProductFamilyList.vue deleted file mode 100644 index 978bea1..0000000 --- a/cateditor/src/components/ProductFamilyList.vue +++ /dev/null @@ -1,121 +0,0 @@ - - - - Product Families - - - - - - - - - - - {{item.models.length}} {{item.models.length | pluralize('model') }} - - - - - - - info - - - delete - - - - - - - - - - - - - - - - - - diff --git a/cateditor/src/components/SectionList.vue b/cateditor/src/components/SectionList.vue deleted file mode 100644 index d891c6d..0000000 --- a/cateditor/src/components/SectionList.vue +++ /dev/null @@ -1,128 +0,0 @@ - - - - Sections - - - - - - - - - - - - - 12 models - - - - - - - info - - - delete - - - - - - - - - - - - - - - - - - - - - diff --git a/cateditor/src/components/SelectionMixin.js b/cateditor/src/components/SelectionMixin.js deleted file mode 100644 index 7621bb6..0000000 --- a/cateditor/src/components/SelectionMixin.js +++ /dev/null @@ -1,111 +0,0 @@ -const SelectionMixin = { // eslint-disable-line no-unused-vars - computed: { - selectedSectionID: { - get() { - return this.$store.getters.SELECTED_SECTION_ID - }, - set(value) { - this.$store.dispatch('SET_SELECTED_SECTION_ID', value) - } - }, - selectedFamilyID: { - get() { - return this.$store.getters.SELECTED_FAMILY_ID - }, - set(value) { - this.$store.dispatch('SET_SELECTED_FAMILY_ID', value) - } - }, - selectedModelID: { - get() { - return this.$store.getters.SELECTED_MODEL_ID - }, - set(value) { - this.$store.dispatch('SET_SELECTED_MODEL_ID', value) - } - }, - selectedMaterial: { - get() { - return this.$store.getters.SELECTED_MATERIAL_ID - }, - set(value) { - this.$store.dispatch('SET_SELECTED_MATERIAL_ID', value) - } - }, - }, - methods: { - selectSection: function(id) { - this.selectedSectionID = id - // this.selectedFamilyID = null - // this.selectedModelID = null - // this.selectedMaterial = null - }, - selectFamily: function(id) { - this.selectedFamilyID = id - // this.selectedModelID = null - // this.selectedMaterial = null - }, - selectModel: function(id) { - this.selectedModelID = id - // this.selectedFamilyID = null - // this.selectedMaterial = null - }, - selectMaterial: function(id) { - this.selectedMaterial = id - }, - 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() { - let families = this.selectedFamilies() - return families.find(s => s.id === this.selectedFamilyID) - }, - sectionIDs: function(section) { - let ids = [] - - if (section) { - for (let page of section.pages) { - for (let block of page) { - ids.push(...block.ids) - } - } - } - - return ids - }, - findMaterials: function(ids) { - return ids.map(id => this.$store.getters.MATERIAL(id)) - }, - makeFamilies: function(materials) { - let families = [] - - for (let mat of materials) { - let family = families.length > 0 ? families[families.length - 1] : null - - if (family === null || family.id !== mat.family) { - // new family - family = { id: mat.family, - name: mat.name, // TODO where does this come from? - models: [mat.model], - materials: [mat.id] } - families.push(family) - } else { - // add to existing - family.materials.push(mat.id) - family.models.push(mat.model) - family.models = this.uniquify(family.models) - } - } - - return families - }, - uniquify: function(arr) { - return [...new Set(arr)] - }, - } -} - -export default SelectionMixin