Browse Source

fix(gui-v2): show expand icon in cell

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/3414/head
Pranav C 2 years ago
parent
commit
f3d4b45d00
  1. 4
      packages/nc-gui-v2/components/virtual-cell/ManyToMany.vue
  2. 40
      packages/nc-gui-v2/composables/useLTARStore.ts

4
packages/nc-gui-v2/components/virtual-cell/ManyToMany.vue

@ -94,14 +94,14 @@ const unlinkRef = async (rec: Record<string, any>) => {
</template>
</div>
<div v-if="!isLocked && isUIAllowed('xcDatatableEditable')" class="flex justify-end gap-1 min-h-[30px] items-center">
<div v-if="!isLocked" class="flex justify-end gap-1 min-h-[30px] items-center">
<MdiArrowExpand
class="text-sm nc-action-icon text-gray-500/50 hover:text-gray-500 nc-arrow-expand"
@click="childListDlg = true"
/>
<MdiPlus
v-if="!readOnly"
v-if="!readOnly && isUIAllowed('xcDatatableEditable')"
class="text-sm nc-action-icon text-gray-500/50 hover:text-gray-500 nc-plus"
@click="listItemsDlg = true"
/>

40
packages/nc-gui-v2/composables/useLTARStore.ts

@ -150,19 +150,33 @@ const [useProvideLTARStore, useLTARStore] = useInjectionState(
try {
if (colOptions.type === 'bt') return
childrenList.value = await $api.dbTableRow.nestedList(
NOCO,
(project?.value?.id || sharedView?.value?.view?.project_id) as string,
meta.value.id,
rowId.value,
colOptions.type as 'mm' | 'hm',
encodeURIComponent(column?.value?.title),
{
limit: String(childrenListPagination.size),
offset: String(childrenListPagination.size * (childrenListPagination.page - 1)),
where: childrenListPagination.query && `(${relatedTablePrimaryValueProp.value},like,${childrenListPagination.query})`,
} as any,
)
if (isPublic) {
childrenList.value = await $api.public.dataNestedList(
sharedView.value?.uuid as string,
rowId.value,
colOptions.type as 'mm' | 'hm',
encodeURIComponent(column?.value?.id),
{
limit: String(childrenListPagination.size),
offset: String(childrenListPagination.size * (childrenListPagination.page - 1)),
where: childrenListPagination.query && `(${relatedTablePrimaryValueProp.value},like,${childrenListPagination.query})`,
} as any,
)
}else{
childrenList.value = await $api.dbTableRow.nestedList(
NOCO,
(project?.value?.id || sharedView?.value?.view?.project_id) as string,
meta.value.id,
rowId.value,
colOptions.type as 'mm' | 'hm',
encodeURIComponent(column?.value?.title),
{
limit: String(childrenListPagination.size),
offset: String(childrenListPagination.size * (childrenListPagination.page - 1)),
where: childrenListPagination.query && `(${relatedTablePrimaryValueProp.value},like,${childrenListPagination.query})`,
} as any,
)
}
} catch (e: any) {
message.error(`Failed to load children list: ${await extractSdkResponseErrorMsg(e)}`)
}

Loading…
Cancel
Save