Files
nocodb/packages/nc-gui/components/dashboard/Sidebar/TopSection.vue
Ramesh Mane e808ef4a15 Nc Fix: Update extension UI as per new design (#9306)
* fix(nc-gui): show extension as floating

* chore(nc-gui): add puzzle icon

* fix(nc-gui): toolbar searchbox auto close issue on clearing input value

* fix(nc-gui): update extension header

* fix(nc-gui): update extension panel as per new design

* fix(nc-gui): update extension icons

* fix(nc-gui): mionr extension panel corrections

* feat(nc-gui): extension reorder support

* fix(nc-gui): extension reorder issue

* fix(nc-gui): extension min height issue

* fix(nc-gui): extension error screen

* fix(nc-gui): extension fullscreen padding

* fix(nc-gui): update extension marketplace modal

* fix(nc-gui): update extension details modal

* fix(nc-gui): some changes

* fix(nc-gui): some review changes

* fix(nc-gui): some review changes

* fix(nc-gui): update extension header

* fix(nc-gui): update extension title input box

* fix(nc-gui): enable extension is cloud

* fix(nc-gui): add extension subtitle support

* feat(nc-gui): allow user to add extension description in markdown file

* fix(nc-gui): add cmdk topbar btn in all screens

* fix(nc-gui): meta.glob() as option deprecated warning

* fix(nc-gui): minor changes

* fix(nc-gui): make cmdk icon smaller

* fix(nc-gui): monor review changes

* misc: alignment & text for desc

* fix(nc-gui): extension review changes

* fix(nc-gui): extension topbar btn ui updates

* fix(nc-gui): update extension header icon size

* fix(nc-gui): use description md file instead of plain text in manifest

* fix(nc-gui): update extension modal size

* fix(nc-gui): cmdk test update

* chore(nc-gui): lint

* fix(nc-gui): minor changes

* fix(nc-gui): update extension details panel gap

* fix: minor alignments

---------

Co-authored-by: Raju Udava <86527202+dstala@users.noreply.github.com>
2024-08-23 12:29:11 +05:30

129 lines
4.3 KiB
Vue

<script setup lang="ts">
const workspaceStore = useWorkspace()
const baseStore = useBase()
const { isUIAllowed } = useRoles()
const { appInfo } = useGlobal()
const { meta: metaKey, control } = useMagicKeys()
const { isWorkspaceLoading, isWorkspaceSettingsPageOpened, isIntegrationsPageOpened } = storeToRefs(workspaceStore)
const { navigateToWorkspaceSettings, navigateToIntegrations: _navigateToIntegrations } = workspaceStore
const { isSharedBase } = storeToRefs(baseStore)
const isCreateProjectOpen = ref(false)
const navigateToSettings = () => {
const cmdOrCtrl = isMac() ? metaKey.value : control.value
// TODO: Handle cloud case properly
navigateToWorkspaceSettings('', cmdOrCtrl)
// if (appInfo.value.baseHostName) {
// window.location.href = `https://app.${appInfo.value.baseHostName}/dashboard`
// } else {
// }
}
const navigateToIntegrations = () => {
const cmdOrCtrl = isMac() ? metaKey.value : control.value
_navigateToIntegrations('', cmdOrCtrl)
}
</script>
<template>
<template v-if="isWorkspaceLoading">
<div class="flex flex-col w-full gap-y-3.75 ml-3 mt-3.75">
<div v-if="appInfo.ee" class="flex flex-row items-center w-full gap-x-3">
<a-skeleton-input :active="true" class="!w-4 !h-4 !rounded overflow-hidden" />
<a-skeleton-input :active="true" class="!w-40 !h-4 !rounded overflow-hidden" />
</div>
<div class="flex flex-row items-center w-full gap-x-3">
<a-skeleton-input :active="true" class="!w-4 !h-4 !rounded overflow-hidden" />
<a-skeleton-input :active="true" class="!w-40 !h-4 !rounded overflow-hidden" />
</div>
<div class="flex flex-row items-center w-full gap-x-3">
<a-skeleton-input :active="true" class="!w-4 !h-4 !rounded overflow-hidden" />
<a-skeleton-input :active="true" class="!w-40 !h-4 !rounded overflow-hidden" />
</div>
</div>
</template>
<template v-else-if="!isSharedBase">
<div class="xs:hidden flex flex-col p-1 mt-0.25 mb-0.5 truncate">
<!-- <DashboardSidebarTopSectionHeader /> -->
<NcButton
v-if="isUIAllowed('workspaceSettings') || isUIAllowed('workspaceCollaborators')"
v-e="['c:team:settings']"
type="text"
size="xsmall"
class="nc-sidebar-top-button !xs:hidden my-0.5 !h-7"
data-testid="nc-sidebar-team-settings-btn"
:centered="false"
:class="{
'!text-brand-600 !bg-brand-50 !hover:bg-brand-50': isWorkspaceSettingsPageOpened,
'!hover:(bg-gray-200 text-gray-700)': !isWorkspaceSettingsPageOpened,
}"
@click="navigateToSettings"
>
<div
class="flex items-center gap-2"
:class="{
'font-semibold': isWorkspaceSettingsPageOpened,
}"
>
<GeneralIcon icon="settings" class="!h-4" />
<div>{{ $t('title.teamAndSettings') }}</div>
</div>
</NcButton>
<NcButton
v-if="isUIAllowed('workspaceSettings')"
v-e="['c:integrations']"
type="text"
size="xsmall"
class="nc-sidebar-top-button !xs:hidden my-0.5 !h-7"
data-testid="nc-sidebar-integrations-btn"
:centered="false"
:class="{
'!text-brand-600 !bg-brand-50 !hover:bg-brand-50': isIntegrationsPageOpened,
'!hover:(bg-gray-200 text-gray-700)': !isIntegrationsPageOpened,
}"
@click="navigateToIntegrations"
>
<div
class="flex items-center gap-2"
:class="{
'font-semibold': isIntegrationsPageOpened,
}"
>
<GeneralIcon icon="integration" class="!h-4" />
<div>{{ $t('general.integrations') }}</div>
</div>
</NcButton>
<WorkspaceCreateProjectBtn
v-model:is-open="isCreateProjectOpen"
modal
type="text"
class="nc-sidebar-top-button !hover:(bg-gray-200 text-gray-700) !xs:hidden !h-7 my-0.5"
data-testid="nc-sidebar-create-base-btn"
>
<div class="gap-x-2 flex flex-row w-full items-center !font-normal">
<GeneralIcon icon="plus" />
<div class="flex">{{ $t('title.createBase') }}</div>
</div>
</WorkspaceCreateProjectBtn>
</div>
</template>
</template>
<style lang="scss" scoped>
.nc-sidebar-top-button {
@apply w-full !rounded-md !font-normal !px-3;
}
</style>