Browse Source

fix: update fields tab

pull/6513/head
DarkPhoenix2704 1 year ago committed by sreehari jayaraj
parent
commit
5f7bdb101c
  1. 21
      packages/nc-gui/components/smartsheet/column/EditOrAdd.vue

21
packages/nc-gui/components/smartsheet/column/EditOrAdd.vue

@ -56,6 +56,8 @@ const { appInfo } = useGlobal()
const { betaFeatureToggleState } = useBetaFeatureToggle() const { betaFeatureToggleState } = useBetaFeatureToggle()
const { openedViewsTab } = storeToRefs(useViewsStore())
const { loadMagic, predictColumnType: _predictColumnType } = useNocoEe() const { loadMagic, predictColumnType: _predictColumnType } = useNocoEe()
const meta = inject(MetaInj, ref()) const meta = inject(MetaInj, ref())
@ -194,6 +196,10 @@ const handleEscape = (event: KeyboardEvent): void => {
if (event.key === 'Escape') emit('cancel') if (event.key === 'Escape') emit('cancel')
} }
const isFieldsTab = computed(() => {
return openedViewsTab.value === 'field'
})
if (props.fromTableExplorer) { if (props.fromTableExplorer) {
watch( watch(
formState, formState,
@ -220,8 +226,21 @@ if (props.fromTableExplorer) {
> >
<a-form v-model="formState" no-style name="column-create-or-edit" layout="vertical" data-testid="add-or-edit-column"> <a-form v-model="formState" no-style name="column-create-or-edit" layout="vertical" data-testid="add-or-edit-column">
<div class="flex flex-col gap-2"> <div class="flex flex-col gap-2">
<a-form-item v-if="isFieldsTab" v-bind="validateInfos.title" class="flex flex-grow">
<div
class="flex flex-grow px-2 py-1 items-center rounded-lg bg-white hover:bg-gray-100 focus:bg-gray-100 outline-none"
style="outline-style: solid; outline-width: thin"
>
<input
ref="antInput"
v-model="formState.title"
class="flex flex-grow text-lg font-bold outline-none bg-inherit"
:contenteditable="true"
/>
</div>
</a-form-item>
<a-form-item <a-form-item
v-if="!props.hideTitle" v-if="!props.hideTitle && !isFieldsTab"
:label="`${columnLabel} ${$t('general.name')}`" :label="`${columnLabel} ${$t('general.name')}`"
v-bind="validateInfos.title" v-bind="validateInfos.title"
:required="false" :required="false"

Loading…
Cancel
Save