Merge pull request #7884 from aignatov-bio/ai-sci-11084-add-storage-location-banner-to-item-card

Add placeholder for disabled storage locations to item card [SCI-11084]
This commit is contained in:
aignatov-bio 2024-09-25 14:14:01 +02:00 committed by GitHub
commit a70b081c38
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 14 additions and 1 deletions

View file

@ -4,6 +4,7 @@ class RepositoryRowsController < ApplicationController
include ApplicationHelper
include MyModulesHelper
include RepositoryDatatableHelper
include StorageLocationsHelper
before_action :load_repository, except: %i(show print rows_to_print print_zpl validate_label_template_columns)
before_action :load_repository_or_snapshot, only: %i(show print rows_to_print print_zpl

View file

@ -0,0 +1,7 @@
module StorageLocationsHelper
def storage_locations_placeholder
"<div class=\"p-4 rounded bg-sn-super-light-blue\">
#{I18n.t('storage_locations.storage_locations_disabled')}
</div>"
end
end

View file

@ -7,7 +7,7 @@
{{ i18n.t('repositories.locations.assign') }}
</button>
</div>
<template v-for="(location, index) in repositoryRow.storage_locations.locations" :key="location.id">
<template v-if="repositoryRow.storage_locations.enabled" v-for="(location, index) in repositoryRow.storage_locations.locations" :key="location.id">
<div>
<div class="sci-divider my-4" v-if="index > 0"></div>
<div class="flex gap-2 mb-3">
@ -30,6 +30,9 @@
</div>
</div>
</template>
<div v-else>
<div v-html="repositoryRow.storage_locations.placeholder"></div>
</div>
<Teleport to="body">
<AssignModal
v-if="openAssignModal"

View file

@ -52,6 +52,7 @@ json.storage_locations do
end
)
json.enabled StorageLocation.storage_locations_enabled?
json.placeholder storage_locations_placeholder
end
json.default_columns do

View file

@ -2670,6 +2670,7 @@ en:
errors:
my_module_references_missing: 'Task references are not set'
storage_locations:
storage_locations_disabled: "<b>Storage locations are disabled</b>"
container: 'box'
location: 'location'
show: