MDL-70911 core_badges: Move "External backpack" to badges settings

Setting "External backpack connection" has been moved from "Backpack
settings" to "Badges settings" in order to make easier to find and
configure it.
Some extra tests have been added to cover existing behaviour and
confirm is still working as expected.
This commit is contained in:
Sara Arjona
2021-03-08 09:24:53 +01:00
parent 96b49ddc97
commit a306fd7a18
2 changed files with 30 additions and 6 deletions
+4 -4
View File
@@ -71,6 +71,10 @@ if (($hassiteconfig || has_any_capability(array(
new lang_string('allowcoursebadges', 'badges'),
new lang_string('allowcoursebadges_desc', 'badges'), 1));
$globalsettings->add(new admin_setting_configcheckbox('badges_allowexternalbackpack',
new lang_string('allowexternalbackpack', 'badges'),
new lang_string('allowexternalbackpack_desc', 'badges'), 1));
$ADMIN->add('badges', $globalsettings);
$ADMIN->add('badges',
@@ -100,10 +104,6 @@ if (($hassiteconfig || has_any_capability(array(
$backpacksettings = new admin_settingpage('backpacksettings', new lang_string('backpacksettings', 'badges'),
array('moodle/badges:manageglobalsettings'), empty($CFG->enablebadges));
$backpacksettings->add(new admin_setting_configcheckbox('badges_allowexternalbackpack',
new lang_string('allowexternalbackpack', 'badges'),
new lang_string('allowexternalbackpack_desc', 'badges'), 1));
$backpacksettings->add(new admin_setting_configselect('badges_site_backpack',
new lang_string('sitebackpack', 'badges'),
new lang_string('sitebackpack_help', 'badges'),
+26 -2
View File
@@ -17,13 +17,34 @@ Feature: Backpack badges
And I set the field "Badge issuer email address" to "testuser@example.com"
And I log out
@javascript
Scenario: If external backpack connection is disabled, backpack settings should not be displayed
Given I am on homepage
And I log in as "admin"
And I navigate to "Badges > Badges settings" in site administration
And I set the following fields to these values:
| External backpack connection | 0 |
And I press "Save changes"
When I navigate to "Badges" in site administration
Then I should not see "Manage backpacks"
And I navigate to "Badges > Badges settings" in site administration
And I set the following fields to these values:
| External backpack connection | 1 |
And I press "Save changes"
And I am on homepage
And I navigate to "Badges" in site administration
And I should see "Manage backpacks"
@javascript
Scenario: Verify backback settings
Given I am on homepage
And I log in as "admin"
And I navigate to "Badges > Backpack settings" in site administration
And I navigate to "Badges > Badges settings" in site administration
And I set the following fields to these values:
| External backpack connection | 1 |
And I press "Save changes"
And I navigate to "Badges > Backpack settings" in site administration
And I set the following fields to these values:
| Active external backpack | https://dc.imsglobal.org |
And I press "Save changes"
And I navigate to "Badges > Add a new badge" in site administration
@@ -57,9 +78,12 @@ Feature: Backpack badges
Scenario: User has been connected backpack
Given I am on homepage
And I log in as "admin"
And I navigate to "Badges > Backpack settings" in site administration
And I navigate to "Badges > Badges settings" in site administration
And I set the following fields to these values:
| External backpack connection | 1 |
And I press "Save changes"
And I navigate to "Badges > Backpack settings" in site administration
And I set the following fields to these values:
| Active external backpack | https://dc.imsglobal.org |
And I press "Save changes"
And I navigate to "Badges > Add a new badge" in site administration