Fixed Translation error for Error message on item card [SCI-9601]

This commit is contained in:
Gregor Lasnibat 2023-11-02 12:58:40 +01:00
parent 4fd3933bdb
commit 68dc671f06
3 changed files with 15 additions and 19 deletions

View file

@ -1,25 +1,15 @@
<template>
<inline-edit
v-if="editable"
class="item-name my-auto text-xl font-semibold"
:value="name"
:characterLimit="255"
:characterMinLimit="0"
:allowBlank="false"
:smartAnnotation="false"
:attributeName="`${i18n.t('Repository_row')} ${i18n.t('Name')} `"
:singleLine="true"
@editingEnabled="editingName = true"
@editingDisabled="editingName = false"
@update="updateName"
></inline-edit>
<inline-edit v-if="editable" class="item-name my-auto text-xl font-semibold" :value="name" :characterLimit="255"
:characterMinLimit="0" :allowBlank="false" :smartAnnotation="false"
:attributeName="`${i18n.t('repositories.item_card.header_title')}`" :singleLine="true"
@editingEnabled="editingName = true" @editingDisabled="editingName = false" @update="updateName" @delete="handleDelete"></inline-edit>
<h4 v-else class="item-name my-auto truncate text-xl" :title="name">
{{ name }}
</h4>
</template>
<script>
import InlineEdit from "../shared/inline_edit.vue";
import InlineEdit from "../shared/inline_edit.vue";
export default {
name: "RepositoryItemSidebarTitle",

View file

@ -107,7 +107,10 @@
},
computed: {
isBlank() {
return this.newValue.length === 0;
if (typeof this.newValue === 'string') {
return this.newValue.trim().length === 0;
}
return true; // treat as blank for non-string values
},
isContentDefault() {
return this.newValue === this.defaultValue;
@ -152,8 +155,11 @@
this.$emit('blur');
if (this.allowBlank || !this.isBlank) {
this.$nextTick(this.update);
} else {
this.$emit('delete');
} else if (this.isBlank) {
this.newValue = this.value || '';
}
else {
this.$emit('delete')
}
},
focus() {

View file

@ -2221,6 +2221,7 @@ en:
my_module_assigned_snapshot_service:
invalid_arguments: "Can't find %{key}"
item_card:
header_title: "Inventory item"
section:
information: "Information"
assigned: "Assigned (%{count})"
@ -3909,7 +3910,6 @@ en:
Tables: "Tables"
Repositories_team: "Inventories - %{team}"
Repository: "Inventory"
Repository_row: "Inventory item"
Reports: "Reports"
Comments: "Comments"
Step: "Step"