mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-02 07:01:30 -08:00
Update evaluation UI components and add test IDs
- Add data-test-id to input components - Update TagsInput to use useI18n composable - Fix typo in TestsList component - Add test ID to "Run Test" button - Remove unused locale references
This commit is contained in:
parent
b8073c70fb
commit
1417fe4719
|
@ -38,6 +38,7 @@ defineProps<EvaluationHeaderProps>();
|
|||
<N8nInput
|
||||
v-else
|
||||
ref="nameInput"
|
||||
data-test-id="evaluation-name-input"
|
||||
:model-value="modelValue.tempValue"
|
||||
type="text"
|
||||
:placeholder="$locale.baseText('workflowEvaluation.edit.namePlaceholder')"
|
||||
|
|
|
@ -35,6 +35,7 @@ function updateMetric(index: number, value: string) {
|
|||
<div v-for="(metric, index) in modelValue" :key="index">
|
||||
<N8nInput
|
||||
:ref="`metric_${index}`"
|
||||
data-test-id="evaluation-metric-item"
|
||||
:model-value="metric"
|
||||
:placeholder="$locale.baseText('workflowEvaluation.edit.metricsPlaceholder')"
|
||||
@update:model-value="(value: string) => updateMetric(index, value)"
|
||||
|
|
|
@ -26,6 +26,7 @@ const props = withDefaults(defineProps<TagsInputProps>(), {
|
|||
|
||||
const emit = defineEmits<{ 'update:modelValue': [value: TagsInputProps['modelValue']] }>();
|
||||
|
||||
const locale = useI18n();
|
||||
const tagsEventBus = createEventBus();
|
||||
const getTagName = computed(() => (tagId: string) => {
|
||||
return props.tagsById[tagId]?.name ?? '';
|
||||
|
@ -45,7 +46,7 @@ function updateTags(tags: string[]) {
|
|||
<n8n-input-label label="Tag name" :bold="false" size="small">
|
||||
<div v-if="!modelValue.isEditing" :class="$style.tagsRead" @click="startEditing('tags')">
|
||||
<n8n-text v-if="modelValue.appliedTagIds.length === 0" size="small">
|
||||
{{ $locale.baseText('workflowEvaluation.edit.selectTag') }}
|
||||
{{ locale.baseText('workflowEvaluation.edit.selectTag') }}
|
||||
</n8n-text>
|
||||
<n8n-tag v-for="tagId in modelValue.appliedTagIds" :key="tagId" :text="getTagName(tagId)" />
|
||||
<n8n-icon-button
|
||||
|
@ -59,7 +60,7 @@ function updateTags(tags: string[]) {
|
|||
<TagsDropdown
|
||||
v-else
|
||||
:model-value="modelValue.appliedTagIds"
|
||||
:placeholder="$locale.baseText('executionAnnotationView.chooseOrCreateATag')"
|
||||
:placeholder="locale.baseText('executionAnnotationView.chooseOrCreateATag')"
|
||||
:create-enabled="false"
|
||||
:all-tags="allTags"
|
||||
:is-loading="isLoading"
|
||||
|
@ -72,7 +73,7 @@ function updateTags(tags: string[]) {
|
|||
/>
|
||||
</n8n-input-label>
|
||||
<n8n-text size="small" color="text-light">{{
|
||||
$locale.baseText('workflowEvaluation.edit.tagsHelpText')
|
||||
locale.baseText('workflowEvaluation.edit.tagsHelpText')
|
||||
}}</n8n-text>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<script setup lang="ts">
|
||||
import TestItem from './TestItem.vue';
|
||||
import type { TestListItem } from '@/components/WorkflowEvaluation/types';
|
||||
|
||||
s;
|
||||
export interface TestListProps {
|
||||
tests: TestListItem[];
|
||||
}
|
||||
|
|
|
@ -99,7 +99,13 @@ function hasIssues(key: string) {
|
|||
<MetricsInput v-model="state.metrics" :class="{ 'has-issues': hasIssues('metrics') }" />
|
||||
|
||||
<div :class="$style.footer">
|
||||
<n8n-button type="primary" :label="buttonLabel" :loading="isSaving" @click="onSaveTest" />
|
||||
<n8n-button
|
||||
type="primary"
|
||||
data-test-id="run-test-button"
|
||||
:label="buttonLabel"
|
||||
:loading="isSaving"
|
||||
@click="onSaveTest"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
Loading…
Reference in a new issue