Fix product filters (#2192)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2022-07-02 17:27:26 +07:00 committed by GitHub
parent fb8685d46d
commit 8f3129c225
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 5 deletions

View File

@ -165,6 +165,10 @@ export function createModel (builder: Builder): void {
group: 'associate' group: 'associate'
} }
}) })
builder.mixin(inventory.class.Product, core.class.Class, view.mixin.ClassFilters, {
filters: ['attachedTo', 'name', 'modifiedOn']
})
} }
export { default } from './plugin' export { default } from './plugin'

View File

@ -112,7 +112,7 @@
<div bind:this={container} class="min-w-0" class:w-full={width === '100%'}> <div bind:this={container} class="min-w-0" class:w-full={width === '100%'}>
<Button <Button
{focusIndex} {focusIndex}
icon={hideIcon && selected ? undefined : icon} icon={hideIcon || selected ? undefined : icon}
width={width ?? 'min-content'} width={width ?? 'min-content'}
{size} {size}
{kind} {kind}
@ -122,7 +122,7 @@
> >
<span slot="content" class="overflow-label disabled"> <span slot="content" class="overflow-label disabled">
{#if selected} {#if selected}
{#if hideIcon} {#if hideIcon || selected}
<UserInfo value={selected} size={kind === 'link' ? 'x-small' : 'medium'} {icon} /> <UserInfo value={selected} size={kind === 'link' ? 'x-small' : 'medium'} {icon} />
{:else} {:else}
{getName(selected)} {getName(selected)}

View File

@ -15,12 +15,21 @@
--> -->
<script lang="ts"> <script lang="ts">
import { Category } from '@anticrm/inventory' import { Category } from '@anticrm/inventory'
import { getPanelURI } from '@anticrm/ui'
import view from '@anticrm/view'
export let value: Category export let value: Category
export let inline: boolean = false
</script> </script>
{#if value} {#if value}
<div class="overflow-label sm-tool-icon"> <a
{value.name} class="flex-presenter"
</div> class:inline-presenter={inline}
href="#{getPanelURI(view.component.EditDoc, value._id, value._class, 'content')}"
>
<div class="overflow-label sm-tool-icon">
{value.name}
</div>
</a>
{/if} {/if}