Merge branch 'MDL-81307-402' of https://github.com/roland04/moodle into MOODLE_402_STABLE
This commit is contained in:
@@ -35,7 +35,7 @@
|
||||
}
|
||||
}}
|
||||
{{< core/sticky_footer }}
|
||||
{{$ stickyclasses }} justify-content-between {{/ stickyclasses }}
|
||||
{{$ stickyclasses }} justify-content-center bulkactions {{/ stickyclasses }}
|
||||
{{$ disable }} data-disable="true" {{/ disable }}
|
||||
{{$ extradata }} data-for="bulkedittools" {{/ extradata }}
|
||||
{{$ stickycontent }}
|
||||
@@ -45,7 +45,7 @@
|
||||
{{#str}} selectall {{/str}}
|
||||
</label>
|
||||
</div>
|
||||
<div data-for="bulktools">
|
||||
<div class="mx-auto" data-for="bulktools">
|
||||
{{^hasactions}}
|
||||
{{#str}} nobulkaction, core_courseformat {{/str}}
|
||||
{{/hasactions}}
|
||||
@@ -60,8 +60,8 @@
|
||||
data-for="bulkaction"
|
||||
{{#title}} title="{{title}}" {{/title}}
|
||||
>
|
||||
<span class="w-100 pl-2">{{#pix}}{{icon}}{{/pix}}</span>
|
||||
<span>{{name}}</span>
|
||||
<span class="bulkaction-icon w-100 pl-2">{{#pix}}{{icon}}{{/pix}}</span>
|
||||
<span class="bulkaction-name">{{name}}</span>
|
||||
</button>
|
||||
</li>
|
||||
{{/actions}}
|
||||
@@ -69,7 +69,7 @@
|
||||
{{/hasactions}}
|
||||
</div>
|
||||
<div class="d-flex flex-column">
|
||||
<div class="ml-auto">
|
||||
<div class="bulkcancel ml-auto">
|
||||
<button
|
||||
class="btn pr-0 pb-0"
|
||||
data-action="bulkcancel"
|
||||
@@ -79,7 +79,7 @@
|
||||
{{#pix}} e/cancel, core {{/pix}}
|
||||
</button>
|
||||
</div>
|
||||
<div data-for="bulkcount">
|
||||
<div class="bulkcount" data-for="bulkcount">
|
||||
{{#str}} bulkselection, core_courseformat, 0 {{/str}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -227,3 +227,16 @@ Feature: Bulk activity and section selection.
|
||||
When I click on "Select topic Topic 1" "checkbox"
|
||||
And I click on "Select topic Topic 2" "checkbox"
|
||||
Then I should see "2 selected" in the "sticky-footer" "region"
|
||||
|
||||
Scenario: Bulk selection in small devices
|
||||
Given I change the viewport size to "mobile"
|
||||
And I close block drawer if open
|
||||
When I click on "Bulk edit" "button"
|
||||
Then I should not see "0 selected" in the "sticky-footer" "region"
|
||||
And I should not see "Select all" in the "sticky-footer" "region"
|
||||
And I should not see "Availability" in the "sticky-footer" "region"
|
||||
And I should not see "Duplicate" in the "sticky-footer" "region"
|
||||
And I should not see "Move" in the "sticky-footer" "region"
|
||||
And I should not see "Delete" in the "sticky-footer" "region"
|
||||
And I click on "Close bulk edit" "button" in the "sticky-footer" "region"
|
||||
And "sticky-footer" "region" should not be visible
|
||||
|
||||
@@ -1466,4 +1466,36 @@ class behat_navigation extends behat_base {
|
||||
throw new ExpectationException('The edit mode could not be turned off', $this->getSession());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Close the block drawer if it is open.
|
||||
*
|
||||
* This is necessary as in Behat the block drawer is open at each page load (disregarding user's settings)
|
||||
* As the block drawer is positioned at the front of some contextual dialogs on the grade report for example.
|
||||
* @Given I close block drawer if open
|
||||
* @return void
|
||||
*/
|
||||
public function i_close_block_drawer_if_open() {
|
||||
if ($this->running_javascript()) {
|
||||
$xpath = "//button[contains(@data-action,'closedrawer')][contains(@data-placement,'left')]";
|
||||
$node = $this->getSession()->getPage()->find('xpath', $xpath);
|
||||
if ($node && $node->isVisible()) {
|
||||
$ishidden = $node->getAttribute('aria-hidden-tab-index');
|
||||
if (!$ishidden) {
|
||||
$this->execute('behat_general::i_click_on', [$node, 'NodeElement']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* I close the block drawer and keep it closed.
|
||||
*
|
||||
* @Given I keep block drawer closed
|
||||
* @return void
|
||||
*/
|
||||
public function i_keep_block_drawer_closed() {
|
||||
set_user_preference('behat_keep_drawer_closed', 1);
|
||||
$this->i_close_block_drawer_if_open();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,9 @@ information provided here is intended especially for developers.
|
||||
|
||||
* The `html_writer::select_time` method has a `$timezone` parameter to use when formatting the time parameter
|
||||
* New Behat `heading` named selector to more easily assert the presence of H1-H6 elements on the page
|
||||
* New behat behat_navigation::i_close_block_drawer_if_open() and behat_navigation::i_keep_block_drawer_closed()
|
||||
to ensure in some test that the block drawer is closed. This helps with random failures due to the block drawer
|
||||
being forced open in all behat tests.
|
||||
|
||||
=== 4.2.5 ===
|
||||
|
||||
|
||||
@@ -1633,3 +1633,22 @@ $activity-add-hover: theme-color-level('primary', -10) !default;
|
||||
margin-left: 2rem;
|
||||
}
|
||||
}
|
||||
|
||||
// Custom styles for bulk actions sticky footer in small devices.
|
||||
.stickyfooter.bulkactions {
|
||||
@include media-breakpoint-down(sm) {
|
||||
.form-check,
|
||||
.bulkaction-name,
|
||||
.bulkcount {
|
||||
display: none;
|
||||
}
|
||||
.actions button {
|
||||
padding: 0 map-get($spacers, 2);
|
||||
}
|
||||
.bulkcancel {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ body.behat-site {
|
||||
// Sticky footer can overlap with elements so we keep it relative for behat.
|
||||
&.hasstickyfooter .stickyfooter,
|
||||
.stickyfooter {
|
||||
position: inherit;
|
||||
position: relative;
|
||||
z-index: inherit;
|
||||
}
|
||||
|
||||
|
||||
@@ -29236,6 +29236,22 @@ span.editinstructions .alert-link {
|
||||
margin-left: 2rem;
|
||||
}
|
||||
}
|
||||
@media (max-width: 767.98px) {
|
||||
.stickyfooter.bulkactions .form-check,
|
||||
.stickyfooter.bulkactions .bulkaction-name,
|
||||
.stickyfooter.bulkactions .bulkcount {
|
||||
display: none;
|
||||
}
|
||||
.stickyfooter.bulkactions .actions button {
|
||||
padding: 0 0.5rem;
|
||||
}
|
||||
.stickyfooter.bulkactions .bulkcancel {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Anchor link offset fix. This makes hash links scroll 60px down to account for the fixed header. */
|
||||
:target {
|
||||
scroll-margin-top: 70px;
|
||||
@@ -35387,7 +35403,7 @@ body.behat-site .fixed-top {
|
||||
}
|
||||
body.behat-site.hasstickyfooter .stickyfooter,
|
||||
body.behat-site .stickyfooter {
|
||||
position: inherit;
|
||||
position: relative;
|
||||
z-index: inherit;
|
||||
}
|
||||
body.behat-site .dropdown-item {
|
||||
|
||||
@@ -29236,6 +29236,22 @@ span.editinstructions .alert-link {
|
||||
margin-left: 2rem;
|
||||
}
|
||||
}
|
||||
@media (max-width: 767.98px) {
|
||||
.stickyfooter.bulkactions .form-check,
|
||||
.stickyfooter.bulkactions .bulkaction-name,
|
||||
.stickyfooter.bulkactions .bulkcount {
|
||||
display: none;
|
||||
}
|
||||
.stickyfooter.bulkactions .actions button {
|
||||
padding: 0 0.5rem;
|
||||
}
|
||||
.stickyfooter.bulkactions .bulkcancel {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Anchor link offset fix. This makes hash links scroll 60px down to account for the fixed header. */
|
||||
:target {
|
||||
scroll-margin-top: 60px;
|
||||
@@ -35321,7 +35337,7 @@ body.behat-site .fixed-top {
|
||||
}
|
||||
body.behat-site.hasstickyfooter .stickyfooter,
|
||||
body.behat-site .stickyfooter {
|
||||
position: inherit;
|
||||
position: relative;
|
||||
z-index: inherit;
|
||||
}
|
||||
body.behat-site .dropdown-item {
|
||||
|
||||
Reference in New Issue
Block a user