From 29e3517f51124a0460065746e103a8ccae9b7b56 Mon Sep 17 00:00:00 2001 From: Gregor Lasnibat Date: Tue, 14 Nov 2023 16:58:10 +0100 Subject: [PATCH] Implement a link in the relationships column [SCI-9670] --- .../sitewide/repository_row_card.js | 9 +- .../RepositoryItemSidebar.vue | 49 +++---- .../repository_values/ScrollSpy.vue | 122 +++++++++--------- 3 files changed, 89 insertions(+), 91 deletions(-) diff --git a/app/assets/javascripts/sitewide/repository_row_card.js b/app/assets/javascripts/sitewide/repository_row_card.js index 60b3336a8..aceed5d2e 100644 --- a/app/assets/javascripts/sitewide/repository_row_card.js +++ b/app/assets/javascripts/sitewide/repository_row_card.js @@ -6,8 +6,11 @@ $(document).on('click', '.relationships-cell-wrapper', function(e) { e.stopPropagation(); e.preventDefault(); - const relationshipsUrl = $(this).attr('data-relationships-url'); - window.itemRelationshipsModal.show(relationshipsUrl); + const myModuleId = $('.my-module-content').data('task-id'); + // extract the href attribute from a neighboring column cell, required for sidebar to open + const repositoryRowURL = $(this).closest('tr').find('.sorting_1 a').attr('href'); + + window.repositoryItemSidebarComponent.toggleShowHideSidebar(repositoryRowURL, myModuleId, 'relationships-section'); }); $(document).on('click', '.record-info-link', function (e) { @@ -17,7 +20,7 @@ e.stopPropagation(); e.preventDefault(); - window.repositoryItemSidebarComponent.toggleShowHideSidebar(repositoryRowURL, myModuleId); + window.repositoryItemSidebarComponent.toggleShowHideSidebar(repositoryRowURL, myModuleId, null); }); $(document).on('click', '.print-label-button', function(e) { diff --git a/app/javascript/vue/repository_item_sidebar/RepositoryItemSidebar.vue b/app/javascript/vue/repository_item_sidebar/RepositoryItemSidebar.vue index 6a4c6900b..fa3675af1 100644 --- a/app/javascript/vue/repository_item_sidebar/RepositoryItemSidebar.vue +++ b/app/javascript/vue/repository_item_sidebar/RepositoryItemSidebar.vue @@ -128,7 +128,7 @@
+ ref="relationships-label"> {{ i18n.t('repositories.item_card.section.relationships') }}