diff --git a/models/recruit/src/index.ts b/models/recruit/src/index.ts index 6208ed9284..e9cf32c215 100644 --- a/models/recruit/src/index.ts +++ b/models/recruit/src/index.ts @@ -436,7 +436,7 @@ export function createModel (builder: Builder): void { action: view.actionImpl.ShowPanel, actionProps: { component: recruit.component.EditVacancy, - element: 'right' + element: 'content' }, input: 'focus', category: recruit.category.Recruit, diff --git a/packages/ui/src/components/internal/Root.svelte b/packages/ui/src/components/internal/Root.svelte index 66c0e118af..f3aa8e7202 100644 --- a/packages/ui/src/components/internal/Root.svelte +++ b/packages/ui/src/components/internal/Root.svelte @@ -96,7 +96,7 @@ .status-bar { min-height: var(--status-bar-height); height: var(--status-bar-height); - min-width: 1200px; + min-width: 600px; font-size: 12px; line-height: 150%; background-color: var(--divider-color); @@ -120,7 +120,7 @@ .app { height: calc(100vh - var(--status-bar-height)); - min-width: 1200px; + min-width: 600px; min-height: 480px; .error { diff --git a/plugins/contact-resources/src/components/Contacts.svelte b/plugins/contact-resources/src/components/Contacts.svelte index 5f5eb103ab..e8fa57eea4 100644 --- a/plugins/contact-resources/src/components/Contacts.svelte +++ b/plugins/contact-resources/src/components/Contacts.svelte @@ -18,12 +18,14 @@ import { createQuery, getClient } from '@anticrm/presentation' import { ActionIcon, Button, Icon, IconAdd, Label, Loading, SearchEdit, showPopup } from '@anticrm/ui' import view, { Viewlet, ViewletPreference } from '@anticrm/view' - import { ActionContext, TableBrowser, ViewletSetting } from '@anticrm/view-resources' + import type { Filter } from '@anticrm/view' + import { ActionContext, TableBrowser, ViewletSetting, FilterButton } from '@anticrm/view-resources' import contact from '../plugin' import CreateContact from './CreateContact.svelte' let search = '' let resultQuery: DocumentQuery = {} + let filters: Filter[] = [] function updateResultQuery (search: string): void { resultQuery = search === '' ? {} : { $search: search } @@ -73,6 +75,7 @@
+
{/if} diff --git a/plugins/recruit-resources/src/components/ApplicationsView.svelte b/plugins/recruit-resources/src/components/ApplicationsView.svelte index fa6d9b3573..29a57c514f 100644 --- a/plugins/recruit-resources/src/components/ApplicationsView.svelte +++ b/plugins/recruit-resources/src/components/ApplicationsView.svelte @@ -19,7 +19,8 @@ import task from '@anticrm/task' import { ActionIcon, Button, Icon, IconAdd, Label, Loading, SearchEdit, showPopup } from '@anticrm/ui' import view, { Viewlet, ViewletPreference } from '@anticrm/view' - import { TableBrowser, ViewletSetting } from '@anticrm/view-resources' + import type { Filter } from '@anticrm/view' + import { TableBrowser, ViewletSetting, FilterButton } from '@anticrm/view-resources' import recruit from '../plugin' import CreateApplication from './CreateApplication.svelte' @@ -28,6 +29,7 @@ const baseQuery: DocumentQuery = { doneState: null } + let filters: Filter[] = [] const client = getClient() let descr: Viewlet | undefined @@ -71,6 +73,7 @@
+
{/if} diff --git a/plugins/recruit-resources/src/components/Candidates.svelte b/plugins/recruit-resources/src/components/Candidates.svelte index b4c7f0b138..7d27ae3446 100644 --- a/plugins/recruit-resources/src/components/Candidates.svelte +++ b/plugins/recruit-resources/src/components/Candidates.svelte @@ -19,12 +19,14 @@ import { createQuery, getClient } from '@anticrm/presentation' import { ActionIcon, showPopup, Icon, Label, Loading, SearchEdit, Button, IconAdd } from '@anticrm/ui' import view, { Viewlet, ViewletPreference } from '@anticrm/view' - import { ActionContext, TableBrowser, ViewletSetting } from '@anticrm/view-resources' + import type { Filter } from '@anticrm/view' + import { ActionContext, TableBrowser, ViewletSetting, FilterButton } from '@anticrm/view-resources' import recruit from '../plugin' import CreateCandidate from './CreateCandidate.svelte' let search = '' let resultQuery: DocumentQuery = {} + let filters: Filter[] = [] const client = getClient() @@ -71,6 +73,7 @@
+
{/if} diff --git a/plugins/task-resources/src/components/StatusTableView.svelte b/plugins/task-resources/src/components/StatusTableView.svelte index 5b517209cb..faa26ba1d6 100644 --- a/plugins/task-resources/src/components/StatusTableView.svelte +++ b/plugins/task-resources/src/components/StatusTableView.svelte @@ -173,7 +173,7 @@
- +
diff --git a/plugins/tracker-resources/src/components/FilterSummarySection.svelte b/plugins/tracker-resources/src/components/FilterSummarySection.svelte index 088a5d3253..3f16710c80 100644 --- a/plugins/tracker-resources/src/components/FilterSummarySection.svelte +++ b/plugins/tracker-resources/src/components/FilterSummarySection.svelte @@ -13,7 +13,7 @@ // limitations under the License. --> -
-
- + + +
-
-
-
-
-
-
-
+{/if} diff --git a/plugins/tracker-resources/src/plugin.ts b/plugins/tracker-resources/src/plugin.ts index d2c99b4715..7efd2f120a 100644 --- a/plugins/tracker-resources/src/plugin.ts +++ b/plugins/tracker-resources/src/plugin.ts @@ -145,7 +145,12 @@ export default mergeIds(trackerId, tracker, { FilterIsEither: '' as IntlString, FilterStatesCount: '' as IntlString, - EditIssue: '' as IntlString + EditIssue: '' as IntlString, + + Save: '' as IntlString, + IncludeItemsThatMatch: '' as IntlString, + AnyFilter: '' as IntlString, + AllFilters: '' as IntlString }, component: { NopeComponent: '' as AnyComponent, diff --git a/plugins/view-assets/assets/icons.svg b/plugins/view-assets/assets/icons.svg index c6dab15143..4dea2e5303 100644 --- a/plugins/view-assets/assets/icons.svg +++ b/plugins/view-assets/assets/icons.svg @@ -53,5 +53,8 @@ + + + diff --git a/plugins/view-assets/lang/en.json b/plugins/view-assets/lang/en.json index 86ddfd4430..94970966b6 100644 --- a/plugins/view-assets/lang/en.json +++ b/plugins/view-assets/lang/en.json @@ -46,6 +46,10 @@ "FilterStatesCount": "{value, plural, =1 {1 state} other {# states}}", "Before": "Before", "After": "After", - "Apply": "Apply" + "Apply": "Apply", + "Save": "Save", + "IncludeItemsThatMatch": "Include items that match", + "AnyFilter": "any filter", + "AllFilters": "all filters" } } diff --git a/plugins/view-assets/lang/ru.json b/plugins/view-assets/lang/ru.json index 24f2dac41e..3ae36978d0 100644 --- a/plugins/view-assets/lang/ru.json +++ b/plugins/view-assets/lang/ru.json @@ -44,6 +44,10 @@ "FilterStatesCount": "{value, plural, =1 {1 состоянию} other {# состояний}}", "Before": "До", "After": "После", - "Apply": "Применить" + "Apply": "Применить", + "Save": "Сохранить", + "IncludeItemsThatMatch": "Включить элементы, которые соответствуют", + "AnyFilter": "любому фильтру", + "AllFilters": "всем фильтрам" } } diff --git a/plugins/view-assets/src/index.ts b/plugins/view-assets/src/index.ts index 2acec4f6ce..702fa52ccb 100644 --- a/plugins/view-assets/src/index.ts +++ b/plugins/view-assets/src/index.ts @@ -27,7 +27,8 @@ loadMetadata(view.icon, { Statuses: `${icons}#statuses`, Open: `${icons}#open`, Setting: `${icons}#setting`, - ArrowRight: `${icons}#arrow-right` + ArrowRight: `${icons}#arrow-right`, + Views: `${icons}#views` }) addStringsLoader(viewId, async (lang: string) => await import(`../lang/${lang}.json`)) diff --git a/plugins/view-resources/src/components/TableBrowser.svelte b/plugins/view-resources/src/components/TableBrowser.svelte index 9c4ce2bbec..db3a0574c3 100644 --- a/plugins/view-resources/src/components/TableBrowser.svelte +++ b/plugins/view-resources/src/components/TableBrowser.svelte @@ -16,6 +16,7 @@ import type { Class, Doc, DocumentQuery, FindOptions, Ref } from '@anticrm/core' import { Scroller } from '@anticrm/ui' import { BuildModelKey } from '@anticrm/view' + import type { Filter } from '@anticrm/view' import { onMount } from 'svelte' import { ActionContext } from '..' import { focusStore, ListSelectionProvider, SelectDirection, selectionStore } from '../selection' @@ -32,6 +33,7 @@ // If defined, will show a number of dummy items before real data will appear. export let loadingProps: LoadingProps | undefined = undefined + export let filters: Filter[] | undefined = undefined let resultQuery = query @@ -54,14 +56,16 @@ }} /> - (resultQuery = e.detail)} /> +{#if filters} + (resultQuery = e.detail)} /> +{/if} import { Class, Doc, DocumentQuery, Ref } from '@anticrm/core' import { getClient } from '@anticrm/presentation' - import { Button, eventToHTMLElement, IconAdd, IconClose, showPopup } from '@anticrm/ui' + import { Button, eventToHTMLElement, IconAdd, Label, showPopup } from '@anticrm/ui' import { Filter } from '@anticrm/view' import { createEventDispatcher } from 'svelte' import view from '../../plugin' @@ -24,13 +24,14 @@ export let _class: Ref> export let query: DocumentQuery + export let filters: Filter[] = [] const client = getClient() const hierarchy = client.getHierarchy() const dispatch = createEventDispatcher() - let filters: Filter[] = [] - let maxIndex = 0 + let maxIndex = filters ? filters.length : 0 + let allFilters: boolean = true function onChange (e: Filter | undefined) { if (e === undefined) return @@ -118,43 +119,92 @@ $: visible = hierarchy.hasMixin(clazz, view.mixin.ClassFilters) -{#if visible} -
- {#each filters as filter, i} - { - makeQuery(query, filters) - }} - on:remove={() => { - remove(i) - }} - /> - {/each} -
-
- {#if filters.length} -
-
- {/if} +
+ +
+ {#if filters.length > 1} +
+ + + +
+
+ {/if} +
{/if} + + diff --git a/plugins/view-resources/src/components/filter/FilterButton.svelte b/plugins/view-resources/src/components/filter/FilterButton.svelte new file mode 100644 index 0000000000..a745eb11ac --- /dev/null +++ b/plugins/view-resources/src/components/filter/FilterButton.svelte @@ -0,0 +1,73 @@ + + + +{#if visible} + +{/if} diff --git a/plugins/view-resources/src/components/filter/FilterSection.svelte b/plugins/view-resources/src/components/filter/FilterSection.svelte index d8a76d10fd..ad379e4baf 100644 --- a/plugins/view-resources/src/components/filter/FilterSection.svelte +++ b/plugins/view-resources/src/components/filter/FilterSection.svelte @@ -14,7 +14,7 @@ --> -
-
-
-
-
-
-
-
-
+
+ + + +