From db6c6baac45bea37f0389bd2e12101527c309c0f Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Tue, 10 Jun 2025 09:24:32 -0500 Subject: [PATCH] Fixes for new nickname edits --- forms/sim_details.rb | 14 ++++++++------ lib/edit_sim_nicknames.rb | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/forms/sim_details.rb b/forms/sim_details.rb index 1b64cfbc641159d8378a7f435001344d84f2007e..210ee9e1fd4a62cced108fbecd5b668d3d62d6a5 100644 --- a/forms/sim_details.rb +++ b/forms/sim_details.rb @@ -1,6 +1,12 @@ form! title "(e)SIM Details" +actions = [ + { label: "Done", value: "complete" }, + { label: "Order new Physical SIM", value: "order-sim" }, + { label: "Order new eSIM", value: "order-esim" } +] + if @sims.empty? instructions "You have no (e)SIMs." else @@ -10,17 +16,13 @@ else type: "fixed", value: @sims.map(&:to_s) ) + actions.push({ label: "Edit (e)SIM nicknames", value: "edit-nicknames" }) end field( var: "http://jabber.org/protocol/commands#actions", label: "Action", type: "list-single", - options: [ - { label: "Done", value: "complete" }, - { label: "Order new Physical SIM", value: "order-sim" }, - { label: "Order new eSIM", value: "order-esim" }, - { label: "Edit (e)SIM nicknames", value: "edit-nicknames" } - ], + options: actions, value: "complete" ) diff --git a/lib/edit_sim_nicknames.rb b/lib/edit_sim_nicknames.rb index 3107430bc8135a26c0112e85d173bac060fc22ca..b8c60471117fa0b69203bad4d5600a51bc02285f 100644 --- a/lib/edit_sim_nicknames.rb +++ b/lib/edit_sim_nicknames.rb @@ -4,7 +4,7 @@ class EditSimNicknames # @param [Customer] customer the customer editing the sims # @param [Array] sims the sims whose nicknames # are up for editing - def initialize(customer, sims, sim_repo: SIMRepo.new(DB)) + def initialize(customer, sims, sim_repo: SIMRepo.new(db: DB)) @customer = customer @sims = sims @sim_repo = sim_repo