Process minor fixes (#10704)

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov
2026-03-29 15:49:08 +05:00
committed by GitHub
parent 0e3cfbd949
commit 9d4e14cb70
9 changed files with 61 additions and 54 deletions
@@ -13,36 +13,17 @@
// limitations under the License.
-->
<script lang="ts">
import { Class, Doc, Ref } from '@hcengineering/core'
import { Asset, IntlString } from '@hcengineering/platform'
import { Button, ToggleWithLabel } from '@hcengineering/ui'
import { BuildModelKey, Viewlet } from '@hcengineering/view'
import { Viewlet } from '@hcengineering/view'
import { createEventDispatcher } from 'svelte'
import view from '../plugin'
import { AttributeConfig, Config, isAttribute } from '../viewOptions'
export let viewlet: Viewlet
export let items: Array<Config | AttributeConfig> = []
const dispatch = createEventDispatcher()
interface Config {
value: string | BuildModelKey | undefined
type: 'divider' | 'attribute'
}
interface AttributeConfig extends Config {
type: 'attribute'
enabled: boolean
label: IntlString
_class: Ref<Class<Doc>>
icon: Asset | undefined
order?: number
}
function isAttribute (val: Config): val is AttributeConfig {
return val.type === 'attribute'
}
function dragEnd () {
selected = undefined
dispatch('save', items)
+21 -2
View File
@@ -8,7 +8,7 @@ import {
SortingOrder,
type Space
} from '@hcengineering/core'
import { getResource } from '@hcengineering/platform'
import { type Asset, getResource, type IntlString } from '@hcengineering/platform'
import { type LiveQuery, createQuery, getAttributePresenterClass, getClient } from '@hcengineering/presentation'
import { locationToUrl, getCurrentResolvedLocation } from '@hcengineering/ui'
import {
@@ -20,7 +20,8 @@ import {
type ViewOptionModel,
type ViewOptions,
type Viewlet,
type ViewletDescriptor
type ViewletDescriptor,
type BuildModelKey
} from '@hcengineering/view'
import { get, writable } from 'svelte/store'
import view from './plugin'
@@ -235,3 +236,21 @@ export async function getResultQuery (
}
return result
}
export interface Config {
value: string | BuildModelKey | undefined
type: 'divider' | 'attribute'
}
export interface AttributeConfig extends Config {
type: 'attribute'
enabled: boolean
label: IntlString
_class: Ref<Class<Doc>>
icon: Asset | undefined
order?: number
}
export function isAttribute (val: Config): val is AttributeConfig {
return val.type === 'attribute'
}