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"> <script setup lang="ts">
import type { ComponentPublicInstance } from '@vue/runtime-core' import type {ComponentPublicInstance} from '@vue/runtime-core'
import type { Form as AntForm, SelectProps } from 'ant-design-vue' import {capitalize} 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, KanbanType, MapType, TableType} from 'nocodb-sdk' import {
import { UITypes, ViewTypes, isSystemColumn } from 'nocodb-sdk' CalendarType,
import { computed, message, nextTick, onBeforeMount, reactive, ref, useApi, useI18n, useVModel, watch } from '#imports' 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 { interface Props {
modelValue: boolean modelValue: boolean
@ -22,6 +32,7 @@ interface Props {
interface Emits { interface Emits {
(event: 'update:modelValue', value: boolean): void (event: 'update:modelValue', value: boolean): void
(event: 'created', value: GridType | KanbanType | GalleryType | FormType | MapType | CalendarType): void (event: 'created', value: GridType | KanbanType | GalleryType | FormType | MapType | CalendarType): void
} }
@ -354,7 +365,8 @@ onMounted(async () => {
</template> </template>
</template> </template>
</div> </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 Go to Docs
</a> </a>
</div> </div>
@ -409,7 +421,7 @@ onMounted(async () => {
{{ $t('labels.organizeRecordsBy') }} {{ $t('labels.organizeRecordsBy') }}
</span> </span>
<NcSelect <NcSelect
v-model:value="range.fk_from_column_id" v-model:value="range.fk_from_column_id"
class="w-full" class="w-full"
:disabled="isMetaLoading" :disabled="isMetaLoading"
:loading="isMetaLoading" :loading="isMetaLoading"
@ -435,7 +447,7 @@ onMounted(async () => {
}"/> }"/>
</div> </div>
<NcSelect <NcSelect
v-model:value="range.fk_to_column_id" v-model:value="range.fk_to_column_id"
class="w-full" class="w-full"
:disabled="isMetaLoading" :disabled="isMetaLoading"
:loading="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 meta = inject(MetaInj, ref())
const { $e, $api } = useNuxtApp() const {$e, $api} = useNuxtApp()
const activeView = inject(ActiveViewInj, ref()) const activeView = inject(ActiveViewInj, ref())

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

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

Loading…
Cancel
Save