Process minor ui fixes (#9766)

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov
2025-09-03 17:03:55 +07:00
committed by GitHub
parent c18617c3a3
commit e1ca3b625d
11 changed files with 65 additions and 7 deletions
@@ -13,7 +13,6 @@
// limitations under the License.
-->
<script lang="ts">
import { MasterTag, Tag } from '@hcengineering/card'
import { AnyAttribute, Class, Doc, DocumentQuery, Ref } from '@hcengineering/core'
import { getClient } from '@hcengineering/presentation'
import { Context, Func, Process, ProcessFunction, SelectedContext } from '@hcengineering/process'
@@ -28,7 +28,7 @@
{#if func !== undefined}
<div class="container">
{#if func.presenter !== undefined}
<Component is={func.presenter} props={{ props: value.props, context, process }} />
<Component is={func.presenter} props={{ value, context, process }} />
{:else}
<Label label={func.label} />
{/if}
@@ -231,7 +231,6 @@
&.context {
background: #3575de33;
padding-left: 0.75rem;
border-color: var(--primary-button-default);
}
}
@@ -176,7 +176,6 @@
&.context {
background: #3575de33;
padding-left: 0.75rem;
border-color: var(--primary-button-default);
}
}
@@ -18,7 +18,7 @@
import process from '../../plugin'
import ui, { DropdownIntlItem, DropdownLabelsIntl, NumberInput } from '@hcengineering/ui'
export const props: Record<string, any> = {}
export let props: Record<string, any>
let offset = props?.offset
let offsetType = props?.offsetType ?? 'days'
@@ -0,0 +1,48 @@
<!--
// Copyright © 2025 Hardcore Engineering Inc.
//
// Licensed under the Eclipse Public License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. You may
// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
-->
<script lang="ts">
import { Context, Func, parseContext, Process } from '@hcengineering/process'
import plugin from '../../plugin'
import ContextValuePresenter from '../attributeEditors/ContextValuePresenter.svelte'
export let value: Func
export let process: Process
export let context: Context
const ops = {
[plugin.function.Add]: '+',
[plugin.function.Subtract]: '-',
[plugin.function.Multiply]: '×',
[plugin.function.Divide]: '/',
[plugin.function.Modulo]: '%',
[plugin.function.Power]: '^'
}
$: op = ops[value.func as keyof typeof ops]
$: val = value.props?.value
$: contextValue = parseContext(val)
</script>
<div class="flex-row-center flex-gap-2">
{#if op !== undefined}
{op}
{/if}
{#if contextValue && context}
<ContextValuePresenter {contextValue} {context} {process} />
{:else}
{val}
{/if}
</div>