Browse Source

refactor: remove unused icons from icon map and combine import statement

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5343/head
Pranav C 2 years ago
parent
commit
bc9c999a3d
  1. 1
      packages/nc-gui/components.d.ts
  2. 2
      packages/nc-gui/components/dashboard/TreeView.vue
  3. 3
      packages/nc-gui/components/dashboard/settings/Modal.vue
  4. 11
      packages/nc-gui/components/general/PreviewAs.vue
  5. 2
      packages/nc-gui/components/smartsheet/header/CellIcon.ts
  6. 3
      packages/nc-gui/components/smartsheet/header/VirtualCellIcon.ts
  7. 2
      packages/nc-gui/components/smartsheet/toolbar/ColumnFilterMenu.vue
  8. 2
      packages/nc-gui/components/smartsheet/toolbar/ExportSubActions.vue
  9. 3
      packages/nc-gui/components/smartsheet/toolbar/LockType.vue
  10. 2
      packages/nc-gui/components/smartsheet/toolbar/SearchData.vue
  11. 3
      packages/nc-gui/components/smartsheet/toolbar/ViewActions.vue
  12. 6
      packages/nc-gui/pages/[projectType]/[projectId]/index/index.vue
  13. 18
      packages/nc-gui/utils/iconUtils.ts

1
packages/nc-gui/components.d.ts vendored

