Browse Source

chore(nc-gui): lint & remove unused imports

pull/6447/head
wkw 11 months ago
parent
commit
c5b986d7ff
  1. 26
      packages/nc-gui/components/dashboard/Sidebar/UserInfo.vue
  2. 3
      packages/nc-gui/components/dashboard/TreeView/TableNode.vue
  3. 4
      packages/nc-gui/components/dashboard/settings/DataSources.vue
  4. 13
      packages/nc-gui/components/general/JoinCloud.vue
  5. 26
      packages/nc-gui/components/general/Modal.vue
  6. 2
      packages/nc-gui/components/roles/Badge.vue
  7. 1
      packages/nc-gui/components/smartsheet/expanded-form/index.vue
  8. 2
      packages/nc-gui/components/workspace/InviteSection.vue
  9. 9
      packages/nc-gui/components/workspace/Menu.vue
  10. 3
      packages/nc-gui/store/workspace.ts

26
packages/nc-gui/components/dashboard/Sidebar/UserInfo.vue

@ -67,8 +67,10 @@ onMounted(() => {
<template>
<div class="flex w-full flex-col p-1 border-t-1 border-gray-200 gap-y-2">
<NcDropdown v-model:visible="isMenuOpen" placement="topLeft" overlay-class-name="!min-w-64">
<div class="flex flex-row py-2 px-3 gap-x-2 items-center hover:bg-gray-200 rounded-lg cursor-pointer h-10"
data-testid="nc-sidebar-userinfo">
<div
class="flex flex-row py-2 px-3 gap-x-2 items-center hover:bg-gray-200 rounded-lg cursor-pointer h-10"
data-testid="nc-sidebar-userinfo"
>
<GeneralUserIcon />
<div class="flex truncate">
{{ name ? name : user?.email }}
@ -96,9 +98,7 @@ onMounted(() => {
</NcMenuItem>
</a>
<a href="https://www.reddit.com/r/NocoDB" target="_blank" class="!underline-transparent">
<NcMenuItem class="social-icon-wrapper">
<GeneralIcon class="social-icon" icon="reddit" />/r/NocoDB
</NcMenuItem>
<NcMenuItem class="social-icon-wrapper"> <GeneralIcon class="social-icon" icon="reddit" />/r/NocoDB </NcMenuItem>
</a>
<a href="https://twitter.com/nocodb" target="_blank" class="!underline-transparent">
<NcMenuItem class="social-icon-wrapper group">
@ -114,8 +114,7 @@ onMounted(() => {
<div class="flex items-center text-gray-400 text-xs">(Community Translated)</div>
<div class="flex-1" />
<MaterialSymbolsChevronRightRounded
class="transform group-hover:(scale-115 text-accent) text-xl text-gray-400" />
<MaterialSymbolsChevronRightRounded class="transform group-hover:(scale-115 text-accent) text-xl text-gray-400" />
</NcMenuItem>
<template #content>
@ -134,9 +133,7 @@ onMounted(() => {
<template v-else> Copy Auth Token </template>
</NcMenuItem>
<nuxt-link v-e="['c:navbar:user:email']" class="!no-underline" to="/account/profile">
<NcMenuItem>
<GeneralIcon icon="settings" class="menu-icon" /> Account Settings
</NcMenuItem>
<NcMenuItem> <GeneralIcon icon="settings" class="menu-icon" /> Account Settings </NcMenuItem>
</nuxt-link>
</NcMenu>
</template>
@ -145,8 +142,13 @@ onMounted(() => {
<div v-if="appInfo.ee" class="text-gray-500 text-xs pl-3">© 2023 NocoDB. Inc</div>
<div v-else-if="isMounted" class="flex flex-row justify-between pt-1 truncate">
<div class="flex flex-wrap mb-1">
<GithubButton class="px-2 mb-1" href="https://github.com/nocodb/nocodb" data-icon="octicon-star"
data-show-count="true" data-size="large">
<GithubButton
class="px-2 mb-1"
href="https://github.com/nocodb/nocodb"
data-icon="octicon-star"
data-show-count="true"
data-size="large"
>
Star
</GithubButton>
<div>

3
packages/nc-gui/components/dashboard/TreeView/TableNode.vue

@ -157,7 +157,8 @@ const canUserEditEmote = computed(() => {
<NcDropdown
v-if="
!isSharedBase && (isUIAllowed('tableRename', { roles: projectRole }) || isUIAllowed('tableDelete', { roles: projectRole }))
!isSharedBase &&
(isUIAllowed('tableRename', { roles: projectRole }) || isUIAllowed('tableDelete', { roles: projectRole }))
"
:trigger="['click']"
@click.stop

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

@ -513,9 +513,7 @@ const isEditBaseModalOpen = computed({
</div>
</GeneralModal>
<GeneralModal v-model:visible="isErdModalOpen" size="large">
<div
class="h-[80vh]"
>
<div class="h-[80vh]">
<LazyDashboardSettingsErd :base-id="activeBaseId" />
</div>
</GeneralModal>

13
packages/nc-gui/components/general/JoinCloud.vue

@ -3,17 +3,22 @@ import { iconMap } from '#imports'
</script>
<template>
<a v-e="['c:navbar:join-cloud']" class="flex !no-underline"
href="https://docs.google.com/forms/d/e/1FAIpQLSfKLe8Rcrq0uo2_jM5W1kbVBbzDiQ3IvlP8Iov61FTekVAvzA/viewform?usp=pp_url">
<a
v-e="['c:navbar:join-cloud']"
class="flex !no-underline"
href="https://docs.google.com/forms/d/e/1FAIpQLSfKLe8Rcrq0uo2_jM5W1kbVBbzDiQ3IvlP8Iov61FTekVAvzA/viewform?usp=pp_url"
>
<div
class="flex justify-center items-center rounded-l-[3px] w-full cursor-pointer px-2 py-1 !text-current !no-underline text-primary border-1 border-[#cdd1d6] bg-[#EFF2F6] hover:bg-[#e9ebef] m-0"
target="_blank">
target="_blank"
>
<component :is="iconMap.cloud" class="mt-[1px] text-black font-bold" />
<div class="px-1 text-xs font-bold text-gray-800">Join</div>
</div>
<div
class="group flex justify-center items-center rounded-r-[3px] w-full cursor-pointer px-1 py-1 text-primary border-r-1 border-b-1 border-t-1 border-[#cdd1d6] m-0"
target="_blank">
target="_blank"
>
<div class="px-1 text-xs font-semibold group-hover:text-[#0a69da] text-gray-900">NocoDB Cloud</div>
</div>
</a>

26
packages/nc-gui/components/general/Modal.vue

@ -57,20 +57,18 @@ const visible = useVModel(props, 'visible', emits)
<template>
<a-modal
v-model:visible="visible"
:class="{ active: visible }"
:width="width"
:closable="false"
wrap-class-name="nc-modal-wrapper"
:footer="null"
:destroy-on-close="destroyOnClose"
@keydown.esc="visible = false"
>
<div
class="nc-modal max-h-[{{ height }}]"
>
<slot />
</div>
v-model:visible="visible"
:class="{ active: visible }"
:width="width"
:closable="false"
wrap-class-name="nc-modal-wrapper"
:footer="null"
:destroy-on-close="destroyOnClose"
@keydown.esc="visible = false"
>
<div class="nc-modal max-h-[{{ height }}]">
<slot />
</div>
</a-modal>
</template>

2
packages/nc-gui/components/roles/Badge.vue

@ -18,7 +18,7 @@ const props = withDefaults(
const roleRef = toRef(props, 'role')
const clickableRef = toRef(props, 'clickable')
const inheritRef = toRef(props, 'inherit')
// const inheritRef = toRef(props, 'inherit')
const borderRef = toRef(props, 'border')
const roleProperties = computed(() => {

1
packages/nc-gui/components/smartsheet/expanded-form/index.vue

@ -7,7 +7,6 @@ import {
CellClickHookInj,
FieldsInj,
IsExpandedFormOpenInj,
IsFormInj,
IsKanbanInj,
MetaInj,
ReloadRowDataHookInj,

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

@ -1,5 +1,5 @@
<script lang="ts" setup>
import { OrderedWorkspaceRoles, RoleColors, RoleLabels, WorkspaceUserRoles } from 'nocodb-sdk'
import { OrderedWorkspaceRoles, WorkspaceUserRoles } from 'nocodb-sdk'
import { extractSdkResponseErrorMsg, useWorkspace } from '#imports'
const inviteData = reactive({

9
packages/nc-gui/components/workspace/Menu.vue

@ -3,10 +3,11 @@
<template>
<div class="flex flex-row flex-grow pl-0.5 pr-1 py-0.5 rounded-md w-full" style="max-width: calc(100% - 2.5rem)">
<div class="flex-grow min-w-20">
<div data-testid="nc-workspace-menu"
class="flex items-center nc-workspace-menu overflow-hidden py-1.25 pr-0.25 justify-center w-full">
<a class="transition-all duration-200 transform" href="https://github.com/nocodb/nocodb"
target="_blank">
<div
data-testid="nc-workspace-menu"
class="flex items-center nc-workspace-menu overflow-hidden py-1.25 pr-0.25 justify-center w-full"
>
<a class="transition-all duration-200 transform" href="https://github.com/nocodb/nocodb" target="_blank">
<img alt="NocoDB" src="~/assets/img/brand/nocodb-full.png" class="h-10" />
</a>
<div class="flex flex-grow"></div>

3
packages/nc-gui/store/workspace.ts

@ -1,4 +1,3 @@
import { OrgUserRoles } from 'nocodb-sdk'
import type { ProjectType } from 'nocodb-sdk'
import { acceptHMRUpdate, defineStore } from 'pinia'
import { message } from 'ant-design-vue'
@ -27,8 +26,6 @@ export const useWorkspace = defineStore('workspaceStore', () => {
const { appInfo, ncNavigateTo } = useGlobal()
const { orgRoles } = useRoles()
const workspaces = ref<Map<string, any>>(new Map())
const workspacesList = computed<any[]>(() => Array.from(workspaces.value.values()).sort((a, b) => a.updated_at - b.updated_at))

Loading…
Cancel
Save