mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-29 04:55:03 +02:00
Process minor fixes (#10704)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user