Browse Source

fix(nc-gui): calendar toolbar

pull/7611/head
DarkPhoenix2704 9 months ago
parent
commit
1a0b288f7c
  1. 30
      packages/nc-gui/components/dlg/ViewCreate.vue
  2. 2
      packages/nc-gui/components/smartsheet/toolbar/CalendarRange.vue
  3. 18
      packages/nc-gui/components/smartsheet/toolbar/FieldsMenu.vue

30
packages/nc-gui/components/dlg/ViewCreate.vue

@ -1,10 +1,20 @@
<script setup lang="ts">
import type { ComponentPublicInstance } from '@vue/runtime-core'
import type { Form as AntForm, SelectProps } from 'ant-design-vue'
import { capitalize } from '@vue/runtime-core'
import {CalendarType, FormType, GalleryType, GridType, KanbanType, MapType, TableType} from 'nocodb-sdk'
import { UITypes, ViewTypes, isSystemColumn } from 'nocodb-sdk'
import { computed, message, nextTick, onBeforeMount, reactive, ref, useApi, useI18n, useVModel, watch } from '#imports'
import type {ComponentPublicInstance} from '@vue/runtime-core'
import {capitalize} from '@vue/runtime-core'
import type {Form as AntForm, SelectProps} from 'ant-design-vue'
import {
CalendarType,
FormType,
GalleryType,
GridType,
isSystemColumn,
KanbanType,
MapType,
TableType,
UITypes,
ViewTypes
} from 'nocodb-sdk'
import {computed, message, nextTick, onBeforeMount, reactive, ref, useApi, useI18n, useVModel, watch} from '#imports'
interface Props {
modelValue: boolean
@ -22,6 +32,7 @@ interface Props {
interface Emits {
(event: 'update:modelValue', value: boolean): void
(event: 'created', value: GridType | KanbanType | GalleryType | FormType | MapType | CalendarType): void
}
@ -354,7 +365,8 @@ onMounted(async () => {
</template>
</template>
</div>
<a v-if="!form.copy_from_id" href="https://docs.nocodb.com/views/view-types/calendar/" target="_blank" class="text-sm !no-underline !hover:text-brand-500 text-brand-500 ">
<a v-if="!form.copy_from_id" href="https://docs.nocodb.com/views/view-types/calendar/" target="_blank"
class="text-sm !no-underline !hover:text-brand-500 text-brand-500 ">
Go to Docs
</a>
</div>
@ -409,7 +421,7 @@ onMounted(async () => {
{{ $t('labels.organizeRecordsBy') }}
</span>
<NcSelect
v-model:value="range.fk_from_column_id"
v-model:value="range.fk_from_column_id"
class="w-full"
:disabled="isMetaLoading"
:loading="isMetaLoading"
@ -435,7 +447,7 @@ onMounted(async () => {
}"/>
</div>
<NcSelect
v-model:value="range.fk_to_column_id"
v-model:value="range.fk_to_column_id"
class="w-full"
:disabled="isMetaLoading"
:loading="isMetaLoading"

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

@ -19,7 +19,7 @@ const {eventBus} = useSmartsheetStoreOrThrow()
const meta = inject(MetaInj, ref())
const { $e, $api } = useNuxtApp()
const {$e, $api} = useNuxtApp()
const activeView = inject(ActiveViewInj, ref())

18
packages/nc-gui/components/smartsheet/toolbar/FieldsMenu.vue

@ -1,18 +1,17 @@
<script setup lang="ts">
import {CalendarType, ColumnType, GalleryType, KanbanType} from 'nocodb-sdk'
import { UITypes, ViewTypes, isVirtualCol } from 'nocodb-sdk'
import {CalendarType, ColumnType, GalleryType, isVirtualCol, KanbanType, UITypes, ViewTypes} from 'nocodb-sdk'
import Draggable from 'vuedraggable'
import type { SelectProps } from 'ant-design-vue'
import type {SelectProps} from 'ant-design-vue'
import {
ActiveViewInj,
FieldsInj,
IsLockedInj,
IsPublicInj,
computed,
FieldsInj,
iconMap,
inject,
IsLockedInj,
IsPublicInj,
ref,
resolveComponent,
useMenuCloseOnEsc,
@ -151,7 +150,7 @@ const coverOptions = computed<SelectProps['options']>(() => {
const updateCoverImage = async (val?: string | null) => {
if (
(activeView.value?.type === ViewTypes.GALLERY || activeView.value?.type === ViewTypes.KANBAN || activeView.value?.type === ViewTypes.CALENDAR) &&
(activeView.value?.type === ViewTypes.GALLERY || activeView.value?.type === ViewTypes.KANBAN || activeView.value?.type === ViewTypes.CALENDAR) &&
activeView.value?.id &&
activeView.value?.view
) {
@ -178,7 +177,7 @@ const updateCoverImage = async (val?: string | null) => {
const coverImageColumnId = computed({
get: () => {
const fk_cover_image_col_id =
(activeView.value?.type === ViewTypes.GALLERY || activeView.value?.type === ViewTypes.KANBAN || activeView.value?.type === ViewTypes.CALENDAR) && activeView.value?.view
(activeView.value?.type === ViewTypes.GALLERY || activeView.value?.type === ViewTypes.KANBAN || activeView.value?.type === ViewTypes.CALENDAR) && activeView.value?.view
? (activeView.value?.view as GalleryType).fk_cover_image_col_id
: undefined
// check if `fk_cover_image_col_id` is in `coverOptions`
@ -310,7 +309,8 @@ useMenuCloseOnEsc(open)
<!-- Fields -->
<span v-if="!isMobileMode" class="text-capitalize text-sm font-medium">
<template v-if="activeView?.type === ViewTypes.KANBAN || activeView?.type === ViewTypes.GALLERY || activeView?.type === ViewTypes.CALENDAR">
<template
v-if="activeView?.type === ViewTypes.KANBAN || activeView?.type === ViewTypes.GALLERY || activeView?.type === ViewTypes.CALENDAR">
{{ $t('title.editCards') }}
</template>
<template v-else>

Loading…
Cancel
Save