Browse Source

fix: child items in form view

pull/6360/head
DarkPhoenix2704 11 months ago
parent
commit
205faff842
  1. 5
      packages/nc-gui/components/virtual-cell/components/ListChildItems.vue
  2. 2
      packages/nc-gui/components/virtual-cell/components/ListItem.vue
  3. 7
      packages/nc-gui/components/virtual-cell/components/ListItems.vue
  4. 5
      tests/playwright/pages/Dashboard/common/Toolbar/Sort.ts

5
packages/nc-gui/components/virtual-cell/components/ListChildItems.vue

@ -6,6 +6,7 @@ import InboxIcon from '~icons/nc-icons/inbox'
import {
ColumnInj,
IsFormInj,
IsPublicInj,
ReadonlyInj,
computed,
inject,
@ -24,6 +25,8 @@ const vModel = useVModel(props, 'modelValue', emit)
const isForm = inject(IsFormInj, ref(false))
const isPublic = inject(IsPublicInj, ref(false))
const injectedColumn = inject(ColumnInj, ref())
const readonly = inject(ReadonlyInj, ref(false))
@ -153,6 +156,8 @@ watch(expandedFormDlg, () => {
@expand="onClick(refRow)"
@click="
() => {
if (isPublic) return
isChildrenListLinked[Number.parseInt(id)]
? unlinkRow(refRow, Number.parseInt(id))
: link(refRow, {}, false, Number.parseInt(id))

2
packages/nc-gui/components/virtual-cell/components/ListItem.vue

@ -115,7 +115,7 @@ const attachments: Attachment[] = computed(() => {
</div>
</div>
<NcButton
v-if="!isForm"
v-if="!isPublic"
type="text"
size="lg"
class="!px-2 nc-expand-item !group-hover:block !hidden !absolute right-1 bottom-1"

7
packages/nc-gui/components/virtual-cell/components/ListItems.vue

@ -68,7 +68,9 @@ watch(vModel, (nextVal, prevVal) => {
/** reset query and limit */
childrenExcludedListPagination.query = ''
childrenExcludedListPagination.page = 1
loadChildrenList()
if (!isForm) {
loadChildrenList()
}
loadChildrenExcludedList()
selectedRowIndex.value = 0
}
@ -142,6 +144,7 @@ watch(expandedFormDlg, () => {
wrap-class-name="nc-modal-link-record"
>
<LazyVirtualCellComponentsHeader
v-if="!isForm"
:relation="relation"
:table-title="meta?.title"
:related-table-title="relatedTableMeta?.title"
@ -192,9 +195,9 @@ watch(expandedFormDlg, () => {
<div class="pb-2 pt-1">
<div class="h-[420px] overflow-scroll nc-scrollbar-md pr-1 cursor-pointer">
<LazyVirtualCellComponentsListItem
data-testid="nc-excluded-list-item"
v-for="(refRow, id) in childrenExcludedList?.list ?? []"
:key="id"
data-testid="nc-excluded-list-item"
:row="refRow"
:fields="fields"
:attachment="attachmentCol"

5
tests/playwright/pages/Dashboard/common/Toolbar/Sort.ts

@ -102,6 +102,11 @@ export class ToolbarSortPage extends BasePage {
await this.get().locator(`button:has-text("Add Sort Option")`).click();
}
await this.rootPage
.locator('.nc-sort-create-modal')
.locator('.nc-sort-column-search-item', { hasText: title })
.scrollIntoViewIfNeeded();
// select column
const selectColumn = async () =>
await this.rootPage

Loading…
Cancel
Save