Browse Source

refactor(gui-v2): remove unnecessary class and attributes

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/3267/head
Pranav C 2 years ago
parent
commit
d7f339231b
  1. 3
      packages/nc-gui-v2/components/dashboard/TreeView.vue
  2. 42
      packages/nc-gui-v2/components/general/HelpAndSupport.vue
  3. 3
      packages/nc-gui-v2/components/general/ShareBaseButton.vue
  4. 58
      packages/nc-gui-v2/components/general/SocialCard.vue
  5. 2
      packages/nocodb/package-lock.json
  6. 2
      packages/nocodb/package.json

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

@ -410,7 +410,8 @@ function openTableCreateDialog() {
<a-divider class="!my-0" />
<div class="flex items-start flex-col justify-start px-4 py-5 gap-2">
<GeneralShareBaseButton class="py-1 px-2 text-primary font-weight-bold cursor-pointer select-none" />
<GeneralShareBaseButton class="py-1 px-2 text-primary font-bold cursor-pointer select-none" />
<GeneralHelpAndSupport class="py-1 px-2 text-gray-500 cursor-pointer select-none" />
</div>
</div>

42
packages/nc-gui-v2/components/general/HelpAndSupport.vue

@ -1,10 +1,22 @@
<script lang="ts" setup>
import { useGlobal, useProject } from '#imports'
const showDrawer = ref(false)
const { appInfo } = useGlobal()
const { project } = useProject()
const route = useRoute()
const openSwaggerLink = () => {
openLink(`/api/v1/db/meta/projects/${route.params.projectId}/swagger`, appInfo.value.ncSiteUrl)
}
</script>
<template>
<div>
<div size="middle" type="primary" class="rounded" @click="showDrawer = true">
<div @click="showDrawer = true">
<div class="flex items-center space-x-1">
<MdiCommentTextOutline class="mr-1 nc-share-base" />
<!-- todo: i18n -->
@ -15,19 +27,39 @@ const showDrawer = ref(false)
<a-drawer
v-model:visible="showDrawer"
class="h-full relative"
style="color: red"
placement="right"
size="small"
:closable="false"
:body-style="{ padding: '12px 24px 24px 24px', background: '#fafafa' }"
:body-style="{ padding: '12px 24px 0 24px', background: '#fafafa' }"
>
<div class="flex flex-col w-full h-full p-4">
<div class="flex flex-col w-full h-full p-4 pb-0">
<!-- todo: i18n -->
<a-typography-title :level="4" class="!mb-6 !text-gray-500">Help center</a-typography-title>
<GeneralSocialCard show-swagger-link class="!w-full nc-social-card" />
<GeneralSocialCard show-swagger-link class="!w-full nc-social-card">
<template #before>
<a-list-item v-if="project">
<nuxt-link
v-t="['e:docs']"
class="text-primary !no-underline !text-current py-4 font-weight-medium"
target="_blank"
@click="openSwaggerLink"
>
<div class="ml-3 flex items-center text-sm">
<LogosSwagger />
<!-- todo: i18n -->
<span class="ml-3">{{ project.title }} : Swagger Documentation</span>
</div>
</nuxt-link>
</a-list-item>
</template>
</GeneralSocialCard>
<div class="flex-1 my-2"></div>
<GeneralSponsors class="!w-full" />
<div class="min-h-10 w-full" />
</div>
</a-drawer>
</div>

3
packages/nc-gui-v2/components/general/ShareBaseButton.vue

@ -18,9 +18,6 @@ const { isUIAllowed } = useUIPermission()
route.name !== 'project-index-create-external' &&
route.name !== 'index-user-index'
"
size="middle"
type="primary"
class="rounded"
@click="showUserModal = true"
>
<div class="flex items-center space-x-1">

58
packages/nc-gui-v2/components/general/SocialCard.vue

@ -1,40 +1,16 @@
<script setup lang="ts">
import { enumColor as colors } from '#imports'
const { showSwaggerLink } = defineProps<{ showSwaggerLink?: boolean }>()
const { project } = useProject()
const route = useRoute()
const { appInfo } = useGlobal()
const { lang: currentLang } = useGlobal()
const isRtlLang = $computed(() => ['fa'].includes(currentLang.value))
const openSwaggerLink = () => {
openLink(`/api/v1/db/meta/projects/${route.params.projectId}/swagger`, appInfo.value?.ncSiteUrl)
}
</script>
<template>
<a-card :body-style="{ padding: '0px' }" class="w-[300px] shadow-sm !rounded-lg">
<a-list class="w-full" dense>
<a-list-item v-if="showSwaggerLink && project">
<nuxt-link
v-t="['e:docs']"
class="text-primary !no-underline !text-current py-4 font-weight-medium"
target="_blank"
@click="openSwaggerLink"
>
<div class="ml-3 flex items-center text-sm">
<LogosSwagger />
<!-- todo: i18n -->
<span class="ml-3">{{ project.title }} : Swagger Documentation</span>
</div>
</nuxt-link>
</a-list-item>
<a-card :body-style="{ padding: '0px' }" class="w-[300px] shadow-sm rounded-lg">
<a-lis class="w-full" dense>
<slot name="before" />
<a-list-item>
<nuxt-link
v-t="['e:docs']"
@ -76,8 +52,8 @@ const openSwaggerLink = () => {
</div>
<div v-else class="flex items-center">
<!-- Star -->
{{ `${$t('labels.community.starUs1')} ` }}
{{ $t('labels.community.starUs1') }}
{{ ' ' }}
<!-- us on Github -->
{{ $t('labels.community.starUs2') }}
</div>
@ -85,7 +61,7 @@ const openSwaggerLink = () => {
</nuxt-link>
</a-list-item>
<a-list-item>
<nuxt-link class="text-primary !no-underline !text-current" to="https://calendly.com/nocodb-meeting" target="_blank">
<nuxt-link class="!no-underline !text-current" to="https://calendly.com/nocodb-meeting" target="_blank">
<div class="flex items-center text-sm">
<mdi-calendar-month class="mx-3 text-lg" :color="colors.dark[3 % colors.dark.length]" />
<!-- Book a Free DEMO -->
@ -96,7 +72,7 @@ const openSwaggerLink = () => {
</nuxt-link>
</a-list-item>
<a-list-item>
<nuxt-link class="text-primary !no-underline !text-current" to="https://discord.gg/5RgZmkW" target="_blank">
<nuxt-link class="!no-underline !text-current" to="https://discord.gg/5RgZmkW" target="_blank">
<div class="flex items-center text-sm">
<mdi-discord class="mx-3 text-lg" :color="colors.dark[0 % colors.dark.length]" />
<!-- Get your questions answered -->
@ -107,7 +83,7 @@ const openSwaggerLink = () => {
</nuxt-link>
</a-list-item>
<a-list-item>
<nuxt-link class="text-primary !no-underline !text-current" to="https://twitter.com/NocoDB" target="_blank">
<nuxt-link class="!no-underline !text-current" to="https://twitter.com/NocoDB" target="_blank">
<div class="flex items-center text-sm">
<mdi-twitter class="mx-3 text-lg" :color="colors.dark[1 % colors.dark.length]" />
<!-- Follow NocoDB -->
@ -118,12 +94,7 @@ const openSwaggerLink = () => {
</nuxt-link>
</a-list-item>
<a-list-item>
<nuxt-link
v-t="['e:hiring']"
class="text-primary !no-underline !text-current"
target="_blank"
to="http://careers.nocodb.com"
>
<nuxt-link v-t="['e:hiring']" class="!no-underline !text-current" target="_blank" to="http://careers.nocodb.com">
<div class="flex items-center text-sm">
<!-- todo: i18n -->
<div class="ml-3">🚀 <span class="ml-3">We are Hiring!!!</span></div>
@ -131,19 +102,14 @@ const openSwaggerLink = () => {
</nuxt-link>
</a-list-item>
<a-list-item>
<nuxt-link
v-t="['e:reddit']"
class="text-primary !no-underline !text-current"
target="_blank"
to="https://www.reddit.com/r/NocoDB/"
>
<nuxt-link v-t="['e:reddit']" class="!no-underline !text-current" target="_blank" to="https://www.reddit.com/r/NocoDB/">
<div class="ml-3 flex items-center text-sm">
<LogosRedditIcon />
<span class="ml-4">/r/NocoDB/</span>
</div>
</nuxt-link>
</a-list-item>
</a-list>
</a-lis>
</a-card>
</template>

2
packages/nocodb/package-lock.json generated

@ -95,7 +95,7 @@
"sha.js": "^2.4.11",
"slash": "^3.0.0",
"socket.io": "^4.4.1",
"sqlite3": "5.0.0",
"sqlite3": "^5.0.0",
"twilio": "^3.55.1",
"unique-names-generator": "^4.3.1",
"uuid": "^8.2.0",

2
packages/nocodb/package.json

@ -181,7 +181,7 @@
"sha.js": "^2.4.11",
"slash": "^3.0.0",
"socket.io": "^4.4.1",
"sqlite3": "5.0.0",
"sqlite3": "^5.0.0",
"twilio": "^3.55.1",
"unique-names-generator": "^4.3.1",
"uuid": "^8.2.0",

Loading…
Cancel
Save