add img preview + fix navbar
This commit is contained in:
@@ -840,18 +840,6 @@ const formatAssignmentList = (assignments) => {
|
||||
.join(', ')
|
||||
}
|
||||
|
||||
const selectedComponentIds = computed(() => {
|
||||
const ids = []
|
||||
Object.values(componentRequirementSelections).forEach((entries) => {
|
||||
;(entries || []).forEach((entry) => {
|
||||
if (entry?.composantId) {
|
||||
ids.push(entry.composantId)
|
||||
}
|
||||
})
|
||||
})
|
||||
return ids
|
||||
})
|
||||
|
||||
const selectedPieceIds = computed(() => {
|
||||
const ids = []
|
||||
Object.values(pieceRequirementSelections).forEach((entries) => {
|
||||
@@ -866,21 +854,15 @@ const selectedPieceIds = computed(() => {
|
||||
|
||||
const getComponentOptions = (requirement, currentEntry) => {
|
||||
const requirementTypeId = requirement?.typeComposantId || requirement?.typeComposant?.id || null
|
||||
const usedIds = new Set(
|
||||
selectedComponentIds.value.filter((id) => id && (!currentEntry || id !== currentEntry.composantId)),
|
||||
)
|
||||
|
||||
return componentInventory.value.filter((component) => {
|
||||
if (!component?.id) {
|
||||
return false
|
||||
}
|
||||
if (requirementTypeId && component.typeComposantId !== requirementTypeId) {
|
||||
return false
|
||||
return currentEntry?.composantId === component.id
|
||||
}
|
||||
if (!component.id) {
|
||||
return false
|
||||
}
|
||||
if (currentEntry?.composantId === component.id) {
|
||||
return true
|
||||
}
|
||||
return !usedIds.has(component.id)
|
||||
return true
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user