Fix private inventory item when adding new item relationship [SCI-12253]

This commit is contained in:
Andrej 2025-08-18 10:53:52 +02:00
parent 11dfe8f172
commit ebdba39445
3 changed files with 20 additions and 16 deletions

View file

@ -145,19 +145,23 @@ class RepositoryRowConnectionsController < ApplicationController
repository_connections.map do |connection|
repository_row = @relation_type == 'parent' ? connection.parent : connection.child
{
name: repository_row.name_with_label,
code: repository_row.code,
path: repository_repository_row_path(repository_row.repository, repository_row),
repository_name: repository_row.repository.name_with_label,
repository_path: repository_path(repository_row.repository),
unlink_path: repository_repository_row_repository_row_connection_path(
repository_row.repository,
repository_row,
connection
)
}
if can_read_repository?(repository_row.repository)
{
name: repository_row.name_with_label,
code: repository_row.code,
path: repository_repository_row_path(repository_row.repository, repository_row),
repository_name: repository_row.repository.name_with_label,
repository_path: repository_path(repository_row.repository),
can_connect_rows: can_connect_repository_rows?(repository_row.repository),
unlink_path: repository_repository_row_repository_row_connection_path(
repository_row.repository,
repository_row,
connection
)
}
else
{ name: I18n.t('repositories.item_card.relationships.private_item_name') }
end
end
end

View file

@ -184,7 +184,7 @@
</a>
</div>
<div v-if="parentsCount">
<details v-for="(parent) in parents" @toggle="updateOpenState(parent.code, $event.target.open)" :key="parent.code" class="flex flex-col font-normal gap-4 group cursor-default">
<details v-for="(parent) in parents" @toggle="updateOpenState(parent.code, $event.target.open)" :key="parent.code" class="flex flex-col font-normal group cursor-default">
<summary class="flex flex-row gap-3 mb-4 relative group">
<img :src="icons.delimiter_path" class="w-3 h-3 cursor-pointer flex-shrink-0 relative top-1"
:class="{ 'rotate-90': relationshipDetailsState[parent.code] }" />
@ -234,7 +234,7 @@
</div>
<div v-if="childrenCount">
<details v-for="(child) in children" :key="child.code" @toggle="updateOpenState(child.code, $event.target.open)"
class="flex flex-col font-normal gap-4 group-last-of-type:[&>p:last-child]:mb-0">
class="flex flex-col font-normal group-last-of-type:[&>p:last-child]:mb-0">
<summary class="flex flex-row gap-3 mb-4 relative group"
:class="{ 'group-last-of-type:mb-0': !relationshipDetailsState[child.code] }">
<img :src="icons.delimiter_path" class="w-3 h-3 flex-shrink-0 cursor-pointer relative top-1"

View file

@ -2919,7 +2919,7 @@ en:
select_valid_value: 'Select a valid date or date-time value'
browser_alert_message: 'You have made some changes, are you sure you want to leave this page?'
errors:
load_error_header: 'Your workspace does not have the necessary permissions to view the details of this item.'
load_error_header: 'You do not have the necessary permissions to view the details of this item.'
load_error_description: 'To obtain access, reach out to your workspace administrator.'
highlight_component:
information_label: 'Information'