Browse Source

fix: warnings in ui

Signed-off-by: mertmit <mertmit99@gmail.com>
pull/6314/head
mertmit 1 year ago
parent
commit
9b20269d08
  1. 5
      packages/nc-gui/components/dashboard/settings/DataSources.vue
  2. 4
      packages/nc-gui/components/dashboard/settings/data-sources/CreateBase.vue
  3. 8
      packages/nc-gui/components/dlg/ViewCreate.vue
  4. 8
      packages/nc-gui/components/nc/Button.vue
  5. 7
      packages/nc-gui/components/nc/Tabs.vue
  6. 2
      packages/nc-gui/components/project/AccessSettings.vue
  7. 5
      packages/nc-gui/components/project/AllTables.vue
  8. 8
      packages/nc-gui/components/project/InviteProjectCollabSection.vue
  9. 1
      packages/nc-gui/components/smartsheet/toolbar/GroupByMenu.vue
  10. 2
      packages/nc-gui/components/workspace/CollaboratorsList.vue

5
packages/nc-gui/components/dashboard/settings/DataSources.vue

@ -52,6 +52,7 @@ async function loadBases(changed?: boolean) {
try {
if (changed) refreshCommandPalette()
await until(() => !!project.value.id).toBeTruthy()
isReloading.value = true
vReload.value = true
const baseList = await $api.base.list(project.value.id as string)
@ -164,8 +165,7 @@ const forceAwaken = () => {
onMounted(async () => {
if (sources.value.length === 0) {
await loadBases()
await loadMetaDiff()
loadBases()
}
})
@ -174,7 +174,6 @@ watch(
async (reload) => {
if (reload && !isReloading.value) {
await loadBases()
await loadMetaDiff()
}
},
)

4
packages/nc-gui/components/dashboard/settings/data-sources/CreateBase.vue

@ -350,8 +350,8 @@ onMounted(async () => {
// todo: replace setTimeout and follow better approach
setTimeout(() => {
const input = form.value?.$el?.querySelector('input[type=text]')
input.setSelectionRange(0, formState.value.title.length)
input.focus()
input?.setSelectionRange(0, formState.value.title.length)
input?.focus()
}, 500)
})
})

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

@ -156,7 +156,13 @@ function init() {
}
async function onSubmit() {
const isValid = await formValidator.value?.validateFields()
let isValid = null
try {
isValid = await formValidator.value?.validateFields()
} catch (e) {
console.error(e)
}
if (isValid && form.type) {
const _meta = unref(meta)

8
packages/nc-gui/components/nc/Button.vue

@ -33,6 +33,8 @@ const emits = defineEmits(['update:loading'])
const slots = useSlots()
const NcButton = ref<HTMLElement | null>(null)
const size = computed(() => props.size)
const type = computed(() => props.type)
@ -63,10 +65,15 @@ const onBlur = () => {
isFocused.value = false
isClicked.value = false
}
useEventListener(NcButton, 'mousedown', () => {
isClicked.value = true
})
</script>
<template>
<a-button
ref="NcButton"
:disabled="props.disabled"
:loading="loading"
:type="type"
@ -80,7 +87,6 @@ const onBlur = () => {
}"
@focus="onFocus"
@blur="onBlur"
@mousedown="isClicked = true"
>
<div
class="flex flex-row gap-x-2.5 w-full"

7
packages/nc-gui/components/nc/Tabs.vue

@ -3,17 +3,10 @@ const props = defineProps<{
modelValue?: string
centered?: boolean
}>()
const emits = defineEmits<{
(event: 'update:modelValue', data: string): void
}>()
const vModel = useVModel(props, 'modelValue', emits)
</script>
<template>
<a-tabs
v-model:activeKey="vModel"
class="nc-tabs"
:class="{
centered: props.centered,

2
packages/nc-gui/components/project/AccessSettings.vue

@ -154,7 +154,7 @@ const accessibleRoles = computed<(typeof ProjectRoles)[keyof typeof ProjectRoles
v-else-if="!collaborators?.length"
class="nc-collaborators-list w-full h-full flex flex-col items-center justify-center mt-36"
>
<Empty description="No collaborators found" />
<a-empty description="No collaborators found" />
</div>
<div v-else class="nc-collaborators-list nc-scrollbar-md">
<div class="nc-collaborators-list-header">

5
packages/nc-gui/components/project/AllTables.vue

@ -1,4 +1,5 @@
<script lang="ts" setup>
import { stringifyRolesObj } from 'nocodb-sdk'
import type { BaseType, TableType } from 'nocodb-sdk'
import dayjs from 'dayjs'
@ -8,6 +9,8 @@ const { openedProject } = storeToRefs(useProjects())
const { isUIAllowed } = useUIPermission()
const { allRoles } = useRoles()
const { $e } = useNuxtApp()
const isImportModalOpen = ref(false)
@ -71,7 +74,7 @@ function openTableCreateDialog(baseIndex?: number | undefined) {
<template>
<div class="nc-all-tables-view">
<div v-if="isUIAllowed('tableCreate', false, roles)" class="flex flex-row gap-x-6 pb-3 pt-6">
<div v-if="isUIAllowed('tableCreate', false, stringifyRolesObj(allRoles))" class="flex flex-row gap-x-6 pb-3 pt-6">
<div class="nc-project-view-all-table-btn" data-testid="proj-view-btn__add-new-table" @click="openTableCreateDialog()">
<GeneralIcon icon="addOutlineBox" />
<div class="label">{{ $t('general.new') }} {{ $t('objects.table') }}</div>

8
packages/nc-gui/components/project/InviteProjectCollabSection.vue

@ -23,7 +23,13 @@ const usersData = ref<{
roles?: string
}>()
const isInvitingCollaborators = ref(false)
const inviteCollaborator = async () => {
isInvitingCollaborators.value = true
if (isInvitingCollaborators.value) return
try {
usersData.value = await inviteUser(inviteData)
usersData.roles = inviteData.roles
@ -35,6 +41,8 @@ const inviteCollaborator = async () => {
} catch (e: any) {
message.error(await extractSdkResponseErrorMsg(e))
}
isInvitingCollaborators.value = false
}
const inviteUrl = computed(() =>

1
packages/nc-gui/components/smartsheet/toolbar/GroupByMenu.vue

@ -145,7 +145,6 @@ watch(open, () => {
<NcDropdown
v-model:visible="open"
offset-y
class=""
:trigger="['click']"
overlay-class-name="nc-dropdown-group-by-menu nc-toolbar-dropdown"
>

2
packages/nc-gui/components/workspace/CollaboratorsList.vue

@ -48,7 +48,7 @@ const accessibleRoles = computed<WorkspaceUserRoles[]>(() => {
</a-input>
</div>
<div v-if="!filterCollaborators?.length" class="w-full h-full flex flex-col items-center justify-center mt-36">
<Empty description="No collaborators found" />
<a-empty description="No collaborators found" />
</div>
<table v-else class="nc-collaborators-list-table !nc-scrollbar-md">
<thead>

Loading…
Cancel
Save