mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-22 14:54:38 +08:00
Fix relationship css issues on Item card [SCI-9911] (#6857)
* Fix relationship css issues on Item card [SCI-9911] * Fix failing specs [SCI-9911]
This commit is contained in:
parent
5ca33bb96a
commit
f892467d67
2 changed files with 10 additions and 10 deletions
|
@ -130,8 +130,8 @@
|
|||
|
||||
<!-- RELATIONSHIPS -->
|
||||
<section id="relationships-section" class="flex flex-col" ref="relationshipsSectionRef">
|
||||
<div class="flex flex-row text-base font-semibold w-[350px] pb-4 leading-7 items-center justify-between transition-colors duration-300"
|
||||
ref="relationships-label">
|
||||
<div ref="relationships-label" id="relationships-label"
|
||||
class="font-inter text-lg font-semibold leading-7 mb-4 transition-colors duration-300">
|
||||
{{ i18n.t('repositories.item_card.section.relationships') }}
|
||||
</div>
|
||||
<div class="font-inter text-sm leading-5 w-full">
|
||||
|
|
|
@ -15,6 +15,14 @@ class RepositoryRowConnection < ApplicationRecord
|
|||
validates :parent_id, uniqueness: { scope: :child_id }
|
||||
validate :prevent_self_connections, :prevent_reciprocal_connections
|
||||
|
||||
def parent?(repository_row)
|
||||
parent_id == repository_row.id
|
||||
end
|
||||
|
||||
def child?(repository_row)
|
||||
child_id == repository_row.id
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def prevent_self_connections
|
||||
|
@ -27,14 +35,6 @@ class RepositoryRowConnection < ApplicationRecord
|
|||
end
|
||||
end
|
||||
|
||||
def parent?(repository_row)
|
||||
parent_id == repository_row.id
|
||||
end
|
||||
|
||||
def child?(repository_row)
|
||||
child_id == repository_row.id
|
||||
end
|
||||
|
||||
def relationship_type(repository_row)
|
||||
return :parent if parent?(repository_row)
|
||||
|
||||
|
|
Loading…
Reference in a new issue