From 62d362147aba3d81a361865b4575a173f52e665c Mon Sep 17 00:00:00 2001 From: mnenie <121057011+mneniee@users.noreply.github.com> Date: Sun, 29 Dec 2024 22:32:10 +0300 Subject: [PATCH] feat: add workspace popover --- core/client/src/app/providers/router/index.ts | 6 +- core/client/src/entities/workspace/index.ts | 1 + .../src/entities/workspace/model/index.ts | 1 + .../workspace/model/workspace.store.ts | 27 ++++++ .../src/features/filter/ui/SearchFilter.vue | 6 +- core/client/src/shared/ui/index.ts | 1 + .../src/shared/ui/popover/UiPopover.vue | 15 +++ .../shared/ui/popover/UiPopoverContent.vue | 48 ++++++++++ .../shared/ui/popover/UiPopoverTrigger.vue | 11 +++ core/client/src/shared/ui/popover/index.ts | 4 + .../src/widgets/dialogs/ui/HotkeysDialog.vue | 14 +-- .../src/widgets/dialogs/ui/ShareDialog.vue | 14 +-- .../widgets/layout/header/ui/HeaderMain.vue | 12 ++- .../widgets/layout/sidebar/ui/InfoMenu.vue | 7 +- .../layout/sidebar/ui/IntegrationItems.vue | 4 +- .../layout/sidebar/ui/ProjectsList.vue | 4 +- .../widgets/layout/sidebar/ui/WorkSpace.vue | 2 +- .../layout/sidebar/ui/WorkSpaceChooser.vue | 13 ++- .../__snapshots__/WorkSpace.spec.ts.snap | 2 +- core/client/src/widgets/workspace/index.ts | 1 + .../widgets/workspace/ui/WorkspaceMenu.vue | 93 +++++++++++++++++++ core/client/src/widgets/workspace/ui/index.ts | 1 + 22 files changed, 252 insertions(+), 35 deletions(-) create mode 100644 core/client/src/entities/workspace/index.ts create mode 100644 core/client/src/entities/workspace/model/index.ts create mode 100644 core/client/src/entities/workspace/model/workspace.store.ts create mode 100644 core/client/src/shared/ui/popover/UiPopover.vue create mode 100644 core/client/src/shared/ui/popover/UiPopoverContent.vue create mode 100644 core/client/src/shared/ui/popover/UiPopoverTrigger.vue create mode 100644 core/client/src/shared/ui/popover/index.ts create mode 100644 core/client/src/widgets/workspace/index.ts create mode 100644 core/client/src/widgets/workspace/ui/WorkspaceMenu.vue create mode 100644 core/client/src/widgets/workspace/ui/index.ts diff --git a/core/client/src/app/providers/router/index.ts b/core/client/src/app/providers/router/index.ts index 94f1fe4d..6798d93b 100644 --- a/core/client/src/app/providers/router/index.ts +++ b/core/client/src/app/providers/router/index.ts @@ -10,9 +10,9 @@ export const router = createRouter({ router.beforeEach((to, from) => { // Needs to add guard auth logic in router - if (to.meta.requiresAuth === true) { - return router.push({ name: 'sign-in' }) - } + // if (to.meta.requiresAuth === true) { + // return router.push({ name: 'sign-in' }) + // } }) router.beforeEach(layoutResolverMiddleware) diff --git a/core/client/src/entities/workspace/index.ts b/core/client/src/entities/workspace/index.ts new file mode 100644 index 00000000..116e6686 --- /dev/null +++ b/core/client/src/entities/workspace/index.ts @@ -0,0 +1 @@ +export * from './model' diff --git a/core/client/src/entities/workspace/model/index.ts b/core/client/src/entities/workspace/model/index.ts new file mode 100644 index 00000000..5f9ee99b --- /dev/null +++ b/core/client/src/entities/workspace/model/index.ts @@ -0,0 +1 @@ +export * from './workspace.store' diff --git a/core/client/src/entities/workspace/model/workspace.store.ts b/core/client/src/entities/workspace/model/workspace.store.ts new file mode 100644 index 00000000..27aa80ce --- /dev/null +++ b/core/client/src/entities/workspace/model/workspace.store.ts @@ -0,0 +1,27 @@ +import { ref } from 'vue' +import { defineStore } from 'pinia' +import type { User } from '@/entities/user' + +interface BaseTestWorkspace { + _id: string + name: string + img: string | Blob + link: string + status: 'active' | 'archive' + members: User[] +} + +export const useWorkspaceStore = defineStore('workspace', () => { + const workspace = ref({ + _id: '0', + name: 'Example.io', + img: 'https://avatars.githubusercontent.com/u/185750893?s=100&v=4', + link: 'https://jenda-app-mnenie.com/example.io', + status: 'active', + members: [], + } as BaseTestWorkspace) + + return { + workspace, + } +}) diff --git a/core/client/src/features/filter/ui/SearchFilter.vue b/core/client/src/features/filter/ui/SearchFilter.vue index a80daff5..a3e7da7f 100644 --- a/core/client/src/features/filter/ui/SearchFilter.vue +++ b/core/client/src/features/filter/ui/SearchFilter.vue @@ -46,11 +46,11 @@ const [DefineTemplate, ReuseTemplate] = createReusableTemplate() >
+import { PopoverRoot, useForwardPropsEmits } from 'radix-vue' +import type { PopoverRootEmits, PopoverRootProps } from 'radix-vue' + +const props = defineProps
{{ $t('sidebar.integrations') }}
@@ -43,7 +43,7 @@ const { isExpanded } = expanded.getExpanded()
{{ $t('sidebar.projects') }}
@@ -84,7 +84,7 @@ function changeShowList() { > { :style="{ padding: !isExpanded ? '0px' : '', justifyContent: contentPosition }" >+ {{ data }} +
++ {{ workspace.name }} +
++ {{ workspace.members.length }} участников +
++ Управление +
+