mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-10 19:57:43 +02:00
Use dslContext everywhere (#10028)
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
<script lang="ts">
|
||||
import { MasterTag, Tag } from '@hcengineering/card'
|
||||
import { AnyAttribute, Class, Doc, Ref } from '@hcengineering/core'
|
||||
import { Context, createDSLContext, parseContext, Process, SelectedContext } from '@hcengineering/process'
|
||||
import { Context, createContext, parseContext, Process, SelectedContext } from '@hcengineering/process'
|
||||
import {
|
||||
AnySvelteComponent,
|
||||
Button,
|
||||
@@ -72,11 +72,7 @@
|
||||
if (res === null) {
|
||||
value = undefined
|
||||
} else {
|
||||
try {
|
||||
value = createDSLContext(res)
|
||||
} catch {
|
||||
value = '$' + JSON.stringify(res)
|
||||
}
|
||||
value = createContext(res)
|
||||
}
|
||||
dispatch('change', value)
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
import { getClient } from '@hcengineering/presentation'
|
||||
import {
|
||||
ContextId,
|
||||
createContext,
|
||||
MethodParams,
|
||||
parseContext,
|
||||
Process,
|
||||
@@ -115,15 +116,13 @@
|
||||
eventToHTMLElement(ev),
|
||||
(result) => {
|
||||
if (result !== undefined) {
|
||||
dispatch(
|
||||
'change',
|
||||
'$' +
|
||||
JSON.stringify({
|
||||
type: 'context',
|
||||
id: result as ContextId,
|
||||
key: ''
|
||||
})
|
||||
)
|
||||
const ctx: SelectedExecutionContext = {
|
||||
type: 'context',
|
||||
id: result as ContextId,
|
||||
key: ''
|
||||
}
|
||||
const res = createContext(ctx)
|
||||
dispatch('change', res)
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<script lang="ts">
|
||||
import core, { AnyAttribute } from '@hcengineering/core'
|
||||
import { getClient } from '@hcengineering/presentation'
|
||||
import { parseContext, Process, SelectedContext } from '@hcengineering/process'
|
||||
import { createContext, parseContext, Process, SelectedContext } from '@hcengineering/process'
|
||||
import { Button, Component, eventToHTMLElement, IconAdd, IconClose, showPopup } from '@hcengineering/ui'
|
||||
import view from '@hcengineering/view-resources/src/plugin'
|
||||
import { createEventDispatcher } from 'svelte'
|
||||
@@ -51,7 +51,7 @@
|
||||
}
|
||||
|
||||
function onSelect (res: SelectedContext | null): void {
|
||||
val = res === null ? undefined : '$' + JSON.stringify(res)
|
||||
val = res === null ? undefined : createContext(res)
|
||||
dispatch('change', val)
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<script lang="ts">
|
||||
import { AnyAttribute } from '@hcengineering/core'
|
||||
import { findAttributeEditor, getAttributePresenterClass, getClient } from '@hcengineering/presentation'
|
||||
import { Context, parseContext, Process, SelectedContext } from '@hcengineering/process'
|
||||
import { Context, createContext, parseContext, Process, SelectedContext } from '@hcengineering/process'
|
||||
import { Button, Component, eventToHTMLElement, IconAdd, IconClose, showPopup } from '@hcengineering/ui'
|
||||
import { createEventDispatcher } from 'svelte'
|
||||
import ContextSelectorPopup from '../attributeEditors/ContextSelectorPopup.svelte'
|
||||
@@ -47,7 +47,7 @@
|
||||
}
|
||||
|
||||
function onSelect (res: SelectedContext | null): void {
|
||||
val = res === null ? undefined : '$' + JSON.stringify(res)
|
||||
val = res === null ? undefined : createContext(res)
|
||||
dispatch('change', val)
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<script lang="ts">
|
||||
import { AnyAttribute } from '@hcengineering/core'
|
||||
import { findAttributeEditor, getAttributePresenterClass, getClient } from '@hcengineering/presentation'
|
||||
import { Context, parseContext, Process, SelectedContext } from '@hcengineering/process'
|
||||
import { Context, createContext, parseContext, Process, SelectedContext } from '@hcengineering/process'
|
||||
import { Button, Component, eventToHTMLElement, IconAdd, IconClose, showPopup } from '@hcengineering/ui'
|
||||
import { createEventDispatcher } from 'svelte'
|
||||
import ContextSelectorPopup from '../attributeEditors/ContextSelectorPopup.svelte'
|
||||
@@ -52,7 +52,7 @@
|
||||
}
|
||||
|
||||
function onSelect (res: SelectedContext | null, index: number): void {
|
||||
val[index] = res === null ? undefined : '$' + JSON.stringify(res)
|
||||
val[index] = res === null ? undefined : createContext(res)
|
||||
dispatch('change', val)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user