Process errors (#8476)

This commit is contained in:
Denis Bykhov
2025-04-06 20:20:47 +07:00
committed by GitHub
parent 9bf5234730
commit d2bdf88249
26 changed files with 517 additions and 101 deletions
@@ -0,0 +1,27 @@
<!--
// 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 { ExecutionError } from '@hcengineering/process'
import { IconError, tooltip } from '@hcengineering/ui'
import ErrorTooltip from './ErrorTooltip.svelte'
export let value: ExecutionError[] | null | undefined
</script>
{#if value}
<div use:tooltip={{ component: ErrorTooltip, props: { value } }} class="error">
<IconError size="medium" />
</div>
{/if}
@@ -0,0 +1,42 @@
<!--
// 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 { translate } from '@hcengineering/platform'
import { ExecutionError } from '@hcengineering/process'
import { Label } from '@hcengineering/ui'
export let value: ExecutionError[]
async function fillProps (value: ExecutionError[]): Promise<ExecutionError[]> {
for (const val of value) {
for (const key in val.intlProps) {
try {
val.props[key] = await translate(val.intlProps[key], {})
} catch (err) {
console.error(err)
}
}
}
return value
}
</script>
<div class="p-2 flex-col-center flex-gap-2">
{#await fillProps(value) then res}
{#each res as error}
<div><Label label={error.error} params={error.props} /></div>
{/each}
{/await}
</div>
@@ -16,6 +16,7 @@
import { WithLookup } from '@hcengineering/core'
import { getClient } from '@hcengineering/presentation'
import { Execution } from '@hcengineering/process'
import ErrorPresenter from './ErrorPresenter.svelte'
export let value: WithLookup<Execution>
@@ -25,7 +26,8 @@
</script>
{#if process}
<div>
<div class="flex-row-center flex-gap-2">
<ErrorPresenter value={value.error} />
{process.name}
</div>
{/if}
@@ -122,6 +122,7 @@
bind:this={list}
_class={process.class.Execution}
{viewOptions}
baseMenuClass={process.class.Execution}
viewOptionsConfig={viewlet.viewOptions?.other}
config={preference?.config ?? viewlet.config}
configurations={undefined}
@@ -55,7 +55,7 @@
<Card on:close width={'small'} label={process.string.Offset} canSave okAction={save}>
<div class="flex-row-center flex-gap-2">
<DropdownLabelsIntl items={directions} bind:selected={direction} />
<NumberInput bind:value={offset} autoFocus focusable maxDigitsAfterPoint={0} />
<NumberInput bind:value={offset} autoFocus minValue={0} focusable maxDigitsAfterPoint={0} />
<DropdownLabelsIntl {items} bind:selected={offsetType} {params} />
</div></Card
>