mirror of
https://github.com/baserow/baserow.git
synced 2026-12-04 08:18:42 +00:00
* refactor: extract grid view common test helpers
* refactor: extract row-lifecycle helpers and migrate grid store
Add computeRowInsertPosition to utils/row.js (expresses insert
position by row identity rather than flat array index).
Add handleRowCreated, handleRowDeleted, handleRowUpdated to
rowLifecycle.js. Each takes a store-supplied mutations adapter so
the decision logic (filter matching, sort position) is shared
between the flat-array grid store and the upcoming collapsible
group-by store.
Migrate createdNewRow, updatedExistingRow, deletedExistingRow in
grid.js to delegate through the new helpers via inline adapter
closures that translate position descriptors to the existing
flat-buffer Vuex mutations. Observable behaviour is unchanged;
search gating is preserved in each Vuex action.
Also includes grid view e2e test additions (section 1.5 task queue,
section 7.7 row identifier type, section 10.1 hover actions) and
grid test plan updates from the refactor/grid-view-common-e2e work.
* chore: fix CI
* chore: cleanup
* refactor: remove dead grid e2e search helpers and dedupe row-lifecycle guards
- Drop the unused openSearch/typeInSearch/clearSearch/toggleHideNotMatchingRows
methods from GridPage; the richer, used variants live in
grid_view_options.spec.ts. This also removes the placeholder/getByText
selectors flagged in review (the remaining 'Delete row' selector stays scoped
to the visible context menu).
- Centralize the repeated 'applyMatchFlags ?? noop' / 'rowsForMatchCheck ??
emptyRows' guards into a single normalizeMutations() helper. No behavior change.
* refactor: remove dead updateMatchFilters/updateMatchSortings grid actions
Both grid store actions lost all production callers in the row-lifecycle
migration (match flags are now computed via onRowChange/reapplyMatchFlags and
direct computeRowMatchFlags calls). Repoint the remaining viewFilters test at
the live onRowChange path instead of the orphaned updateMatchFilters action.
* docs: note field-constraint create/edit coverage in grid view test plan
Add 1.6.x and 2.6.x TODO entries describing add/edit behavior under unique and
unique-with-empty field constraints (backend validation error surfaced +
optimistic rollback; empty values exempt from uniqueness).
* test: await route registration in failNextRequest
failNextRequest fired page.route() without awaiting it, so the intercept
could register after the caller already triggered the request. Make it async
and await registration before returning (mirroring pauseNextRequestWithSignal);
it now returns { done } and the 3 callers await it.
* test: scope grid_interaction serial mode per-describe
Replace the single file-level serial config with a per-describe one (matching
the other two grid specs) so a failure in one block no longer skips the rest and
independent blocks can run in parallel.
* docs: document createRowLifecycleContext and clarify escape wording
- Add a docstring to createRowLifecycleContext.
- Reword the Deferred/Escape note in the grid view test plan.
* fix(e2e): return created rows from createRows helper
setupGrid expected createRows to return the created rows to collect their
ids, but the helper returned void and discarded the batch-create response,
so created.map() threw 'Cannot read properties of undefined' and every
grid_interaction spec failed deterministically. Return response.data.items.
* revert publicView changes
87 lines
2.1 KiB
Vue
87 lines
2.1 KiB
Vue
<template>
|
|
<div
|
|
class="grid-view__placeholder"
|
|
:style="{
|
|
height: placeholderHeight + 'px',
|
|
width: placeholderWidth + 'px',
|
|
}"
|
|
>
|
|
<div
|
|
v-if="includeGroupBy"
|
|
class="grid-view__placeholder-groups"
|
|
:style="{ width: groupByWidth + 'px' }"
|
|
></div>
|
|
<template v-if="includeRowDetails || visibleFields.length > 0">
|
|
<div
|
|
v-for="(value, index) in placeholderPositions"
|
|
:key="'placeholder-column-' + index"
|
|
class="grid-view__placeholder-column"
|
|
:style="{ left: value - 1 + 'px' }"
|
|
></div>
|
|
</template>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import gridViewHelpers from '@baserow/modules/database/mixins/gridViewHelpers'
|
|
|
|
export default {
|
|
name: 'GridViewPlaceholder',
|
|
mixins: [gridViewHelpers],
|
|
props: {
|
|
visibleFields: {
|
|
type: Array,
|
|
required: true,
|
|
},
|
|
view: {
|
|
type: Object,
|
|
required: true,
|
|
},
|
|
includeRowDetails: {
|
|
type: Boolean,
|
|
required: true,
|
|
},
|
|
includeGroupBy: {
|
|
type: Boolean,
|
|
required: false,
|
|
default: () => false,
|
|
},
|
|
},
|
|
computed: {
|
|
groupByWidth() {
|
|
return this.includeGroupBy ? this.activeGroupByWidth : 0
|
|
},
|
|
/**
|
|
* Calculate the left positions of the placeholder columns. These are the gray
|
|
* vertical lines that are always visible, even when the data hasn't loaded yet.
|
|
*/
|
|
placeholderPositions() {
|
|
let last = this.groupByWidth
|
|
last += this.includeRowDetails ? this.gridViewRowDetailsWidth : 0
|
|
const placeholderPositions = {}
|
|
this.visibleFields.forEach((field) => {
|
|
last += this.getFieldWidth(field)
|
|
placeholderPositions[field.id] = last
|
|
})
|
|
return placeholderPositions
|
|
},
|
|
placeholderWidth() {
|
|
let width = this.visibleFields.reduce(
|
|
(value, field) => this.getFieldWidth(field) + value,
|
|
0
|
|
)
|
|
width += this.groupByWidth
|
|
if (this.includeRowDetails) {
|
|
width += this.gridViewRowDetailsWidth
|
|
}
|
|
return width
|
|
},
|
|
placeholderHeight() {
|
|
return this.$store.getters[
|
|
this.storePrefix + 'view/grid/getPlaceholderHeight'
|
|
]
|
|
},
|
|
},
|
|
}
|
|
</script>
|