Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion models/process/src/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export function defineMethods (builder: Builder): void {
editor: process.component.CreateCardEditor,
presenter: process.component.CreateCardPresenter,
createdContext: { _class: card.class.Card },
requiredParams: ['title', '_class']
requiredParams: ['title', 'targetClass']
},
process.method.CreateCard
)
Expand Down
3 changes: 2 additions & 1 deletion plugins/card-resources/src/components/TypeSelector.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@
export let width: string | undefined = undefined
export let kind: ButtonKind | undefined = undefined
export let size: ButtonSize | undefined = undefined
export let parent: Ref<MasterTag> = card.class.Card
export let disabled: boolean = false

const client = getClient()
const hierarchy = client.getHierarchy()

function filterClasses (): [DropdownIntlItem, DropdownIntlItem[]][] {
const descendants = hierarchy.getDescendants(card.class.Card).filter((p) => p !== card.class.Card)
const descendants = hierarchy.getDescendants(parent).filter((p) => p !== card.class.Card)
const added = new Set<Ref<Class<Doc>>>()
const base = new Map<Ref<Class<Doc>>, Class<Doc>[]>()
for (const _id of descendants) {
Expand Down
3 changes: 2 additions & 1 deletion plugins/process-assets/lang/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@
"MarkupFromText": "MarkUp z textu",
"TextFromMarkup": "Text z MarkUp",
"TextFromSelect": "Text z výběru",
"SelectFromText": "Výběr z textu"
"SelectFromText": "Výběr z textu",
"AskSubclass": "Zeptat se na podtřídu"
},
"error": {
"MethodNotFound": "Metoda nenalezena: {methodId}",
Expand Down
3 changes: 2 additions & 1 deletion plugins/process-assets/lang/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@
"TextFromMarkup": "Text aus Markup",
"MarkupFromText": "Markup aus Text",
"TextFromSelect": "Text aus Auswahl",
"SelectFromText": "Auswahl aus Text"
"SelectFromText": "Auswahl aus Text",
"AskSubclass": "Nach Unterklasse fragen"
},
"error": {
"MethodNotFound": "Methode nicht gefunden: {methodId}",
Expand Down
3 changes: 2 additions & 1 deletion plugins/process-assets/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@
"TextFromMarkup": "Text from markup",
"MarkupFromText": "Markup from text",
"TextFromSelect": "Text from select",
"SelectFromText": "Select from text"
"SelectFromText": "Select from text",
"AskSubclass": "Ask subclass"
},
"error": {
"MethodNotFound": "Method not found: {methodId}",
Expand Down
3 changes: 2 additions & 1 deletion plugins/process-assets/lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@
"TextFromMarkup": "Texto desde markup",
"MarkupFromText": "Markup desde texto",
"TextFromSelect": "Texto desde selección",
"SelectFromText": "Selección desde texto"
"SelectFromText": "Selección desde texto",
"AskSubclass": "Preguntar por subclase"
},
"error": {
"MethodNotFound": "Método no encontrado: {methodId}",
Expand Down
3 changes: 2 additions & 1 deletion plugins/process-assets/lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@
"TextFromMarkup": "Texte depuis markup",
"MarkupFromText": "Markup depuis texte",
"TextFromSelect": "Texte depuis sélection",
"SelectFromText": "Sélection depuis texte"
"SelectFromText": "Sélection depuis texte",
"AskSubclass": "Demander la sous-classe"
},
"error": {
"MethodNotFound": "Méthode introuvable : {methodId}",
Expand Down
3 changes: 2 additions & 1 deletion plugins/process-assets/lang/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@
"TextFromMarkup": "Testo da markup",
"MarkupFromText": "Markup da testo",
"TextFromSelect": "Testo da selezione",
"SelectFromText": "Selezione da testo"
"SelectFromText": "Selezione da testo",
"AskSubclass": "Chiedi sottoclasse"
},
"error": {
"MethodNotFound": "Metodo non trovato: {methodId}",
Expand Down
3 changes: 2 additions & 1 deletion plugins/process-assets/lang/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@
"TextFromMarkup": "テキストからマークアップ",
"MarkupFromText": "マークアップからテキスト",
"TextFromSelect": "テキストから選択",
"SelectFromText": "選択からテキスト"
"SelectFromText": "選択からテキスト",
"AskSubclass": "サブクラスを尋ねる"
},
"error": {
"MethodNotFound": "メソッドが見つかりません: {methodId}",
Expand Down
3 changes: 2 additions & 1 deletion plugins/process-assets/lang/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@
"TextFromMarkup": "마크업에서 텍스트로",
"MarkupFromText": "텍스트에서 마크업으로",
"TextFromSelect": "선택에서 텍스트로",
"SelectFromText": "텍스트에서 선택으로"
"SelectFromText": "텍스트에서 선택으로",
"AskSubclass": "하위 클래스 선택"
},
"error": {
"MethodNotFound": "메서드를 찾을 수 없습니다: {methodId}",
Expand Down
3 changes: 2 additions & 1 deletion plugins/process-assets/lang/pt-br.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@
"TextFromMarkup": "Texto de marcação",
"MarkupFromText": "Marcação de texto",
"TextFromSelect": "Texto de seleção",
"SelectFromText": "Seleção de texto"
"SelectFromText": "Seleção de texto",
"AskSubclass": "Perguntar subclasse"
},
"error": {
"MethodNotFound": "Método não encontrado: {methodId}",
Expand Down
3 changes: 2 additions & 1 deletion plugins/process-assets/lang/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@
"TextFromMarkup": "Texto de marcação",
"MarkupFromText": "Marcação de texto",
"TextFromSelect": "Texto de seleção",
"SelectFromText": "Seleção de texto"
"SelectFromText": "Seleção de texto",
"AskSubclass": "Perguntar subclasse"
},
"error": {
"MethodNotFound": "Método não encontrado: {methodId}",
Expand Down
3 changes: 2 additions & 1 deletion plugins/process-assets/lang/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@
"MarkupFromText": "Текст из разметки",
"TextFromMarkup": "Разметка из текста",
"TextFromSelect": "Текст из выбора",
"SelectFromText": "Выбор из текста"
"SelectFromText": "Выбор из текста",
"AskSubclass": "Спросить подкласс"
},
"error": {
"MethodNotFound": "Метод не найден: {methodId}",
Expand Down
3 changes: 2 additions & 1 deletion plugins/process-assets/lang/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@
"TextFromMarkup": "Metinden işaretleme",
"MarkupFromText": "İşaretlemeden metin",
"TextFromSelect": "Seçimden metin",
"SelectFromText": "Metinden seçim"
"SelectFromText": "Metinden seçim",
"AskSubclass": "Alt sınıfı sor"
},
"error": {
"MethodNotFound": "Metod bulunamadı: {methodId}",
Expand Down
3 changes: 2 additions & 1 deletion plugins/process-assets/lang/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@
"TextFromMarkup": "标记到文本",
"MarkupFromText": "文本到标记",
"TextFromSelect": "选择到文本",
"SelectFromText": "文本到选择"
"SelectFromText": "文本到选择",
"AskSubclass": "询问子类"
},
"error": {
"MethodNotFound": "找不到方法:{methodId}",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<!--
// Copyright © 2026 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 { TypeSelector } from '@hcengineering/card-resources'
import { Class, Doc, Ref } from '@hcengineering/core'
import { getClient } from '@hcengineering/presentation'
import { Label } from '@hcengineering/ui'
import { createEventDispatcher } from 'svelte'

export let _class: Ref<Class<Doc>>
export let value: any | undefined = undefined

const client = getClient()
const hierarchy = client.getHierarchy()
const attribute = hierarchy.findAttribute(_class, '_class')

const dispatch = createEventDispatcher()
function onChange (val: any | undefined): void {
value = val
dispatch('change', val)
}
</script>

{#if attribute}
<div>
<Label label={attribute.label} />:
</div>
{/if}
<div class="w-full">
<TypeSelector
value={value ?? _class}
parent={_class}
kind={'ghost'}
width={'100%'}
on:change={(e) => {
if (e.detail !== undefined) {
onChange(e.detail)
}
}}
/>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import plugin from '../../plugin'
import TransitionPresenter from '../settings/TransitionPresenter.svelte'
import RequestUserInputAttribute from './RequestUserInputAttribute.svelte'
import ClassUserInput from './ClassUserInput.svelte'

export let processId: Ref<Process>
export let space: Ref<Space>
Expand Down Expand Up @@ -66,16 +67,27 @@
{/if}
<div class="grid">
{#each inputs as input}
<RequestUserInputAttribute
key={input.key}
_class={input._class}
{space}
value={values[input.id]}
on:change={(e) => {
values[input.id] = e.detail
values = values
}}
/>
{#if input.key === '_class'}
<ClassUserInput
_class={input._class}
value={values[input.id]}
on:change={(e) => {
values[input.id] = e.detail
values = values
}}
/>
{:else}
<RequestUserInputAttribute
key={input.key}
_class={input._class}
{space}
value={values[input.id]}
on:change={(e) => {
values[input.id] = e.detail
values = values
}}
/>
{/if}
{/each}
</div>
</Card>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@
$: contextValue = params.title !== undefined ? parseContext(params.title) : undefined
$: context = getContext(client, process, core.class.TypeString, 'attribute')

$: _class = params?._class
? (client.getHierarchy().getClass(params._class as Ref<MasterTag>) as MasterTag)
: undefined
$: target = params?.targetClass ?? params?._class
$: _class = target !== undefined ? (client.getHierarchy().getClass(target as Ref<MasterTag>) as MasterTag) : undefined
$: icon = _class?.icon
</script>

Expand Down
Loading
Loading