Browse Source

geodata: add 'Add Map View' button

pull/4140/head
flisowna 2 years ago
parent
commit
440765cff8
  1. 22
      packages/nc-gui/components/smartsheet/sidebar/MenuBottom.vue
  2. 3
      packages/nc-gui/lang/de.json
  3. 4
      packages/nc-gui/lang/en.json
  4. 3
      packages/nc-gui/utils/viewUtils.ts

22
packages/nc-gui/components/smartsheet/sidebar/MenuBottom.vue

@ -114,6 +114,28 @@ function onOpenModal(type: ViewTypes, title = '') {
</a-tooltip> </a-tooltip>
</a-menu-item> </a-menu-item>
<a-menu-item
key="map"
class="group !flex !items-center !my-0 !h-2.5rem nc-create-map-view"
@click="onOpenModal(ViewTypes.MAP)"
>
<a-tooltip :mouse-enter-delay="1" placement="left">
<template #title>
{{ $t('msg.info.addView.map') }}
</template>
<div class="nc-project-menu-item !py-0 text-xs flex items-center h-full w-full gap-2">
<component :is="viewIcons[ViewTypes.MAP].icon" :style="{ color: viewIcons[ViewTypes.MAP].color }" />
<div>{{ $t('objects.viewType.map') }}</div>
<div class="flex-1" />
<mdi-plus class="group-hover:text-primary" />
</div>
</a-tooltip>
</a-menu-item>
<div class="w-full h-4" /> <div class="w-full h-4" />
</div> </div>
</a-menu> </a-menu>

3
packages/nc-gui/lang/de.json

@ -93,7 +93,8 @@
"gallery": "Galerie", "gallery": "Galerie",
"form": "Formular", "form": "Formular",
"kanban": "Kanban", "kanban": "Kanban",
"calendar": "Kalender" "calendar": "Kalender",
"map": "Karte"
}, },
"user": "Nutzer", "user": "Nutzer",
"users": "Benutzer", "users": "Benutzer",

4
packages/nc-gui/lang/en.json

@ -93,7 +93,8 @@
"gallery": "Gallery", "gallery": "Gallery",
"form": "Form", "form": "Form",
"kanban": "Kanban", "kanban": "Kanban",
"calendar": "Calendar" "calendar": "Calendar",
"map": "Map"
}, },
"user": "User", "user": "User",
"users": "Users", "users": "Users",
@ -562,6 +563,7 @@
"gallery": "Add Gallery View", "gallery": "Add Gallery View",
"form": "Add Form View", "form": "Add Form View",
"kanban": "Add Kanban View", "kanban": "Add Kanban View",
"map": "Add Map View",
"calendar": "Add Calendar View" "calendar": "Add Calendar View"
}, },
"tablesMetadataInSync": "Tables metadata is in Sync", "tablesMetadataInSync": "Tables metadata is in Sync",

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

@ -6,6 +6,7 @@ import MdiFormIcon from '~icons/mdi/form-select'
import MdiCalendarIcon from '~icons/mdi/calendar' import MdiCalendarIcon from '~icons/mdi/calendar'
import MdiGalleryIcon from '~icons/mdi/camera-image' import MdiGalleryIcon from '~icons/mdi/camera-image'
import MdiKanbanIcon from '~icons/mdi/tablet-dashboard' import MdiKanbanIcon from '~icons/mdi/tablet-dashboard'
import MdiMapIcon from '~icons/mdi/map-outline'
import MdiEyeIcon from '~icons/mdi/eye-circle-outline' import MdiEyeIcon from '~icons/mdi/eye-circle-outline'
export const viewIcons: Record<number | string, { icon: any; color: string }> = { export const viewIcons: Record<number | string, { icon: any; color: string }> = {
@ -13,6 +14,7 @@ export const viewIcons: Record<number | string, { icon: any; color: string }> =
[ViewTypes.FORM]: { icon: MdiFormIcon, color: themeV2Colors.pink['500'] }, [ViewTypes.FORM]: { icon: MdiFormIcon, color: themeV2Colors.pink['500'] },
calendar: { icon: MdiCalendarIcon, color: 'purple' }, calendar: { icon: MdiCalendarIcon, color: 'purple' },
[ViewTypes.GALLERY]: { icon: MdiGalleryIcon, color: 'orange' }, [ViewTypes.GALLERY]: { icon: MdiGalleryIcon, color: 'orange' },
[ViewTypes.MAP]: { icon: MdiMapIcon, color: 'blue' },
[ViewTypes.KANBAN]: { icon: MdiKanbanIcon, color: 'green' }, [ViewTypes.KANBAN]: { icon: MdiKanbanIcon, color: 'green' },
view: { icon: MdiEyeIcon, color: 'blue' }, view: { icon: MdiEyeIcon, color: 'blue' },
} }
@ -22,4 +24,5 @@ export const viewTypeAlias = {
[ViewTypes.FORM]: 'form', [ViewTypes.FORM]: 'form',
[ViewTypes.GALLERY]: 'gallery', [ViewTypes.GALLERY]: 'gallery',
[ViewTypes.KANBAN]: 'kanban', [ViewTypes.KANBAN]: 'kanban',
[ViewTypes.MAP]: 'map',
} }

Loading…
Cancel
Save