diff --git a/report/eventlist/yui/build/moodle-report_eventlist-eventfilter/moodle-report_eventlist-eventfilter-debug.js b/report/eventlist/yui/build/moodle-report_eventlist-eventfilter/moodle-report_eventlist-eventfilter-debug.js index 34cc92a6a4b..617edac493c 100644 --- a/report/eventlist/yui/build/moodle-report_eventlist-eventfilter/moodle-report_eventlist-eventfilter-debug.js +++ b/report/eventlist/yui/build/moodle-report_eventlist-eventfilter/moodle-report_eventlist-eventfilter-debug.js @@ -181,8 +181,6 @@ Y.extend(EventFilter, Y.Base, { _totalFilter: function() { // Get all of the details of the filter elements var eventNameFilter = this._eventName.get('value').toLowerCase(), - // Component selected text. - componentFilter = this._component.get('options').item(this._component.get('selectedIndex')).get('text').toLowerCase(), // Component selected value. componentValue = this._component.get('value'), // Education level selected text. @@ -201,7 +199,7 @@ Y.extend(EventFilter, Y.Base, { // These variables will either be false or true depending on the statement outcome. var fullEventText = Y.Node.create(this.get('tabledata')[i].fulleventname).get('text'), eventNameValue = fullEventText.toLowerCase().indexOf(eventNameFilter) >= 0, - componentFilterValue = this.get('tabledata')[i].component.toLowerCase().indexOf(componentFilter) >= 0, + componentFilterValue = fullEventText.toLowerCase().indexOf('\\' + componentValue + '\\event\\') >= 0, eduLevelFilterValue = this.get('tabledata')[i].edulevel.toLowerCase().indexOf(eduLevelFilter) >= 0, crudFilterValue = this.get('tabledata')[i].crud.toLowerCase().indexOf(crudFilter) >= 0; // If the name field is empty then add to the filter. diff --git a/report/eventlist/yui/build/moodle-report_eventlist-eventfilter/moodle-report_eventlist-eventfilter-min.js b/report/eventlist/yui/build/moodle-report_eventlist-eventfilter/moodle-report_eventlist-eventfilter-min.js index 292bdc17e6d..110843d3546 100644 --- a/report/eventlist/yui/build/moodle-report_eventlist-eventfilter/moodle-report_eventlist-eventfilter-min.js +++ b/report/eventlist/yui/build/moodle-report_eventlist-eventfilter/moodle-report_eventlist-eventfilter-min.js @@ -1 +1 @@ -YUI.add("moodle-report_eventlist-eventfilter",function(g,e){function t(){t.superclass.constructor.apply(this,arguments)}var l="#id_eventname",n="#id_eventcomponent",i="#id_eventedulevel",a="#id_eventcrud",r="#id_filterbutton",s="#id_clearbutton";g.extend(t,g.Base,{_table:null,_eventName:null,_component:null,_eduLevel:null,_crud:null,initializer:function(){var e=g.one(r),t=g.one(s);this._createTable(this.get("tabledata")),this._eventName=g.one(l),this._component=g.one(n),this._eduLevel=g.one(i),this._crud=g.one(a),this._eventName.on("valuechange",this._totalFilter,this),e.on("click",this._totalFilter,this),t.on("click",this._clearFilter,this)},_createTable:function(e){var t=new g.DataTable({columns:[{key:"fulleventname",label:M.util.get_string("eventname","report_eventlist"),allowHTML:!0,sortable:!0,sortFn:function(e,t,l){var n=e.getAttrs().raweventname,i=t.getAttrs().raweventname= 0, - componentFilterValue = this.get('tabledata')[i].component.toLowerCase().indexOf(componentFilter) >= 0, + componentFilterValue = fullEventText.toLowerCase().indexOf('\\' + componentValue + '\\event\\') >= 0, eduLevelFilterValue = this.get('tabledata')[i].edulevel.toLowerCase().indexOf(eduLevelFilter) >= 0, crudFilterValue = this.get('tabledata')[i].crud.toLowerCase().indexOf(crudFilter) >= 0; // If the name field is empty then add to the filter. diff --git a/report/eventlist/yui/src/eventfilter/js/eventfilter.js b/report/eventlist/yui/src/eventfilter/js/eventfilter.js index 771b2669481..adf481b9140 100644 --- a/report/eventlist/yui/src/eventfilter/js/eventfilter.js +++ b/report/eventlist/yui/src/eventfilter/js/eventfilter.js @@ -179,8 +179,6 @@ Y.extend(EventFilter, Y.Base, { _totalFilter: function() { // Get all of the details of the filter elements var eventNameFilter = this._eventName.get('value').toLowerCase(), - // Component selected text. - componentFilter = this._component.get('options').item(this._component.get('selectedIndex')).get('text').toLowerCase(), // Component selected value. componentValue = this._component.get('value'), // Education level selected text. @@ -199,7 +197,7 @@ Y.extend(EventFilter, Y.Base, { // These variables will either be false or true depending on the statement outcome. var fullEventText = Y.Node.create(this.get('tabledata')[i].fulleventname).get('text'), eventNameValue = fullEventText.toLowerCase().indexOf(eventNameFilter) >= 0, - componentFilterValue = this.get('tabledata')[i].component.toLowerCase().indexOf(componentFilter) >= 0, + componentFilterValue = fullEventText.toLowerCase().indexOf('\\' + componentValue + '\\event\\') >= 0, eduLevelFilterValue = this.get('tabledata')[i].edulevel.toLowerCase().indexOf(eduLevelFilter) >= 0, crudFilterValue = this.get('tabledata')[i].crud.toLowerCase().indexOf(crudFilter) >= 0; // If the name field is empty then add to the filter. diff --git a/theme/boost/tests/behat/primarynav.feature b/theme/boost/tests/behat/primarynav.feature new file mode 100644 index 00000000000..d4a03a26ec7 --- /dev/null +++ b/theme/boost/tests/behat/primarynav.feature @@ -0,0 +1,45 @@ +@javascript @theme_boost +Feature: Primary navigation + To navigate in boost theme + As a user + I need to use the primary navigation + + Background: + Given the following "users" exist: + | username | firstname | lastname | email | + | user1 | User | One | user1@example.com | + + @javascript @theme_boost + Scenario Outline: Admin sets defaulthomepage to 0,1 and verify the landing page and site home link + Given I log in as "admin" + And the following config values are set as admin: + | defaulthomepage | | + And I am on homepage + And I should see "" in the "//a[contains(@class,'nav-link active') and contains(., '')]" "xpath_element" + And I should see "" in the "" "xpath_element" + + Examples: + | defaulthomepageset | homepage | sitehome | linkelement | + | 0 | Home | Home | //a[contains(@class, 'nav-link active') and contains(@tabindex, 0) and not(contains(@href, 'redirect=0'))] | + | 1 | Dashboard | Site home | //a[contains(@class, 'nav-link') and contains(@tabindex, -1) and (contains(@href, 'redirect=0'))] | + + @javascript @theme_boost + Scenario Outline: Admin sets defaulthomepage to 2 and verify the landing page based on user preference set + Given I log in as "admin" + And I navigate to "Appearance > Navigation" in site administration + And I set the field "Home page for users" to "User preference" + And I press "Save changes" + And I follow "Preferences" in the user menu + And I follow "Home page" + And I set the field "Home page" to "" + And I press "Save changes" + And the following config values are set as admin: + | defaulthomepage | 2 | + And I log out + And I log in as "admin" + And I should see "" in the "//a[contains(@class,'nav-link active') and contains(., '')]" "xpath_element" + + Examples: + | userpreference | homepage | + | Site | Home | + | Dashboard | Dashboard | diff --git a/user/tests/behat/set_default_homepage.feature b/user/tests/behat/set_default_homepage.feature index 8c5ec2c5232..917a007810f 100644 --- a/user/tests/behat/set_default_homepage.feature +++ b/user/tests/behat/set_default_homepage.feature @@ -71,38 +71,3 @@ Feature: Set the site home page and dashboard as the default home page | preference | breadcrumb | | Site | Home | | Dashboard | Dashboard | - - @javascript @theme_boost - Scenario Outline: Admin sets defaulthomepage to 0,1 and verify the landing page and site home link - Given I log in as "admin" - And the following config values are set as admin: - | defaulthomepage | | - And I am on homepage - And I should see "" in the "//a[contains(@class,'nav-link active') and contains(., '')]" "xpath_element" - And I should see "" in the "" "xpath_element" - - Examples: - | defaulthomepageset | homepage | sitehome | linkelement | - | 0 | Home | Home | //a[contains(@class, 'nav-link active') and contains(@tabindex, 0) and not(contains(@href, 'redirect=0'))] | - | 1 | Dashboard | Site home | //a[contains(@class, 'nav-link') and contains(@tabindex, -1) and (contains(@href, 'redirect=0'))] | - - @javascript @theme_boost - Scenario Outline: Admin sets defaulthomepage to 2 and verify the landing page based on user preference set - Given I log in as "admin" - And I navigate to "Appearance > Navigation" in site administration - And I set the field "Home page for users" to "User preference" - And I press "Save changes" - And I follow "Preferences" in the user menu - And I follow "Home page" - And I set the field "Home page" to "" - And I press "Save changes" - And the following config values are set as admin: - | defaulthomepage | 2 | - And I log out - And I log in as "admin" - And I should see "" in the "//a[contains(@class,'nav-link active') and contains(., '')]" "xpath_element" - - Examples: - | userpreference | homepage | - | Site | Home | - | Dashboard | Dashboard |