mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-06 13:14:29 +08:00
Fix private inventory item when adding new item relationship [SCI-12253]
This commit is contained in:
parent
11dfe8f172
commit
ebdba39445
3 changed files with 20 additions and 16 deletions
|
@ -145,19 +145,23 @@ class RepositoryRowConnectionsController < ApplicationController
|
||||||
|
|
||||||
repository_connections.map do |connection|
|
repository_connections.map do |connection|
|
||||||
repository_row = @relation_type == 'parent' ? connection.parent : connection.child
|
repository_row = @relation_type == 'parent' ? connection.parent : connection.child
|
||||||
|
if can_read_repository?(repository_row.repository)
|
||||||
{
|
{
|
||||||
name: repository_row.name_with_label,
|
name: repository_row.name_with_label,
|
||||||
code: repository_row.code,
|
code: repository_row.code,
|
||||||
path: repository_repository_row_path(repository_row.repository, repository_row),
|
path: repository_repository_row_path(repository_row.repository, repository_row),
|
||||||
repository_name: repository_row.repository.name_with_label,
|
repository_name: repository_row.repository.name_with_label,
|
||||||
repository_path: repository_path(repository_row.repository),
|
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(
|
unlink_path: repository_repository_row_repository_row_connection_path(
|
||||||
repository_row.repository,
|
repository_row.repository,
|
||||||
repository_row,
|
repository_row,
|
||||||
connection
|
connection
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{ name: I18n.t('repositories.item_card.relationships.private_item_name') }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -184,7 +184,7 @@
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="parentsCount">
|
<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">
|
<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"
|
<img :src="icons.delimiter_path" class="w-3 h-3 cursor-pointer flex-shrink-0 relative top-1"
|
||||||
:class="{ 'rotate-90': relationshipDetailsState[parent.code] }" />
|
:class="{ 'rotate-90': relationshipDetailsState[parent.code] }" />
|
||||||
|
@ -234,7 +234,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div v-if="childrenCount">
|
<div v-if="childrenCount">
|
||||||
<details v-for="(child) in children" :key="child.code" @toggle="updateOpenState(child.code, $event.target.open)"
|
<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"
|
<summary class="flex flex-row gap-3 mb-4 relative group"
|
||||||
:class="{ 'group-last-of-type:mb-0': !relationshipDetailsState[child.code] }">
|
: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"
|
<img :src="icons.delimiter_path" class="w-3 h-3 flex-shrink-0 cursor-pointer relative top-1"
|
||||||
|
|
|
@ -2919,7 +2919,7 @@ en:
|
||||||
select_valid_value: 'Select a valid date or date-time value'
|
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?'
|
browser_alert_message: 'You have made some changes, are you sure you want to leave this page?'
|
||||||
errors:
|
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.'
|
load_error_description: 'To obtain access, reach out to your workspace administrator.'
|
||||||
highlight_component:
|
highlight_component:
|
||||||
information_label: 'Information'
|
information_label: 'Information'
|
||||||
|
|
Loading…
Add table
Reference in a new issue