From 5dba8f8ad7489a02f3bd5cf09144eddf0ed9ae1b Mon Sep 17 00:00:00 2001 From: Audrey Hamelers Date: Tue, 7 May 2024 23:23:44 +0200 Subject: [PATCH 1/2] fix js error from branch merging, style --- app/views/stash_engine/tenant_admin/_logo.html.erb | 2 +- app/views/stash_engine/tenant_admin/edit.js.erb | 2 +- app/views/stash_engine/tenant_admin/popup.js.erb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/stash_engine/tenant_admin/_logo.html.erb b/app/views/stash_engine/tenant_admin/_logo.html.erb index 700312ba0b..25021b030b 100644 --- a/app/views/stash_engine/tenant_admin/_logo.html.erb +++ b/app/views/stash_engine/tenant_admin/_logo.html.erb @@ -10,6 +10,6 @@ <% end %>

-
+
<%= form.hidden_field :logo, value: @tenant.logo, id: 'logo_input' %> diff --git a/app/views/stash_engine/tenant_admin/edit.js.erb b/app/views/stash_engine/tenant_admin/edit.js.erb index a4cf7dd887..ef51e29fb7 100644 --- a/app/views/stash_engine/tenant_admin/edit.js.erb +++ b/app/views/stash_engine/tenant_admin/edit.js.erb @@ -14,5 +14,5 @@ when 'ror_orgs' when 'logo' @tenant.logo.blank? ? '' : "#{@tenant.short_name} logo".html_safe end %>"; -document.getElementById('<%= @field %>_button').setAttribute('aria-expanded', 'false'); +document.getElementById('<%= @field %>_button_<%= @tenant.id %>').setAttribute('aria-expanded', 'false'); document.getElementById('genericModalDialog').close(); \ No newline at end of file diff --git a/app/views/stash_engine/tenant_admin/popup.js.erb b/app/views/stash_engine/tenant_admin/popup.js.erb index 34548784a9..39f84c113e 100644 --- a/app/views/stash_engine/tenant_admin/popup.js.erb +++ b/app/views/stash_engine/tenant_admin/popup.js.erb @@ -16,7 +16,7 @@ document.getElementById('file-select').addEventListener('change', () => { const reader = new FileReader(); reader.addEventListener('load', () => { document.getElementById('logo_input').value = reader.result; - document.getElementById('file-preview').innerHTML = ``; + document.getElementById('file-preview').innerHTML = ``; }); if (file) { reader.readAsDataURL(file); From 1a970289f48fcd8ce5358866e6d11ee9e26d6df5 Mon Sep 17 00:00:00 2001 From: Audrey Hamelers Date: Tue, 7 May 2024 23:24:08 +0200 Subject: [PATCH 2/2] attempt logo test re-enable --- spec/features/stash_engine/tenant_admin_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/features/stash_engine/tenant_admin_spec.rb b/spec/features/stash_engine/tenant_admin_spec.rb index 03b3225ac8..ae6211e4e5 100644 --- a/spec/features/stash_engine/tenant_admin_spec.rb +++ b/spec/features/stash_engine/tenant_admin_spec.rb @@ -25,7 +25,7 @@ expect(page).not_to have_content(@match.short_name) end - xit 'allows changing the logo as a superuser', js: true do + it 'allows changing the logo as a superuser', js: true do visit stash_url_helpers.tenant_admin_path expect(page).to have_content(@match.short_name) within(:css, "form[action=\"#{tenant_popup_path(id: @match.id, field: 'logo')}\"]") do