Skip to content

Commit

Permalink
fix: resolve pagination issues
Browse files Browse the repository at this point in the history
Signed-off-by: Elizabeth Danzberger <lizzy7128@tutanota.de>
  • Loading branch information
Elizabeth Danzberger authored and elzody committed May 28, 2024
1 parent f86b6f6 commit 44e3745
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 17 deletions.
31 changes: 17 additions & 14 deletions cypress/support/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,26 @@ import '../styleguide/assets/default.css'
import '../styleguide/assets/additional.css'
import '../styleguide/assets/icons.css'

const defaultOptions = {
extensions: {
mixins: [
{ methods: { t, n } },
{ store: { ...store, data } },
],
plugins: [],
components: {},
},
}
const prepareOptions = (options = {}) => {
store.data = data

Cypress.Commands.add('mount', (component, options) => {
// Use default options and mix in the given options
options = {
const defaultOptions = {
extensions: {
mixins: [
{ methods: { t, n } },
{ store, },
],
plugins: [],
components: {},
},
}

return {
...defaultOptions,
...options,
}
}

return mount(component, options)
Cypress.Commands.add('mount', (component, options) => {
return mount(component, prepareOptions(options))
})
4 changes: 3 additions & 1 deletion src/reference.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ registerWidget('tables_content', async (el, { richObjectType, richObject, access
const { default: store } = await import(/* webpackChunkName: 'store' */ './store/store.js')
const { default: data } = await import(/* webpackChunkName: 'store' */ './store/data.js')

store.data = data

Vue.mixin({ methods: { t, n } })
const Widget = Vue.extend(TableReferenceWidget)
new Widget({
Expand All @@ -33,7 +35,7 @@ registerWidget('tables_content', async (el, { richObjectType, richObject, access
richObject,
accessible,
},
store: { ...store, data },
store,
}).$mount(el)
}, () => {}, { hasInteractiveView: true })

Expand Down
2 changes: 0 additions & 2 deletions src/views/ContentReferenceWidget.vue
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,6 @@ export default {
const { width } = entry.contentRect
this.$el.style.setProperty('--widget-content-width', `${width}px`)
})
await this.loadRows()
},
methods: {
Expand Down
12 changes: 12 additions & 0 deletions src/views/SmartPicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,26 @@ export default {
},
},
async mounted() {
if (!this.$store) {
const { default: store } = await import(
/* webpackChunkName: 'store' */
'../store/store.js')
this.$store = store
}
},
methods: {
t,
n,
async updateContent() {
if (this.renderMode === 'content') {
this.previewLoading = true
await this.loadColumnsForContentPreview()
await this.loadRowsForContentPreview()
this.previewLoading = false
} else {
delete this.richObject.rows
Expand Down

0 comments on commit 44e3745

Please sign in to comment.