Browse Source

fix: GUI corrections

pull/8367/head
Pranav C 5 months ago
parent
commit
42d6241a00
  1. 30
      packages/nc-gui/components/smartsheet/column/LinkedToAnotherRecordOptions.vue
  2. 6
      packages/nocodb/src/db/genRollupSelectv2.ts

30
packages/nc-gui/components/smartsheet/column/LinkedToAnotherRecordOptions.vue

@ -157,7 +157,6 @@ const handleUpdateRefTable = () => {
updateFieldName() updateFieldName()
}) })
} }
const oneToOneEnabled = ref(false)
const isAdvancedOptionsShownEasterEgg = ref(false) const isAdvancedOptionsShownEasterEgg = ref(false)
@ -196,9 +195,7 @@ const handleShowAdvanceOptions = () => {
</script> </script>
<template> <template>
<div class="w-full flex flex-col mb-2 mt-1"> <div class="w-full flex flex-col gap-4">
<div class="mb-2">Relation Type <span class="text-red-500">*</span></div>
<div class="border-2 p-6">
<div class="flex flex-col gap-4"> <div class="flex flex-col gap-4">
<a-form-item :label="$t('labels.relationType')" v-bind="validateInfos.type" class="nc-ltar-relation-type"> <a-form-item :label="$t('labels.relationType')" v-bind="validateInfos.type" class="nc-ltar-relation-type">
<a-radio-group v-model:value="linkType" name="type" v-bind="validateInfos.type" :disabled="isEdit"> <a-radio-group v-model:value="linkType" name="type" v-bind="validateInfos.type" :disabled="isEdit">
@ -214,7 +211,7 @@ const handleShowAdvanceOptions = () => {
</span> </span>
{{ $t('title.hasMany') }} {{ $t('title.hasMany') }}
</a-radio> </a-radio>
<a-radio value="oo" data-testid="One to One"> <a-radio value="oo" data-testid="One to One" @dblclick="handleShowAdvanceOptions">
<span class="nc-ltar-icon nc-oo-icon"> <span class="nc-ltar-icon nc-oo-icon">
<GeneralIcon icon="oneToOneSolid" /> <GeneralIcon icon="oneToOneSolid" />
</span> </span>
@ -223,17 +220,13 @@ const handleShowAdvanceOptions = () => {
</a-radio-group> </a-radio-group>
</a-form-item> </a-form-item>
</div> </div>
<div v-if="isAdvancedOptionsShownEasterEgg && isEeUI" class="mt-4"> <div v-if="isAdvancedOptionsShownEasterEgg && isEeUI">
<a-switch v-model:checked="vModel.is_custom_link" size="small" name="Custom" @change="onCustomSwitchToggle" /> <a-switch v-model:checked="vModel.is_custom_link" size="small" name="Custom" @change="onCustomSwitchToggle" />
<span class="ml-3">Advanced Link</span> <span class="ml-3">Advanced Link</span>
</div> </div>
<div <div v-if="isEeUI && vModel.is_custom_link" :class="{}">
:class="{ <LazySmartsheetColumnLinkAdvancedOptions v-model:value="vModel" :meta="meta" />
'mt-3': isAdvancedOptionsShownEasterEgg, </div>
'mt-4': !isAdvancedOptionsShownEasterEgg,
}"
>
<LazySmartsheetColumnLinkAdvancedOptions v-if="isEeUI && vModel.is_custom_link" v-model:value="vModel" />
<template v-else> <template v-else>
<a-form-item class="flex w-full pb-2 nc-ltar-child-table" v-bind="validateInfos.childId"> <a-form-item class="flex w-full pb-2 nc-ltar-child-table" v-bind="validateInfos.childId">
<a-select <a-select
@ -259,14 +252,11 @@ const handleShowAdvanceOptions = () => {
</NcTooltip> </NcTooltip>
</div> </div>
</a-select-option> </a-select-option>
<template #suffixIcon>
<GeneralIcon class="" icon="chevronDown" />
</template>
</a-select> </a-select>
</a-form-item> </a-form-item>
</template> </template>
<div v-if="isEeUI" class="w-full flex-col"> <template v-if="isEeUI">
<div class="flex gap-2 items-center" :class="{ 'mb-2': limitRecToView }"> <div class="flex gap-2 items-center" :class="{ 'mb-2': limitRecToView }">
<a-switch <a-switch
v-model:checked="limitRecToView" v-model:checked="limitRecToView"
@ -305,7 +295,7 @@ const handleShowAdvanceOptions = () => {
</NcSelect> </NcSelect>
</a-form-item> </a-form-item>
<div class="mt-4 flex gap-2 items-center" :class="{ 'mb-2': limitRecToCond }"> <div class="flex gap-2 items-center" :class="{ 'mb-2': limitRecToCond }">
<a-switch <a-switch
v-model:checked="limitRecToCond" v-model:checked="limitRecToCond"
v-e="['c:link:limit-record-by-filter', { status: limitRecToCond }]" v-e="['c:link:limit-record-by-filter', { status: limitRecToCond }]"
@ -332,8 +322,7 @@ const handleShowAdvanceOptions = () => {
:link-col-id="vModel.id" :link-col-id="vModel.id"
/> />
</div> </div>
</div> </template>
</div>
<template v-if="(!isXcdbBase && !isEdit) || isLinks"> <template v-if="(!isXcdbBase && !isEdit) || isLinks">
<div> <div>
<NcButton <NcButton
@ -349,7 +338,6 @@ const handleShowAdvanceOptions = () => {
<GeneralIcon :icon="advancedOptions ? 'arrowUp' : 'arrowDown'" class="h-4 w-4" /> <GeneralIcon :icon="advancedOptions ? 'arrowUp' : 'arrowDown'" class="h-4 w-4" />
</div> </div>
</NcButton> </NcButton>
</div> </div>

6
packages/nocodb/src/db/genRollupSelectv2.ts

@ -34,11 +34,11 @@ export default async function ({
const parentModel = await parentCol?.getModel(context); const parentModel = await parentCol?.getModel(context);
const refTableAlias = `__nc_rollup`; const refTableAlias = `__nc_rollup`;
const parentBaseModel = await Model.getBaseModelSQL(this.context, { const parentBaseModel = await Model.getBaseModelSQL(context, {
model: parentModel, model: parentModel,
dbDriver: knex, dbDriver: knex,
}); });
const childBaseModel = await Model.getBaseModelSQL(this.context, { const childBaseModel = await Model.getBaseModelSQL(context, {
model: childModel, model: childModel,
dbDriver: knex, dbDriver: knex,
}); });
@ -98,7 +98,7 @@ export default async function ({
const mmModel = await relationColumnOption.getMMModel(context); const mmModel = await relationColumnOption.getMMModel(context);
const mmChildCol = await relationColumnOption.getMMChildColumn(context); const mmChildCol = await relationColumnOption.getMMChildColumn(context);
const mmParentCol = await relationColumnOption.getMMParentColumn(context); const mmParentCol = await relationColumnOption.getMMParentColumn(context);
const assocBaseModel = await Model.getBaseModelSQL(this.context, { const assocBaseModel = await Model.getBaseModelSQL(context, {
id: mmModel.id, id: mmModel.id,
dbDriver: knex, dbDriver: knex,
}); });

Loading…
Cancel
Save