From f4e1498df15858f83531b134226712929d8578a7 Mon Sep 17 00:00:00 2001 From: Anton Date: Mon, 16 Sep 2024 11:50:54 +0200 Subject: [PATCH 1/2] Add repository item card to storage container [SCI-11048] --- .../packs/vue/storage_locations_container.js | 2 +- .../vue/repository_item_sidebar/locations.vue | 18 +++++++++++-- .../vue/storage_locations/container.vue | 18 +++++-------- .../renderers/item_name_renderer.vue | 26 +++++++++++++++++++ ...rage_location_repository_row_serializer.rb | 6 ++++- app/views/storage_locations/show.html.erb | 1 + 6 files changed, 55 insertions(+), 16 deletions(-) create mode 100644 app/javascript/vue/storage_locations/renderers/item_name_renderer.vue diff --git a/app/javascript/packs/vue/storage_locations_container.js b/app/javascript/packs/vue/storage_locations_container.js index abf6912c3..e7f2e6259 100644 --- a/app/javascript/packs/vue/storage_locations_container.js +++ b/app/javascript/packs/vue/storage_locations_container.js @@ -7,4 +7,4 @@ const app = createApp(); app.component('StorageLocationsContainer', StorageLocationsContainer); app.config.globalProperties.i18n = window.I18n; app.use(PerfectScrollbar); -mountWithTurbolinks(app, '#StorageLocationsContainer'); +window.StorageLocationsContainer = mountWithTurbolinks(app, '#StorageLocationsContainer'); diff --git a/app/javascript/vue/repository_item_sidebar/locations.vue b/app/javascript/vue/repository_item_sidebar/locations.vue index 7b3898797..4f61847c1 100644 --- a/app/javascript/vue/repository_item_sidebar/locations.vue +++ b/app/javascript/vue/repository_item_sidebar/locations.vue @@ -22,7 +22,9 @@
{{ formatPosition(position.metadata.position) }} - +
@@ -41,8 +43,11 @@ diff --git a/app/serializers/lists/storage_location_repository_row_serializer.rb b/app/serializers/lists/storage_location_repository_row_serializer.rb index c86b42e94..00509d457 100644 --- a/app/serializers/lists/storage_location_repository_row_serializer.rb +++ b/app/serializers/lists/storage_location_repository_row_serializer.rb @@ -6,7 +6,7 @@ module Lists include Rails.application.routes.url_helpers attributes :created_by, :created_on, :position, :row_id, :row_name, :hidden, :position_formatted, :stock, - :have_reminders, :reminders_url + :have_reminders, :reminders_url, :row_url def row_id object.repository_row.code @@ -38,6 +38,10 @@ module Lists end end + def row_url + repository_repository_row_path(object.repository_row.repository, object.repository_row) + end + def hidden !can_read_repository?(object.repository_row.repository) end diff --git a/app/views/storage_locations/show.html.erb b/app/views/storage_locations/show.html.erb index eefdfdcf0..0037e222a 100644 --- a/app/views/storage_locations/show.html.erb +++ b/app/views/storage_locations/show.html.erb @@ -11,6 +11,7 @@
Date: Mon, 16 Sep 2024 11:59:35 +0200 Subject: [PATCH 2/2] Remove unused method from item sidebar title --- app/javascript/vue/repository_item_sidebar/Title.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/javascript/vue/repository_item_sidebar/Title.vue b/app/javascript/vue/repository_item_sidebar/Title.vue index c238c63a1..9bba67953 100644 --- a/app/javascript/vue/repository_item_sidebar/Title.vue +++ b/app/javascript/vue/repository_item_sidebar/Title.vue @@ -3,7 +3,7 @@ :characterMinLimit="0" :allowBlank="false" :smartAnnotation="false" :preventLeavingUntilFilled="true" :attributeName="`${i18n.t('repositories.item_card.header_title')}`" :singleLine="true" - @editingEnabled="editingName = true" @editingDisabled="editingName = false" @update="updateName" @delete="handleDelete"> + @editingEnabled="editingName = true" @editingDisabled="editingName = false" @update="updateName">

{{ computedName }}