Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
3c25e20
basic delete page for stacks
Oct 22, 2025
f0830c0
adding component system to visualize. Starting to fill model's collec…
Oct 23, 2025
ee276ee
implementing delete page for all model in sidebar. using default dele…
Oct 24, 2025
f687f25
updating test for model with delete page
Oct 27, 2025
527e836
removing delete dependency concern, logic is now in component
Oct 27, 2025
c45e842
refactor
Oct 28, 2025
3e20f64
test for delete_dependency_component
Oct 28, 2025
76bfa70
robocop fixes
Oct 28, 2025
3835f72
remove optimisation and show all association in delete_dependency_com…
Oct 29, 2025
6a39e6c
rework
nicolas-brousse Oct 29, 2025
abbade9
Code cleanup
nicolas-brousse Oct 29, 2025
25aea10
renaming same variables, cleanup, and tests
Oct 29, 2025
845cd87
visual improuvment
Oct 29, 2025
12fc5c8
implementing nicolas's proposition
Oct 30, 2025
3679946
Update component design (wip)
B-Rass Nov 21, 2025
ba955f4
refactor: rework DeleteDependencyComponent
nicolas-brousse Nov 26, 2025
c0fd0bb
Code cleanup
nicolas-brousse Nov 26, 2025
829cf78
Move Destroy confirm check in a shared method
nicolas-brousse Nov 26, 2025
59ff7d3
Rework tests and code cleanup
nicolas-brousse Nov 26, 2025
390ed83
Add destroy confirmation to cables
nicolas-brousse Nov 26, 2025
3cc6d3c
Tests and cleanups
nicolas-brousse Nov 26, 2025
c6ffae7
Add expand/collapse all buttons
B-Rass Nov 27, 2025
0a57111
Update locales
B-Rass Nov 27, 2025
c4fcceb
Update skin and tests
B-Rass Dec 3, 2025
0858ce5
fix minitests
B-Rass Dec 3, 2025
9c55a93
test: cleanup
nicolas-brousse Dec 10, 2025
420a018
Improve color.to_s
B-Rass Dec 10, 2025
29d014d
Re-add confirmation to cables
nicolas-brousse Dec 10, 2025
a64a6b8
style: code cleanup + tests
nicolas-brousse Dec 17, 2025
5882c59
wip
nicolas-brousse Dec 17, 2025
cb90e2c
Merge remote-tracking branch 'upstream/master' into 360068-improve-de…
nicolas-brousse Jan 14, 2026
075ba73
wip
nicolas-brousse Jan 14, 2026
49e14e2
fix
nicolas-brousse Jan 14, 2026
5e4c3d0
Merge remote-tracking branch 'upstream/master' into 360068-improve-de…
nicolas-brousse Feb 4, 2026
924eb35
merge try
Feb 18, 2026
0c370de
merge again
Feb 19, 2026
28ee609
Merge remote-tracking branch 'upstream/master' into 360068-improve-de…
nicolas-brousse Mar 18, 2026
1f70562
Cleanup
nicolas-brousse Mar 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions app/models/frame.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@ class Frame < ApplicationRecord # rubocop:disable Metrics/ClassLength

belongs_to :bay

has_one :islet, through: :bay
has_one :room, through: :islet

has_many :materials, -> { order("servers.position desc") }, class_name: "Server", dependent: :restrict_with_error
has_many :pdus, -> { only_pdus }, class_name: "Server", dependent: :restrict_with_error
has_many :servers, -> { no_pdus.order("servers.position desc") }, class_name: "Server", dependent: :restrict_with_error

has_one :islet, through: :bay
has_one :room, through: :islet
delegate :name, to: :room, prefix: true, allow_nil: true

validates :position, uniqueness: { scope: :bay_id }
Expand Down
2 changes: 2 additions & 0 deletions app/models/permission_scope_domain.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
class PermissionScopeDomain < ApplicationRecord
belongs_to :permission_scope
belongs_to :domaine

delegate :to_s, to: :permission_scope
Comment thread
B-Rass marked this conversation as resolved.
end
3 changes: 2 additions & 1 deletion app/models/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ class Server < ApplicationRecord # rubocop:disable Metrics/ClassLength
has_changelog

belongs_to :frame
belongs_to :modele, counter_cache: true
belongs_to :gestion, optional: true, counter_cache: true
belongs_to :domaine, optional: true, counter_cache: true
belongs_to :cluster, optional: true, counter_cache: true
belongs_to :stack, optional: true, counter_cache: true
belongs_to :modele, counter_cache: true

has_one :bay, through: :frame
has_one :islet, through: :frame
Expand All @@ -27,6 +27,7 @@ class Server < ApplicationRecord # rubocop:disable Metrics/ClassLength
has_many :cables, through: :connections
has_many :moves, as: :moveable, dependent: :destroy
has_many :documents, dependent: :restrict_with_error
# TODO: should be plural
has_many :external_app_record, dependent: :destroy

has_one_attached :photo
Expand Down
8 changes: 4 additions & 4 deletions app/views/rooms/destroy.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

<div class="col-12 p-4 border-top">
<%= render DeleteDependencyComponent.new(
@room,
except: %i[cluster_rooms],
confirmation_path: room_path(@room, confirm: true),
) %>
@room,
except: %i[cluster_rooms],
confirmation_path: room_path(@room, confirm: true)
) %>
</div>
1 change: 1 addition & 0 deletions config/locales/activerecord.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ en:
stack: Stack
user: User
permission_scope: Permission Scope
permission_scope_domain: Permission Scope

attributes:
bay:
Expand Down
1 change: 1 addition & 0 deletions config/locales/activerecord.fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ fr:
contact_role: Rôle
contact_assignment: Assignation
permission_scope: Permission
permission_scope_domain: Permission

attributes:
room:
Expand Down
3 changes: 2 additions & 1 deletion spec/models/server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
it { is_expected.to belong_to(:frame) }
it { is_expected.to belong_to(:gestion).optional(true) }
it { is_expected.to belong_to(:domaine).optional(true) }
it { is_expected.to belong_to(:modele) }
it { is_expected.to belong_to(:cluster).optional(true) }
it { is_expected.to belong_to(:stack).optional(true) }
it { is_expected.to belong_to(:modele) }

it { is_expected.to have_one(:bay).through(:frame) }
it { is_expected.to have_one(:islet).through(:frame) }
Expand All @@ -30,6 +30,7 @@
it { is_expected.to have_many(:cables).through(:connections) }
it { is_expected.to have_many(:moves).dependent(:destroy) }
it { is_expected.to have_many(:documents) }
it { is_expected.to have_many(:external_app_record) }
end

describe "attachement" do
Expand Down
Loading