Merge pull request #7869 from rekonder/aj_SCI_11074

Fix displaying of checklist items for repository snapshots [SCI-11074]
This commit is contained in:
ajugo 2024-09-19 15:54:26 +02:00 committed by GitHub
commit c53034359a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -16,14 +16,14 @@
> >
</select-dropdown> </select-dropdown>
</div> </div>
<div v-else-if="computedArrOfItemObjects && computedArrOfItemObjects.length > 0" <div v-else-if="colVal && colVal.length > 0"
class="text-sn-dark-grey font-inter text-sm font-normal leading-5 w-[370px] overflow-x-auto flex flex-wrap gap-1"> class="text-sn-dark-grey font-inter text-sm font-normal leading-5 w-[370px] overflow-x-auto flex flex-wrap gap-1">
<span v-for="(checklistItem, index) in computedArrOfItemObjects" <span v-for="(checklistItem, index) in colVal"
:key="index" :key="index"
:id="`checklist-item-${index}`" :id="`checklist-item-${index}`"
class="flex w-fit break-words"> class="flex w-fit break-words">
{{ {{
index + 1 === computedArrOfItemObjects.length index + 1 === colVal.length
? checklistItem?.label ? checklistItem?.label
: `${checklistItem?.label} |` : `${checklistItem?.label} |`
}} }}
@ -66,18 +66,6 @@ export default {
this.selectedChecklistItemsIds = this.colVal.map((item) => String(item.value)); this.selectedChecklistItemsIds = this.colVal.map((item) => String(item.value));
} }
}, },
computed: {
computedArrOfItemObjects() {
const arrOfItemObjects = this.selectedChecklistItemsIds.map((id) => {
const matchingItem = this.availableChecklistItems.find((item) => item[0] === id);
return {
id: matchingItem ? matchingItem[0] : null,
label: matchingItem ? matchingItem[1] : null
};
});
return arrOfItemObjects;
}
},
methods: { methods: {
fetchChecklistItems() { fetchChecklistItems() {
this.isLoading = true; this.isLoading = true;