Commit 2b2493e2 authored by anton's avatar anton

Fix exception when editing cell, remove redundant api call in CellEditor.vue

parent cb565595
Pipeline #29636 passed with stage
in 4 minutes and 11 seconds
......@@ -2,10 +2,10 @@
div.q-px-md.q-pb-md.q-pt-sm
q-list.q-py-none.ani-opacity(v-for="(cell, index) in cellsData", :key="cell._uuid")
q-list.q-py-none.ani-opacity(v-for="(cell, index) in cells", :key="cell._uuid")
//----- header
// q-item.q-py-sm(:class="[isMobile ? 'q-pr-sm' : 'q-pr-none']")
// q-item.q-py-sm(:class="[isMobil.componente ? 'q-pr-sm' : 'q-pr-none']")
q-item.q-pa-none.q-mb-sm(:class="[isMobile ? '' : 'q-py-xs q-mt-sm']")
q-item-main.text-dark
strong {{ itemSpecs[cell.configuration._value.component][0].type }}
......@@ -50,7 +50,7 @@
:type="spec.inputType",
:min-rows="1",
:max-height="500",
:value="cell.data[spec.path]",
:value="cell.source._value[spec.path]",
@change="value => handleItemChanged(value, cell, spec.path)",
hide-underline)
......@@ -78,7 +78,8 @@
data () {
return {
isMobile: undefined,
cellsData: [],
cells: [],
cellSourceValues: {},
typeToIconName: {
'Image': 'photo',
'IFrame': 'picture in picture',
......@@ -286,17 +287,17 @@
computed: {
...mapGetters({
// showEditingCells: 'mosys/getShowEditingCells'
cells: 'mosys/getEditingCells'
annotations: 'mosys/getEditingCells'
})
},
watch: {
async cells (val) {
this.getCellsData(val)
async annotations (val) {
this.getCells(val)
}
},
mounted () {
this.isMobile = this.$q.platform.is.mobile
this.getCellsData(this.cells)
// this.getCells(this.annotations)
},
methods: {
deleteCell (cell) {
......@@ -307,12 +308,13 @@
this.$store.commit('mosys/setEditCellModal', false)
// this.$store.commit('mosys/setEditingCells', '')
},
async getCellsData (cells) {
this.cellsData = []
for (let i = 0; i < cells.length; i++) {
let c = await this.$store.dispatch('cells/get', cells[i].body.source.id)
c.configuration = Object.assign({}, c.configuration._value, { path: 'content' })
this.cellsData.push(c)
async getCells (annotations) {
this.cells = []
for (let i = 0; i < annotations.length; i++) {
let c = await this.$store.dispatch('cells/get', annotations[i].body.source.id)
c.configuration.value = Object.assign({}, c.configuration._value, { path: 'content' })
this.cells.push(c)
this.cellSourceValues[c.id] = c.source._value
}
},
async handleItemChanged (value, cell, path) {
......
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