From b6d543fc279b836d24e3f93e3e0f2e276315518a Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Wed, 5 Apr 2023 11:43:52 +0000 Subject: [PATCH] Bug 33408: Remove obsolete tests and template sys pref code Signed-off-by: Pedro Amorim Signed-off-by: Martin Renvoize Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 0f01c16ba1cf277a709c0a79aeea0f4b99c12353) Signed-off-by: Matt Blenkinsop --- .../intranet-tmpl/prog/en/modules/erm/erm.tt | 5 --- t/cypress/support/commands.js | 31 ------------------- 2 files changed, 36 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/erm/erm.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/erm/erm.tt index e356e85dd8..98c0a4294b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/erm/erm.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/erm/erm.tt @@ -33,13 +33,8 @@ const eholdings_packages_table_settings = [% TablesSettings.GetTableSettings( 'erm', 'eholdings', 'packages', 'json' ) | $raw %]; const eholdings_titles_table_settings = [% TablesSettings.GetTableSettings( 'erm', 'eholdings', 'titles', 'json' ) | $raw %]; - const ERMProviders = "[% Koha.Preference('ERMProviders') | html %]"; - const erm_providers = ERMProviders.split(','); - const max_allowed_packet = [% To.json(max_allowed_packet) | $raw %]; - const ERMModule = [% IF Koha.Preference('ERMModule') %]true[% ELSE %]false[% END %]; - const logged_in_user_lists = [% To.json(logged_in_user.virtualshelves.unblessed) | $raw %]; const logged_in_user = [% To.json(logged_in_user.unblessed) | $raw %]; diff --git a/t/cypress/support/commands.js b/t/cypress/support/commands.js index bea38fb7c9..60bea1fcb6 100644 --- a/t/cypress/support/commands.js +++ b/t/cypress/support/commands.js @@ -39,34 +39,3 @@ Cypress.Commands.add('login', (username, password) => { cy.get("#password").type(pass) cy.get("#submit-button").click() }) - -Cypress.Commands.add('set_ERM_sys_pref_value', (enable) => { - cy.visit('/cgi-bin/koha/admin/admin-home.pl') - cy.get("h4").contains("Global system preferences").click(); - cy.get("a[title^=E-resource]").contains("E-resource management").click(); - cy.get('#pref_ERMModule').then(($select) => { - // Only enable if currently disabled, or only disable if currently enabled - let sys_pref_value = $select.find(":selected").text().trim(); - if (enable && sys_pref_value == 'Disable' || !enable && sys_pref_value == 'Enable') { - cy.get("#pref_ERMModule").select(enable ? 'Enable' : 'Disable'); - cy.get(".save-all").first().click(); - Cypress.env("current_ERM_Module_sys_pref_value", enable); - cy.wait(500); // Cypress is too fast! - } - }) -}) - -Cypress.Commands.add('fetch_initial_ERM_sys_pref_value', () => { - cy.login(); - cy.visit('/cgi-bin/koha/admin/admin-home.pl') - cy.get("h4").contains("Global system preferences").click(); - cy.get("a[title^=E-resource]").contains("E-resource management").click(); - cy.get('#pref_ERMModule').then(($select) => { - Cypress.env('initial_ERM_Module_sys_pref_value', $select.find(":selected").text().trim() == 'Enable'); - }) -}) - -Cypress.Commands.add('reset_initial_ERM_sys_pref_value', () => { - cy.login(); - cy.set_ERM_sys_pref_value(Cypress.env("initial_ERM_Module_sys_pref_value")); -}) -- 2.39.5