Sanity test fixes for link results [SCI-12008]

This commit is contained in:
Anton 2025-06-13 13:37:33 +02:00
parent 3ee93b287f
commit 330e713436
4 changed files with 6 additions and 5 deletions

View file

@ -83,12 +83,12 @@
:data-object-type="step.attributes.type" :data-object-type="step.attributes.type"
tabindex="0" tabindex="0"
></span> <!-- Hidden element to support legacy code --> ></span> <!-- Hidden element to support legacy code -->
<button v-if="step.attributes.results.length == 0" class="btn btn-light icon-btn" @click="this.openLinkResultsModal = true"> <button v-if="step.attributes.results.length == 0" :title="i18n.t('protocols.steps.link_results')" class="btn btn-light icon-btn" @click="this.openLinkResultsModal = true">
<i class="sn-icon sn-icon-results"></i> <i class="sn-icon sn-icon-results"></i>
</button> </button>
<GeneralDropdown v-else ref="linkedResultsDropdown" position="right"> <GeneralDropdown v-else ref="linkedResultsDropdown" position="right">
<template v-slot:field> <template v-slot:field>
<button class="btn btn-light icon-btn"> <button class="btn btn-light icon-btn" :title="i18n.t('protocols.steps.link_results')">
<i class="sn-icon sn-icon-results"></i> <i class="sn-icon sn-icon-results"></i>
<span class="absolute top-1 right-1 h-4 min-w-4 bg-sn-science-blue text-white flex items-center justify-center rounded-full text-[10px]"> <span class="absolute top-1 right-1 h-4 min-w-4 bg-sn-science-blue text-white flex items-center justify-center rounded-full text-[10px]">
{{ step.attributes.results.length }} {{ step.attributes.results.length }}

View file

@ -71,7 +71,7 @@
<GeneralDropdown v-else ref="linkedStepsDropdown" position="right"> <GeneralDropdown v-else ref="linkedStepsDropdown" position="right">
<template v-slot:field> <template v-slot:field>
<button class="btn btn-light icon-btn"> <button class="btn btn-light icon-btn">
{{ i18n.t('my_modules.results.link_to_step') }} <i class="sn-icon sn-icon-steps"></i>
<span class="absolute top-1 -right-1 h-4 min-w-4 bg-sn-science-blue text-white flex items-center justify-center rounded-full text-[10px]"> <span class="absolute top-1 -right-1 h-4 min-w-4 bg-sn-science-blue text-white flex items-center justify-center rounded-full text-[10px]">
{{ result.attributes.steps.length }} {{ result.attributes.steps.length }}
</span> </span>

View file

@ -225,7 +225,7 @@ export default {
if (this.newValue.length === 0) { if (this.newValue.length === 0) {
return false; return false;
} }
if (this.newValue.length === 1) { if (this.newValue.length === 1 && this.rawOptions.length > 1) {
this.selectAllState = 'indeterminate'; this.selectAllState = 'indeterminate';
return this.renderLabel(this.rawOptions.find((option) => option[0] === this.newValue[0])); return this.renderLabel(this.rawOptions.find((option) => option[0] === this.newValue[0]));
} }

View file

@ -1647,7 +1647,7 @@ en:
modals: modals:
link_steps: link_steps:
title: 'Link result to protocol steps' title: 'Link result to protocol steps'
description: 'You can link result to multipple steps' description: 'You can link a result to multiple steps.'
empty_description: 'No step found. Add a step first to enable linking with a result.' empty_description: 'No step found. Add a step first to enable linking with a result.'
steps_label: 'Protocol steps' steps_label: 'Protocol steps'
placeholder: 'Select steps' placeholder: 'Select steps'
@ -4054,6 +4054,7 @@ en:
timestamp: "Created on %{date} by %{user}" timestamp: "Created on %{date} by %{user}"
timestamp_iso_html: "Created on <span class='iso-formatted-date'>%{date}</span> by %{user}" timestamp_iso_html: "Created on <span class='iso-formatted-date'>%{date}</span> by %{user}"
manage_links: "Manage links" manage_links: "Manage links"
link_results: "Link results to this step"
status: status:
complete: "Mark as done" complete: "Mark as done"
uncomplete: "Unmark as done" uncomplete: "Unmark as done"