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

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

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

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

@ -786,7 +786,6 @@ useEventListener(
document, document,
'mousedown', 'mousedown',
(e: MouseEvent) => { (e: MouseEvent) => {
console.log('e.target', e.target)
if ( if (
(draggableRef.value?.targetDomElement && draggableRef.value?.targetDomElement.contains(e.target)) || (draggableRef.value?.targetDomElement && draggableRef.value?.targetDomElement.contains(e.target)) ||
(e.target as HTMLElement)?.closest( (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 { isUIAllowed } = useRoles()
const { selectedDate, formattedData, formattedSideBarData, calendarRange, updateRowProperty } = const { selectedDate, formattedData, formattedSideBarData, calendarRange, updateRowProperty } = useCalendarViewStoreOrThrow()
useCalendarViewStoreOrThrow()
const fields = inject(FieldsInj, ref()) 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) => { watch(vModel, (next) => {
const cdfs = (next.cdf ?? '').toString().split(',') 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 acc[c.title.replace(/^'|'$/g, '')] = c
return acc return acc
}, {}) }, {})

Loading…
Cancel
Save