From 39b0cbda0e7c8ed42fa819335c78b2646d57a2bf Mon Sep 17 00:00:00 2001 From: Alex <41288429+Dvinyanin@users.noreply.github.com> Date: Sun, 10 Jul 2022 22:29:59 +0700 Subject: [PATCH] Tracker: Refactor ViewOptions (#2228) Signed-off-by: Dvinyanin Alexandr --- .../components/issues/IssuesContent.svelte | 2 +- .../src/components/issues/IssuesHeader.svelte | 2 - .../src/components/issues/IssuesView.svelte | 10 +- .../src/components/issues/KanbanView.svelte | 10 +- .../components/issues/ViewOptionsPopup.svelte | 104 ------------------ plugins/tracker-resources/src/index.ts | 2 - plugins/tracker-resources/src/utils.ts | 45 ++++++++ plugins/tracker-resources/src/viewOptions.ts | 7 -- .../src/components/ViewOptionsButton.svelte} | 48 ++++---- .../src/components/ViewOptionsPopup.svelte | 35 ++++++ plugins/view-resources/src/index.ts | 6 +- plugins/view-resources/src/utils.ts | 21 ---- plugins/view-resources/src/viewOptions.ts | 56 ++++++++++ 13 files changed, 178 insertions(+), 170 deletions(-) delete mode 100644 plugins/tracker-resources/src/components/issues/ViewOptionsPopup.svelte delete mode 100644 plugins/tracker-resources/src/viewOptions.ts rename plugins/{tracker-resources/src/components/issues/ViewOptions.svelte => view-resources/src/components/ViewOptionsButton.svelte} (59%) create mode 100644 plugins/view-resources/src/components/ViewOptionsPopup.svelte create mode 100644 plugins/view-resources/src/viewOptions.ts diff --git a/plugins/tracker-resources/src/components/issues/IssuesContent.svelte b/plugins/tracker-resources/src/components/issues/IssuesContent.svelte index 1e5dfcae8d..bb2b6c9a66 100644 --- a/plugins/tracker-resources/src/components/issues/IssuesContent.svelte +++ b/plugins/tracker-resources/src/components/issues/IssuesContent.svelte @@ -3,7 +3,7 @@ import { Component } from '@anticrm/ui' import { Viewlet } from '@anticrm/view' import { Issue } from '@anticrm/tracker' - import { viewOptionsStore } from '../../viewOptions' + import { viewOptionsStore } from '@anticrm/view-resources' export let viewlet: WithLookup export let query: DocumentQuery = {} diff --git a/plugins/tracker-resources/src/components/issues/IssuesHeader.svelte b/plugins/tracker-resources/src/components/issues/IssuesHeader.svelte index 7e0a3584e1..1f09fe491d 100644 --- a/plugins/tracker-resources/src/components/issues/IssuesHeader.svelte +++ b/plugins/tracker-resources/src/components/issues/IssuesHeader.svelte @@ -4,7 +4,6 @@ import { FilterButton, setActiveViewletId } from '@anticrm/view-resources' import tracker from '../../plugin' import { WithLookup } from '@anticrm/core' - import ViewOptions from './ViewOptions.svelte' export let viewlet: WithLookup | undefined export let viewlets: WithLookup[] = [] @@ -43,6 +42,5 @@ }} /> {/if} - diff --git a/plugins/tracker-resources/src/components/issues/IssuesView.svelte b/plugins/tracker-resources/src/components/issues/IssuesView.svelte index b20d2222e4..ee0f67ecdd 100644 --- a/plugins/tracker-resources/src/components/issues/IssuesView.svelte +++ b/plugins/tracker-resources/src/components/issues/IssuesView.svelte @@ -5,15 +5,16 @@ import { Issue } from '@anticrm/tracker' import { Button, IconDetails } from '@anticrm/ui' import view, { Viewlet } from '@anticrm/view' - import { FilterBar } from '@anticrm/view-resources' - import { getActiveViewletId } from '@anticrm/view-resources/src/utils' - import tracker from '../../plugin' + import { FilterBar, ViewOptionModel, ViewOptionsButton, getActiveViewletId } from '@anticrm/view-resources' import IssuesContent from './IssuesContent.svelte' import IssuesHeader from './IssuesHeader.svelte' + import { getDefaultViewOptionsConfig } from '../../utils' + import tracker from '../../plugin' export let query: DocumentQuery = {} export let title: IntlString | undefined = undefined export let label: string = '' + export let viewOptionsConfig: ViewOptionModel[] = getDefaultViewOptionsConfig() export let panelWidth: number = 0 @@ -67,6 +68,9 @@ + {#if viewlet} + + {/if} {#if asideFloat && $$slots.aside}