Browse Source

Nc fix(nc-gui): ui break on toggle between select based field type (#8001)

* fix(nc-gui): ui break on toggle field type

* chore(nc-gui): remove console

* chore(nc-gui): lint
pull/8005/head
Ramesh Mane 9 months ago committed by GitHub
parent
commit
80affcbad0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      packages/nc-gui/components/cell/Rating.vue
  2. 3
      packages/nc-gui/components/smartsheet/Cell.vue
  3. 1
      packages/nc-gui/components/smartsheet/Form.vue
  4. 3
      packages/nc-gui/components/smartsheet/calendar/DayView/DateField.vue
  5. 2
      packages/nc-gui/components/smartsheet/column/SelectOptions.vue

2
packages/nc-gui/components/cell/Rating.vue

@ -73,12 +73,12 @@ watch(rateDomRef, () => {
<template>
<a-rate
ref="rateDomRef"
:key="ratingMeta.icon.full"
v-model:value="vModel"
:disabled="readOnly"
:count="ratingMeta.max"
:class="readOnly ? 'pointer-events-none' : ''"
:style="`color: ${ratingMeta.color}; padding: ${isExpandedFormOpen ? '0px 8px' : '0px 2px'};`"
:key="ratingMeta.icon.full"
@keydown="onKeyPress"
>
<template #character>

3
packages/nc-gui/components/smartsheet/Cell.vue

@ -195,7 +195,8 @@ onUnmounted(() => {
`nc-cell-${(column?.uidt || 'default').toLowerCase()}`,
{
'text-brand-500': isPrimary(column) && !props.virtual && !isForm && !isCalendar,
'nc-grid-numeric-cell-right': isGrid && isNumericField && !isEditColumnMenu && !isForm && !isExpandedFormOpen && !isRating(column),
'nc-grid-numeric-cell-right':
isGrid && isNumericField && !isEditColumnMenu && !isForm && !isExpandedFormOpen && !isRating(column),
'h-10': !isEditColumnMenu && isForm && !isAttachment(column) && !isTextArea(column) && !isJSON(column) && !props.virtual,
'nc-grid-numeric-cell-left': (isForm && isNumericField && isExpandedFormOpen) || isEditColumnMenu,
'!min-h-30': isTextArea(column) && (isForm || isSurveyForm),

1
packages/nc-gui/components/smartsheet/Form.vue

@ -786,7 +786,6 @@ useEventListener(
document,
'mousedown',
(e: MouseEvent) => {
console.log('e.target', e.target)
if (
(draggableRef.value?.targetDomElement && draggableRef.value?.targetDomElement.contains(e.target)) ||
(e.target as HTMLElement)?.closest(

3
packages/nc-gui/components/smartsheet/calendar/DayView/DateField.vue

@ -12,8 +12,7 @@ const container = ref()
const { isUIAllowed } = useRoles()
const { selectedDate, formattedData, formattedSideBarData, calendarRange, updateRowProperty } =
useCalendarViewStoreOrThrow()
const { selectedDate, formattedData, formattedSideBarData, calendarRange, updateRowProperty } = useCalendarViewStoreOrThrow()
const fields = inject(FieldsInj, ref())

2
packages/nc-gui/components/smartsheet/column/SelectOptions.vue

@ -277,7 +277,7 @@ const undoRemoveRenderedOption = (index: number) => {
watch(vModel, (next) => {
const cdfs = (next.cdf ?? '').toString().split(',')
const valuesMap = (next.colOptions.options ?? []).reduce((acc, c) => {
const valuesMap = (next.colOptions?.options ?? []).reduce((acc, c) => {
acc[c.title.replace(/^'|'$/g, '')] = c
return acc
}, {})

Loading…
Cancel
Save