Process improvements (#9801)

This commit is contained in:
Denis Bykhov
2025-09-08 22:43:45 +07:00
committed by GitHub
parent 1ed6f1d486
commit 6003e4a86a
27 changed files with 591 additions and 407 deletions
@@ -14,12 +14,9 @@
-->
<script lang="ts">
import { MasterTag, Tag } from '@hcengineering/card'
import core, { AnyAttribute, Ref } from '@hcengineering/core'
import { getResource } from '@hcengineering/platform'
import { AnyAttribute, Ref } from '@hcengineering/core'
import presentation, { Card, getAttributePresenterClass, getClient } from '@hcengineering/presentation'
import { Process, ProcessFunction } from '@hcengineering/process'
import { AnySvelteComponent } from '@hcengineering/ui'
import view from '@hcengineering/view'
import { createEventDispatcher } from 'svelte'
import { getContext } from '../../utils'
import ProcessAttribute from '../ProcessAttribute.svelte'
@@ -29,6 +26,7 @@
export let masterTag: Ref<MasterTag | Tag>
export let attribute: AnyAttribute
export let props: Record<string, any> = {}
export let allowArray: boolean = false
let value: any = props?.value ?? ''
@@ -40,28 +38,9 @@
dispatch('close', { value })
}
let editor: AnySvelteComponent | undefined
function getEditor (): void {
try {
const inlineEditor = h.as(h.getClass(core.class.ArrOf), view.mixin.AttributeEditor).inlineEditor
void getResource(inlineEditor)
.then((p) => {
editor = p
})
.catch((e) => {
console.error(e)
})
} catch (e) {
console.error(e)
}
}
getEditor()
$: presenterClass = getAttributePresenterClass(h, attribute.type)
$: elementContext = getContext(client, process, presenterClass.attrClass, 'object')
$: elementContext = getContext(client, process, presenterClass.attrClass, 'attribute')
</script>
<Card on:close width={'x-small'} label={func.label} canSave okAction={save} okLabel={presentation.string.Save}>
@@ -71,12 +50,13 @@
{masterTag}
context={elementContext}
{attribute}
editor={undefined}
presenterClass={{
attrClass: presenterClass.attrClass,
category: 'attribute'
}}
{allowArray}
{value}
{editor}
on:change={(e) => {
value = e.detail
}}
@@ -0,0 +1,28 @@
<!--
// 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 { MasterTag, Tag } from '@hcengineering/card'
import { AnyAttribute, Ref } from '@hcengineering/core'
import { Process, ProcessFunction } from '@hcengineering/process'
import ArrayElementEditor from './ArrayElementEditor.svelte'
export let func: ProcessFunction
export let process: Process
export let masterTag: Ref<MasterTag | Tag>
export let attribute: AnyAttribute
export let props: Record<string, any> = {}
</script>
<ArrayElementEditor {func} {process} {masterTag} {attribute} {props} allowArray on:close />