Browse Source

chore(gui-v2): cleanup type issues

pull/3044/head
braks 2 years ago
parent
commit
1b87292e97
  1. 4
      packages/nc-gui-v2/components/smartsheet-column/RollupOptions.vue
  2. 2
      packages/nc-gui-v2/components/smartsheet-toolbar/ColumnFilter.vue
  3. 4
      packages/nc-gui-v2/components/smartsheet-toolbar/SearchData.vue
  4. 11
      packages/nc-gui-v2/components/smartsheet/Grid.vue
  5. 2
      packages/nc-gui-v2/components/smartsheet/sidebar/toolbar/LockMenu.vue

4
packages/nc-gui-v2/components/smartsheet-column/RollupOptions.vue

@ -5,11 +5,11 @@ import { MetaInj } from '~/context'
const { formState, validateInfos, onDataTypeChange, setAdditionalValidations } = $(useColumnCreateStoreOrThrow())
const { tables } = $(useProject())!
const { tables } = $(useProject())
const meta = $(inject(MetaInj)!)
const { metas } = $(useMetas())!
const { metas } = $(useMetas())
setAdditionalValidations({
fk_relation_column_id: [{ required: true, message: 'Required' }],

2
packages/nc-gui-v2/components/smartsheet-toolbar/ColumnFilter.vue

@ -289,6 +289,6 @@ defineExpose({
}
:deep(.ant-select-item-option) {
@apply "!min-w-min";
@apply "!min-w-full";
}
</style>

4
packages/nc-gui-v2/components/smartsheet-toolbar/SearchData.vue

@ -4,13 +4,13 @@ import { ReloadViewDataHookInj } from '~/context'
const reloadData = inject(ReloadViewDataHookInj)!
const { search, meta } = useSmartsheetStoreOrThrow()!
const { search, meta } = useSmartsheetStoreOrThrow()
// todo: where is this value supposed to come from? it's not in the store
const isDropdownOpen = ref(false)
const columns = computed(() =>
meta.value.columns?.map((c) => ({
meta.value?.columns?.map((c) => ({
value: c.id,
label: c.title,
})),

11
packages/nc-gui-v2/components/smartsheet/Grid.vue

@ -25,8 +25,6 @@ import {
ReloadViewDataHookInj,
} from '~/context'
import { NavigateDir } from '~/lib'
import MdiArrowExpandIcon from '~icons/mdi/arrow-expand'
import MdiPlusIcon from '~icons/mdi/plus'
const meta = inject(MetaInj)
const view = inject(ActiveViewInj)
@ -40,7 +38,6 @@ const isView = false
const selected = reactive<{ row: number | null; col: number | null }>({ row: null, col: null })
let editEnabled = $ref(false)
const { sqlUi } = useProject()
const { xWhere, isPkAvail } = useSmartsheetStoreOrThrow()
const addColumnDropdown = ref(false)
const contextMenu = ref(false)
@ -288,7 +285,7 @@ const onNavigate = (dir: NavigateDir) => {
<th v-t="['c:column:add']" @click="addColumnDropdown = true">
<a-dropdown v-model:visible="addColumnDropdown" :trigger="['click']">
<div class="h-full w-[60px] flex align-center justify-center">
<MdiPlusIcon class="text-sm" />
<MdiPlus class="text-sm" />
</div>
<template #overlay>
<SmartsheetColumnEditOrAdd @click.stop @cancel="addColumnDropdown = false" />
@ -308,7 +305,7 @@ const onNavigate = (dir: NavigateDir) => {
>
<a-checkbox v-model:checked="row.rowMeta.selected" />
<span class="flex-1" />
<MdiArrowExpandIcon class="text-sm text-pink hidden group-hover:inline-block" />
<MdiArrowExpand class="text-sm text-pink hidden group-hover:inline-block" />
</div>
</div>
</td>
@ -357,8 +354,8 @@ const onNavigate = (dir: NavigateDir) => {
@click="addEmptyRow()"
>
<a-tooltip top left>
<div class="w-min flex align-center">
<MdiPlusIcon class="text-pint-500 text-xs" />
<div class="w-full flex align-center">
<MdiPlus class="text-pint-500 text-xs" />
<span class="ml-1 caption grey--text">
{{ $t('activity.addRow') }}
</span>

2
packages/nc-gui-v2/components/smartsheet/sidebar/toolbar/LockMenu.vue

@ -36,7 +36,7 @@ function changeLockType(type: LockType) {
}
const Icon = computed(() => {
switch ((view.value as any).lock_type) {
switch ((view.value as any)?.lock_type) {
case LockType.Personal:
return MdiAccountIcon
case LockType.Locked:

Loading…
Cancel
Save