Skip to content

Commit 692fdb2

Browse files
committed
fix(gpr): add brackets around GPR items when multiple exist
1 parent e1de4f0 commit 692fdb2

File tree

1 file changed

+9
-2
lines changed
  • curationTool/reactions/static/reactions/js_VMH_workspace

1 file changed

+9
-2
lines changed

curationTool/reactions/static/reactions/js_VMH_workspace/workspace.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,11 @@ document.querySelectorAll('.subtabs').forEach((bar) => {
457457

458458
// Build GPR summary string
459459
const gprItems = gene_info.filter(item => item.info && item.info.trim() !== '').map(item => item.info);
460-
const gprSummary = gprItems.length > 0 ? `${gprItems.join(' OR ')}` : '';
460+
const gprSummary = gprItems.length > 0
461+
? (gprItems.length > 1
462+
? gprItems.map(item => `(${item})`).join(' OR ')
463+
: gprItems[0])
464+
: '';
461465

462466
listItem.innerHTML += createSectionHTML('References', 'reference', references, reaction.pk, false, true);
463467
listItem.innerHTML += createSectionHTML('External Links', 'ext-link', ext_links, reaction.pk, true, false);
@@ -568,7 +572,10 @@ function updateGPRSummary() {
568572
});
569573

570574
if (gprItems.length > 0) {
571-
const gprText = gprItems.join(' OR ');
575+
// Add brackets around each item when joining with OR (only if multiple items)
576+
const gprText = gprItems.length > 1
577+
? gprItems.map(item => `(${item})`).join(' OR ')
578+
: gprItems[0];
572579
if (gprSummaryEl) {
573580
gprSummaryEl.innerHTML = `<span class="gpr-label">GPR:</span> <code class="gpr-formula">${gprText}</code>`;
574581
gprSummaryEl.style.display = '';

0 commit comments

Comments
 (0)