@ -259,7 +259,6 @@ declare module '@vue/runtime-core' {
NcIconsRowHeightMedium: typeof import('~icons/nc-icons/row-height-medium')['default']
NcIconsRowHeightShort: typeof import('~icons/nc-icons/row-height-short')['default']
NcIconsRowHeightTall: typeof import('~icons/nc-icons/row-height-tall')['default']
'Ph:clockClockwiseThin': typeof import('~icons/ph/clock-clockwise-thin')['default']
PhArrowClockwiseThin: typeof import('~icons/ph/arrow-clockwise-thin')['default']
PhAtThin: typeof import('~icons/ph/at-thin')['default']
PhBracketsAngleThin: typeof import('~icons/ph/brackets-angle-thin')['default']

2
packages/nc-gui/components/dashboard/TreeView.vue

@ -29,10 +29,10 @@ import {
useToggle,
useUIPermission,
watchEffect,
iconMap
} from '#imports'
import PhEyeThin from '~icons/ph/EyeThin'
import PhTableThin from '~icons/ph/TableThin'
import { iconMap } from '~/utils'
const { isMobileMode } = useGlobal()

3
packages/nc-gui/components/dashboard/settings/Modal.vue

@ -2,8 +2,7 @@
import type { FunctionalComponent, SVGAttributes } from 'vue'
import DataSources from './DataSources.vue'
import Misc from './Misc.vue'
import { iconMap } from '~/utils'
import { DataSourcesSubTab, useI18n, useNuxtApp, useUIPermission, useVModel, watch } from '#imports'
import { DataSourcesSubTab,iconMap, useI18n, useNuxtApp, useUIPermission, useVModel, watch } from '#imports'
interface Props {
modelValue: boolean

11
packages/nc-gui/components/general/PreviewAs.vue

@ -1,10 +1,9 @@
<script lang="ts" setup>
import { onUnmounted, ref, useEventListener, useGlobal, useI18n, useNuxtApp, watch } from '#imports'
import { iconMap } from '~/utils'
import { onUnmounted, ref, useEventListener, useGlobal, useI18n, useNuxtApp, watch,iconMap } from '#imports'
import MdiAccountStar from '~icons/mdi/account-star'
import MdiAccountHardHat from '~icons/mdi/account-hard-hat'
import MdiAccountEdit from '~icons/ph/pencil-circle-thin'
import MdiCommentAccountOutline from '~icons/ph/chat-teardrop-text-thin'
import PhPencilCircleThin from '~icons/ph/pencil-circle-thin'
import PhChtTeardropTextThin from '~icons/ph/chat-teardrop-text-thin'
import { ProjectRole } from '~/lib'
const { float } = defineProps<{ float?: boolean }>()
@ -24,9 +23,9 @@ const roleList = [
const roleIcon = {
owner: MdiAccountStar,
creator: MdiAccountHardHat,
editor: MdiAccountEdit,
editor: PhPencilCircleThin,
viewer: iconMap.eye,
commenter: MdiCommentAccountOutline,
commenter: PhChtTeardropTextThin,
}
const position = ref({

2
packages/nc-gui/components/smartsheet/header/CellIcon.ts

@ -33,8 +33,8 @@ import {
storeToRefs,
toRef,
useProject,
iconMap
} from '#imports'
import { iconMap } from '~/utils'
const renderIcon = (column: ColumnType, abstractType: any) => {
if (isPrimaryKey(column)) {

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

@ -2,8 +2,7 @@ import type { PropType } from '@vue/runtime-core'
import type { ColumnType, LinkToAnotherRecordType, LookupType, RollupType } from 'nocodb-sdk'
import type { Ref } from 'vue'
import { RelationTypes, UITypes } from 'nocodb-sdk'
import { ColumnInj, MetaInj, defineComponent, h, inject, isBt, isHm, isLookup, isMm, isRollup, ref, toRef } from '#imports'
import { iconMap } from '~/utils'
import { ColumnInj, MetaInj, defineComponent, h, inject, isBt, isHm, isLookup, isMm, isRollup, ref, toRef, iconMap} from '#imports'
import CountIcon from '~icons/mdi/counter'
const renderIcon = (column: ColumnType, relationColumn?: ColumnType) => {

2
packages/nc-gui/components/smartsheet/toolbar/ColumnFilterMenu.vue

@ -13,8 +13,8 @@ import {
useSmartsheetStoreOrThrow,
useViewFilters,
watch,
iconMap
} from '#imports'
import { iconMap } from '~/utils'
const isLocked = inject(IsLockedInj, ref(false))

2
packages/nc-gui/components/smartsheet/toolbar/ExportSubActions.vue

@ -15,8 +15,8 @@ import {
useNuxtApp,
useProject,
useSmartsheetStoreOrThrow,
iconMap
} from '#imports'
import { iconMap } from '~/utils'
const { t } = useI18n()

3
packages/nc-gui/components/smartsheet/toolbar/LockType.vue

@ -1,7 +1,6 @@
<script setup lang="ts">
import { iconMap } from '~/utils'
import { LockType } from '~/lib'
import { ActiveViewInj, inject } from '#imports'
import { ActiveViewInj, inject, iconMap } from '#imports'
const { type, hideTick } = defineProps<{ hideTick?: boolean; type: LockType }>()

2
packages/nc-gui/components/smartsheet/toolbar/SearchData.vue

@ -8,10 +8,10 @@ import {
onClickOutside,
ref,
useFieldQuery,
iconMap,
useSmartsheetStoreOrThrow,
} from '#imports'
import { iconMap } from '~/utils'
const reloadData = inject(ReloadViewDataHookInj)!

3
packages/nc-gui/components/smartsheet/toolbar/ViewActions.vue

@ -15,10 +15,9 @@ import {
useNuxtApp,
useProject,
useSmartsheetStoreOrThrow,
useUIPermission,
useUIPermission,iconMap
} from '#imports'
import { LockType } from '~/lib'
import { iconMap } from '~/utils'
const { t } = useI18n()

6
packages/nc-gui/pages/[projectType]/[projectId]/index/index.vue

@ -15,11 +15,11 @@ provide(TabMetaInj, activeTab)
const icon = (tab: TabItem) => {
switch (tab.type) {
case TabType.TABLE:
return iconMap['mdi-table-large']
return iconMap['table']
case TabType.VIEW:
return iconMap['mdi-eye-circle-outline']
return iconMap['eye']
case TabType.AUTH:
return iconMap['mdi-account-group']
return iconMap['users-icon']
}
}

18
packages/nc-gui/utils/iconUtils.ts

@ -79,24 +79,6 @@ import BTIcon from '~icons/mdi/table-arrow-left'
import MMIcon from '~icons/mdi/table-network'
export const iconMap = {
'mdi-check-bold': MdiCheckBold,
'mdi-crop-square': MdiCropSquare,
'mdi-check-circle-outline': MdiCheckCircleOutline,
'mdi-checkbox-blank-circle-outline': MdiCheckboxBlankCircleOutline,
'mdi-star': MdiStar,
'mdi-star-outline': MdiStarOutline,
'mdi-heart': MdiHeart,
'mdi-heart-outline': MdiHeartOutline,
'mdi-moon-full': MdiMoonFull,
'mdi-moon-new': MdiMoonNew,
'mdi-thumb-up': MdiThumbUp,
'mdi-thumb-up-outline': MdiThumbUpOutline,
'mdi-flag': MdiFlag,
'mdi-flag-outline': MdiFlagOutline,
'mdi-table-large': PhTableThin,
'mdi-eye-circle-outline': PhEyeThin,
'mdi-account-group': PhUsersThreeThin,
'lock-icon': PhLockIcon,
'account-icon': PhAccountIcon,
'users-icon': PhUsersThreeThin,

Loading…
Cancel
Save