Browse Source

refactor: cell icon update

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/4504/head
Pranav C 2 years ago
parent
commit
e25625be84
  1. 3
      packages/nc-gui/components/smartsheet/header/Menu.vue
  2. 10
      packages/nc-gui/components/smartsheet/header/VirtualCellIcon.ts
  3. 3
      packages/nc-gui/utils/columnUtils.ts

3
packages/nc-gui/components/smartsheet/header/Menu.vue

@ -130,12 +130,11 @@ const duplicateColumn = async () => {
}
break
}
try {
await $api.dbTableColumn.create(meta!.value!.id!, columnCreatePayload)
await getMeta(meta!.value!.id!, true)
debugger
const gridViewColumnList = await $api.dbViewColumn.list(view.value?.id as string)
const currentColumnIndex = gridViewColumnList.findIndex((f) => f.fk_column_id === column!.value.id)

10
packages/nc-gui/components/smartsheet/header/VirtualCellIcon.ts

@ -12,7 +12,7 @@ import QrCodeScan from '~icons/mdi/qrcode-scan'
import RollupIcon from '~icons/mdi/movie-roll'
import CountIcon from '~icons/mdi/counter'
import SpecificDBTypeIcon from '~icons/mdi/database-settings'
import TableColumnPlusBefore from '~icons/mdi/table-column-plus-before'
import MdiTextSearchVariant from '~icons/mdi/text-search-variant'
const renderIcon = (column: ColumnType, relationColumn?: ColumnType) => {
switch (column.uidt) {
@ -35,13 +35,13 @@ const renderIcon = (column: ColumnType, relationColumn?: ColumnType) => {
case UITypes.Lookup:
switch ((relationColumn?.colOptions as LinkToAnotherRecordType)?.type) {
case RelationTypes.MANY_TO_MANY:
return { icon: TableColumnPlusBefore, color: 'text-accent' }
return { icon: MdiTextSearchVariant, color: 'text-accent' }
case RelationTypes.HAS_MANY:
return { icon: TableColumnPlusBefore, color: 'text-yellow-500' }
return { icon: MdiTextSearchVariant, color: 'text-yellow-500' }
case RelationTypes.BELONGS_TO:
return { icon: TableColumnPlusBefore, color: 'text-sky-500' }
return { icon: MdiTextSearchVariant, color: 'text-sky-500' }
}
return { icon: TableColumnPlusBefore, color: 'text-grey' }
return { icon: MdiTextSearchVariant, color: 'text-grey' }
case UITypes.Rollup:
switch ((relationColumn?.colOptions as LinkToAnotherRecordType)?.type) {
case RelationTypes.MANY_TO_MANY:

3
packages/nc-gui/utils/columnUtils.ts

@ -28,6 +28,7 @@ import MovieRoll from '~icons/mdi/movie-roll'
import CalendarClock from '~icons/mdi/calendar-clock'
import ID from '~icons/mdi/identifier'
import RulerSquareCompass from '~icons/mdi/ruler-square-compass'
import MdiTextSearchVariant from '~icons/mdi/text-search-variant'
const uiTypes = [
{
@ -37,7 +38,7 @@ const uiTypes = [
},
{
name: UITypes.Lookup,
icon: TableColumnPlusBefore,
icon: MdiTextSearchVariant,
virtual: 1,
},
{

Loading…
Cancel
Save